Package org.apache.flink.runtime.state
Interface StreamStateHandle
-
- All Superinterfaces:
Serializable
,StateObject
- All Known Subinterfaces:
OperatorStateHandle
- All Known Implementing Classes:
ByteStreamStateHandle
,DirectoryStreamStateHandle
,EmptyFileMergingOperatorStreamStateHandle
,EmptySegmentFileStateHandle
,FileMergingOperatorStreamStateHandle
,FileStateHandle
,KeyGroupsSavepointStateHandle
,KeyGroupsStateHandle
,OperatorStreamStateHandle
,PlaceholderStreamStateHandle
,RelativeFileStateHandle
,RetrievableStreamStateHandle
,SegmentFileStateHandle
,SharedStateRegistryImpl.EmptyDiscardStateObjectForRegister
public interface StreamStateHandle extends StateObject
AStateObject
that represents state that was written to a stream. The data can be read back viaopenInputStream()
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateObject
StateObject.StateObjectLocation, StateObject.StateObjectSizeStatsCollector
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Optional<byte[]>
asBytesIfInMemory()
PhysicalStateHandleID
getStreamStateHandleID()
default Optional<Path>
maybeGetPath()
FSDataInputStream
openInputStream()
Returns anFSDataInputStream
that can be used to read back the data that was previously written to the stream.-
Methods inherited from interface org.apache.flink.runtime.state.StateObject
collectSizeStats, discardState, getStateSize
-
-
-
-
Method Detail
-
openInputStream
FSDataInputStream openInputStream() throws IOException
Returns anFSDataInputStream
that can be used to read back the data that was previously written to the stream.- Throws:
IOException
-
asBytesIfInMemory
Optional<byte[]> asBytesIfInMemory()
- Returns:
- Content of this handle as bytes array if it is already in memory.
-
maybeGetPath
default Optional<Path> maybeGetPath()
- Returns:
- Path to an underlying file represented by this
StreamStateHandle
orOptional.empty()
if there is no such file.
-
getStreamStateHandleID
PhysicalStateHandleID getStreamStateHandleID()
- Returns:
- a unique identifier of this handle.
-
-