Class RocksDBStorageEngine
java.lang.Object
com.linkedin.davinci.store.AbstractStorageEngine<RocksDBStoragePartition>
com.linkedin.davinci.store.rocksdb.RocksDBStorageEngine
- All Implemented Interfaces:
StorageEngine<RocksDBStoragePartition>,Closeable,AutoCloseable
-
Field Summary
FieldsFields inherited from class com.linkedin.davinci.store.AbstractStorageEngine
METADATA_PARTITION_ID -
Constructor Summary
ConstructorsConstructorDescriptionRocksDBStorageEngine(VeniceStoreVersionConfig storeConfig, RocksDBStorageEngineFactory factory, String rocksDbPath, RocksDBMemoryStats rocksDBMemoryStats, RocksDBThrottler rocksDbThrottler, RocksDBServerConfig rocksDBServerConfig, InternalAvroSpecificSerializer<StoreVersionState> storeVersionStateSerializer, InternalAvroSpecificSerializer<PartitionState> partitionStateSerializer, boolean replicationMetadataEnabled) -
Method Summary
Modifier and TypeMethodDescriptioncreateStoragePartition(StoragePartitionConfig storagePartitionConfig) voiddrop()Drop the whole storeprotected voiddropPartitionDirectory(int partitionId) Remove any on-disk artifacts for a partition that failed to restore.getIterator(int partitionId) protected AbstractStoragePartitionRetrieves the IDs of persisted partitions for the store.getStats()getType()voidsetRocksDBServerConfig(RocksDBServerConfig rocksDBServerConfig) protected booleanshouldDropPartitionOnRestoreFailure(int partitionId, Throwable cause) Only drop a partition for failures that are clearly local to its on-disk state.Methods inherited from class com.linkedin.davinci.store.AbstractStorageEngine
addStoragePartition, addStoragePartitionIfAbsent, adjustStoragePartition, beginBatchWrite, checkDatabaseIntegrity, clearPartitionOffset, clearStoreVersionState, close, closeMetadataPartition, closePartition, containsPartition, delete, deleteGlobalRtDivMetadata, deleteWithReplicationMetadata, dropPartition, dropPartition, endBatchWrite, executeWithSafeGuard, get, get, get, getByKeyPrefix, getGlobalRtDivMetadata, getNumberOfPartitions, getPartitionIds, getPartitionOffset, getPartitionOrThrow, getPartitions, getReplicationMetadata, getRWLockForPartitionOrThrow, getStoreVersionName, getStoreVersionState, isClosed, keyExists, put, put, putGlobalRtDivMetadata, putPartitionOffset, putReplicationMetadata, putStoreVersionState, putWithReplicationMetadata, reopenStoragePartition, restoreStoragePartitions, restoreStoragePartitions, restoreStoragePartitions, suppressLogs, sync, toString, updateStoreVersionStateCache
-
Field Details
-
SERVER_CONFIG_FILE_NAME
- See Also:
-
-
Constructor Details
-
RocksDBStorageEngine
public RocksDBStorageEngine(VeniceStoreVersionConfig storeConfig, RocksDBStorageEngineFactory factory, String rocksDbPath, RocksDBMemoryStats rocksDBMemoryStats, RocksDBThrottler rocksDbThrottler, RocksDBServerConfig rocksDBServerConfig, InternalAvroSpecificSerializer<StoreVersionState> storeVersionStateSerializer, InternalAvroSpecificSerializer<PartitionState> partitionStateSerializer, boolean replicationMetadataEnabled)
-
-
Method Details
-
getMetadataPartition
- Overrides:
getMetadataPartitionin classAbstractStorageEngine<RocksDBStoragePartition>
-
getType
-
getPersistedPartitionIds
Retrieves the IDs of persisted partitions for the store. This method scans the existing store directory to identify the partition IDs that are retained and need to be persisted. Note: For stores with blob transfer enabled, temporary partition directories may exist if the instance previously fails during a transfer. In such cases, temporary directories should be excluded from the returned partition IDs.- Returns:
- A set of IDs representing the persisted partitions.
-
createStoragePartition
public RocksDBStoragePartition createStoragePartition(StoragePartitionConfig storagePartitionConfig) - Specified by:
createStoragePartitionin classAbstractStorageEngine<RocksDBStoragePartition>
-
dropPartitionDirectory
protected void dropPartitionDirectory(int partitionId) Description copied from class:AbstractStorageEngineRemove any on-disk artifacts for a partition that failed to restore. Subclasses backed by a real filesystem (e.g. RocksDB) should delete the partition directory so the partition can be re-bootstrapped from scratch. The default implementation is a no-op for in-memory engines.- Overrides:
dropPartitionDirectoryin classAbstractStorageEngine<RocksDBStoragePartition>
-
shouldDropPartitionOnRestoreFailure
Only drop a partition for failures that are clearly local to its on-disk state. Environmental failures (disk full, permission denied, lock contention) must not trigger a drop — re-bootstrapping would amplify the problem or mask infra issues that need human attention. The drop-eligible cases are:Status.Code.Corruption: RocksDB has detected on-disk state it cannot read.Status.Code.IOErrorwhose status state or exception message contains "No such file or directory": a partition file went missing. rocksdbjni 8.x does not expose a dedicated SubCode for path-not-found, so we fall back to a substring match on the human-readable status text. The substring match is gated byCode.IOErrorso we never drop on message text alone. Other IOError flavors (NoSpace, generic EIO, permission denied) are intentionally excluded because their status messages do not contain this substring.
- Overrides:
shouldDropPartitionOnRestoreFailurein classAbstractStorageEngine<RocksDBStoragePartition>
-
drop
public void drop()Description copied from class:AbstractStorageEngineDrop the whole store- Specified by:
dropin interfaceStorageEngine<RocksDBStoragePartition>- Overrides:
dropin classAbstractStorageEngine<RocksDBStoragePartition>
-
setRocksDBServerConfig
-
getIterator
- Specified by:
getIteratorin interfaceStorageEngine<RocksDBStoragePartition>- Overrides:
getIteratorin classAbstractStorageEngine<RocksDBStoragePartition>
-
getStats
-