@Internal public class StreamGraph extends Object implements org.apache.flink.api.dag.Pipeline
Modifier and Type | Field and Description |
---|---|
static String |
ITERATION_SINK_NAME_PREFIX |
static String |
ITERATION_SOURCE_NAME_PREFIX |
protected Map<Integer,String> |
vertexIDtoBrokerID |
protected Map<Integer,Long> |
vertexIDtoLoopTimeout |
Constructor and Description |
---|
StreamGraph(org.apache.flink.api.common.ExecutionConfig executionConfig,
CheckpointConfig checkpointConfig,
org.apache.flink.runtime.jobgraph.SavepointRestoreSettings savepointRestoreSettings) |
Modifier and Type | Method and Description |
---|---|
<IN1,IN2,OUT> |
addCoOperator(Integer vertexID,
String slotSharingGroup,
String coLocationGroup,
StreamOperatorFactory<OUT> taskOperatorFactory,
org.apache.flink.api.common.typeinfo.TypeInformation<IN1> in1TypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<IN2> in2TypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo,
String operatorName) |
void |
addEdge(Integer upStreamVertexID,
Integer downStreamVertexID,
int typeNumber) |
void |
addEdge(Integer upStreamVertexID,
Integer downStreamVertexID,
int typeNumber,
org.apache.flink.runtime.jobgraph.IntermediateDataSetID intermediateDataSetId) |
<IN,OUT> void |
addLegacySource(Integer vertexID,
String slotSharingGroup,
String coLocationGroup,
StreamOperatorFactory<OUT> operatorFactory,
org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo,
String operatorName) |
<OUT> void |
addMultipleInputOperator(Integer vertexID,
String slotSharingGroup,
String coLocationGroup,
StreamOperatorFactory<OUT> operatorFactory,
List<org.apache.flink.api.common.typeinfo.TypeInformation<?>> inTypeInfos,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo,
String operatorName) |
protected StreamNode |
addNode(Integer vertexID,
String slotSharingGroup,
String coLocationGroup,
Class<? extends org.apache.flink.runtime.jobgraph.tasks.TaskInvokable> vertexClass,
StreamOperatorFactory<?> operatorFactory,
String operatorName) |
<IN,OUT> void |
addOperator(Integer vertexID,
String slotSharingGroup,
String coLocationGroup,
StreamOperatorFactory<OUT> operatorFactory,
org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo,
String operatorName) |
<IN,OUT> void |
addSink(Integer vertexID,
String slotSharingGroup,
String coLocationGroup,
StreamOperatorFactory<OUT> operatorFactory,
org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo,
String operatorName) |
<IN,OUT> void |
addSource(Integer vertexID,
String slotSharingGroup,
String coLocationGroup,
SourceOperatorFactory<OUT> operatorFactory,
org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo,
String operatorName) |
void |
addVirtualPartitionNode(Integer originalId,
Integer virtualId,
StreamPartitioner<?> partitioner,
StreamExchangeMode exchangeMode)
Adds a new virtual node that is used to connect a downstream vertex to an input with a
certain partitioning.
|
void |
addVirtualSideOutputNode(Integer originalId,
Integer virtualId,
org.apache.flink.util.OutputTag outputTag)
Adds a new virtual node that is used to connect a downstream vertex to only the outputs with
the selected side-output
OutputTag . |
void |
clear()
Remove all registered nodes etc.
|
org.apache.flink.api.java.tuple.Tuple2<StreamNode,StreamNode> |
createIterationSourceAndSink(int loopId,
int sourceId,
int sinkId,
long timeout,
int parallelism,
int maxParallelism,
org.apache.flink.api.common.operators.ResourceSpec minResources,
org.apache.flink.api.common.operators.ResourceSpec preferredResources) |
Set<org.apache.flink.api.java.tuple.Tuple2<Integer,StreamOperatorFactory<?>>> |
getAllOperatorFactory() |
String |
getBrokerID(Integer vertexID) |
CheckpointConfig |
getCheckpointConfig() |
org.apache.flink.runtime.state.CheckpointStorage |
getCheckpointStorage() |
org.apache.flink.api.common.ExecutionConfig |
getExecutionConfig() |
GlobalStreamExchangeMode |
getGlobalStreamExchangeMode() |
Set<org.apache.flink.api.java.tuple.Tuple2<StreamNode,StreamNode>> |
getIterationSourceSinkPairs() |
org.apache.flink.runtime.jobgraph.JobGraph |
getJobGraph()
Gets the assembled
JobGraph with a random JobID . |
org.apache.flink.runtime.jobgraph.JobGraph |
getJobGraph(ClassLoader userClassLoader,
org.apache.flink.api.common.JobID jobID)
Gets the assembled
JobGraph with a specified JobID . |
String |
getJobName() |
List<org.apache.flink.runtime.executiongraph.JobStatusHook> |
getJobStatusHooks() |
org.apache.flink.runtime.jobgraph.JobType |
getJobType() |
long |
getLoopTimeout(Integer vertexID) |
org.apache.flink.core.fs.Path |
getSavepointDirectory() |
org.apache.flink.runtime.jobgraph.SavepointRestoreSettings |
getSavepointRestoreSettings() |
Collection<Integer> |
getSinkIDs() |
String |
getSlotSharingGroup(Integer id)
Determines the slot sharing group of an operation across virtual nodes.
|
Optional<org.apache.flink.runtime.clusterframework.types.ResourceProfile> |
getSlotSharingGroupResource(String groupId) |
Collection<Integer> |
getSourceIDs() |
StreamNode |
getSourceVertex(StreamEdge edge) |
org.apache.flink.runtime.state.StateBackend |
getStateBackend() |
List<StreamEdge> |
getStreamEdges(int sourceId) |
List<StreamEdge> |
getStreamEdges(int sourceId,
int targetId) |
List<StreamEdge> |
getStreamEdgesOrThrow(int sourceId,
int targetId)
Deprecated.
|
String |
getStreamingPlanAsJSON() |
StreamNode |
getStreamNode(Integer vertexID) |
Collection<StreamNode> |
getStreamNodes() |
StreamNode |
getTargetVertex(StreamEdge edge) |
TimeCharacteristic |
getTimeCharacteristic() |
InternalTimeServiceManager.Provider |
getTimerServiceProvider() |
Collection<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> |
getUserArtifacts() |
org.apache.flink.configuration.PipelineOptions.VertexDescriptionMode |
getVertexDescriptionMode() |
protected Collection<? extends Integer> |
getVertexIDs() |
boolean |
hasFineGrainedResource() |
boolean |
isAllVerticesInSameSlotSharingGroupByDefault()
Gets whether to put all vertices into the same slot sharing group by default.
|
boolean |
isAutoParallelismEnabled() |
boolean |
isChainingEnabled() |
org.apache.flink.util.TernaryBoolean |
isChangelogStateBackendEnabled() |
boolean |
isDynamic() |
boolean |
isEnableCheckpointsAfterTasksFinish() |
boolean |
isIterative() |
boolean |
isVertexNameIncludeIndexPrefix() |
void |
registerJobStatusHook(org.apache.flink.runtime.executiongraph.JobStatusHook hook)
Registers the JobStatusHook.
|
void |
setAllVerticesInSameSlotSharingGroupByDefault(boolean allVerticesInSameSlotSharingGroupByDefault)
Set whether to put all vertices into the same slot sharing group by default.
|
void |
setAutoParallelismEnabled(boolean autoParallelismEnabled) |
void |
setBufferTimeout(Integer vertexID,
long bufferTimeout) |
void |
setChaining(boolean chaining) |
void |
setChangelogStateBackendEnabled(org.apache.flink.util.TernaryBoolean changelogStateBackendEnabled) |
void |
setCheckpointStorage(org.apache.flink.runtime.state.CheckpointStorage checkpointStorage) |
void |
setDynamic(boolean dynamic) |
void |
setEnableCheckpointsAfterTasksFinish(boolean enableCheckpointsAfterTasksFinish) |
void |
setGlobalStreamExchangeMode(GlobalStreamExchangeMode globalExchangeMode) |
void |
setInputFormat(Integer vertexID,
org.apache.flink.api.common.io.InputFormat<?,?> inputFormat) |
void |
setJobName(String jobName) |
void |
setJobType(org.apache.flink.runtime.jobgraph.JobType jobType) |
void |
setManagedMemoryUseCaseWeights(int vertexID,
Map<org.apache.flink.core.memory.ManagedMemoryUseCase,Integer> operatorScopeUseCaseWeights,
Set<org.apache.flink.core.memory.ManagedMemoryUseCase> slotScopeUseCases) |
void |
setMaxParallelism(int vertexID,
int maxParallelism) |
void |
setMultipleInputStateKey(Integer vertexID,
List<org.apache.flink.api.java.functions.KeySelector<?,?>> keySelectors,
org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer) |
void |
setOneInputStateKey(Integer vertexID,
org.apache.flink.api.java.functions.KeySelector<?,?> keySelector,
org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer) |
void |
setOutputFormat(Integer vertexID,
org.apache.flink.api.common.io.OutputFormat<?> outputFormat) |
void |
setParallelism(Integer vertexID,
int parallelism) |
void |
setParallelism(Integer vertexId,
int parallelism,
boolean parallelismConfigured) |
void |
setResources(int vertexID,
org.apache.flink.api.common.operators.ResourceSpec minResources,
org.apache.flink.api.common.operators.ResourceSpec preferredResources) |
void |
setSavepointDirectory(org.apache.flink.core.fs.Path savepointDir) |
void |
setSavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings savepointRestoreSettings) |
void |
setSerializers(Integer vertexID,
org.apache.flink.api.common.typeutils.TypeSerializer<?> in1,
org.apache.flink.api.common.typeutils.TypeSerializer<?> in2,
org.apache.flink.api.common.typeutils.TypeSerializer<?> out) |
void |
setSlotSharingGroupResource(Map<String,org.apache.flink.runtime.clusterframework.types.ResourceProfile> slotSharingGroupResources) |
void |
setStateBackend(org.apache.flink.runtime.state.StateBackend backend) |
void |
setSupportsConcurrentExecutionAttempts(Integer vertexId,
boolean supportsConcurrentExecutionAttempts) |
void |
setTimeCharacteristic(TimeCharacteristic timeCharacteristic) |
void |
setTimerServiceProvider(InternalTimeServiceManager.Provider timerServiceProvider) |
void |
setTransformationUID(Integer nodeId,
String transformationId) |
void |
setTwoInputStateKey(Integer vertexID,
org.apache.flink.api.java.functions.KeySelector<?,?> keySelector1,
org.apache.flink.api.java.functions.KeySelector<?,?> keySelector2,
org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer) |
void |
setUserArtifacts(Collection<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> userArtifacts) |
void |
setVertexDescriptionMode(org.apache.flink.configuration.PipelineOptions.VertexDescriptionMode mode) |
void |
setVertexNameIncludeIndexPrefix(boolean includePrefix) |
public static final String ITERATION_SOURCE_NAME_PREFIX
public static final String ITERATION_SINK_NAME_PREFIX
public StreamGraph(org.apache.flink.api.common.ExecutionConfig executionConfig, CheckpointConfig checkpointConfig, org.apache.flink.runtime.jobgraph.SavepointRestoreSettings savepointRestoreSettings)
public void clear()
public org.apache.flink.api.common.ExecutionConfig getExecutionConfig()
public CheckpointConfig getCheckpointConfig()
public void setSavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings savepointRestoreSettings)
public org.apache.flink.runtime.jobgraph.SavepointRestoreSettings getSavepointRestoreSettings()
public String getJobName()
public void setJobName(String jobName)
public void setChaining(boolean chaining)
public void setStateBackend(org.apache.flink.runtime.state.StateBackend backend)
public org.apache.flink.runtime.state.StateBackend getStateBackend()
public void setChangelogStateBackendEnabled(org.apache.flink.util.TernaryBoolean changelogStateBackendEnabled)
public org.apache.flink.util.TernaryBoolean isChangelogStateBackendEnabled()
public void setCheckpointStorage(org.apache.flink.runtime.state.CheckpointStorage checkpointStorage)
public org.apache.flink.runtime.state.CheckpointStorage getCheckpointStorage()
public void setSavepointDirectory(org.apache.flink.core.fs.Path savepointDir)
public org.apache.flink.core.fs.Path getSavepointDirectory()
public InternalTimeServiceManager.Provider getTimerServiceProvider()
public void setTimerServiceProvider(InternalTimeServiceManager.Provider timerServiceProvider)
public Collection<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> getUserArtifacts()
public void setUserArtifacts(Collection<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> userArtifacts)
public TimeCharacteristic getTimeCharacteristic()
public void setTimeCharacteristic(TimeCharacteristic timeCharacteristic)
public GlobalStreamExchangeMode getGlobalStreamExchangeMode()
public void setGlobalStreamExchangeMode(GlobalStreamExchangeMode globalExchangeMode)
public void setSlotSharingGroupResource(Map<String,org.apache.flink.runtime.clusterframework.types.ResourceProfile> slotSharingGroupResources)
public Optional<org.apache.flink.runtime.clusterframework.types.ResourceProfile> getSlotSharingGroupResource(String groupId)
public boolean hasFineGrainedResource()
public void setAllVerticesInSameSlotSharingGroupByDefault(boolean allVerticesInSameSlotSharingGroupByDefault)
allVerticesInSameSlotSharingGroupByDefault
- indicates whether to put all vertices into
the same slot sharing group by default.public boolean isAllVerticesInSameSlotSharingGroupByDefault()
public boolean isEnableCheckpointsAfterTasksFinish()
public void setEnableCheckpointsAfterTasksFinish(boolean enableCheckpointsAfterTasksFinish)
public boolean isChainingEnabled()
public boolean isIterative()
public <IN,OUT> void addSource(Integer vertexID, @Nullable String slotSharingGroup, @Nullable String coLocationGroup, SourceOperatorFactory<OUT> operatorFactory, org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo, String operatorName)
public <IN,OUT> void addLegacySource(Integer vertexID, @Nullable String slotSharingGroup, @Nullable String coLocationGroup, StreamOperatorFactory<OUT> operatorFactory, org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo, String operatorName)
public <IN,OUT> void addSink(Integer vertexID, @Nullable String slotSharingGroup, @Nullable String coLocationGroup, StreamOperatorFactory<OUT> operatorFactory, org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo, String operatorName)
public <IN,OUT> void addOperator(Integer vertexID, @Nullable String slotSharingGroup, @Nullable String coLocationGroup, StreamOperatorFactory<OUT> operatorFactory, org.apache.flink.api.common.typeinfo.TypeInformation<IN> inTypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo, String operatorName)
public <IN1,IN2,OUT> void addCoOperator(Integer vertexID, String slotSharingGroup, @Nullable String coLocationGroup, StreamOperatorFactory<OUT> taskOperatorFactory, org.apache.flink.api.common.typeinfo.TypeInformation<IN1> in1TypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<IN2> in2TypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo, String operatorName)
public <OUT> void addMultipleInputOperator(Integer vertexID, String slotSharingGroup, @Nullable String coLocationGroup, StreamOperatorFactory<OUT> operatorFactory, List<org.apache.flink.api.common.typeinfo.TypeInformation<?>> inTypeInfos, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo, String operatorName)
protected StreamNode addNode(Integer vertexID, @Nullable String slotSharingGroup, @Nullable String coLocationGroup, Class<? extends org.apache.flink.runtime.jobgraph.tasks.TaskInvokable> vertexClass, StreamOperatorFactory<?> operatorFactory, String operatorName)
public void addVirtualSideOutputNode(Integer originalId, Integer virtualId, org.apache.flink.util.OutputTag outputTag)
OutputTag
.originalId
- ID of the node that should be connected to.virtualId
- ID of the virtual node.outputTag
- The selected side-output OutputTag
.public void addVirtualPartitionNode(Integer originalId, Integer virtualId, StreamPartitioner<?> partitioner, StreamExchangeMode exchangeMode)
When adding an edge from the virtual node to a downstream node the connection will be made to the original node, but with the partitioning given here.
originalId
- ID of the node that should be connected to.virtualId
- ID of the virtual node.partitioner
- The partitionerpublic String getSlotSharingGroup(Integer id)
public void addEdge(Integer upStreamVertexID, Integer downStreamVertexID, int typeNumber, org.apache.flink.runtime.jobgraph.IntermediateDataSetID intermediateDataSetId)
public void setParallelism(Integer vertexID, int parallelism)
public boolean isDynamic()
public void setParallelism(Integer vertexId, int parallelism, boolean parallelismConfigured)
public void setDynamic(boolean dynamic)
public void setMaxParallelism(int vertexID, int maxParallelism)
public void setResources(int vertexID, org.apache.flink.api.common.operators.ResourceSpec minResources, org.apache.flink.api.common.operators.ResourceSpec preferredResources)
public void setManagedMemoryUseCaseWeights(int vertexID, Map<org.apache.flink.core.memory.ManagedMemoryUseCase,Integer> operatorScopeUseCaseWeights, Set<org.apache.flink.core.memory.ManagedMemoryUseCase> slotScopeUseCases)
public void setOneInputStateKey(Integer vertexID, org.apache.flink.api.java.functions.KeySelector<?,?> keySelector, org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer)
public void setTwoInputStateKey(Integer vertexID, org.apache.flink.api.java.functions.KeySelector<?,?> keySelector1, org.apache.flink.api.java.functions.KeySelector<?,?> keySelector2, org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer)
public void setMultipleInputStateKey(Integer vertexID, List<org.apache.flink.api.java.functions.KeySelector<?,?>> keySelectors, org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer)
public void setBufferTimeout(Integer vertexID, long bufferTimeout)
public void setSerializers(Integer vertexID, org.apache.flink.api.common.typeutils.TypeSerializer<?> in1, org.apache.flink.api.common.typeutils.TypeSerializer<?> in2, org.apache.flink.api.common.typeutils.TypeSerializer<?> out)
public void setInputFormat(Integer vertexID, org.apache.flink.api.common.io.InputFormat<?,?> inputFormat)
public void setOutputFormat(Integer vertexID, org.apache.flink.api.common.io.OutputFormat<?> outputFormat)
public StreamNode getStreamNode(Integer vertexID)
protected Collection<? extends Integer> getVertexIDs()
@VisibleForTesting public List<StreamEdge> getStreamEdges(int sourceId)
@VisibleForTesting public List<StreamEdge> getStreamEdges(int sourceId, int targetId)
@VisibleForTesting @Deprecated public List<StreamEdge> getStreamEdgesOrThrow(int sourceId, int targetId)
public Collection<Integer> getSourceIDs()
public Collection<Integer> getSinkIDs()
public Collection<StreamNode> getStreamNodes()
public Set<org.apache.flink.api.java.tuple.Tuple2<Integer,StreamOperatorFactory<?>>> getAllOperatorFactory()
public long getLoopTimeout(Integer vertexID)
public org.apache.flink.api.java.tuple.Tuple2<StreamNode,StreamNode> createIterationSourceAndSink(int loopId, int sourceId, int sinkId, long timeout, int parallelism, int maxParallelism, org.apache.flink.api.common.operators.ResourceSpec minResources, org.apache.flink.api.common.operators.ResourceSpec preferredResources)
public Set<org.apache.flink.api.java.tuple.Tuple2<StreamNode,StreamNode>> getIterationSourceSinkPairs()
public StreamNode getSourceVertex(StreamEdge edge)
public StreamNode getTargetVertex(StreamEdge edge)
@VisibleForTesting public org.apache.flink.runtime.jobgraph.JobGraph getJobGraph()
JobGraph
with a random JobID
.public org.apache.flink.runtime.jobgraph.JobGraph getJobGraph(ClassLoader userClassLoader, @Nullable org.apache.flink.api.common.JobID jobID)
JobGraph
with a specified JobID
.public String getStreamingPlanAsJSON()
public void setJobType(org.apache.flink.runtime.jobgraph.JobType jobType)
public org.apache.flink.runtime.jobgraph.JobType getJobType()
public boolean isAutoParallelismEnabled()
public void setAutoParallelismEnabled(boolean autoParallelismEnabled)
public org.apache.flink.configuration.PipelineOptions.VertexDescriptionMode getVertexDescriptionMode()
public void setVertexDescriptionMode(org.apache.flink.configuration.PipelineOptions.VertexDescriptionMode mode)
public void setVertexNameIncludeIndexPrefix(boolean includePrefix)
public boolean isVertexNameIncludeIndexPrefix()
public void registerJobStatusHook(org.apache.flink.runtime.executiongraph.JobStatusHook hook)
public List<org.apache.flink.runtime.executiongraph.JobStatusHook> getJobStatusHooks()
public void setSupportsConcurrentExecutionAttempts(Integer vertexId, boolean supportsConcurrentExecutionAttempts)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.