Package org.apache.flink.runtime.blob
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intSIZESize of the internal BLOB key in bytes.
-
Constructor Summary
Constructors Modifier Constructor Description protectedBlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type)Constructs a new BLOB key.protectedBlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type, byte[] key)Constructs a new BLOB key from the given byte array.protectedBlobKey(org.apache.flink.runtime.blob.BlobKey.BlobType type, byte[] key, byte[] random)Constructs a new BLOB key from the given byte array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToMessageDigest(MessageDigest md)Adds the BLOB key to the givenMessageDigest.intcompareTo(BlobKey o)booleanequals(Object obj)byte[]getHash()Returns the hash component of this key.inthashCode()StringtoString()
-
-
-
Field Detail
-
SIZE
public static final int SIZE
Size of the internal BLOB key in bytes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 transientkey- 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 transientkey- the actual key datarandom- the random component of the key
-
-
Method Detail
-
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 givenMessageDigest.- Parameters:
md- the message digest to add the BLOB key to
-
compareTo
public int compareTo(BlobKey o)
- Specified by:
compareToin interfaceComparable<BlobKey>
-
-