Package org.apache.flink.runtime.state
Class CheckpointStorageLocationReference
- java.lang.Object
-
- org.apache.flink.runtime.state.CheckpointStorageLocationReference
-
- All Implemented Interfaces:
Serializable
public class CheckpointStorageLocationReference extends Object implements Serializable
A reference to a storage location. This is a wrapper around an array of bytes that are subject to interpretation by the state backend's storage locations (similar as a serializer needs to interpret byte streams). There is special handling for a 'default location', which can be used as an optimization by state backends, when no extra information is needed to determine where the checkpoints should be stored (all information can be derived from the configuration and the checkpoint id).Why is this simply a byte array?
The reference is represented via raw bytes, which are subject to interpretation by the state backends. We did not add any more typing and serialization abstraction in between, because these types need to serialize/deserialize fast in between network streams (byte buffers) and barriers. We may ultimately add some more typing if we simply keep the byte buffers for the checkpoint barriers and forward them, thus saving decoding and re-encoding these references repeatedly.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CheckpointStorageLocationReference(byte[] encodedReference)
Creates a new location reference.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static CheckpointStorageLocationReference
getDefault()
byte[]
getReferenceBytes()
Gets the reference bytes.int
hashCode()
boolean
isDefaultReference()
Returns true, if this object is the default reference.protected Object
readResolve()
readResolve() preserves the singleton property of the default value.String
toString()
-
-
-
Method Detail
-
getReferenceBytes
public byte[] getReferenceBytes()
Gets the reference bytes.Important: For efficiency, this method does not make a defensive copy, so the caller must not modify the bytes in the array.
-
isDefaultReference
public boolean isDefaultReference()
Returns true, if this object is the default reference.
-
readResolve
protected final Object readResolve() throws ObjectStreamException
readResolve() preserves the singleton property of the default value.- Throws:
ObjectStreamException
-
getDefault
public static CheckpointStorageLocationReference getDefault()
-
-