public class FileStreamStateHandle extends AbstractFileStateHandle implements StreamStateHandle
Constructor and Description |
---|
FileStreamStateHandle(Path filePath)
Creates a new FileStreamStateHandle pointing to state at the given file path.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
getState(ClassLoader userCodeClassLoader)
This retrieves and return the state represented by the handle.
|
long |
getStateSize()
Returns the file size in bytes.
|
<T extends Serializable> |
toSerializableHandle()
Converts this stream state handle into a state handle that de-serializes
the stream into an object using Java's serialization mechanism.
|
discardState, getFilePath, getFileSize, getFileSystem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
discardState
public FileStreamStateHandle(Path filePath)
filePath
- The path to the file containing the checkpointed state.public InputStream getState(ClassLoader userCodeClassLoader) throws Exception
StateHandle
getState
in interface StateHandle<InputStream>
userCodeClassLoader
- Class loader for deserializing user code specific classesException
- Thrown, if the state cannot be fetched.public long getStateSize() throws IOException
getStateSize
in interface StateHandle<InputStream>
IOException
- Thrown if the file system cannot be accessed.public <T extends Serializable> StateHandle<T> toSerializableHandle()
StreamStateHandle
toSerializableHandle
in interface StreamStateHandle
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.