Class ResourceSpec

    • Field Detail

      • UNKNOWN

        public static final ResourceSpec UNKNOWN
        A ResourceSpec that indicates an unknown set of resources.
      • DEFAULT

        public static final ResourceSpec DEFAULT
        The default ResourceSpec used for operators and transformation functions. Currently equal to UNKNOWN.
      • ZERO

        public static final ResourceSpec ZERO
        A ResourceSpec that indicates zero amount of resources.
    • Method Detail

      • merge

        public ResourceSpec merge​(ResourceSpec other)
        Used by system internally to merge the other resources of chained operators when generating the job graph.
        Parameters:
        other - Reference to resource to merge in.
        Returns:
        The new resource with merged values.
      • subtract

        public ResourceSpec subtract​(ResourceSpec other)
        Subtracts another resource spec from this one.
        Parameters:
        other - The other resource spec to subtract.
        Returns:
        The subtracted resource spec.
      • getTaskHeapMemory

        public MemorySize getTaskHeapMemory()
      • getTaskOffHeapMemory

        public MemorySize getTaskOffHeapMemory()
      • getManagedMemory

        public MemorySize getManagedMemory()
      • lessThanOrEqual

        public boolean lessThanOrEqual​(ResourceSpec other)
        Checks the current resource less than or equal with the other resource by comparing all the fields in the resource.
        Parameters:
        other - The resource to compare
        Returns:
        True if current resource is less than or equal with the other resource, otherwise return false.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • newBuilder

        public static ResourceSpec.Builder newBuilder​(double cpuCores,
                                                      int taskHeapMemoryMB)