Class BlobKey

java.lang.Object
org.apache.flink.runtime.blob.BlobKey
All Implemented Interfaces:
Serializable, Comparable<BlobKey>
Direct Known Subclasses:
PermanentBlobKey, TransientBlobKey

public abstract class BlobKey extends Object implements Serializable, Comparable<BlobKey>
A BLOB key uniquely identifies a BLOB.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Size of the internal BLOB key in bytes.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type)
    Constructs a new BLOB key.
    protected
    BlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type, byte[] key)
    Constructs a new BLOB key from the given byte array.
    protected
    BlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type, byte[] key, byte[] random)
    Constructs a new BLOB key from the given byte array.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the BLOB key to the given MessageDigest.
    int
     
    boolean
     
    byte[]
    Returns the hash component of this key.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • SIZE

      public static final int SIZE
      Size of the internal BLOB key in bytes.
      See Also:
  • Constructor Details

    • BlobKey

      protected BlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type)
      Constructs a new BLOB key.
      Parameters:
      type - whether the referenced BLOB is permanent or transient
    • BlobKey

      protected BlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type, byte[] key)
      Constructs a new BLOB key from the given byte array.
      Parameters:
      type - whether the referenced BLOB is permanent or transient
      key - the actual key data
    • BlobKey

      protected BlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type, byte[] key, byte[] random)
      Constructs a new BLOB key from the given byte array.
      Parameters:
      type - whether the referenced BLOB is permanent or transient
      key - the actual key data
      random - the random component of the key
  • Method Details

    • getHash

      @VisibleForTesting public byte[] getHash()
      Returns the hash component of this key.
      Returns:
      a 20 bit hash of the contents the key refers to
    • addToMessageDigest

      public void addToMessageDigest(MessageDigest md)
      Adds the BLOB key to the given MessageDigest.
      Parameters:
      md - the message digest to add the BLOB key to
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(BlobKey o)
      Specified by:
      compareTo in interface Comparable<BlobKey>