Class DirectoryStreamStateHandle
- java.lang.Object
-
- org.apache.flink.runtime.state.filemerging.DirectoryStreamStateHandle
-
- All Implemented Interfaces:
Serializable
,StateObject
,StreamStateHandle
public class DirectoryStreamStateHandle extends Object implements StreamStateHandle
This state handle represents a directory, usually used to be registered toSharedStateRegistry
to track the life cycle of the directory.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateObject
StateObject.StateObjectLocation, StateObject.StateObjectSizeStatsCollector
-
-
Constructor Summary
Constructors Constructor Description DirectoryStreamStateHandle(org.apache.flink.core.fs.Path directory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<byte[]>
asBytesIfInMemory()
SharedStateRegistryKey
createStateRegistryKey()
void
discardState()
Discards the state referred to and solemnly owned by this handle, to free up resources in the persistent storage.boolean
equals(Object o)
org.apache.flink.core.fs.Path
getDirectory()
long
getStateSize()
This handle usually used to track the life cycle of the directory, therefore a fake size is provided.PhysicalStateHandleID
getStreamStateHandleID()
int
hashCode()
static DirectoryStreamStateHandle
of(org.apache.flink.core.fs.Path directory)
org.apache.flink.core.fs.FSDataInputStream
openInputStream()
Returns anFSDataInputStream
that can be used to read back the data that was previously written to the stream.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.state.StateObject
collectSizeStats
-
Methods inherited from interface org.apache.flink.runtime.state.StreamStateHandle
maybeGetPath
-
-
-
-
Method Detail
-
openInputStream
public org.apache.flink.core.fs.FSDataInputStream openInputStream()
Description copied from interface:StreamStateHandle
Returns anFSDataInputStream
that can be used to read back the data that was previously written to the stream.- Specified by:
openInputStream
in interfaceStreamStateHandle
-
asBytesIfInMemory
public Optional<byte[]> asBytesIfInMemory()
- Specified by:
asBytesIfInMemory
in interfaceStreamStateHandle
- Returns:
- Content of this handle as bytes array if it is already in memory.
-
getStreamStateHandleID
public PhysicalStateHandleID getStreamStateHandleID()
- Specified by:
getStreamStateHandleID
in interfaceStreamStateHandle
- Returns:
- a unique identifier of this handle.
-
createStateRegistryKey
public SharedStateRegistryKey createStateRegistryKey()
-
getDirectory
public org.apache.flink.core.fs.Path getDirectory()
-
discardState
public void discardState() throws Exception
Description copied from interface:StateObject
Discards the state referred to and solemnly owned by this handle, to free up resources in the persistent storage. This method is called when the state represented by this object will not be used anymore.- Specified by:
discardState
in interfaceStateObject
- Throws:
Exception
-
getStateSize
public long getStateSize()
This handle usually used to track the life cycle of the directory, therefore a fake size is provided.- Specified by:
getStateSize
in interfaceStateObject
- Returns:
- Size of the state in bytes.
-
of
public static DirectoryStreamStateHandle of(@Nonnull org.apache.flink.core.fs.Path directory)
-
-