Class StreamGraphUserHashHasher
- java.lang.Object
-
- org.apache.flink.streaming.api.graph.StreamGraphUserHashHasher
-
- All Implemented Interfaces:
StreamGraphHasher
public class StreamGraphUserHashHasher extends Object implements StreamGraphHasher
StreamGraphHasher that works with user provided hashes. This is useful in case we want to set (alternative) hashes explicitly, e.g. to provide a way of manual backwards compatibility between versions when the mechanism of generating hashes has changed in an incompatible way.
-
-
Constructor Summary
Constructors Constructor Description StreamGraphUserHashHasher()
-
Method Summary
All 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
.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)
Description copied from interface:StreamGraphHasher
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.- Specified by:
traverseStreamGraphAndGenerateHashes
in interfaceStreamGraphHasher
-
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
-
-