T - The type of state represented by this state handle.public class SerializedStateHandle<T extends Serializable> extends AbstractCloseableHandle implements StateHandle<T>
| Constructor and Description |
|---|
SerializedStateHandle(byte[] serializedData)
Creates a new serialized state handle, based in the given already serialized data.
|
SerializedStateHandle(T value)
Creates a new serialized state handle, eagerly serializing the given state object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
discardState()
Discarding heap-memory backed state is a no-op, so this method does nothing.
|
int |
getSizeOfSerializedState()
Gets the size of the serialized state.
|
T |
getState(ClassLoader classLoader)
This retrieves and return the state represented by the handle.
|
long |
getStateSize()
Returns the size of the state in bytes.
|
close, ensureNotClosed, isClosed, registerCloseablepublic SerializedStateHandle(T value) throws IOException
value - The state object.IOException - Thrown, if the serialization fails.public SerializedStateHandle(byte[] serializedData)
serializedData - The serialized data.public T getState(ClassLoader classLoader) throws Exception
StateHandlegetState in interface StateHandle<T extends Serializable>classLoader - Class loader for deserializing user code specific classesException - Thrown, if the state cannot be fetched.public int getSizeOfSerializedState()
public void discardState()
discardState in interface StateObjectpublic long getStateSize()
StateObjectIf the the size is not known, return 0.
getStateSize in interface StateObjectCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.