public ResourceSpec build() { return new ResourceSpec( cpuCores, heapMemoryInMB, directMemoryInMB, nativeMemoryInMB, stateSizeInMB, gpuResource); } }
/** * Used by system internally to merge the other resources of chained operators * when generating the job graph or merge the resource consumed by state backend. * * @param other Reference to resource to merge in. * @return The new resource with merged values. */ public ResourceSpec merge(ResourceSpec other) { ResourceSpec target = new ResourceSpec( Math.max(this.cpuCores, other.cpuCores), this.heapMemoryInMB + other.heapMemoryInMB, this.directMemoryInMB + other.directMemoryInMB, this.nativeMemoryInMB + other.nativeMemoryInMB, this.stateSizeInMB + other.stateSizeInMB); target.extendedResources.putAll(extendedResources); for (Resource resource : other.extendedResources.values()) { target.extendedResources.merge(resource.getName(), resource, (v1, v2) -> v1.merge(v2)); } return target; }
public ResourceSpec build() { return new ResourceSpec( cpuCores, heapMemoryInMB, directMemoryInMB, nativeMemoryInMB, stateSizeInMB, gpuResource); } }
public ResourceSpec build() { return new ResourceSpec( cpuCores, heapMemoryInMB, directMemoryInMB, nativeMemoryInMB, stateSizeInMB, extendedResources.values().toArray(new Resource[0])); } }
/** * Used by system internally to merge the other resources of chained operators * when generating the job graph or merge the resource consumed by state backend. * * @param other Reference to resource to merge in. * @return The new resource with merged values. */ public ResourceSpec merge(ResourceSpec other) { ResourceSpec target = new ResourceSpec( Math.max(this.cpuCores, other.cpuCores), this.heapMemoryInMB + other.heapMemoryInMB, this.directMemoryInMB + other.directMemoryInMB, this.nativeMemoryInMB + other.nativeMemoryInMB, this.stateSizeInMB + other.stateSizeInMB); target.extendedResources.putAll(extendedResources); for (Resource resource : other.extendedResources.values()) { target.extendedResources.merge(resource.getName(), resource, (v1, v2) -> v1.merge(v2)); } return target; }
/** * Used by system internally to merge the other resources of chained operators * when generating the job graph or merge the resource consumed by state backend. * * @param other Reference to resource to merge in. * @return The new resource with merged values. */ public ResourceSpec merge(ResourceSpec other) { ResourceSpec target = new ResourceSpec( Math.max(this.cpuCores, other.cpuCores), this.heapMemoryInMB + other.heapMemoryInMB, this.directMemoryInMB + other.directMemoryInMB, this.nativeMemoryInMB + other.nativeMemoryInMB, this.stateSizeInMB + other.stateSizeInMB); target.extendedResources.putAll(extendedResources); for (Resource resource : other.extendedResources.values()) { target.extendedResources.merge(resource.getName(), resource, (v1, v2) -> v1.merge(v2)); } return target; }