public class JobResourceRequirements extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
JobResourceRequirements.Builder |
Constructor and Description |
---|
JobResourceRequirements(Map<JobVertexID,JobVertexResourceRequirements> vertexResources) |
Modifier and Type | Method and Description |
---|---|
static JobResourceRequirements |
empty() |
boolean |
equals(Object o) |
Map<JobVertexID,JobVertexResourceRequirements> |
getJobVertexParallelisms() |
Set<JobVertexID> |
getJobVertices() |
JobVertexResourceRequirements.Parallelism |
getParallelism(JobVertexID jobVertexId) |
int |
hashCode() |
static JobResourceRequirements.Builder |
newBuilder() |
static Optional<JobResourceRequirements> |
readFromJobGraph(JobGraph jobGraph)
Read
resource requirements from the configuration of a given
JobGraph . |
String |
toString() |
static List<String> |
validate(JobResourceRequirements jobResourceRequirements,
Map<JobVertexID,Integer> maxParallelismPerVertex)
This method validates that:
The requested boundaries are less or equal than the max parallelism.
|
static void |
writeToJobGraph(JobGraph jobGraph,
JobResourceRequirements jobResourceRequirements)
Write
resource requirements into the configuration of a given
JobGraph . |
public JobResourceRequirements(Map<JobVertexID,JobVertexResourceRequirements> vertexResources)
public static void writeToJobGraph(JobGraph jobGraph, JobResourceRequirements jobResourceRequirements) throws IOException
resource requirements
into the configuration of a given
JobGraph
.jobGraph
- job graph to write requirements tojobResourceRequirements
- resource requirements to writeIOException
- in case we're not able to serialize requirements into the configurationpublic static Optional<JobResourceRequirements> readFromJobGraph(JobGraph jobGraph) throws IOException
resource requirements
from the configuration of a given
JobGraph
.jobGraph
- job graph to read requirements fromIOException
- in case we're not able to deserialize requirements from the configurationpublic static List<String> validate(JobResourceRequirements jobResourceRequirements, Map<JobVertexID,Integer> maxParallelismPerVertex)
-1
, it will be expanded to the default value (1
for the lower bound and the max parallelism for the upper bound), before the validation.jobResourceRequirements
- contains the new resources requirements for the job verticesmaxParallelismPerVertex
- allows us to look up maximum possible parallelism for a job
vertexpublic static JobResourceRequirements empty()
public static JobResourceRequirements.Builder newBuilder()
public JobVertexResourceRequirements.Parallelism getParallelism(JobVertexID jobVertexId)
public Set<JobVertexID> getJobVertices()
public Map<JobVertexID,JobVertexResourceRequirements> getJobVertexParallelisms()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.