@Internal public final class ResourceSpec extends Object implements Serializable
The state backend provides the method to estimate memory usages based on state size in the resource.
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 String |
GPU_NAME |
static ResourceSpec |
UNKNOWN
A ResourceSpec that indicates an unknown set of resources.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
double |
getCpuCores() |
int |
getDirectMemory() |
Map<String,Resource> |
getExtendedResources() |
double |
getGPUResource() |
int |
getHeapMemory() |
int |
getManagedMemory() |
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.
|
static ResourceSpec.Builder |
newBuilder() |
String |
toString() |
public static final ResourceSpec UNKNOWN
public static final ResourceSpec DEFAULT
UNKNOWN
.public static final String GPU_NAME
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 int getManagedMemory()
public double getGPUResource()
public boolean isValid()
public boolean lessThanOrEqual(@Nonnull ResourceSpec other)
other
- The resource to comparepublic static ResourceSpec.Builder newBuilder()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.