Documentation ¶
Index ¶
- func Add(left *si.Resource, right *si.Resource) *si.Resource
- func CreateAllocationForTask(appID, taskID, nodeID string, resource *si.Resource, placeholder bool, ...) *si.AllocationRequest
- func CreateAllocationRequestForTask(appID, taskID string, resource *si.Resource, placeholder bool, ...) *si.AllocationRequest
- func CreatePriorityForTask(pod *v1.Pod) int32
- func CreateReleaseAllocationRequestForTask(appID, taskID, allocationID, partition, terminationType string) *si.AllocationRequest
- func CreateReleaseAskRequestForTask(appID, taskID, partition string) *si.AllocationRequest
- func CreateTagsForTask(pod *v1.Pod) map[string]string
- func CreateUpdateRequestForDeleteOrRestoreNode(nodeID string, action si.NodeInfo_ActionFromRM) *si.NodeRequest
- func CreateUpdateRequestForNewNode(nodeID string, nodeLabels map[string]string, capacity *si.Resource, ...) *si.NodeRequest
- func CreateUpdateRequestForRemoveApplication(appID, partition string) *si.ApplicationRequest
- func CreateUpdateRequestForUpdatedNode(nodeID string, capacity *si.Resource, occupied *si.Resource, ready bool) *si.NodeRequest
- func Equals(left *si.Resource, right *si.Resource) bool
- func GetNodeResource(nodeStatus *v1.NodeStatus) *si.Resource
- func GetPodResource(pod *v1.Pod) (resource *si.Resource)
- func GetResource(resMap map[string]string) *si.Resource
- func GetTGResource(resMap map[string]resource.Quantity, members int64) *si.Resource
- func GetTerminationTypeFromString(terminationTypeStr string) si.TerminationType
- func IsZero(r *si.Resource) bool
- func ParseResource(cpuStr, memStr string) *si.Resource
- func Sub(left *si.Resource, right *si.Resource) *si.Resource
- type ResourceBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAllocationForTask ¶ added in v1.5.0
func CreatePriorityForTask ¶ added in v1.1.0
func CreateReleaseAllocationRequestForTask ¶
func CreateReleaseAllocationRequestForTask(appID, taskID, allocationID, partition, terminationType string) *si.AllocationRequest
func CreateReleaseAskRequestForTask ¶
func CreateReleaseAskRequestForTask(appID, taskID, partition string) *si.AllocationRequest
func CreateUpdateRequestForDeleteOrRestoreNode ¶
func CreateUpdateRequestForDeleteOrRestoreNode(nodeID string, action si.NodeInfo_ActionFromRM) *si.NodeRequest
CreateUpdateRequestForDeleteOrRestoreNode builds a NodeRequest for Node actions like drain, decommissioning & restore
func CreateUpdateRequestForNewNode ¶
func CreateUpdateRequestForNewNode(nodeID string, nodeLabels map[string]string, capacity *si.Resource, occupied *si.Resource, existingAllocations []*si.Allocation, ready bool) *si.NodeRequest
CreateUpdateRequestForNewNode builds a NodeRequest for new node addition and restoring existing node
func CreateUpdateRequestForRemoveApplication ¶
func CreateUpdateRequestForRemoveApplication(appID, partition string) *si.ApplicationRequest
func CreateUpdateRequestForUpdatedNode ¶
func CreateUpdateRequestForUpdatedNode(nodeID string, capacity *si.Resource, occupied *si.Resource, ready bool) *si.NodeRequest
CreateUpdateRequestForUpdatedNode builds a NodeRequest for any node updates like capacity, ready status flag etc
func GetNodeResource ¶
func GetNodeResource(nodeStatus *v1.NodeStatus) *si.Resource
func GetPodResource ¶
GetPodResource from a pod's containers and convert that into an internal resource. Scheduling only accounts for requests. Convert the pod into a resource to allow for pod count checks in quotas and nodes.
func GetTGResource ¶
func GetTerminationTypeFromString ¶
func GetTerminationTypeFromString(terminationTypeStr string) si.TerminationType
func ParseResource ¶
parse cpu and memory from string to si.Resource, both of them are optional if parse failed with some errors, log the error and return a nil
Types ¶
type ResourceBuilder ¶
type ResourceBuilder struct {
// contains filtered or unexported fields
}
resource builder is a helper struct to construct si resources
func NewResourceBuilder ¶
func NewResourceBuilder() *ResourceBuilder
func (*ResourceBuilder) AddResource ¶
func (w *ResourceBuilder) AddResource(name string, value int64) *ResourceBuilder
func (*ResourceBuilder) Build ¶
func (w *ResourceBuilder) Build() *si.Resource