Package org.rocksdb
Class OptimisticTransactionDB
java.lang.Object
org.rocksdb.AbstractNativeReference
org.rocksdb.AbstractImmutableNativeReference
org.rocksdb.RocksObject
org.rocksdb.RocksDB
org.rocksdb.OptimisticTransactionDB
- All Implemented Interfaces:
AutoCloseable
Database with Transaction support.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.rocksdb.RocksDB
RocksDB.CountAndSize, RocksDB.LiveFiles, RocksDB.Version -
Field Summary
Fields inherited from class org.rocksdb.RocksDB
DEFAULT_COLUMN_FAMILY, NOT_FOUND, options_Fields inherited from class org.rocksdb.RocksObject
nativeHandle_Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_ -
Method Summary
Modifier and TypeMethodDescriptionbeginTransaction(WriteOptions writeOptions) beginTransaction(WriteOptions writeOptions, OptimisticTransactionOptions optimisticTransactionOptions) beginTransaction(WriteOptions writeOptions, OptimisticTransactionOptions optimisticTransactionOptions, Transaction oldTransaction) beginTransaction(WriteOptions writeOptions, Transaction oldTransaction) voidclose()This is similar tocloseE()except that it silently ignores any errors.voidcloseE()This is similar toclose()except that it throws an exception if any error occurs.protected final voiddisposeInternal(long handle) Get the underlying database that was opened.protected static longprotected static long[]static OptimisticTransactionDBopen(DBOptions dbOptions, String path, List<ColumnFamilyDescriptor> columnFamilyDescriptors, List<ColumnFamilyHandle> columnFamilyHandles) Open an OptimisticTransactionDB similar toRocksDB.open(DBOptions, String, List, List).static OptimisticTransactionDBOpen an OptimisticTransactionDB similar toRocksDB.open(Options, String).Methods inherited from class org.rocksdb.RocksDB
cancelAllBackgroundWork, clipColumnFamily, compactFiles, compactFiles, compactRange, compactRange, compactRange, compactRange, compactRange, continueBackgroundWork, createColumnFamilies, createColumnFamilies, createColumnFamily, createColumnFamilyWithImport, createColumnFamilyWithImport, delete, delete, delete, delete, delete, delete, delete, delete, delete, delete, deleteFile, deleteFilesInRanges, deleteRange, deleteRange, deleteRange, deleteRange, destroyColumnFamilyHandle, destroyDB, disableFileDeletions, dropColumnFamilies, dropColumnFamily, enableAutoCompaction, enableFileDeletions, endTrace, flush, flush, flush, flushWal, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAggregatedLongProperty, getApproximateMemTableStats, getApproximateMemTableStats, getApproximateSizes, getApproximateSizes, getColumnFamilyMetaData, getColumnFamilyMetaData, getDBOptions, getDefaultColumnFamily, getEnv, getLatestSequenceNumber, getLiveFiles, getLiveFiles, getLiveFilesMetaData, getLongProperty, getLongProperty, getMapProperty, getMapProperty, getName, getOptions, getOptions, getPerfContext, getPerfLevel, getPropertiesOfAllTables, getPropertiesOfAllTables, getPropertiesOfTablesInRange, getPropertiesOfTablesInRange, getProperty, getProperty, getSnapshot, getSortedWalFiles, getUpdatesSince, ingestExternalFile, ingestExternalFile, isClosed, keyExists, keyExists, keyExists, keyExists, keyExists, keyExists, keyExists, keyExists, keyExists, keyExists, keyExists, keyExists, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, keyMayExist, level0StopWriteTrigger, level0StopWriteTrigger, listColumnFamilies, loadLibrary, loadLibrary, makeDefaultColumnFamilyHandle, maxMemCompactionLevel, maxMemCompactionLevel, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, multiGetAsList, multiGetAsList, multiGetAsList, multiGetAsList, multiGetByteBuffers, multiGetByteBuffers, multiGetByteBuffers, multiGetByteBuffers, newIterator, newIterator, newIterator, newIterator, newIterators, newIterators, numberLevels, numberLevels, open, open, openAsSecondary, openAsSecondary, openReadOnly, openReadOnly, openReadOnly, openReadOnly, openReadOnly, openReadOnly, pauseBackgroundWork, promoteL0, promoteL0, put, put, put, put, put, put, put, put, put, put, releaseSnapshot, resetStats, rocksdbVersion, setDBOptions, setOptions, setOptions, setPerfLevel, singleDelete, singleDelete, singleDelete, singleDelete, startTrace, storeDefaultColumnFamilyHandle, storeOptionsInstance, suggestCompactRange, suggestCompactRange, syncWal, tryCatchUpWithPrimary, verifyChecksum, write, writeMethods inherited from class org.rocksdb.RocksObject
disposeInternal, getNativeHandleMethods inherited from class org.rocksdb.AbstractImmutableNativeReference
disOwnNativeHandle, isOwningHandle
-
Method Details
-
open
Open an OptimisticTransactionDB similar toRocksDB.open(Options, String).- Parameters:
options-Optionsinstance.path- the path to the rocksdb.- Returns:
- a
OptimisticTransactionDBinstance on success, null if the specifiedOptimisticTransactionDBcan not be opened. - Throws:
RocksDBException- if an error occurs whilst opening the database.
-
open
public static OptimisticTransactionDB open(DBOptions dbOptions, String path, List<ColumnFamilyDescriptor> columnFamilyDescriptors, List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException Open an OptimisticTransactionDB similar toRocksDB.open(DBOptions, String, List, List).- Parameters:
dbOptions-DBOptionsinstance.path- the path to the rocksdb.columnFamilyDescriptors- list of column family descriptorscolumnFamilyHandles- will be filled with ColumnFamilyHandle instances- Returns:
- a
OptimisticTransactionDBinstance on success, null if the specifiedOptimisticTransactionDBcan not be opened. - Throws:
RocksDBException- if an error occurs whilst opening the database.
-
closeE
This is similar toclose()except that it throws an exception if any error occurs.This will not fsync the WAL files. If syncing is required, the caller must first call
RocksDB.syncWal()orRocksDB.write(WriteOptions, WriteBatch)using an empty write batch withWriteOptions.setSync(boolean)set to true.See also
close().- Overrides:
closeEin classRocksDB- Throws:
RocksDBException- if an error occurs whilst closing.
-
close
public void close()This is similar tocloseE()except that it silently ignores any errors.This will not fsync the WAL files. If syncing is required, the caller must first call
RocksDB.syncWal()orRocksDB.write(WriteOptions, WriteBatch)using an empty write batch withWriteOptions.setSync(boolean)set to true.See also
close().- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classRocksDB
-
beginTransaction
-
beginTransaction
public Transaction beginTransaction(WriteOptions writeOptions, OptimisticTransactionOptions optimisticTransactionOptions) -
beginTransaction
-
beginTransaction
public Transaction beginTransaction(WriteOptions writeOptions, OptimisticTransactionOptions optimisticTransactionOptions, Transaction oldTransaction) -
getBaseDB
Get the underlying database that was opened.- Returns:
- The underlying database that was opened.
-
disposeInternal
protected final void disposeInternal(long handle) - Overrides:
disposeInternalin classRocksDB
-
open
- Throws:
RocksDBException
-
open
protected static long[] open(long handle, String path, byte[][] columnFamilyNames, long[] columnFamilyOptions)
-