public class DefaultVertexParallelismInfo extends Object implements VertexParallelismInformation
VertexParallelismInformation
implementation that provides common validation.Constructor and Description |
---|
DefaultVertexParallelismInfo(int parallelism,
int maxParallelism,
Function<Integer,Optional<String>> rescaleMaxValidator)
Create
VertexParallelismInformation with max parallelism rescaling validation for a
vertex. |
DefaultVertexParallelismInfo(int minParallelism,
int parallelism,
int maxParallelism,
Function<Integer,Optional<String>> rescaleMaxValidator) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRescaleMaxParallelism(int desiredMaxParallelism)
Returns whether the vertex's max parallelism can be changed to a given value.
|
int |
getMaxParallelism()
Returns the vertex's max parallelism.
|
int |
getMinParallelism()
Returns a vertex's min parallelism.
|
int |
getParallelism()
Returns a vertex's parallelism.
|
void |
setMaxParallelism(int maxParallelism)
Changes a given vertex's max parallelism property.
|
void |
setParallelism(int parallelism)
Set a given vertex's parallelism property.
|
public DefaultVertexParallelismInfo(int parallelism, int maxParallelism, Function<Integer,Optional<String>> rescaleMaxValidator)
VertexParallelismInformation
with max parallelism rescaling validation for a
vertex.parallelism
- the vertex's parallelismmaxParallelism
- the vertex's max parallelismrescaleMaxValidator
- the validation function to provide an error message if a max
parallelism rescale is not allowedpublic int getMinParallelism()
VertexParallelismInformation
getMinParallelism
in interface VertexParallelismInformation
public int getParallelism()
VertexParallelismInformation
getParallelism
in interface VertexParallelismInformation
public int getMaxParallelism()
VertexParallelismInformation
getMaxParallelism
in interface VertexParallelismInformation
public void setParallelism(int parallelism)
VertexParallelismInformation
setParallelism
in interface VertexParallelismInformation
parallelism
- the parallelism for the vertexpublic void setMaxParallelism(int maxParallelism)
VertexParallelismInformation
VertexParallelismInformation.canRescaleMaxParallelism(int)
, otherwise this operation may fail.setMaxParallelism
in interface VertexParallelismInformation
maxParallelism
- the new max parallelism for the vertexpublic boolean canRescaleMaxParallelism(int desiredMaxParallelism)
VertexParallelismInformation
canRescaleMaxParallelism
in interface VertexParallelismInformation
desiredMaxParallelism
- the desired max parallelism for the vertexCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.