Class DistributeStateHandlerHelper
- java.lang.Object
-
- org.apache.flink.state.rocksdb.restore.DistributeStateHandlerHelper
-
- All Implemented Interfaces:
AutoCloseable
public class DistributeStateHandlerHelper extends Object implements AutoCloseable
Helper class for distributing state handle data during RocksDB incremental restore. This class encapsulates the logic for processing a single state handle.
-
-
Constructor Summary
Constructors Constructor Description DistributeStateHandlerHelper(org.apache.flink.runtime.state.IncrementalLocalKeyedStateHandle stateHandle, List<org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot> stateMetaInfoSnapshots, Function<String,org.rocksdb.ColumnFamilyOptions> columnFamilyOptionsFactory, org.rocksdb.DBOptions dbOptions, RocksDbTtlCompactFiltersManager ttlCompactFiltersManager, Long writeBufferManagerCapacity, int keyGroupPrefixBytes, org.apache.flink.runtime.state.KeyGroupRange keyGroupRange, String operatorIdentifier, int index)Creates a helper for processing a single state handle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.apache.flink.types.Either<org.apache.flink.runtime.state.KeyGroupRange,org.apache.flink.runtime.state.IncrementalLocalKeyedStateHandle>tryDistribute(Path exportCfBasePath, Map<org.apache.flink.runtime.state.RegisteredStateMetaInfoBase.Key,List<org.rocksdb.ExportImportFilesMetaData>> exportedColumnFamiliesOut)Distributes state handle data by checking SST file ranges and exporting column families.
-
-
-
Constructor Detail
-
DistributeStateHandlerHelper
public DistributeStateHandlerHelper(org.apache.flink.runtime.state.IncrementalLocalKeyedStateHandle stateHandle, List<org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot> stateMetaInfoSnapshots, Function<String,org.rocksdb.ColumnFamilyOptions> columnFamilyOptionsFactory, org.rocksdb.DBOptions dbOptions, RocksDbTtlCompactFiltersManager ttlCompactFiltersManager, Long writeBufferManagerCapacity, int keyGroupPrefixBytes, org.apache.flink.runtime.state.KeyGroupRange keyGroupRange, String operatorIdentifier, int index) throws ExceptionCreates a helper for processing a single state handle. The database instance is created in the constructor to enable proper resource management and separation of concerns.- Parameters:
stateHandle- the state handle to processcolumnFamilyOptionsFactory- factory for creating column family optionsdbOptions- database optionsttlCompactFiltersManager- TTL compact filters manager (can be null)writeBufferManagerCapacity- write buffer manager capacity (can be null)keyGroupPrefixBytes- number of key group prefix bytes for SST file range checkingkeyGroupRange- target key group range (for logging)operatorIdentifier- operator identifier (for logging)index- current processing index (for logging)- Throws:
Exception- on any database opening error
-
-
Method Detail
-
tryDistribute
public org.apache.flink.types.Either<org.apache.flink.runtime.state.KeyGroupRange,org.apache.flink.runtime.state.IncrementalLocalKeyedStateHandle> tryDistribute(Path exportCfBasePath, Map<org.apache.flink.runtime.state.RegisteredStateMetaInfoBase.Key,List<org.rocksdb.ExportImportFilesMetaData>> exportedColumnFamiliesOut) throws Exception
Distributes state handle data by checking SST file ranges and exporting column families. Returns Left if successfully exported, Right if the handle was skipped.- Parameters:
exportCfBasePath- base path for exportexportedColumnFamiliesOut- output parameter for exported column families- Returns:
- Either.Left containing key group range if successfully exported, Either.Right containing the skipped state handle otherwise
- Throws:
Exception- on any export error
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-