Package org.rocksdb
Class TransactionDB
- All Implemented Interfaces:
AutoCloseable
Database with Transaction support
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classNested 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, Transaction oldTransaction) beginTransaction(WriteOptions writeOptions, TransactionOptions transactionOptions) beginTransaction(WriteOptions writeOptions, TransactionOptions transactionOptions, 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) Returns map of all locks held.getTransactionByName(String transactionName) static TransactionDBopen(DBOptions dbOptions, TransactionDBOptions transactionDbOptions, String path, List<ColumnFamilyDescriptor> columnFamilyDescriptors, List<ColumnFamilyHandle> columnFamilyHandles) Open a TransactionDB, similar toRocksDB.open(DBOptions, String, List, List).static TransactionDBopen(Options options, TransactionDBOptions transactionDbOptions, String path) Open a TransactionDB, similar toRocksDB.open(Options, String).voidsetDeadlockInfoBufferSize(int targetSize) 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, 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
public static TransactionDB open(Options options, TransactionDBOptions transactionDbOptions, String path) throws RocksDBException Open a TransactionDB, similar toRocksDB.open(Options, String).- Parameters:
options-Optionsinstance.transactionDbOptions-TransactionDBOptionsinstance.path- the path to the rocksdb.- Returns:
- a
TransactionDBinstance on success, null if the specifiedTransactionDBcan not be opened. - Throws:
RocksDBException- if an error occurs whilst opening the database.
-
open
public static TransactionDB open(DBOptions dbOptions, TransactionDBOptions transactionDbOptions, String path, List<ColumnFamilyDescriptor> columnFamilyDescriptors, List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException Open a TransactionDB, similar toRocksDB.open(DBOptions, String, List, List).- Parameters:
dbOptions-DBOptionsinstance.transactionDbOptions-TransactionDBOptionsinstance.path- the path to the rocksdb.columnFamilyDescriptors- list of column family descriptorscolumnFamilyHandles- will be filled with ColumnFamilyHandle instances- Returns:
- a
TransactionDBinstance on success, null if the specifiedTransactionDBcan 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, TransactionOptions transactionOptions) -
beginTransaction
-
beginTransaction
public Transaction beginTransaction(WriteOptions writeOptions, TransactionOptions transactionOptions, Transaction oldTransaction) -
getTransactionByName
-
getAllPreparedTransactions
-
getLockStatusData
Returns map of all locks held.- Returns:
- a map of all the locks held.
-
getDeadlockInfoBuffer
-
setDeadlockInfoBufferSize
public void setDeadlockInfoBufferSize(int targetSize) -
disposeInternal
protected final void disposeInternal(long handle) - Overrides:
disposeInternalin classRocksDB
-