Class ResourceSpecifier

  • All Implemented Interfaces:
    Serializable

    public final class ResourceSpecifier
    extends Object
    implements Serializable
    Resource specifier for the resources needed by a job. Currently, this consists of three things, but may expand in the future:
    • the degree of parallelism for the job
    • the resources required by the job master process
    • the resources required by workers for each assigned partition
    See Also:
    Serialized Form
    • Field Detail

      • UNSPECIFIED

        public static ResourceSpecifier UNSPECIFIED
        Default, unspecified resources
    • Method Detail

      • PARALLELISM

        public static ResourceSpecifier PARALLELISM​(int parallelism)
        Specifies the parallelism
        Parameters:
        the - desired parallelism
      • parallelism

        public int parallelism()
      • minimumParallelism

        public int minimumParallelism()
      • maximumParallelism

        public int maximumParallelism()
      • parallelism

        public ResourceSpecifier parallelism​(int parallelism)
        Returns a resource specifier with the given specified parallelism
        Parameters:
        parallelism - the parallelism to request
        Returns:
        a resource specifier
      • minimumParallelism

        public ResourceSpecifier minimumParallelism​(int partitions)
        Returns a resource specifier with the given specified minimum parallelism
        Parameters:
        partitions - the minimal number of partitions to acquire
        Returns:
        a resource specifier
      • maximumParallelism

        public ResourceSpecifier maximumParallelism​(int partitions)
        Returns a resource specifier with the given specified maximum parallelism
        Parameters:
        partitions - the maximum number of partitions to acquire
        Returns:
        a resource specifier
      • masterResources

        public ResourceSpecifier masterResources​(ResourceAllocation resources)
        Returns a resource specifier applying the specified allocation for job master resources
        Parameters:
        resources - the resources to request
        Returns:
        a resource specifier
      • partitionResources

        public ResourceSpecifier partitionResources​(ResourceAllocation resources)
        Returns a resource specifier applying the specified allocation for per-partition resources
        Parameters:
        resources - the resources to request
        Returns:
        a resource specifier