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 boolean
generateHashesByStreamNodeId(int streamNodeId, StreamGraph streamGraph, Map<Integer,byte[]> hashes)
Generates a hash forStreamNode
with 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 eachStreamNode
of theStreamGraph
.
-
-
-
Method Detail
-
traverseStreamGraphAndGenerateHashes
public Map<Integer,byte[]> traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph)
Returns a map with a hash for eachStreamNode
of theStreamGraph
. The hash is used as theJobVertexID
in order to identify nodes across job submissions if they didn't change.The complete
StreamGraph
is 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:
traverseStreamGraphAndGenerateHashes
in interfaceStreamGraphHasher
- Returns:
- A map from
StreamNode.id
to 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:StreamGraphHasher
Generates a hash forStreamNode
with the specified stream node id in theStreamGraph
. This hash is stored in the provided map and can be used to uniquely identify theStreamNode
across job submissions, assuming its configuration remains unchanged.- Specified by:
generateHashesByStreamNodeId
in interfaceStreamGraphHasher
-
-