Class JobResourceRequirements
java.lang.Object
org.apache.flink.runtime.jobgraph.JobResourceRequirements
- All Implemented Interfaces:
Serializable
Information about the parallelism of job vertices.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJobResourceRequirements(Map<JobVertexID, JobVertexResourceRequirements> vertexResources) -
Method Summary
Modifier and TypeMethodDescriptionstatic JobResourceRequirementsempty()booleangetParallelism(JobVertexID jobVertexId) inthashCode()static Optional<JobResourceRequirements>readFromExecutionPlan(ExecutionPlan executionPlan) Readresource requirementsfrom the configuration of a givenExecutionPlan.toString()validate(JobResourceRequirements jobResourceRequirements, Map<JobVertexID, Integer> maxParallelismPerVertex) This method validates that: The requested boundaries are less or equal than the max parallelism.static voidwriteToExecutionPlan(ExecutionPlan executionPlan, JobResourceRequirements jobResourceRequirements) Writeresource requirementsinto the configuration of a givenExecutionPlan.
-
Constructor Details
-
JobResourceRequirements
-
-
Method Details
-
writeToExecutionPlan
public static void writeToExecutionPlan(ExecutionPlan executionPlan, JobResourceRequirements jobResourceRequirements) throws IOException Writeresource requirementsinto the configuration of a givenExecutionPlan.- Parameters:
executionPlan- executionPlan to write requirements tojobResourceRequirements- resource requirements to write- Throws:
IOException- in case we're not able to serialize requirements into the configuration
-
readFromExecutionPlan
public static Optional<JobResourceRequirements> readFromExecutionPlan(ExecutionPlan executionPlan) throws IOException Readresource requirementsfrom the configuration of a givenExecutionPlan.- Parameters:
executionPlan- execution plan to read requirements from- Throws:
IOException- in case we're not able to deserialize requirements from the configuration
-
validate
public 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.
- The requested boundaries are greater than zero.
- The requested upper bound is greater than the lower bound.
- There are no unknown job vertex ids and that we're not missing any.
-1, it will be expanded to the default value (1for the lower bound and the max parallelism for the upper bound), before the validation.- Parameters:
jobResourceRequirements- contains the new resources requirements for the job verticesmaxParallelismPerVertex- allows us to look up maximum possible parallelism for a job vertex- Returns:
- a list of validation errors
-
empty
-
newBuilder
-
getParallelism
-
getJobVertices
-
getJobVertexParallelisms
-
equals
-
hashCode
public int hashCode() -
toString
-