Class StreamGraphHasherV2
java.lang.Object
org.apache.flink.streaming.api.graph.StreamGraphHasherV2
- All Implemented Interfaces:
StreamGraphHasher
StreamGraphHasher from Flink 1.2. This contains duplicated code to ensure that the algorithm does
not change with future Flink versions.
DO NOT MODIFY THIS CLASS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangenerateHashesByStreamNodeId(int streamNodeId, StreamGraph streamGraph, Map<Integer, byte[]> hashes) Generates a hash forStreamNodewith the specified stream node id in theStreamGraph.static byte[]generateUserSpecifiedHash(String operatorUid) traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph) Returns a map with a hash for eachStreamNodeof theStreamGraph.
-
Constructor Details
-
StreamGraphHasherV2
public StreamGraphHasherV2()
-
-
Method Details
-
traverseStreamGraphAndGenerateHashes
Returns a map with a hash for eachStreamNodeof theStreamGraph. The hash is used as theJobVertexIDin order to identify nodes across job submissions if they didn't change.The complete
StreamGraphis traversed. The hash is either computed from the transformation's user-specified id (seeTransformation.getUid()) or generated in a deterministic way.The generated hash is deterministic with respect to:
- node-local properties (node ID),
- chained output nodes, and
- input nodes hashes
- Specified by:
traverseStreamGraphAndGenerateHashesin interfaceStreamGraphHasher- Returns:
- A map from
StreamNode.idto hash as 16-byte array.
-
generateUserSpecifiedHash
-
generateHashesByStreamNodeId
public boolean generateHashesByStreamNodeId(int streamNodeId, StreamGraph streamGraph, Map<Integer, byte[]> hashes) Description copied from interface:StreamGraphHasherGenerates a hash forStreamNodewith the specified stream node id in theStreamGraph. This hash is stored in the provided map and can be used to uniquely identify theStreamNodeacross job submissions, assuming its configuration remains unchanged.- Specified by:
generateHashesByStreamNodeIdin interfaceStreamGraphHasher
-