Class StreamGraphHasherV2
- java.lang.Object
-
- org.apache.flink.streaming.api.graph.StreamGraphHasherV2
-
- All Implemented Interfaces:
StreamGraphHasher
public class StreamGraphHasherV2 extends Object implements 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 Constructor Description StreamGraphHasherV2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangenerateHashesByStreamNodeId(int streamNodeId, StreamGraph streamGraph, Map<Integer,byte[]> hashes)Generates a hash forStreamNodewith the specified stream node id in theStreamGraph.static byte[]generateUserSpecifiedHash(String operatorUid)Map<Integer,byte[]>traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph)Returns a map with a hash for eachStreamNodeof theStreamGraph.
-
-
-
Method Detail
-
traverseStreamGraphAndGenerateHashes
public Map<Integer,byte[]> traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph)
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
public static byte[] generateUserSpecifiedHash(String operatorUid)
-
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
-
-