Interface WorkerPoolClient

All Known Implementing Classes:
WorkerPoolClientImpl

public interface WorkerPoolClient
Client interface containing methods for accessing YellowDog Scheduler functions.
  • 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

      WorkerPoolToken refreshConfiguredWorkerPoolToken(ConfiguredWorkerPool workerPool)
      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 pool
      tokenTtl - the token time-to-live.
      Returns:
      the worker pool token
    • refreshConfiguredWorkerPoolToken

      WorkerPoolToken refreshConfiguredWorkerPoolToken(String workerPoolId)
      Refresh a configured worker pool token with an unlimited time-to-live.
      Parameters:
      workerPoolId - the worker pool ID
      Returns:
      the worker pool token
    • refreshConfiguredWorkerPoolToken

      WorkerPoolToken refreshConfiguredWorkerPoolToken(String workerPoolId, Duration tokenTtl)
      Refresh a configured worker pool token with the specified time-to-live.
      Parameters:
      workerPoolId - the worker pool ID
      tokenTtl - the token time-to-live.
      Returns:
      the worker pool token
    • regenerateConfiguredWorkerPoolToken

      WorkerPoolToken regenerateConfiguredWorkerPoolToken(ConfiguredWorkerPool workerPool)
      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 pool
      tokenTtl - the token time-to-live.
      Returns:
      the worker pool token
    • regenerateConfiguredWorkerPoolToken

      WorkerPoolToken regenerateConfiguredWorkerPoolToken(String workerPoolId)
      Regenerate a configured worker pool token with an unlimited time-to-live.
      Parameters:
      workerPoolId - the worker pool ID
      Returns:
      the worker pool token
    • regenerateConfiguredWorkerPoolToken

      WorkerPoolToken regenerateConfiguredWorkerPoolToken(String workerPoolId, Duration tokenTtl)
      Regenerate a configured worker pool token with the specified time-to-live.
      Parameters:
      workerPoolId - the worker pool ID
      tokenTtl - the token time-to-live.
      Returns:
      the worker pool token
    • getConfiguredWorkerPoolToken

      WorkerPoolToken getConfiguredWorkerPoolToken(ConfiguredWorkerPool workerPool)
      Get a configured worker pool token.
      Parameters:
      workerPool - the worker pool
      Returns:
      the worker pool token
    • getConfiguredWorkerPoolToken

      WorkerPoolToken getConfiguredWorkerPoolToken(String workerPoolId)
      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 pool
      provisionedProperties - the properties used to determine behaviour when managing the worker pool
      Returns:
      the provisioned worker pool
    • resizeWorkerPool

      ProvisionedWorkerPool resizeWorkerPool(ProvisionedWorkerPool workerPool, int size)
      Resizes the specified worker pool to the given number of nodes.
      Parameters:
      workerPool - the worker pool to resize
      size - the target number of nodes when resizing the worker pool
      Returns:
      the latest state of the worker pool
    • resizeWorkerPool

      ProvisionedWorkerPool resizeWorkerPool(String workerPoolId, int size)
      Resizes the specified worker pool to the given number of nodes.
      Parameters:
      workerPoolId - the ID of the worker pool to resize
      size - the target number of nodes when resizing the worker pool
      Returns:
      the latest state of the worker pool
    • shutdownWorkerPool

      void shutdownWorkerPool(WorkerPool workerPool)
      Shuts down the specified worker pool.
      Parameters:
      workerPool - the worker pool to shutdown
    • shutdownWorkerPool

      void shutdownWorkerPool(String workerPoolId)
      Shuts down the specified worker pool.
      Parameters:
      workerPoolId - the ID of the worker pool to shutdown
    • getWorkerPool

      <T extends WorkerPool> T getWorkerPool(T workerPool)
      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

      WorkerPool getWorkerPool(String workerPoolId)
      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

      <T extends WorkerPool> T getWorkerPool(String workerPoolId, Class<T> workerPoolClass)
      Gets the latest state of the supplied worker pool by ID.
      Parameters:
      workerPoolId - the ID of the worker pool
      workerPoolClass - the type of the worker pool to return
      Returns:
      the latest state of the worker pool
    • getWorkerPool

      WorkerPool getWorkerPool(String namespace, String name)
      Gets the latest state of the worker pool with the specified namespace and name.
      Parameters:
      namespace - the namespace of the worker pool
      name - the name of the worker pool
      Returns:
      the latest state of the worker pool
    • getWorkerPool

      <T extends WorkerPool> T getWorkerPool(String namespace, String name, Class<T> workerPoolClass)
      Gets the latest state of the supplied worker pool by namespace and name.
      Parameters:
      namespace - the namespace of the worker pool
      name - the name of the worker pool
      workerPoolClass - the type of the worker pool to return
      Returns:
      the latest state of the worker pool
    • addWorkerPoolListener

      void addWorkerPoolListener(WorkerPool workerPool, SubscriptionEventListener<WorkerPool> listener)
      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 notifications
      listener - the event listener that will be invoked for notifications
    • addWorkerPoolListener

      void addWorkerPoolListener(String workerPoolId, SubscriptionEventListener<WorkerPool> listener)
      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 notifications
      listener - the event listener that will be invoked for notifications
    • removeWorkerPoolListener

      void removeWorkerPoolListener(SubscriptionEventListener<WorkerPool> listener)
      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

      WorkerPoolHelper getWorkerPoolHelper(WorkerPool workerPool)
      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

      WorkerPoolHelper getWorkerPoolHelper(String workerPoolId)
      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(since="8.9.34", forRemoval=true) List<WorkerPoolSummary> findAllWorkerPools()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getWorkerPools(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 a SearchClient that offers the ability to search worker pools.
      Parameters:
      search - the search
      Returns:
      the search client
    • findNodes

      @Deprecated(since="6.0.1", forRemoval=true) List<Node> findNodes(NodeSearch search)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getNodes(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 using streamNodes(NodeSearch) or findNodes(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.
      use getNodes(NodeSearch) instead to search nodes.
      Returns a slice of nodes that match the specified search and slice reference.
      Parameters:
      search - the search
      sliceReference - the slice reference
      Returns:
      a slice of nodes
    • streamNodes

      @Deprecated(since="6.0.1", forRemoval=true) Stream<Node> streamNodes(NodeSearch search)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getNodes(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

      Node getNode(Node node)
      Gets the latest state of the node with the specified ID.
      Parameters:
      node - the node
      Returns:
      the latest state of the node
    • getNode

      Node getNode(String nodeId)
      Gets the latest state of the node with the specified ID.
      Parameters:
      nodeId - the ID of the node
      Returns:
      the latest state of the node
    • shutdownNode

      Node shutdownNode(Node node)
      Shuts down the specified node gracefully, allowing any running tasks to finish first.
      Parameters:
      node - the node
      Returns:
      the latest state of the node
    • shutdownNode

      Node shutdownNode(String nodeId)
      Shuts down the specified node gracefully, allowing any running tasks to finish first.
      Parameters:
      nodeId - the ID of the node
      Returns:
      the latest state of the node
    • addNodeActionsForNode

      void addNodeActionsForNode(Node node, NodeAction... actions)
      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 node
      actions - the node actions
    • addNodeActionsForNode

      void addNodeActionsForNode(String workerPoolId, String nodeId, NodeAction... actions)
      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 node
      nodeId - the ID of the node
      actions - the node actions
    • addNodeActions

      void addNodeActions(String workerPoolId, NodeAction... actions)
      Adds the specified node actions to be performed for the specified worker pool.
      Parameters:
      workerPoolId - the ID of the worker pool
      actions - the node actions
    • addNodeActions

      void addNodeActions(String workerPoolId, NodeActionGroup... actionGroups)
      Adds the specified groups of node actions to be performed for the specified worker pool.
      Parameters:
      workerPoolId - the ID of the worker pool
      actionGroups - the node action groups
    • addNodeActions

      void addNodeActions(String workerPoolId, List<NodeActionGroup> actionGroups)
      Adds the specified groups of node actions to be performed for the specified worker pool.
      Parameters:
      workerPoolId - the ID of the worker pool
      actionGroups - 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 pool
      actionGroups - the node action groups
      nodeIdFilterList - a list of node IDs that can be used to filter recipients of node actions
    • addNodeActions

      void addNodeActions(WorkerPool workerPool, NodeAction... actions)
      Adds the specified node actions to be performed for the specified worker pool.
      Parameters:
      workerPool - the worker pool
      actions - the node actions
    • addNodeActions

      void addNodeActions(WorkerPool workerPool, NodeActionGroup... actionGroups)
      Adds the specified groups of node actions to be performed for the specified worker pool.
      Parameters:
      workerPool - the worker pool
      actionGroups - the node action groups
    • addNodeActions

      void addNodeActions(WorkerPool workerPool, List<NodeActionGroup> actionGroups)
      Adds the specified groups of node actions to be performed for the specified worker pool.
      Parameters:
      workerPool - the worker pool
      actionGroups - 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 pool
      actionGroups - the node action groups
      nodeIdFilterList - a list of node IDs that can be used to filter recipients of node actions
    • getNodeActions

      NodeActionQueueSnapshot getNodeActions(Node node)
      Gets the current state of the specified node's action queue.
      Parameters:
      node - the node
      Returns:
      the current state of the action queue
    • getNodeActions

      NodeActionQueueSnapshot getNodeActions(String nodeId)
      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

      SearchClient<Node> getNodes(NodeSearch search)
      Returns a SearchClient that offers the ability to search nodes.
      Parameters:
      search - the search
      Returns:
      the search client