T
- The type of state represented by this state handle.public class SerializedStateHandle<T extends Serializable> extends Object 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.
|
public 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
StateHandle
getState
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 StateHandle<T extends Serializable>
public long getStateSize()
StateHandle
If the the size is not known, return 0
.
getStateSize
in interface StateHandle<T extends Serializable>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.