Class ReplicationMetadataRocksDBStoragePartition
java.lang.Object
com.linkedin.davinci.store.AbstractStoragePartition
com.linkedin.davinci.store.rocksdb.RocksDBStoragePartition
com.linkedin.davinci.store.rocksdb.ReplicationMetadataRocksDBStoragePartition
This
ReplicationMetadataRocksDBStoragePartition is built to store key value pair along with the timestamp
metadata. It is designed for active/active replication mode, which uses putWithReplicationMetadata and getReplicationMetadata
to insert and retrieve replication metadata associated with a key. The implementation relies on different column family
in RocksDB to isolate the value and replication metadata of a key.-
Field Summary
Fields inherited from class com.linkedin.davinci.store.rocksdb.RocksDBStoragePartition
blobTransferInProgress, columnFamilyDescriptors, columnFamilyHandleList, deferredWrite, iteratorReadOptions, partitionId, READ_OPTIONS_DEFAULT, readCloseRWLock, readOnly, readWriteLeaderForDefaultCF, readWriteLeaderForRMDCF, replicaId, rocksDB, ROCKSDB_ERROR_MESSAGE_FOR_RUNNING_OUT_OF_DISK_QUOTA, storeName, storeNameAndVersion, storeVersion, writeOnly, writeOptions -
Constructor Summary
ConstructorsConstructorDescriptionReplicationMetadataRocksDBStoragePartition(StoragePartitionConfig storagePartitionConfig, RocksDBStorageEngineFactory factory, String dbDir, RocksDBMemoryStats rocksDBMemoryStats, RocksDBThrottler rocksDbThrottler, RocksDBServerConfig rocksDBServerConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginBatchWrite(Map<String, String> checkpointedInfo, Optional<Supplier<byte[]>> expectedChecksumSupplier) booleancheckDatabaseIntegrity(Map<String, String> checkpointedInfo) checks whether the current state of the database is valid during the start of ingestion.voidclose()Close the specific partitionvoiddeleteWithReplicationMetadata(byte[] key, byte[] replicationMetadata) This API deletes a record from RocksDB but updates the metadata in ByteBuffer format and puts it into RocksDB.voiddrop()Drop when it is not required anymore.voidbyte[]This API retrieves replication metadata from replicationMetadataColumnFamily.longvoidputReplicationMetadata(byte[] key, byte[] metadata) voidputWithReplicationMetadata(byte[] key, byte[] value, byte[] metadata) This API takes in value and metadata as byte array format and put it into RocksDB.voidputWithReplicationMetadata(byte[] key, ByteBuffer value, byte[] metadata) This API takes in value and metadata as ByteBuffer format and put it into RocksDB.sync()Sync current database.booleanMethods inherited from class com.linkedin.davinci.store.rocksdb.RocksDBStoragePartition
checkAndThrowDiskLimitException, cleanupSnapshot, cleanupSnapshot, createSnapshot, createSnapshot, delete, deleteFilesInDirectory, get, get, get, get, getApproximateMemoryUsageByType, getByKeyPrefix, getColumnFamilyHandleList, getEnvOptions, getIterator, getKeyCountEstimate, getOptions, getPartitionSizeInBytes, getRocksDBStatValue, getStoreOptions, isRocksDBPartitionBlobTransferInProgress, makeSureRocksDBIsStillOpen, multiGet, multiGet, put, put, put, reopen, verifyConfigMethods inherited from class com.linkedin.davinci.store.AbstractStoragePartition
getPartitionId
-
Constructor Details
-
ReplicationMetadataRocksDBStoragePartition
public ReplicationMetadataRocksDBStoragePartition(StoragePartitionConfig storagePartitionConfig, RocksDBStorageEngineFactory factory, String dbDir, RocksDBMemoryStats rocksDBMemoryStats, RocksDBThrottler rocksDbThrottler, RocksDBServerConfig rocksDBServerConfig)
-
-
Method Details
-
putWithReplicationMetadata
public void putWithReplicationMetadata(byte[] key, byte[] value, byte[] metadata) Description copied from class:AbstractStoragePartitionThis API takes in value and metadata as byte array format and put it into RocksDB. OnlyReplicationMetadataRocksDBStoragePartitionwill execute this method, other storage partition implementation will VeniceUnsupportedOperationException.- Overrides:
putWithReplicationMetadatain classAbstractStoragePartition
-
putReplicationMetadata
public void putReplicationMetadata(byte[] key, byte[] metadata) - Overrides:
putReplicationMetadatain classAbstractStoragePartition
-
getRmdByteUsage
public long getRmdByteUsage()- Overrides:
getRmdByteUsagein classRocksDBStoragePartition
-
putWithReplicationMetadata
This API takes in value and metadata as ByteBuffer format and put it into RocksDB. Note that it is not an efficient implementation as it copies the content to perform the ByteBuffer -> byte[] conversion. TODO: Rewrite this implementation after we adopt the thread-local direct bytebuffer approach.- Overrides:
putWithReplicationMetadatain classAbstractStoragePartition
-
getReplicationMetadata
Description copied from class:AbstractStoragePartitionThis API retrieves replication metadata from replicationMetadataColumnFamily. OnlyReplicationMetadataRocksDBStoragePartitionwill execute this method, other storage partition implementation will VeniceUnsupportedOperationException.- Overrides:
getReplicationMetadatain classAbstractStoragePartition
-
deleteWithReplicationMetadata
public void deleteWithReplicationMetadata(byte[] key, byte[] replicationMetadata) This API deletes a record from RocksDB but updates the metadata in ByteBuffer format and puts it into RocksDB.- Overrides:
deleteWithReplicationMetadatain classAbstractStoragePartition
-
checkDatabaseIntegrity
Description copied from class:AbstractStoragePartitionchecks whether the current state of the database is valid during the start of ingestion.- Overrides:
checkDatabaseIntegrityin classRocksDBStoragePartition
-
beginBatchWrite
public void beginBatchWrite(Map<String, String> checkpointedInfo, Optional<Supplier<byte[]>> expectedChecksumSupplier) - Overrides:
beginBatchWritein classRocksDBStoragePartition
-
endBatchWrite
public void endBatchWrite()- Overrides:
endBatchWritein classRocksDBStoragePartition
-
sync
Description copied from class:AbstractStoragePartitionSync current database.- Overrides:
syncin classRocksDBStoragePartition- Returns:
- Database related info, which is required to be checkpointed.
-
close
public void close()Description copied from class:AbstractStoragePartitionClose the specific partition- Overrides:
closein classRocksDBStoragePartition
-
validateBatchIngestion
public boolean validateBatchIngestion()- Overrides:
validateBatchIngestionin classRocksDBStoragePartition
-
drop
public void drop()Description copied from class:AbstractStoragePartitionDrop when it is not required anymore.- Overrides:
dropin classRocksDBStoragePartition
-
getFullPathForTempSSTFileDir
- Overrides:
getFullPathForTempSSTFileDirin classRocksDBStoragePartition
-
getRocksDBSstFileWriter
- Overrides:
getRocksDBSstFileWriterin classRocksDBStoragePartition
-
getValueFullPathForTempSSTFileDir
-
getValueRocksDBSstFileWriter
-