Class DirectoryStreamStateHandle
java.lang.Object
org.apache.flink.runtime.state.filemerging.DirectoryStreamStateHandle
- All Implemented Interfaces:
Serializable,StateObject,StreamStateHandle
This state handle represents a directory, usually used to be registered to
SharedStateRegistry to track the life cycle of the directory.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateObject
StateObject.StateObjectLocation, StateObject.StateObjectSizeStatsCollector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<byte[]>voidDiscards the state referred to and solemnly owned by this handle, to free up resources in the persistent storage.booleanorg.apache.flink.core.fs.PathlongThis handle usually used to track the life cycle of the directory, therefore a fake size is provided.inthashCode()static DirectoryStreamStateHandleof(org.apache.flink.core.fs.Path directory) org.apache.flink.core.fs.FSDataInputStreamReturns anFSDataInputStreamthat can be used to read back the data that was previously written to the stream.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.state.StateObject
collectSizeStatsMethods inherited from interface org.apache.flink.runtime.state.StreamStateHandle
maybeGetPath
-
Constructor Details
-
DirectoryStreamStateHandle
public DirectoryStreamStateHandle(@Nonnull org.apache.flink.core.fs.Path directory)
-
-
Method Details
-
openInputStream
public org.apache.flink.core.fs.FSDataInputStream openInputStream()Description copied from interface:StreamStateHandleReturns anFSDataInputStreamthat can be used to read back the data that was previously written to the stream.- Specified by:
openInputStreamin interfaceStreamStateHandle
-
asBytesIfInMemory
- Specified by:
asBytesIfInMemoryin interfaceStreamStateHandle- Returns:
- Content of this handle as bytes array if it is already in memory.
-
getStreamStateHandleID
- Specified by:
getStreamStateHandleIDin interfaceStreamStateHandle- Returns:
- a unique identifier of this handle.
-
createStateRegistryKey
-
hashCode
public int hashCode() -
equals
-
toString
-
getDirectory
public org.apache.flink.core.fs.Path getDirectory() -
discardState
Description copied from interface:StateObjectDiscards 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:
discardStatein 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:
getStateSizein interfaceStateObject- Returns:
- Size of the state in bytes.
-
of
-