@ThreadSafe public final class RocksStore extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static int |
ROCKS_OPEN_RETRY_TIMEOUT |
Constructor and Description |
---|
RocksStore(String dbPath,
String checkpointPath,
Collection<org.rocksdb.ColumnFamilyDescriptor> columnFamilyDescriptors,
org.rocksdb.DBOptions dbOpts,
List<AtomicReference<org.rocksdb.ColumnFamilyHandle>> columnHandles) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears and re-initializes the database.
|
void |
close() |
org.rocksdb.RocksDB |
getDb() |
void |
restoreFromCheckpoint(CheckpointInputStream input)
Restores the database from a checkpoint.
|
void |
writeToCheckpoint(OutputStream output)
Writes a checkpoint of the database's content to the given output stream.
|
public static final int ROCKS_OPEN_RETRY_TIMEOUT
public RocksStore(String dbPath, String checkpointPath, Collection<org.rocksdb.ColumnFamilyDescriptor> columnFamilyDescriptors, org.rocksdb.DBOptions dbOpts, List<AtomicReference<org.rocksdb.ColumnFamilyHandle>> columnHandles)
dbPath
- a path for the rocks databasecheckpointPath
- a path for taking database checkpointscolumnFamilyDescriptors
- columns to create within the rocks databasedbOpts
- db optionscolumnHandles
- column handle references to populatepublic org.rocksdb.RocksDB getDb()
public void clear()
public void writeToCheckpoint(OutputStream output) throws IOException, InterruptedException
output
- the stream to write toIOException
InterruptedException
public void restoreFromCheckpoint(CheckpointInputStream input) throws IOException
input
- the checkpoint stream to restore fromIOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2023. All Rights Reserved.