Flink uid和uidHash
2021-05-25 23:49:09 0 举报
AI智能生成
flink 源码
作者其他创作
大纲/内容
uid
设置org.apache.flink.api.dag.Transformation#setUid
uidHash
设置org.apache.flink.api.dag.Transformation#setUidHash
设置
org.apache.flink.streaming.api.graph.
StreamGraphGenerator#transform
org.apache.flink.streaming.api.graph.
StreamGraphGenerator#transform
if (transform.getUid() != null) {
streamGraph.setTransformationUID(transform.getId(), transform.getUid());
}
if (transform.getUserProvidedNodeHash() != null) {
streamGraph.setTransformationUserHash(transform.getId(), transform.getUserProvidedNodeHash());
}
streamGraph.setTransformationUID(transform.getId(), transform.getUid());
}
if (transform.getUserProvidedNodeHash() != null) {
streamGraph.setTransformationUserHash(transform.getId(), transform.getUserProvidedNodeHash());
}
org.apache.flink.streaming.api.graph.
StreamingJobGraphGenerator#createJobGraph()
setChaining(hashes, legacyHashes, chainedOperatorHashes);
StreamingJobGraphGenerator#createJobGraph()
setChaining(hashes, legacyHashes, chainedOperatorHashes);
defaultStreamGraphHasher
生成hashes
生成hashes
StreamGraphHasherV2
generateNodeHash
判断用户是否设置uid
generateDeterministicHash
or
generateUserSpecifiedHash
判断用户是否设置uid
generateDeterministicHash
or
generateUserSpecifiedHash
* Generates a deterministic hash from node-local properties and input and output edges.
有可能重复
有可能重复
* Generates a hash from a user-specified ID.
legacyStreamGraphHashers
生成legacyHashes
生成legacyHashes
StreamGraphUserHashHasher
使用用户提供的uid hash
使用用户提供的uid hash
traverseStreamGraphAndGenerateHashes
org.apache.flink.streaming.api.graph.
StreamingJobGraphGenerator#createJobVertex
StreamingJobGraphGenerator#createJobVertex
new JobVertexID(hash)
legacyJobVertexIds
JobVertex
JobVertexID
generateDeterministicHash ps 有可能重复,不可靠,所以建议设置uid
idAlternatives
org.apache.flink.runtime.checkpoint.CheckpointCoordinator#restoreSavepoint
org.apache.flink.runtime.checkpoint.Checkpoints#loadAndValidateCheckpoint
org.apache.flink.runtime.checkpoint.savepoint.SavepointV2#convertToOperatorStateSavepointV2
如果使用job vertex id 找不到就考虑
使用 legacy job vertex
使用 legacy job vertex
org.apache.flink.runtime.executiongraph.ExecutionJobVertex#includeLegacyJobVertexIDs
0 条评论
下一页