Class RocksDBSstFileWriter
java.lang.Object
com.linkedin.davinci.store.rocksdb.RocksDBSstFileWriter
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final String
protected static final String
This field is being stored during offset checkpointing inStoreIngestionTask
. -
Constructor Summary
ConstructorDescriptionRocksDBSstFileWriter
(String storeName, int partitionId, String dbDir, org.rocksdb.EnvOptions envOptions, org.rocksdb.Options options, String fullPathForTempSSTFileDir, boolean isRMD, RocksDBServerConfig rocksDBServerConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected org.rocksdb.Checkpoint
createCheckpoint
(org.rocksdb.RocksDB rocksDB) long
void
ingestSSTFiles
(org.rocksdb.RocksDB rocksDB, List<org.rocksdb.ColumnFamilyHandle> columnFamilyHandleList) void
void
put
(byte[] key, ByteBuffer valueBuffer) sync()
Closes currentSSTFileWriter, update lastCheckPointedSSTFileNum with the current SST file number, validates checksum on this SST file and return updated checkpointingInfo with this lastCheckPointedSSTFileNum.boolean
-
Field Details
-
ROCKSDB_LAST_FINISHED_SST_FILE_NO
This field is being stored during offset checkpointing inStoreIngestionTask
. With the field, RocksDB could recover properly during restart. Essentially, during recovery, this class will remove all the un-committed files afterROCKSDB_LAST_FINISHED_SST_FILE_NO
, and start a new file with no:ROCKSDB_LAST_FINISHED_SST_FILE_NO
+ 1. With this way, we could achieve exact-once ingestion, which is required bySstFileWriter
.- See Also:
-
ROCKSDB_LAST_FINISHED_RMD_SST_FILE_NO
- See Also:
-
DEFAULT_COLUMN_FAMILY_INDEX
protected static final int DEFAULT_COLUMN_FAMILY_INDEX- See Also:
-
REPLICATION_METADATA_COLUMN_FAMILY_INDEX
protected static final int REPLICATION_METADATA_COLUMN_FAMILY_INDEX- See Also:
-
-
Constructor Details
-
RocksDBSstFileWriter
public RocksDBSstFileWriter(String storeName, int partitionId, String dbDir, org.rocksdb.EnvOptions envOptions, org.rocksdb.Options options, String fullPathForTempSSTFileDir, boolean isRMD, RocksDBServerConfig rocksDBServerConfig)
-
-
Method Details
-
createCheckpoint
protected org.rocksdb.Checkpoint createCheckpoint(org.rocksdb.RocksDB rocksDB) -
getLastCheckPointedSSTFileNum
-
put
- Throws:
org.rocksdb.RocksDBException
-
open
-
close
public void close() -
sync
Closes currentSSTFileWriter, update lastCheckPointedSSTFileNum with the current SST file number, validates checksum on this SST file and return updated checkpointingInfo with this lastCheckPointedSSTFileNum. -
validateBatchIngestion
public boolean validateBatchIngestion() -
ingestSSTFiles
public void ingestSSTFiles(org.rocksdb.RocksDB rocksDB, List<org.rocksdb.ColumnFamilyHandle> columnFamilyHandleList) -
getRecordNumInAllSSTFiles
public long getRecordNumInAllSSTFiles()
-