Interface JobTarget

All Known Implementing Classes:
AnyNodeJobTarget, ColocatedJobTarget

public interface JobTarget
Job execution target.

Determines the rules for selecting nodes to execute a job.

  • Method Details

    • node

      static JobTarget node(ClusterNode node)
      Creates a job target for a specific node.

      This target determines that a job should be executed on a given node.

      Parameters:
      node - Node.
      Returns:
      Job target.
    • anyNode

      static JobTarget anyNode(ClusterNode... nodes)
      Creates a job target for any node from the provided collection.

      This target determines that a job can be executed on any node in a given collection, but only one of them. Which node is chosen is implementation defined.

      Parameters:
      nodes - Collection of nodes.
      Returns:
      Job target.
    • anyNode

      static JobTarget anyNode(Collection<ClusterNode> nodes)
      Creates a job target for any node from the provided collection.

      This target determines that a job can be executed on any node in a given collection, but only one of them. Which node is chosen is implementation defined.

      Parameters:
      nodes - Collection of nodes.
      Returns:
      Job target.
    • anyNode

      static JobTarget anyNode(Set<ClusterNode> nodes)
      Creates a job target for any node from the provided collection.

      This target determines that a job can be executed on any node in a given collection, but only one of them. Which node is chosen is implementation defined.

      Parameters:
      nodes - Collection of nodes.
      Returns:
      Job target.
    • colocated

      static JobTarget colocated(String tableName, Tuple key)
      Creates a colocated job target for a specific table and key.

      This target determines that a job should be executed on the same node that hosts the data for a given key of provided table.

      Parameters:
      tableName - Table name.
      key - Key.
      Returns:
      Job target.
    • colocated

      static JobTarget colocated(QualifiedName name, Tuple key)
      Creates a colocated job target for a specific QualifiedName and key.

      This target determines that a job should be executed on the same node that hosts the data for a given key of provided table.

      Parameters:
      name - QualifiedName name.
      key - Key.
      Returns:
      Job target.
    • colocated

      static <K> JobTarget colocated(String tableName, K key, Mapper<K> keyMapper)
      Creates a colocated job target for a specific table and key with mapper.

      This target determines that a job should be executed on the same node that hosts the data for a given key of provided table.

      Parameters:
      tableName - Table name.
      key - Key.
      Returns:
      Job target.
    • colocated

      static <K> JobTarget colocated(QualifiedName name, K key, Mapper<K> keyMapper)
      Creates a colocated job target for a specific QualifiedName and key with mapper.

      This target determines that a job should be executed on the same node that hosts the data for a given key of provided table.

      Parameters:
      name - QualifiedName name.
      key - Key.
      Returns:
      Job target.