@Internal public class ResourceSpec extends Object implements Serializable
merge(ResourceSpec) method for chained operators when generating job graph.
Resource provides lessThanOrEqual(ResourceSpec) method to compare these fields in sequence:
| Modifier and Type | Field and Description |
|---|---|
static ResourceSpec |
DEFAULT |
| Constructor and Description |
|---|
ResourceSpec(double cpuCores,
int heapMemoryInMB)
Creates a new ResourceSpec with basic common resources.
|
ResourceSpec(double cpuCores,
int heapMemoryInMB,
int directMemoryInMB,
int nativeMemoryInMB,
int stateSizeInMB)
Creates a new ResourceSpec with full resources.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
getCpuCores() |
int |
getDirectMemory() |
int |
getHeapMemory() |
int |
getNativeMemory() |
int |
getStateSize() |
int |
hashCode() |
boolean |
isValid()
Check whether all the field values are valid.
|
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 or merge the resource consumed by state backend.
|
String |
toString() |
public static final ResourceSpec DEFAULT
public ResourceSpec(double cpuCores,
int heapMemoryInMB)
cpuCores - The number of CPU cores (possibly fractional, i.e., 0.2 cores)heapMemoryInMB - The size of the java heap memory, in megabytes.public ResourceSpec(double cpuCores,
int heapMemoryInMB,
int directMemoryInMB,
int nativeMemoryInMB,
int stateSizeInMB)
cpuCores - The number of CPU cores (possibly fractional, i.e., 0.2 cores)heapMemoryInMB - The size of the java heap memory, in megabytes.directMemoryInMB - The size of the java nio direct memory, in megabytes.nativeMemoryInMB - The size of the native memory, in megabytes.stateSizeInMB - The state size for storing in checkpoint.public ResourceSpec merge(ResourceSpec other)
other - Reference to resource to merge in.public double getCpuCores()
public int getHeapMemory()
public int getDirectMemory()
public int getNativeMemory()
public int getStateSize()
public boolean isValid()
public boolean lessThanOrEqual(@Nonnull ResourceSpec other)
other - The resource to compareCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.