Interface WorkerPoolClient
- All Known Implementing Classes:
WorkerPoolClientImpl
public interface WorkerPoolClient
Client interface containing methods for accessing YellowDog Scheduler functions.
-
Method Summary
Modifier and TypeMethodDescriptionSubmits a NEW configured worker pool to the YellowDog Scheduler service to be initialised.void
addNodeActions
(WorkerPool workerPool, NodeAction... actions) Adds the specified node actions to be performed for the specified worker pool.void
addNodeActions
(WorkerPool workerPool, NodeActionGroup... actionGroups) Adds the specified groups of node actions to be performed for the specified worker pool.void
addNodeActions
(WorkerPool workerPool, List<NodeActionGroup> actionGroups) Adds the specified groups of node actions to be performed for the specified worker pool.void
addNodeActions
(WorkerPool workerPool, List<NodeActionGroup> actionGroups, List<String> nodeIdFilterList) Adds the specified groups of node actions to be performed for the specified worker pool.void
addNodeActions
(String workerPoolId, NodeAction... actions) Adds the specified node actions to be performed for the specified worker pool.void
addNodeActions
(String workerPoolId, NodeActionGroup... actionGroups) Adds the specified groups of node actions to be performed for the specified worker pool.void
addNodeActions
(String workerPoolId, List<NodeActionGroup> actionGroups) Adds the specified groups of node actions to be performed for the specified worker pool.void
addNodeActions
(String workerPoolId, List<NodeActionGroup> actionGroups, List<String> nodeIdFilterList) Adds the specified groups of node actions to be performed for the specified worker pool.void
addNodeActionsForNode
(Node node, NodeAction... actions) Adds node actions to be performed for the specified node.void
addNodeActionsForNode
(String workerPoolId, String nodeId, NodeAction... actions) Adds node actions to be performed for the specified node.void
addWorkerPoolListener
(WorkerPool workerPool, SubscriptionEventListener<WorkerPool> listener) Adds an event listener to receive notifications of changes for the specified worker pool.void
addWorkerPoolListener
(String workerPoolId, SubscriptionEventListener<WorkerPool> listener) Adds an event listener to receive notifications of changes for the specified worker pool.Deprecated, for removal: This API element is subject to removal in a future version.findNodes
(NodeSearch search) Deprecated, for removal: This API element is subject to removal in a future version.usegetNodes(NodeSearch)
instead to search nodes.findNodes
(NodeSearch search, SliceReference sliceReference) Deprecated, for removal: This API element is subject to removal in a future version.usegetNodes(NodeSearch)
instead to search nodes.getConfiguredWorkerPoolToken
(ConfiguredWorkerPool workerPool) Get a configured worker pool token.getConfiguredWorkerPoolToken
(String workerPoolId) Get a configured worker pool token.Gets the latest state of the node with the specified ID.Gets the latest state of the node with the specified ID.getNodeActions
(Node node) Gets the current state of the specified node's action queue.getNodeActions
(String nodeId) Gets the current state of the specified node's action queue.getNodes
(NodeSearch search) Returns aSearchClient
that offers the ability to search nodes.getWorkerPool
(String workerPoolId) Gets the latest state of the worker pool with the specified ID.<T extends WorkerPool>
TgetWorkerPool
(String workerPoolId, Class<T> workerPoolClass) Gets the latest state of the supplied worker pool by ID.getWorkerPool
(String namespace, String name) Gets the latest state of the worker pool with the specified namespace and name.<T extends WorkerPool>
TgetWorkerPool
(String namespace, String name, Class<T> workerPoolClass) Gets the latest state of the supplied worker pool by namespace and name.<T extends WorkerPool>
TgetWorkerPool
(T workerPool) Gets the latest state of the supplied worker pool.getWorkerPoolHelper
(WorkerPool workerPool) Constructs a new worker pool helper for the specified worker pool.getWorkerPoolHelper
(String workerPoolId) Constructs a new worker pool helper for the specified worker pool.getWorkerPools
(WorkerPoolSearch search) Returns aSearchClient
that offers the ability to search worker pools.provisionWorkerPool
(ComputeRequirementTemplateUsage computeRequirementTemplateUsage) Requests that the supplied compute requirement template request is used to provision a worker pool.provisionWorkerPool
(ComputeRequirementTemplateUsage computeRequirementTemplateUsage, ProvisionedWorkerPoolProperties provisionedProperties) Requests that the supplied compute requirement template request is used to provision a worker pool.refreshConfiguredWorkerPoolToken
(ConfiguredWorkerPool workerPool) Refresh a configured worker pool token with an unlimited time-to-live.refreshConfiguredWorkerPoolToken
(ConfiguredWorkerPool workerPool, Duration tokenTtl) Refresh a configured worker pool token with the specified time-to-live.refreshConfiguredWorkerPoolToken
(String workerPoolId) Refresh a configured worker pool token with an unlimited time-to-live.refreshConfiguredWorkerPoolToken
(String workerPoolId, Duration tokenTtl) Refresh a configured worker pool token with the specified time-to-live.Regenerate a configured worker pool token with an unlimited time-to-live.regenerateConfiguredWorkerPoolToken
(ConfiguredWorkerPool workerPool, Duration tokenTtl) Regenerate a configured worker pool token with the specified time-to-live.regenerateConfiguredWorkerPoolToken
(String workerPoolId) Regenerate a configured worker pool token with an unlimited time-to-live.regenerateConfiguredWorkerPoolToken
(String workerPoolId, Duration tokenTtl) Regenerate a configured worker pool token with the specified time-to-live.void
Removes the specified event listener.resizeWorkerPool
(ProvisionedWorkerPool workerPool, int size) Resizes the specified worker pool to the given number of nodes.resizeWorkerPool
(String workerPoolId, int size) Resizes the specified worker pool to the given number of nodes.shutdownNode
(Node node) Shuts down the specified node gracefully, allowing any running tasks to finish first.shutdownNode
(String nodeId) Shuts down the specified node gracefully, allowing any running tasks to finish first.void
shutdownWorkerPool
(WorkerPool workerPool) Shuts down the specified worker pool.void
shutdownWorkerPool
(String workerPoolId) Shuts down the specified worker pool.streamNodes
(NodeSearch search) Deprecated, for removal: This API element is subject to removal in a future version.usegetNodes(NodeSearch)
instead to search nodes.
-
Method Details
-
addConfiguredWorkerPool
Submits a NEW configured worker pool to the YellowDog Scheduler service to be initialised.- Parameters:
request
- the request containing details of the worker pool- Returns:
- the response containing the worker pool and the token
-
refreshConfiguredWorkerPoolToken
Refresh a configured worker pool token with an unlimited time-to-live.- Parameters:
workerPool
- the worker pool- Returns:
- the worker pool token
-
refreshConfiguredWorkerPoolToken
WorkerPoolToken refreshConfiguredWorkerPoolToken(ConfiguredWorkerPool workerPool, Duration tokenTtl) Refresh a configured worker pool token with the specified time-to-live.- Parameters:
workerPool
- the worker pooltokenTtl
- the token time-to-live.- Returns:
- the worker pool token
-
refreshConfiguredWorkerPoolToken
Refresh a configured worker pool token with an unlimited time-to-live.- Parameters:
workerPoolId
- the worker pool ID- Returns:
- the worker pool token
-
refreshConfiguredWorkerPoolToken
Refresh a configured worker pool token with the specified time-to-live.- Parameters:
workerPoolId
- the worker pool IDtokenTtl
- the token time-to-live.- Returns:
- the worker pool token
-
regenerateConfiguredWorkerPoolToken
Regenerate a configured worker pool token with an unlimited time-to-live.- Parameters:
workerPool
- the worker pool- Returns:
- the worker pool token
-
regenerateConfiguredWorkerPoolToken
WorkerPoolToken regenerateConfiguredWorkerPoolToken(ConfiguredWorkerPool workerPool, Duration tokenTtl) Regenerate a configured worker pool token with the specified time-to-live.- Parameters:
workerPool
- the worker pooltokenTtl
- the token time-to-live.- Returns:
- the worker pool token
-
regenerateConfiguredWorkerPoolToken
Regenerate a configured worker pool token with an unlimited time-to-live.- Parameters:
workerPoolId
- the worker pool ID- Returns:
- the worker pool token
-
regenerateConfiguredWorkerPoolToken
Regenerate a configured worker pool token with the specified time-to-live.- Parameters:
workerPoolId
- the worker pool IDtokenTtl
- the token time-to-live.- Returns:
- the worker pool token
-
getConfiguredWorkerPoolToken
Get a configured worker pool token.- Parameters:
workerPool
- the worker pool- Returns:
- the worker pool token
-
getConfiguredWorkerPoolToken
Get a configured worker pool token.- Parameters:
workerPoolId
- the worker pool ID- Returns:
- the worker pool token
-
provisionWorkerPool
ProvisionedWorkerPool provisionWorkerPool(ComputeRequirementTemplateUsage computeRequirementTemplateUsage) Requests that the supplied compute requirement template request is used to provision a worker pool.- Parameters:
computeRequirementTemplateUsage
- the compute requirement template usage from which to provision a worker pool- Returns:
- the provisioned worker pool
-
provisionWorkerPool
ProvisionedWorkerPool provisionWorkerPool(ComputeRequirementTemplateUsage computeRequirementTemplateUsage, ProvisionedWorkerPoolProperties provisionedProperties) Requests that the supplied compute requirement template request is used to provision a worker pool.- Parameters:
computeRequirementTemplateUsage
- the compute requirement template usage from which to provision a worker poolprovisionedProperties
- the properties used to determine behaviour when managing the worker pool- Returns:
- the provisioned worker pool
-
resizeWorkerPool
Resizes the specified worker pool to the given number of nodes.- Parameters:
workerPool
- the worker pool to resizesize
- the target number of nodes when resizing the worker pool- Returns:
- the latest state of the worker pool
-
resizeWorkerPool
Resizes the specified worker pool to the given number of nodes.- Parameters:
workerPoolId
- the ID of the worker pool to resizesize
- the target number of nodes when resizing the worker pool- Returns:
- the latest state of the worker pool
-
shutdownWorkerPool
Shuts down the specified worker pool.- Parameters:
workerPool
- the worker pool to shutdown
-
shutdownWorkerPool
Shuts down the specified worker pool.- Parameters:
workerPoolId
- the ID of the worker pool to shutdown
-
getWorkerPool
Gets the latest state of the supplied worker pool.- Parameters:
workerPool
- the worker pool for which to get the latest state- Returns:
- the latest state of the worker pool
-
getWorkerPool
Gets the latest state of the worker pool with the specified ID.- Parameters:
workerPoolId
- the ID of the worker pool- Returns:
- the latest state of the worker pool
-
getWorkerPool
Gets the latest state of the supplied worker pool by ID.- Parameters:
workerPoolId
- the ID of the worker poolworkerPoolClass
- the type of the worker pool to return- Returns:
- the latest state of the worker pool
-
getWorkerPool
Gets the latest state of the worker pool with the specified namespace and name.- Parameters:
namespace
- the namespace of the worker poolname
- the name of the worker pool- Returns:
- the latest state of the worker pool
-
getWorkerPool
Gets the latest state of the supplied worker pool by namespace and name.- Parameters:
namespace
- the namespace of the worker poolname
- the name of the worker poolworkerPoolClass
- the type of the worker pool to return- Returns:
- the latest state of the worker pool
-
addWorkerPoolListener
Adds an event listener to receive notifications of changes for the specified worker pool. The client manages subscriptions to YellowDog Scheduler such that the first listener created for a worker pool will cause a Server-Sent Events subscription to be initiated; additional listeners for the same worker pool share that subscription.- Parameters:
workerPool
- the worker pool for which to receive notificationslistener
- the event listener that will be invoked for notifications
-
addWorkerPoolListener
Adds an event listener to receive notifications of changes for the specified worker pool. The client manages subscriptions to YellowDog Scheduler such that the first listener created for a worker pool will cause a Server-Sent Events subscription to be initiated; additional listeners for the same worker pool share that subscription.- Parameters:
workerPoolId
- the ID of the worker pool for which to receive notificationslistener
- the event listener that will be invoked for notifications
-
removeWorkerPoolListener
Removes the specified event listener. The client manages subscriptions to YellowDog Scheduler such that when the last listener for a worker pool is removed, the associated Server-Sent Events subscription is cancelled.- Parameters:
listener
- the event listener that will no longer be invoked for notifications
-
getWorkerPoolHelper
Constructs a new worker pool helper for the specified worker pool.- Parameters:
workerPool
- the worker pool for which the helper will be constructed- Returns:
- a new worker pool helper
-
getWorkerPoolHelper
Constructs a new worker pool helper for the specified worker pool.- Parameters:
workerPoolId
- the ID of the worker pool for which the helper will be constructed- Returns:
- a new worker pool helper
-
findAllWorkerPools
Deprecated, for removal: This API element is subject to removal in a future version.usegetWorkerPools(WorkerPoolSearch)
instead to search worker pools.Returns summaries of all existing worker pools within the system for the requesting user.- Returns:
- a list of worker pool summaries
-
getWorkerPools
Returns aSearchClient
that offers the ability to search worker pools.- Parameters:
search
- the search- Returns:
- the search client
-
findNodes
Deprecated, for removal: This API element is subject to removal in a future version.usegetNodes(NodeSearch)
instead to search nodes.Returns worker pool nodes within the system that match the specified search. WARNING: If your search matches too many workers to fit into your application's memory limits, consider usingstreamNodes(NodeSearch)
orfindNodes(NodeSearch, SliceReference)
.- Parameters:
search
- the search- Returns:
- a list of nodes
-
findNodes
@Deprecated(since="6.0.1", forRemoval=true) Slice<Node> findNodes(NodeSearch search, SliceReference sliceReference) Deprecated, for removal: This API element is subject to removal in a future version.usegetNodes(NodeSearch)
instead to search nodes.Returns a slice of nodes that match the specified search and slice reference.- Parameters:
search
- the searchsliceReference
- the slice reference- Returns:
- a slice of nodes
-
streamNodes
Deprecated, for removal: This API element is subject to removal in a future version.usegetNodes(NodeSearch)
instead to search nodes.Streams nodes within the system that match the specified search.- Parameters:
search
- the search- Returns:
- a stream of nodes
-
getNode
-
getNode
-
shutdownNode
-
shutdownNode
-
addNodeActionsForNode
Adds node actions to be performed for the specified node. Sets the nodeIdFilter and nodeTypes properties of any actions to apply to the specified node.- Parameters:
node
- the nodeactions
- the node actions
-
addNodeActionsForNode
Adds node actions to be performed for the specified node. Sets the nodeIdFilter and nodeTypes properties of any actions to apply to the specified node.- Parameters:
workerPoolId
- the ID of the worker pool containing the nodenodeId
- the ID of the nodeactions
- the node actions
-
addNodeActions
Adds the specified node actions to be performed for the specified worker pool.- Parameters:
workerPoolId
- the ID of the worker poolactions
- the node actions
-
addNodeActions
Adds the specified groups of node actions to be performed for the specified worker pool.- Parameters:
workerPoolId
- the ID of the worker poolactionGroups
- the node action groups
-
addNodeActions
Adds the specified groups of node actions to be performed for the specified worker pool.- Parameters:
workerPoolId
- the ID of the worker poolactionGroups
- the node action groups
-
addNodeActions
void addNodeActions(String workerPoolId, List<NodeActionGroup> actionGroups, List<String> nodeIdFilterList) Adds the specified groups of node actions to be performed for the specified worker pool.- Parameters:
workerPoolId
- the ID of the worker poolactionGroups
- the node action groupsnodeIdFilterList
- a list of node IDs that can be used to filter recipients of node actions
-
addNodeActions
Adds the specified node actions to be performed for the specified worker pool.- Parameters:
workerPool
- the worker poolactions
- the node actions
-
addNodeActions
Adds the specified groups of node actions to be performed for the specified worker pool.- Parameters:
workerPool
- the worker poolactionGroups
- the node action groups
-
addNodeActions
Adds the specified groups of node actions to be performed for the specified worker pool.- Parameters:
workerPool
- the worker poolactionGroups
- the node action groups
-
addNodeActions
void addNodeActions(WorkerPool workerPool, List<NodeActionGroup> actionGroups, List<String> nodeIdFilterList) Adds the specified groups of node actions to be performed for the specified worker pool.- Parameters:
workerPool
- the worker poolactionGroups
- the node action groupsnodeIdFilterList
- a list of node IDs that can be used to filter recipients of node actions
-
getNodeActions
Gets the current state of the specified node's action queue.- Parameters:
node
- the node- Returns:
- the current state of the action queue
-
getNodeActions
Gets the current state of the specified node's action queue.- Parameters:
nodeId
- the ID of the node- Returns:
- the current state of the action queue
-
getNodes
Returns aSearchClient
that offers the ability to search nodes.- Parameters:
search
- the search- Returns:
- the search client
-
getWorkerPools(WorkerPoolSearch)
instead to search worker pools.