@Internal public final class ResourceSpec extends Object implements Serializable
Resource provides merge(ResourceSpec)
method for chained operators when generating
job graph.
Resource provides lessThanOrEqual(ResourceSpec)
method to compare these fields in
sequence:
Modifier and Type | Class and Description |
---|---|
static class |
ResourceSpec.Builder
Builder for the
ResourceSpec . |
Modifier and Type | Field and Description |
---|---|
static ResourceSpec |
DEFAULT
The default ResourceSpec used for operators and transformation functions.
|
static ResourceSpec |
UNKNOWN
A ResourceSpec that indicates an unknown set of resources.
|
static ResourceSpec |
ZERO
A ResourceSpec that indicates zero amount of resources.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Resource |
getCpuCores() |
Map<String,Resource> |
getExtendedResources() |
Resource |
getGPUResource() |
MemorySize |
getManagedMemory() |
MemorySize |
getTaskHeapMemory() |
MemorySize |
getTaskOffHeapMemory() |
int |
hashCode() |
boolean |
lessThanOrEqual(ResourceSpec other)
Checks the current resource less than or equal with the other resource by comparing all the
fields in the resource.
|
ResourceSpec |
merge(ResourceSpec other)
Used by system internally to merge the other resources of chained operators when generating
the job graph.
|
static ResourceSpec.Builder |
newBuilder(double cpuCores,
int taskHeapMemoryMB) |
ResourceSpec |
subtract(ResourceSpec other)
Subtracts another resource spec from this one.
|
String |
toString() |
public static final ResourceSpec UNKNOWN
public static final ResourceSpec DEFAULT
UNKNOWN
.public static final ResourceSpec ZERO
public ResourceSpec merge(ResourceSpec other)
other
- Reference to resource to merge in.public ResourceSpec subtract(ResourceSpec other)
other
- The other resource spec to subtract.public Resource getCpuCores()
public MemorySize getTaskHeapMemory()
public MemorySize getTaskOffHeapMemory()
public MemorySize getManagedMemory()
public Resource getGPUResource()
public boolean lessThanOrEqual(ResourceSpec other)
other
- The resource to comparepublic static ResourceSpec.Builder newBuilder(double cpuCores, int taskHeapMemoryMB)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.