Documentation ¶
Index ¶
- func Claim(nodeAvailableResources, taskAssigned *[]*api.GenericResource, ...) error
- func ClaimResources(nodeAvailableResources, taskAssigned *[]*api.GenericResource, ...)
- func ConsumeNodeResources(nodeAvailableResources *[]*api.GenericResource, res []*api.GenericResource)
- func EnvFormat(res []*api.GenericResource, prefix string) []string
- func GetResource(kind string, resources []*api.GenericResource) []*api.GenericResource
- func HasEnough(nodeRes []*api.GenericResource, taskRes *api.GenericResource) (bool, error)
- func HasResource(res *api.GenericResource, resources []*api.GenericResource) bool
- func Kind(res *api.GenericResource) string
- func NewDiscrete(key string, val int64) *api.GenericResource
- func NewSet(key string, vals ...string) []*api.GenericResource
- func NewString(key, val string) *api.GenericResource
- func Parse(cmds []string) ([]*api.GenericResource, error)
- func ParseCmd(cmd string) ([]*api.GenericResource, error)
- func Reclaim(nodeAvailableResources *[]*api.GenericResource, ...) error
- func ValidateTask(resources *api.Resources) error
- func Value(res *api.GenericResource) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Claim ¶
func Claim(nodeAvailableResources, taskAssigned *[]*api.GenericResource, taskReservations []*api.GenericResource) error
Claim assigns GenericResources to a task by taking them from the node's GenericResource list and storing them in the task's available list
func ClaimResources ¶
func ClaimResources(nodeAvailableResources, taskAssigned *[]*api.GenericResource, resSelected []*api.GenericResource)
ClaimResources adds the specified resources to the task's list and removes them from the node's generic resource list
func ConsumeNodeResources ¶
func ConsumeNodeResources(nodeAvailableResources *[]*api.GenericResource, res []*api.GenericResource)
ConsumeNodeResources removes "res" from nodeAvailableResources
func EnvFormat ¶
func EnvFormat(res []*api.GenericResource, prefix string) []string
EnvFormat returns the environment string version of the resource
func GetResource ¶
func GetResource(kind string, resources []*api.GenericResource) []*api.GenericResource
GetResource returns resources from the "resources" parameter matching the kind key
func HasEnough ¶
func HasEnough(nodeRes []*api.GenericResource, taskRes *api.GenericResource) (bool, error)
HasEnough returns true if node can satisfy the task's GenericResource request
func HasResource ¶
func HasResource(res *api.GenericResource, resources []*api.GenericResource) bool
HasResource checks if there is enough "res" in the "resources" argument
func NewDiscrete ¶
func NewDiscrete(key string, val int64) *api.GenericResource
NewDiscrete creates a Discrete resource
func NewSet ¶
func NewSet(key string, vals ...string) []*api.GenericResource
NewSet creates a set object
func NewString ¶
func NewString(key, val string) *api.GenericResource
NewString creates a String resource
func Parse ¶
func Parse(cmds []string) ([]*api.GenericResource, error)
Parse parses a table of GenericResource resources
func ParseCmd ¶
func ParseCmd(cmd string) ([]*api.GenericResource, error)
ParseCmd parses the Generic Resource command line argument and returns a list of *api.GenericResource
func Reclaim ¶
func Reclaim(nodeAvailableResources *[]*api.GenericResource, taskAssigned, nodeRes []*api.GenericResource) error
Reclaim adds the resources taken by the task to the node's store
func ValidateTask ¶
ValidateTask validates that the task only uses integers for generic resources
Types ¶
This section is empty.