Class 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 Detail

      • StreamGraphHasherV2

        public StreamGraphHasherV2()
    • Method Detail

      • traverseStreamGraphAndGenerateHashes

        public Map<Integer,​byte[]> traverseStreamGraphAndGenerateHashes​(StreamGraph streamGraph)
        Returns a map with a hash for each StreamNode of the StreamGraph. The hash is used as the JobVertexID 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 (see Transformation.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 interface StreamGraphHasher
        Returns:
        A map from StreamNode.id to hash as 16-byte array.
      • generateUserSpecifiedHash

        public static byte[] generateUserSpecifiedHash​(String operatorUid)