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 booleangenerateHashesByStreamNodeId(int streamNodeId, StreamGraph streamGraph, Map<Integer,byte[]> hashes)Generates a hash forStreamNodewith the specified stream node id in theStreamGraph.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)
Description copied from interface:StreamGraphHasherReturns 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.- Specified by:
traverseStreamGraphAndGenerateHashesin interfaceStreamGraphHasher
-
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
-
-