@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 name,
String dbPath,
String checkpointPath,
org.rocksdb.DBOptions dbOpts,
Collection<org.rocksdb.ColumnFamilyDescriptor> columnFamilyDescriptors,
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 name, String dbPath, String checkpointPath, org.rocksdb.DBOptions dbOpts, Collection<org.rocksdb.ColumnFamilyDescriptor> columnFamilyDescriptors, List<AtomicReference<org.rocksdb.ColumnFamilyHandle>> columnHandles)
name
- a name to distinguish what store this isdbPath
- a path for the rocks databasecheckpointPath
- a path for taking database checkpointsdbOpts
- the configured RocksDB optionscolumnFamilyDescriptors
- columns to create within the rocks databasecolumnHandles
- 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.