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
A BLOB key uniquely identifies a BLOB.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlobKey(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
Modifier and TypeMethodDescriptionvoidAdds the BLOB key to the givenMessageDigest.intbooleanbyte[]getHash()Returns the hash component of this key.inthashCode()toString()
-
Field Details
-
SIZE
public static final int SIZESize 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 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 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
Adds the BLOB key to the givenMessageDigest.- Parameters:
md- the message digest to add the BLOB key to
-
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<BlobKey>
-