public class Options extends RocksObject implements DBOptionsInterface<Options>, MutableDBOptionsInterface<Options>, ColumnFamilyOptionsInterface<Options>, MutableColumnFamilyOptionsInterface<Options>
RocksDB (i.e., RocksDB.open()).
As a descendent of AbstractNativeReference, this class is AutoCloseable
and will be automatically released if opened in the preamble of a try with resources block.nativeHandle_owningHandle_DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET| Constructor and Description |
|---|
Options()
Construct options for opening a RocksDB.
|
Options(DBOptions dbOptions,
ColumnFamilyOptions columnFamilyOptions)
Construct options for opening a RocksDB.
|
Options(Options other)
Copy constructor for ColumnFamilyOptions.
|
| Modifier and Type | Method and Description |
|---|---|
AccessHint |
accessHintOnCompactionStart()
Specify the file access pattern once a compaction is started.
|
boolean |
adviseRandomOnOpen()
If set true, will hint the underlying file system that the file
access pattern is random, when a sst file is opened.
|
boolean |
allow2pc()
if set to false then recovery will fail when a prepared
transaction is encountered in the WAL
Default: false
|
boolean |
allowConcurrentMemtableWrite()
If true, allow multi-writers to update mem tables in parallel.
|
boolean |
allowFAllocate()
Whether fallocate calls are allowed
|
boolean |
allowIngestBehind()
Returns true if ingest behind is allowed.
|
boolean |
allowMmapReads()
Allow the OS to mmap file for reading sst tables.
|
boolean |
allowMmapWrites()
Allow the OS to mmap file for writing.
|
long |
arenaBlockSize()
The size of one block in arena memory allocation.
|
boolean |
atomicFlush()
Determine if atomic flush of multiple column families is enabled.
|
boolean |
avoidFlushDuringRecovery()
By default RocksDB replay WAL logs and flush them on DB open, which may
create very small SST files.
|
boolean |
avoidFlushDuringShutdown()
By default RocksDB will flush all memtables on DB close if there are
unpersisted data (i.e. with WAL disabled) The flush can be skip to speedup
DB close.
|
boolean |
avoidUnnecessaryBlockingIO()
If true, working thread may avoid doing unnecessary and long-latency
operation (such as deleting obsolete files directly or deleting memtable)
and will instead schedule a background job to do it.
|
boolean |
bestEffortsRecovery()
By default, RocksDB recovery fails if any table file referenced in
MANIFEST are missing after scanning the MANIFEST.
|
long |
bgerrorResumeRetryInterval()
If max_bgerror_resume_count is ≥ 2, db resume is called multiple times.
|
long |
blobCompactionReadaheadSize()
Get compaction readahead for blob files.
|
CompressionType |
blobCompressionType()
Get the compression algorithm in use for large values stored in blob files.
|
long |
blobFileSize()
The size limit for blob files.
|
double |
blobGarbageCollectionAgeCutoff()
Get cutoff in terms of blob file age for garbage collection.
|
double |
blobGarbageCollectionForceThreshold()
Get the current value for the
AdvancedMutableColumnFamilyOptionsInterface.blobGarbageCollectionForceThreshold() |
int |
bloomLocality()
Control locality of bloom filter probes to improve cache miss rate.
|
CompressionOptions |
bottommostCompressionOptions()
Get the bottom most compression options.
|
CompressionType |
bottommostCompressionType()
Compression algorithm that will be used for the bottommost level that
contain files.
|
long |
bytesPerSync()
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
List<DbPath> |
cfPaths() |
AbstractCompactionFilter<? extends AbstractSlice<?>> |
compactionFilter()
Accessor for the CompactionFilter instance in use.
|
AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> |
compactionFilterFactory()
Accessor for the CompactionFilterFactory instance in use.
|
CompactionOptionsFIFO |
compactionOptionsFIFO()
The options for FIFO compaction style
|
CompactionOptionsUniversal |
compactionOptionsUniversal()
The options needed to support Universal Style compactions
|
CompactionPriority |
compactionPriority()
Get the Compaction priority if level compaction
is used for all levels
|
long |
compactionReadaheadSize()
If non-zero, we perform bigger reads when doing compaction.
|
CompactionStyle |
compactionStyle()
Compaction style for DB.
|
ConcurrentTaskLimiter |
compactionThreadLimiter()
Get compaction thread limiter
|
CompressionOptions |
compressionOptions()
Get the different options for compression algorithms
|
List<CompressionType> |
compressionPerLevel()
Return the currently set
CompressionType
per instances. |
CompressionType |
compressionType()
Compress blocks using the specified compression algorithm.
|
boolean |
createIfMissing()
Return true if the create_if_missing flag is set to true.
|
boolean |
createMissingColumnFamilies()
Return true if the create_missing_column_families flag is set
to true.
|
String |
dbLogDir()
Returns the directory of info log.
|
List<DbPath> |
dbPaths()
A list of paths where SST files can be put into, with its target size.
|
long |
dbWriteBufferSize()
Amount of data to build up in memtables across all column
families before writing to disk.
|
long |
delayedWriteRate()
The limited write rate to DB if
ColumnFamilyOptions.softPendingCompactionBytesLimit() or
ColumnFamilyOptions.level0SlowdownWritesTrigger() is triggered,
or we are writing to the last mem table allowed and we allow more than 3
mem tables. |
long |
deleteObsoleteFilesPeriodMicros()
The periodicity when obsolete files get deleted.
|
boolean |
disableAutoCompactions()
Disable automatic compactions.
|
protected void |
disposeInternal(long handle) |
boolean |
dumpMallocStats()
If true, then print malloc stats together with rocksdb.stats
when printing to LOG.
|
boolean |
enableBlobFiles()
When set, large values (blobs) are written to separate blob files, and only
pointers to them are stored in SST files.
|
boolean |
enableBlobGarbageCollection()
Query whether garbage collection of blobs is enabled.Blob GC is performed as part of
compaction.
|
boolean |
enablePipelinedWrite()
Returns true if pipelined writes are enabled.
|
boolean |
enableThreadTracking()
If true, then the status of the threads involved in this DB will
be tracked and available via GetThreadList() API.
|
boolean |
enableWriteThreadAdaptiveYield()
If true, threads synchronizing with the write batch group leader will
wait for up to
DBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. |
boolean |
errorIfExists()
If true, an error will be thrown during RocksDB.open() if the
database already exists.
|
boolean |
failIfOptionsFileError()
If true, then DB::Open / CreateColumnFamily / DropColumnFamily
/ SetOptions will fail if options file is not detected or properly
persisted.
|
boolean |
forceConsistencyChecks()
In debug mode, RocksDB run consistency checks on the LSM every time the LSM
change (Flush, Compaction, AddFile).
|
Env |
getEnv()
Returns the set RocksEnv instance.
|
static String |
getOptionStringFromProps(Properties properties)
Converts the input properties into a Options-style formatted string
|
long |
hardPendingCompactionBytesLimit()
All writes are stopped if estimated bytes needed to be compaction exceed
this threshold.
|
InfoLogLevel |
infoLogLevel()
Returns currently set log level.
|
long |
inplaceUpdateNumLocks()
Number of locks used for inplace update
Default: 10000, if inplace_update_support = true, else 0.
|
boolean |
inplaceUpdateSupport()
Allows thread-safe inplace updates.
|
boolean |
isFdCloseOnExec()
Disable child process inherit open files.
|
long |
keepLogFileNum()
Returns the maximum number of info log files to be kept.
|
int |
level0FileNumCompactionTrigger()
Number of files to trigger level-0 compaction.
|
int |
level0SlowdownWritesTrigger()
Soft limit on number of level-0 files.
|
int |
level0StopWritesTrigger()
Maximum number of level-0 files.
|
boolean |
levelCompactionDynamicLevelBytes()
Return if
LevelCompactionDynamicLevelBytes is enabled. |
int |
levelZeroFileNumCompactionTrigger()
The number of files in level 0 to trigger compaction from level-0 to
level-1.
|
int |
levelZeroSlowdownWritesTrigger()
Soft limit on the number of level-0 files.
|
int |
levelZeroStopWritesTrigger()
Maximum number of level-0 files.
|
List<AbstractEventListener> |
listeners()
Sets the
EventListeners whose callback functions
will be called when specific RocksDB event happens. |
long |
logFileTimeToRoll()
Returns the time interval for the info log file to roll (in seconds).
|
long |
logReadaheadSize()
The number of bytes to prefetch when reading the log.
|
long |
manifestPreallocationSize()
Number of bytes to preallocate (via fallocate) the manifest
files.
|
boolean |
manualWalFlush()
Returns true if automatic WAL flushing is disabled.
|
int |
maxBackgroundCompactions()
Deprecated.
|
int |
maxBackgroundFlushes()
Deprecated.
|
int |
maxBackgroundJobs()
Returns the maximum number of concurrent background jobs (both flushes
and compactions combined).
|
int |
maxBgerrorResumeCount()
It defines how many times db resume is called by a separate thread when
background retryable IO Error happens.
|
long |
maxBytesForLevelBase()
The upper-bound of the total size of level-1 files in bytes.
|
double |
maxBytesForLevelMultiplier()
The ratio between the total size of level-(L+1) files and the total
size of level-L files for all L.
|
int[] |
maxBytesForLevelMultiplierAdditional()
Different max-size multipliers for different levels.
|
long |
maxCompactionBytes()
Control maximum size of each compaction (not guaranteed)
|
int |
maxFileOpeningThreads()
If
MutableDBOptionsInterface.maxOpenFiles() is -1, DB will open all
files on DB::Open(). |
long |
maxLogFileSize()
Returns the maximum size of a info log file.
|
long |
maxManifestFileSize()
Manifest file is rolled over on reaching this limit.
|
int |
maxOpenFiles()
Number of open files that can be used by the DB.
|
long |
maxSequentialSkipInIterations()
An iteration->Next() sequentially skips over keys with the same
user-key unless this option is set.
|
int |
maxSubcompactions()
This value represents the maximum number of threads that will
concurrently perform a compaction job by breaking it into multiple,
smaller ones that are run simultaneously.
|
long |
maxSuccessiveMerges()
Maximum number of successive merge operations on a key in the memtable.
|
long |
maxTableFilesSizeFIFO()
FIFO compaction option.
|
long |
maxTotalWalSize()
Returns the max total write-ahead log size.
|
long |
maxWriteBatchGroupSizeBytes()
The maximum limit of number of bytes that are written in a single batch
of WAL or memtable write.
|
int |
maxWriteBufferNumber()
Returns maximum number of write buffers.
|
int |
maxWriteBufferNumberToMaintain()
The total maximum number of write buffers to maintain in memory including
copies of buffers that have already been flushed.
|
MemTableConfig |
memTableConfig()
Get the config for mem-table.
|
String |
memTableFactoryName()
Returns the name of the current mem table representation.
|
long |
memtableHugePageSize()
Page size for huge page TLB for bloom in memtable.
|
double |
memtablePrefixBloomSizeRatio()
if prefix_extractor is set and memtable_prefix_bloom_size_ratio is not 0,
create prefix bloom for memtable with the size of
write_buffer_size * memtable_prefix_bloom_size_ratio.
|
boolean |
memtableWholeKeyFiltering()
Returns whether whole key bloom filter is enabled in memtable
|
long |
minBlobSize()
Get the size of the smallest value to be stored separately in a blob file.
|
int |
minWriteBufferNumberToMerge()
The minimum number of write buffers that will be merged together
before writing to storage.
|
int |
numLevels()
If level-styled compaction is used, then this number determines
the total number of levels.
|
Options |
oldDefaults(int majorVersion,
int minorVersion)
The function recovers options to a previous version.
|
boolean |
optimizeFiltersForHits()
Returns the current state of the
optimize_filters_for_hits
setting. |
Options |
optimizeForPointLookup(long blockCacheSizeMb)
Use this if you don't need to keep the data sorted, i.e. you'll never use
an iterator, only Put() and Get() API calls
|
Options |
optimizeForSmallDb()
Use this if your DB is very small (like under 1GB) and you don't want to
spend lots of memory for memtables.
|
Options |
optimizeForSmallDb(Cache cache)
Some functions that make it easier to optimize RocksDB
Use this if your DB is very small (like under 1GB) and you don't want to
spend lots of memory for memtables.
|
Options |
optimizeLevelStyleCompaction()
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
Options |
optimizeLevelStyleCompaction(long memtableMemoryBudget)
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
Options |
optimizeUniversalStyleCompaction()
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
Options |
optimizeUniversalStyleCompaction(long memtableMemoryBudget)
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
boolean |
paranoidChecks()
If true, the implementation will do aggressive checking of the
data it is processing and will stop early if it detects any
errors.
|
boolean |
paranoidFileChecks()
After writing every SST file, reopen it and read all the keys.
|
long |
periodicCompactionSeconds()
Get the periodicCompactionSeconds.
|
boolean |
persistStatsToDisk()
If true, automatically persist stats to a hidden column family (column
family name: ___rocksdb_stats_history___) every
stats_persist_period_sec seconds; otherwise, write to an in-memory
struct.
|
Options |
prepareForBulkLoad()
Set appropriate parameters for bulk loading.
|
long |
randomAccessMaxBufferSize()
This is a maximum buffer size that is used by WinMmapReadableFile in
unbuffered disk I/O mode.
|
long |
recycleLogFileNum()
Recycle log files.
|
boolean |
reportBgIoStats()
Determine whether IO stats in compactions and flushes are being measured
|
Cache |
rowCache()
A global cache for table-level rows.
|
Options |
setAccessHintOnCompactionStart(AccessHint accessHint)
Specify the file access pattern once a compaction is started.
|
Options |
setAdviseRandomOnOpen(boolean adviseRandomOnOpen)
If set true, will hint the underlying file system that the file
access pattern is random, when a sst file is opened.
|
Options |
setAllow2pc(boolean allow2pc)
if set to false then recovery will fail when a prepared
transaction is encountered in the WAL
Default: false
|
Options |
setAllowConcurrentMemtableWrite(boolean allowConcurrentMemtableWrite)
If true, allow multi-writers to update mem tables in parallel.
|
Options |
setAllowFAllocate(boolean allowFAllocate)
Whether fallocate calls are allowed
|
Options |
setAllowIngestBehind(boolean allowIngestBehind)
Set this option to true during creation of database if you want
to be able to ingest behind (call IngestExternalFile() skipping keys
that already exist, rather than overwriting matching keys).
|
Options |
setAllowMmapReads(boolean allowMmapReads)
Allow the OS to mmap file for reading sst tables.
|
Options |
setAllowMmapWrites(boolean allowMmapWrites)
Allow the OS to mmap file for writing.
|
Options |
setArenaBlockSize(long arenaBlockSize)
The size of one block in arena memory allocation.
|
Options |
setAtomicFlush(boolean atomicFlush)
If true, RocksDB supports flushing multiple column families and committing
their results atomically to MANIFEST.
|
Options |
setAvoidFlushDuringRecovery(boolean avoidFlushDuringRecovery)
By default RocksDB replay WAL logs and flush them on DB open, which may
create very small SST files.
|
Options |
setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
By default RocksDB will flush all memtables on DB close if there are
unpersisted data (i.e. with WAL disabled) The flush can be skip to speedup
DB close.
|
Options |
setAvoidUnnecessaryBlockingIO(boolean avoidUnnecessaryBlockingIO)
If true, working thread may avoid doing unnecessary and long-latency
operation (such as deleting obsolete files directly or deleting memtable)
and will instead schedule a background job to do it.
|
Options |
setBestEffortsRecovery(boolean bestEffortsRecovery)
By default, RocksDB recovery fails if any table file referenced in
MANIFEST are missing after scanning the MANIFEST.
|
Options |
setBgerrorResumeRetryInterval(long bgerrorResumeRetryInterval)
If max_bgerror_resume_count is ≥ 2, db resume is called multiple times.
|
Options |
setBlobCompactionReadaheadSize(long blobCompactionReadaheadSize)
Set compaction readahead for blob files.
|
Options |
setBlobCompressionType(CompressionType compressionType)
Set the compression algorithm to use for large values stored in blob files.
|
Options |
setBlobFileSize(long blobFileSize)
Set the size limit for blob files.
|
Options |
setBlobGarbageCollectionAgeCutoff(double blobGarbageCollectionAgeCutoff)
Set cutoff in terms of blob file age for garbage collection.
|
Options |
setBlobGarbageCollectionForceThreshold(double blobGarbageCollectionForceThreshold)
If the ratio of garbage in the oldest blob files exceeds this threshold,
targeted compactions are scheduled in order to force garbage collecting
the blob files in question, assuming they are all eligible based on the
value of
AdvancedMutableColumnFamilyOptionsInterface.blobGarbageCollectionAgeCutoff() above. |
Options |
setBloomLocality(int bloomLocality)
Control locality of bloom filter probes to improve cache miss rate.
|
Options |
setBottommostCompressionOptions(CompressionOptions bottommostCompressionOptions)
Set the options for compression algorithms used by
ColumnFamilyOptionsInterface.bottommostCompressionType() if it is enabled. |
Options |
setBottommostCompressionType(CompressionType bottommostCompressionType)
Compression algorithm that will be used for the bottommost level that
contain files.
|
Options |
setBytesPerSync(long bytesPerSync)
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
Options |
setCfPaths(Collection<DbPath> cfPaths)
A list of paths where SST files for this column family
can be put into, with its target size.
|
Options |
setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
A single CompactionFilter instance to call into during compaction.
|
Options |
setCompactionFilterFactory(AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory)
This is a factory that provides
AbstractCompactionFilter objects
which allow an application to modify/delete a key-value during background
compaction. |
Options |
setCompactionOptionsFIFO(CompactionOptionsFIFO compactionOptionsFIFO)
The options for FIFO compaction style
|
Options |
setCompactionOptionsUniversal(CompactionOptionsUniversal compactionOptionsUniversal)
Set the options needed to support Universal Style compactions
|
Options |
setCompactionPriority(CompactionPriority compactionPriority)
If level
AdvancedColumnFamilyOptionsInterface.compactionStyle() == CompactionStyle.LEVEL,
for each level, which files are prioritized to be picked to compact. |
Options |
setCompactionReadaheadSize(long compactionReadaheadSize)
If non-zero, we perform bigger reads when doing compaction.
|
Options |
setCompactionStyle(CompactionStyle compactionStyle)
Set compaction style for DB.
|
Options |
setCompactionThreadLimiter(ConcurrentTaskLimiter compactionThreadLimiter)
Compaction concurrent thread limiter for the column family.
|
Options |
setComparator(AbstractComparator comparator)
Use the specified comparator for key ordering.
|
Options |
setComparator(BuiltinComparator builtinComparator)
Set
BuiltinComparator to be used with RocksDB. |
Options |
setCompressionOptions(CompressionOptions compressionOptions)
Set the different options for compression algorithms
|
Options |
setCompressionPerLevel(List<CompressionType> compressionLevels)
Different levels can have different compression
policies.
|
Options |
setCompressionType(CompressionType compressionType)
Compress blocks using the specified compression algorithm.
|
Options |
setCreateIfMissing(boolean flag)
If this value is set to true, then the database will be created
if it is missing during
RocksDB.open(). |
Options |
setCreateMissingColumnFamilies(boolean flag)
If true, missing column families will be automatically created
Default: false
|
Options |
setDbLogDir(String dbLogDir)
This specifies the info LOG dir.
|
Options |
setDbPaths(Collection<DbPath> dbPaths)
A list of paths where SST files can be put into, with its target size.
|
Options |
setDbWriteBufferSize(long dbWriteBufferSize)
Amount of data to build up in memtables across all column
families before writing to disk.
|
Options |
setDelayedWriteRate(long delayedWriteRate)
The limited write rate to DB if
ColumnFamilyOptions.softPendingCompactionBytesLimit() or
ColumnFamilyOptions.level0SlowdownWritesTrigger() is triggered,
or we are writing to the last mem table allowed and we allow more than 3
mem tables. |
Options |
setDeleteObsoleteFilesPeriodMicros(long micros)
The periodicity when obsolete files get deleted.
|
Options |
setDisableAutoCompactions(boolean disableAutoCompactions)
Disable automatic compactions.
|
Options |
setDumpMallocStats(boolean dumpMallocStats)
If true, then print malloc stats together with rocksdb.stats
when printing to LOG.
|
Options |
setEnableBlobFiles(boolean enableBlobFiles)
When set, large values (blobs) are written to separate blob files, and only
pointers to them are stored in SST files.
|
Options |
setEnableBlobGarbageCollection(boolean enableBlobGarbageCollection)
Enable/disable garbage collection of blobs.
|
Options |
setEnablePipelinedWrite(boolean enablePipelinedWrite)
By default, a single write thread queue is maintained.
|
Options |
setEnableThreadTracking(boolean enableThreadTracking)
If true, then the status of the threads involved in this DB will
be tracked and available via GetThreadList() API.
|
Options |
setEnableWriteThreadAdaptiveYield(boolean enableWriteThreadAdaptiveYield)
If true, threads synchronizing with the write batch group leader will
wait for up to
DBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. |
Options |
setEnv(Env env)
Use the specified object to interact with the environment,
e.g. to read/write files, schedule background work, etc.
|
Options |
setErrorIfExists(boolean errorIfExists)
If true, an error will be thrown during RocksDB.open() if the
database already exists.
|
Options |
setFailIfOptionsFileError(boolean failIfOptionsFileError)
If true, then DB::Open / CreateColumnFamily / DropColumnFamily
/ SetOptions will fail if options file is not detected or properly
persisted.
|
Options |
setForceConsistencyChecks(boolean forceConsistencyChecks)
In debug mode, RocksDB run consistency checks on the LSM every time the LSM
change (Flush, Compaction, AddFile).
|
Options |
setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
All writes are stopped if estimated bytes needed to be compaction exceed
this threshold.
|
Options |
setIncreaseParallelism(int totalThreads)
By default, RocksDB uses only one background thread for flush and
compaction.
|
Options |
setInfoLogLevel(InfoLogLevel infoLogLevel)
Sets the RocksDB log level.
|
Options |
setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
Number of locks used for inplace update
Default: 10000, if inplace_update_support = true, else 0.
|
Options |
setInplaceUpdateSupport(boolean inplaceUpdateSupport)
Allows thread-safe inplace updates.
|
Options |
setIsFdCloseOnExec(boolean isFdCloseOnExec)
Disable child process inherit open files.
|
Options |
setKeepLogFileNum(long keepLogFileNum)
Specifies the maximum number of info log files to be kept.
|
Options |
setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
Number of files to trigger level-0 compaction.
|
Options |
setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
Soft limit on number of level-0 files.
|
Options |
setLevel0StopWritesTrigger(int level0StopWritesTrigger)
Maximum number of level-0 files.
|
Options |
setLevelCompactionDynamicLevelBytes(boolean enableLevelCompactionDynamicLevelBytes)
If
true, RocksDB will pick target size of each level
dynamically. |
Options |
setLevelZeroFileNumCompactionTrigger(int numFiles)
Number of files to trigger level-0 compaction.
|
Options |
setLevelZeroSlowdownWritesTrigger(int numFiles)
Soft limit on number of level-0 files.
|
Options |
setLevelZeroStopWritesTrigger(int numFiles)
Maximum number of level-0 files.
|
Options |
setListeners(List<AbstractEventListener> listeners)
Sets the
EventListeners whose callback functions
will be called when specific RocksDB event happens. |
Options |
setLogFileTimeToRoll(long logFileTimeToRoll)
Specifies the time interval for the info log file to roll (in seconds).
|
Options |
setLogger(Logger logger)
Any internal progress/error information generated by
the db will be written to the Logger if it is non-nullptr,
or to a file stored in the same directory as the DB
contents if info_log is nullptr.
|
Options |
setLogReadaheadSize(long logReadaheadSize)
The number of bytes to prefetch when reading the log.
|
Options |
setManifestPreallocationSize(long size)
Number of bytes to preallocate (via fallocate) the manifest
files.
|
Options |
setManualWalFlush(boolean manualWalFlush)
If true WAL is not flushed automatically after each write.
|
Options |
setMaxBackgroundCompactions(int maxBackgroundCompactions)
Deprecated.
|
Options |
setMaxBackgroundFlushes(int maxBackgroundFlushes)
Deprecated.
|
Options |
setMaxBackgroundJobs(int maxBackgroundJobs)
Specifies the maximum number of concurrent background jobs (both flushes
and compactions combined).
|
Options |
setMaxBgErrorResumeCount(int maxBgerrorResumeCount)
It defines how many times db resume is called by a separate thread when
background retryable IO Error happens.
|
Options |
setMaxBytesForLevelBase(long maxBytesForLevelBase)
The upper-bound of the total size of level-1 files in bytes.
|
Options |
setMaxBytesForLevelMultiplier(double multiplier)
The ratio between the total size of level-(L+1) files and the total
size of level-L files for all L.
|
Options |
setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
Different max-size multipliers for different levels.
|
Options |
setMaxCompactionBytes(long maxCompactionBytes)
Maximum size of each compaction (not guarantee)
|
Options |
setMaxFileOpeningThreads(int maxFileOpeningThreads)
If
MutableDBOptionsInterface.maxOpenFiles() is -1, DB will open
all files on DB::Open(). |
Options |
setMaxLogFileSize(long maxLogFileSize)
Specifies the maximum size of a info log file.
|
Options |
setMaxManifestFileSize(long maxManifestFileSize)
Manifest file is rolled over on reaching this limit.
|
Options |
setMaxOpenFiles(int maxOpenFiles)
Number of open files that can be used by the DB.
|
Options |
setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
An iteration->Next() sequentially skips over keys with the same
user-key unless this option is set.
|
Options |
setMaxSubcompactions(int maxSubcompactions)
This value represents the maximum number of threads that will
concurrently perform a compaction job by breaking it into multiple,
smaller ones that are run simultaneously.
|
Options |
setMaxSuccessiveMerges(long maxSuccessiveMerges)
Maximum number of successive merge operations on a key in the memtable.
|
Options |
setMaxTableFilesSizeFIFO(long maxTableFilesSize)
FIFO compaction option.
|
Options |
setMaxTotalWalSize(long maxTotalWalSize)
Set the max total write-ahead log size.
|
Options |
setMaxWriteBatchGroupSizeBytes(long maxWriteBatchGroupSizeBytes)
The maximum limit of number of bytes that are written in a single batch
of WAL or memtable write.
|
Options |
setMaxWriteBufferNumber(int maxWriteBufferNumber)
The maximum number of write buffers that are built up in memory.
|
Options |
setMaxWriteBufferNumberToMaintain(int maxWriteBufferNumberToMaintain)
The total maximum number of write buffers to maintain in memory including
copies of buffers that have already been flushed.
|
Options |
setMemTableConfig(MemTableConfig config)
Set the config for mem-table.
|
Options |
setMemtableHugePageSize(long memtableHugePageSize)
Page size for huge page TLB for bloom in memtable.
|
Options |
setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
if prefix_extractor is set and memtable_prefix_bloom_size_ratio is not 0,
create prefix bloom for memtable with the size of
write_buffer_size * memtable_prefix_bloom_size_ratio.
|
Options |
setMemtableWholeKeyFiltering(boolean memtableWholeKeyFiltering)
Enable whole key bloom filter in memtable.
|
Options |
setMergeOperator(MergeOperator mergeOperator)
Set the merge operator to be used for merging two different key/value
pairs that share the same key.
|
Options |
setMergeOperatorName(String name)
Set the merge operator to be used for merging two merge operands
of the same key.
|
Options |
setMinBlobSize(long minBlobSize)
Set the size of the smallest value to be stored separately in a blob file.
|
Options |
setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
The minimum number of write buffers that will be merged together
before writing to storage.
|
Options |
setNumLevels(int numLevels)
Set the number of levels for this database
If level-styled compaction is used, then this number determines
the total number of levels.
|
Options |
setOptimizeFiltersForHits(boolean optimizeFiltersForHits)
This flag specifies that the implementation should optimize the filters
mainly for cases where keys are found rather than also optimize for keys
missed.
|
Options |
setParanoidChecks(boolean paranoidChecks)
If true, the implementation will do aggressive checking of the
data it is processing and will stop early if it detects any
errors.
|
Options |
setParanoidFileChecks(boolean paranoidFileChecks)
After writing every SST file, reopen it and read all the keys.
|
Options |
setPeriodicCompactionSeconds(long periodicCompactionSeconds)
Files older than this value will be picked up for compaction, and
re-written to the same level as they were before.
|
Options |
setPersistStatsToDisk(boolean persistStatsToDisk)
If true, automatically persist stats to a hidden column family (column
family name: ___rocksdb_stats_history___) every
stats_persist_period_sec seconds; otherwise, write to an in-memory
struct.
|
Options |
setRandomAccessMaxBufferSize(long randomAccessMaxBufferSize)
This is a maximum buffer size that is used by WinMmapReadableFile in
unbuffered disk I/O mode.
|
Options |
setRateLimiter(RateLimiter rateLimiter)
Use to control write rate of flush and compaction.
|
Options |
setRecycleLogFileNum(long recycleLogFileNum)
Recycle log files.
|
Options |
setReportBgIoStats(boolean reportBgIoStats)
Measure IO stats in compactions and flushes, if true.
|
Options |
setRowCache(Cache rowCache)
A global cache for table-level rows.
|
Options |
setSkipCheckingSstFileSizesOnDbOpen(boolean skipCheckingSstFileSizesOnDbOpen)
If true, then
RocksDB.open(String) will not fetch and check sizes of all sst files. |
Options |
setSkipStatsUpdateOnDbOpen(boolean skipStatsUpdateOnDbOpen)
If true, then DB::Open() will not update the statistics used to optimize
compaction decision by loading table properties from many files.
|
Options |
setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
All writes will be slowed down to at least delayed_write_rate if estimated
bytes needed to be compaction exceed this threshold.
|
Options |
setSstFileManager(SstFileManager sstFileManager)
Use to track SST files and control their file deletion rate.
|
Options |
setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory)
If non-nullptr, use the specified factory for a function to determine the
partitioning of sst files.
|
Options |
setStatistics(Statistics statistics)
Sets the statistics object which collects metrics about database operations.
|
Options |
setStatsDumpPeriodSec(int statsDumpPeriodSec)
if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 600 (10 minutes)
|
Options |
setStatsHistoryBufferSize(long statsHistoryBufferSize)
If not zero, periodically take stats snapshots and store in memory, the
memory size for stats snapshots is capped at
statsHistoryBufferSize
Default: 1MB |
Options |
setStatsPersistPeriodSec(int statsPersistPeriodSec)
If not zero, dump rocksdb.stats to RocksDB every
statsPersistPeriodSec
Default: 600 |
Options |
setStrictBytesPerSync(boolean strictBytesPerSync)
When true, guarantees WAL files have at most
MutableDBOptionsInterface.walBytesPerSync()
bytes submitted for writeback at any given time, and SST files have at most
MutableDBOptionsInterface.bytesPerSync() bytes pending writeback at any given time. |
Options |
setTableCacheNumshardbits(int tableCacheNumshardbits)
Number of shards used for table cache.
|
Options |
setTableFormatConfig(TableFormatConfig config)
Set the config for table format.
|
Options |
setTargetFileSizeBase(long targetFileSizeBase)
The target file size for compaction.
|
Options |
setTargetFileSizeMultiplier(int multiplier)
targetFileSizeMultiplier defines the size ratio between a
level-L file and level-(L+1) file.
|
Options |
setTtl(long ttl)
Non-bottom-level files older than TTL will go through the compaction
process.
|
Options |
setTwoWriteQueues(boolean twoWriteQueues)
If enabled it uses two queues for writes, one for the ones with
disable_memtable and one for the ones that also write to memtable.
|
Options |
setUnorderedWrite(boolean unorderedWrite)
Setting
DBOptionsInterface.unorderedWrite() to true trades higher write throughput with
relaxing the immutability guarantee of snapshots. |
Options |
setUseAdaptiveMutex(boolean useAdaptiveMutex)
Use adaptive mutex, which spins in the user space before resorting
to kernel.
|
Options |
setUseDirectIoForFlushAndCompaction(boolean useDirectIoForFlushAndCompaction)
Enable the OS to use direct reads and writes in flush and
compaction
Default: false
|
Options |
setUseDirectReads(boolean useDirectReads)
Enable the OS to use direct I/O for reading sst tables.
|
Options |
setUseFsync(boolean useFsync)
If true, then every store to stable storage will issue a fsync.
|
Options |
setWalBytesPerSync(long walBytesPerSync)
Same as
MutableDBOptionsInterface.setBytesPerSync(long) , but applies to WAL files
Default: 0, turned off |
Options |
setWalDir(String walDir)
This specifies the absolute dir path for write-ahead logs (WAL).
|
Options |
setWalFilter(AbstractWalFilter walFilter)
A filter object supplied to be invoked while processing write-ahead-logs
(WALs) during recovery.
|
Options |
setWalRecoveryMode(WALRecoveryMode walRecoveryMode)
Recovery mode to control the consistency while replaying WAL
Default:
WALRecoveryMode.PointInTimeRecovery |
Options |
setWalSizeLimitMB(long sizeLimitMB)
WalTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted.
|
Options |
setWalTtlSeconds(long walTtlSeconds)
DBOptionsInterface.walTtlSeconds() and DBOptionsInterface.walSizeLimitMB() affect how archived logs
will be deleted. |
Options |
setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
This is the maximum buffer size that is used by WritableFileWriter.
|
Options |
setWriteBufferManager(WriteBufferManager writeBufferManager)
Use passed
WriteBufferManager to control memory usage across
multiple column families and/or DB instances. |
Options |
setWriteBufferSize(long writeBufferSize)
Amount of data to build up in memory (backed by an unsorted log
on disk) before converting to a sorted on-disk file.
|
Options |
setWriteDbidToManifest(boolean writeDbidToManifest)
Historically DB ID has always been stored in Identity File in DB folder.
|
Options |
setWriteThreadMaxYieldUsec(long writeThreadMaxYieldUsec)
The maximum number of microseconds that a write operation will use
a yielding spin loop to coordinate with other write threads before
blocking on a mutex.
|
Options |
setWriteThreadSlowYieldUsec(long writeThreadSlowYieldUsec)
The latency in microseconds after which a std::this_thread::yield
call (sched_yield on Linux) is considered to be a signal that
other processes or threads would like to use the current core.
|
boolean |
skipCheckingSstFileSizesOnDbOpen()
If true, then
RocksDB.open(String) will not fetch and check sizes of all sst files. |
boolean |
skipStatsUpdateOnDbOpen()
If true, then DB::Open() will not update the statistics used to optimize
compaction decision by loading table properties from many files.
|
long |
softPendingCompactionBytesLimit()
All writes will be slowed down to at least delayed_write_rate if estimated
bytes needed to be compaction exceed this threshold.
|
SstPartitionerFactory |
sstPartitionerFactory()
Get SST partitioner factory
|
Statistics |
statistics()
Returns statistics object.
|
int |
statsDumpPeriodSec()
If not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 600 (10 minutes)
|
long |
statsHistoryBufferSize()
If not zero, periodically take stats snapshots and store in memory, the
memory size for stats snapshots is capped at
statsHistoryBufferSize |
int |
statsPersistPeriodSec()
If not zero, dump rocksdb.stats to RocksDB every
statsPersistPeriodSec |
boolean |
strictBytesPerSync()
Return the strict byte limit per sync.
|
int |
tableCacheNumshardbits()
Number of shards used for table cache.
|
String |
tableFactoryName() |
TableFormatConfig |
tableFormatConfig()
Get the config for table format.
|
long |
targetFileSizeBase()
The target file size for compaction.
|
int |
targetFileSizeMultiplier()
targetFileSizeMultiplier defines the size ratio between a
level-(L+1) file and level-L file.
|
long |
ttl()
Get the TTL for Non-bottom-level files that will go through the compaction
process.
|
boolean |
twoWriteQueues()
Returns true if two write queues are enabled.
|
boolean |
unorderedWrite()
Returns true if unordered write are enabled.
|
boolean |
useAdaptiveMutex()
Use adaptive mutex, which spins in the user space before resorting
to kernel.
|
Options |
useCappedPrefixExtractor(int n)
Same as fixed length prefix extractor, except that when slice is
shorter than the fixed length, it will use the full key.
|
boolean |
useDirectIoForFlushAndCompaction()
Enable the OS to use direct reads and writes in flush and
compaction
|
boolean |
useDirectReads()
Enable the OS to use direct I/O for reading sst tables.
|
Options |
useFixedLengthPrefixExtractor(int n)
This prefix-extractor uses the first n bytes of a key as its prefix.
|
boolean |
useFsync()
If true, then every store to stable storage will issue a fsync.
|
long |
walBytesPerSync()
Same as
MutableDBOptionsInterface.bytesPerSync() , but applies to WAL files
Default: 0, turned off |
String |
walDir()
Returns the path to the write-ahead-logs (WAL) directory.
|
WalFilter |
walFilter()
Get's the filter for processing WALs during recovery.
|
WALRecoveryMode |
walRecoveryMode()
Recovery mode to control the consistency while replaying WAL
Default:
WALRecoveryMode.PointInTimeRecovery |
long |
walSizeLimitMB()
DBOptionsInterface.walTtlSeconds() and #walSizeLimitMB() affect how archived logs
will be deleted. |
long |
walTtlSeconds()
WalTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted.
|
long |
writableFileMaxBufferSize()
This is the maximum buffer size that is used by WritableFileWriter.
|
WriteBufferManager |
writeBufferManager()
Reference to
WriteBufferManager used by it. |
long |
writeBufferSize()
Return size of write buffer size.
|
boolean |
writeDbidToManifest()
Historically DB ID has always been stored in Identity File in DB folder.
|
long |
writeThreadMaxYieldUsec()
The maximum number of microseconds that a write operation will use
a yielding spin loop to coordinate with other write threads before
blocking on a mutex.
|
long |
writeThreadSlowYieldUsec()
The latency in microseconds after which a std::this_thread::yield
call (sched_yield on Linux) is considered to be a signal that
other processes or threads would like to use the current core.
|
disposeInternal, getNativeHandleclose, disOwnNativeHandle, isOwningHandlepublic Options()
rocksdb::Options in the c++ side.public Options(DBOptions dbOptions, ColumnFamilyOptions columnFamilyOptions)
dbOptions - DBOptions instancecolumnFamilyOptions - ColumnFamilyOptions
instancepublic Options(Options other)
other - The Options to copy.public static String getOptionStringFromProps(Properties properties)
properties - The set of properties to convertpublic Options setIncreaseParallelism(int totalThreads)
DBOptionsInterfaceBy default, RocksDB uses only one background thread for flush and compaction. Calling this function will set it up such that total of `total_threads` is used.
You almost definitely want to call this function if your system is bottlenecked by RocksDB.
setIncreaseParallelism in interface DBOptionsInterface<Options>totalThreads - The total number of threads to be used by RocksDB.
A good value is the number of cores.public Options setCreateIfMissing(boolean flag)
DBOptionsInterfaceRocksDB.open().
Default: falsesetCreateIfMissing in interface DBOptionsInterface<Options>flag - a flag indicating whether to create a database the
specified database in RocksDB.open(org.rocksdb.Options, String) operation
is missing.RocksDB.open(org.rocksdb.Options, String)public Options setCreateMissingColumnFamilies(boolean flag)
DBOptionsInterfaceIf true, missing column families will be automatically created
Default: false
setCreateMissingColumnFamilies in interface DBOptionsInterface<Options>flag - a flag indicating if missing column families shall be
created automatically.public Options setEnv(Env env)
DBOptionsInterfaceEnv.getDefault()setEnv in interface DBOptionsInterface<Options>env - Env instance.public Env getEnv()
DBOptionsInterfacegetEnv in interface DBOptionsInterface<Options>RocksEnv instance set in the options.public Options prepareForBulkLoad()
Set appropriate parameters for bulk loading. The reason that this is a function that returns "this" instead of a constructor is to enable chaining of multiple similar calls in the future.
All data will be in level 0 without any automatic compaction. It's recommended to manually call CompactRange(NULL, NULL) before reading from the database, because otherwise the read can be very slow.
public boolean createIfMissing()
DBOptionsInterfacecreateIfMissing in interface DBOptionsInterface<Options>DBOptionsInterface.setCreateIfMissing(boolean)public boolean createMissingColumnFamilies()
DBOptionsInterfacecreateMissingColumnFamilies in interface DBOptionsInterface<Options>DBOptionsInterface.setCreateMissingColumnFamilies(boolean)public Options oldDefaults(int majorVersion, int minorVersion)
ColumnFamilyOptionsInterfaceoldDefaults in interface ColumnFamilyOptionsInterface<Options>majorVersion - The major version to recover default values of optionsminorVersion - The minor version to recover default values of optionspublic Options optimizeForSmallDb()
DBOptionsInterfaceoptimizeForSmallDb in interface ColumnFamilyOptionsInterface<Options>optimizeForSmallDb in interface DBOptionsInterface<Options>public Options optimizeForSmallDb(Cache cache)
ColumnFamilyOptionsInterfaceoptimizeForSmallDb in interface ColumnFamilyOptionsInterface<Options>cache - An optional cache object is passed in to be used as the block cachepublic Options optimizeForPointLookup(long blockCacheSizeMb)
ColumnFamilyOptionsInterfaceoptimizeForPointLookup in interface ColumnFamilyOptionsInterface<Options>blockCacheSizeMb - Block cache size in MBpublic Options optimizeLevelStyleCompaction()
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for level style compaction.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeLevelStyleCompaction in interface ColumnFamilyOptionsInterface<Options>public Options optimizeLevelStyleCompaction(long memtableMemoryBudget)
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for level style compaction.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeLevelStyleCompaction in interface ColumnFamilyOptionsInterface<Options>memtableMemoryBudget - memory budget in bytespublic Options optimizeUniversalStyleCompaction()
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for universal style compaction.
Universal style compaction is focused on reducing Write Amplification Factor for big data sets, but increases Space Amplification.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeUniversalStyleCompaction in interface ColumnFamilyOptionsInterface<Options>public Options optimizeUniversalStyleCompaction(long memtableMemoryBudget)
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for universal style compaction.
Universal style compaction is focused on reducing Write Amplification Factor for big data sets, but increases Space Amplification.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeUniversalStyleCompaction in interface ColumnFamilyOptionsInterface<Options>memtableMemoryBudget - memory budget in bytespublic Options setComparator(BuiltinComparator builtinComparator)
ColumnFamilyOptionsInterfaceBuiltinComparator to be used with RocksDB.
Note: Comparator can be set once upon database creation.
Default: BytewiseComparator.setComparator in interface ColumnFamilyOptionsInterface<Options>builtinComparator - a BuiltinComparator type.public Options setComparator(AbstractComparator comparator)
ColumnFamilyOptionsInterfacesetComparator in interface ColumnFamilyOptionsInterface<Options>comparator - java instance.public Options setMergeOperatorName(String name)
ColumnFamilyOptionsInterfaceSet the merge operator to be used for merging two merge operands of the same key. The merge function is invoked during compaction and at lookup time, if multiple key/value pairs belonging to the same key are found in the database.
setMergeOperatorName in interface ColumnFamilyOptionsInterface<Options>name - the name of the merge function, as defined by
the MergeOperators factory (see utilities/MergeOperators.h)
The merge function is specified by name and must be one of the
standard merge operators provided by RocksDB. The available
operators are "put", "uint64add", "stringappend" and "stringappendtest".public Options setMergeOperator(MergeOperator mergeOperator)
ColumnFamilyOptionsInterfaceSet the merge operator to be used for merging two different key/value pairs that share the same key. The merge function is invoked during compaction and at lookup time, if multiple key/value pairs belonging to the same key are found in the database.
setMergeOperator in interface ColumnFamilyOptionsInterface<Options>mergeOperator - MergeOperator instance.public Options setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.setCompactionFilterFactory(AbstractCompactionFilterFactory)
instead.
The client should specify only set one of the two.
ColumnFamilyOptionsInterface.setCompactionFilter(AbstractCompactionFilter) takes precedence
over ColumnFamilyOptionsInterface.setCompactionFilterFactory(AbstractCompactionFilterFactory)
if the client specifies both.
If multithreaded compaction is being used, the supplied CompactionFilter
instance may be used from different threads concurrently and so should be thread-safe.setCompactionFilter in interface ColumnFamilyOptionsInterface<Options>compactionFilter - AbstractCompactionFilter instance.public AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter()
ColumnFamilyOptionsInterfacecompactionFilter in interface ColumnFamilyOptionsInterface<Options>public Options setCompactionFilterFactory(AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory)
ColumnFamilyOptionsInterfaceAbstractCompactionFilter objects
which allow an application to modify/delete a key-value during background
compaction.
A new filter will be created on each compaction run. If multithreaded
compaction is being used, each created CompactionFilter will only be used
from a single thread and so does not need to be thread-safe.setCompactionFilterFactory in interface ColumnFamilyOptionsInterface<Options>compactionFilterFactory - AbstractCompactionFilterFactory instance.public AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory()
ColumnFamilyOptionsInterfacecompactionFilterFactory in interface ColumnFamilyOptionsInterface<Options>public Options setWriteBufferSize(long writeBufferSize)
MutableColumnFamilyOptionsInterfacemax_write_buffer_number write buffers may be held in memory
at the same time, so you may wish to adjust this parameter
to control memory usage.
Also, a larger write buffer will result in a longer recovery time
the next time the database is opened.
Default: 64MBsetWriteBufferSize in interface MutableColumnFamilyOptionsInterface<Options>writeBufferSize - the size of write buffer.public long writeBufferSize()
MutableColumnFamilyOptionsInterfacewriteBufferSize in interface MutableColumnFamilyOptionsInterface<Options>MutableColumnFamilyOptionsInterface.setWriteBufferSize(long)public Options setMaxWriteBufferNumber(int maxWriteBufferNumber)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxWriteBufferNumber in interface AdvancedMutableColumnFamilyOptionsInterface<Options>maxWriteBufferNumber - maximum number of write buffers.public int maxWriteBufferNumber()
AdvancedMutableColumnFamilyOptionsInterfacemaxWriteBufferNumber in interface AdvancedMutableColumnFamilyOptionsInterface<Options>AdvancedMutableColumnFamilyOptionsInterface.setMaxWriteBufferNumber(int)public boolean errorIfExists()
DBOptionsInterfaceerrorIfExists in interface DBOptionsInterface<Options>public Options setErrorIfExists(boolean errorIfExists)
DBOptionsInterfacesetErrorIfExists in interface DBOptionsInterface<Options>errorIfExists - if true, an exception will be thrown
during RocksDB.open() if the database already exists.RocksDB.open(org.rocksdb.Options, String)public boolean paranoidChecks()
DBOptionsInterfaceparanoidChecks in interface DBOptionsInterface<Options>public Options setParanoidChecks(boolean paranoidChecks)
DBOptionsInterfacesetParanoidChecks in interface DBOptionsInterface<Options>paranoidChecks - a flag to indicate whether paranoid-check
is on.public int maxOpenFiles()
MutableDBOptionsInterfacetarget_file_size_base and target_file_size_multiplier
for level-based compaction. For universal-style compaction, you can usually
set it to -1.
Default: -1maxOpenFiles in interface MutableDBOptionsInterface<Options>public Options setMaxFileOpeningThreads(int maxFileOpeningThreads)
DBOptionsInterfaceMutableDBOptionsInterface.maxOpenFiles() is -1, DB will open
all files on DB::Open(). You can use this option to increase the number
of threads used to open the files.
Default: 16setMaxFileOpeningThreads in interface DBOptionsInterface<Options>maxFileOpeningThreads - the maximum number of threads to use to
open filespublic int maxFileOpeningThreads()
DBOptionsInterfaceMutableDBOptionsInterface.maxOpenFiles() is -1, DB will open all
files on DB::Open(). You can use this option to increase the number of
threads used to open the files.
Default: 16maxFileOpeningThreads in interface DBOptionsInterface<Options>public Options setMaxTotalWalSize(long maxTotalWalSize)
MutableDBOptionsInterfaceSet the max total write-ahead log size. Once write-ahead logs exceed this size, we will start forcing the flush of column families whose memtables are backed by the oldest live WAL file
The oldest WAL files are the ones that are causing all the space amplification.
For example, with 15 column families, each withwrite_buffer_size = 128 MB
max_write_buffer_number = 6
max_total_wal_size will be calculated to be [15 * 128MB * 6] * 4 =
45GB
The RocksDB wiki has some discussion about how the WAL interacts with memtables and flushing of column families, at ...
If set to 0 (default), we will dynamically choose the WAL size limit to be [sum of all write_buffer_size * max_write_buffer_number] * 4
This option takes effect only when there are more than one column family as otherwise the wal size is dictated by the write_buffer_size.
Default: 0
setMaxTotalWalSize in interface MutableDBOptionsInterface<Options>maxTotalWalSize - max total wal size.public long maxTotalWalSize()
MutableDBOptionsInterfaceReturns the max total write-ahead log size. Once write-ahead logs exceed this size, we will start forcing the flush of column families whose memtables are backed by the oldest live WAL file.
The oldest WAL files are the ones that are causing all the space amplification.
For example, with 15 column families, each withwrite_buffer_size = 128 MB
max_write_buffer_number = 6
max_total_wal_size will be calculated to be [15 * 128MB * 6] * 4 =
45GB
The RocksDB wiki has some discussion about how the WAL interacts with memtables and flushing of column families, at ...
If set to 0 (default), we will dynamically choose the WAL size limit to be [sum of all write_buffer_size * max_write_buffer_number] * 4
This option takes effect only when there are more than one column family as otherwise the wal size is dictated by the write_buffer_size.
Default: 0
If set to 0 (default), we will dynamically choose the WAL size limit to be [sum of all write_buffer_size * max_write_buffer_number] * 4
maxTotalWalSize in interface MutableDBOptionsInterface<Options>public Options setMaxOpenFiles(int maxOpenFiles)
MutableDBOptionsInterfacetarget_file_size_base and target_file_size_multiplier
for level-based compaction. For universal-style compaction, you can usually
set it to -1.
Default: -1setMaxOpenFiles in interface MutableDBOptionsInterface<Options>maxOpenFiles - the maximum number of open files.public boolean useFsync()
DBOptionsInterfaceIf true, then every store to stable storage will issue a fsync.
If false, then every store to stable storage will issue a fdatasync. This parameter should be set to true while storing data to filesystem like ext3 that can lose files after a reboot.
useFsync in interface DBOptionsInterface<Options>public Options setUseFsync(boolean useFsync)
DBOptionsInterfaceIf true, then every store to stable storage will issue a fsync.
If false, then every store to stable storage will issue a fdatasync. This parameter should be set to true while storing data to filesystem like ext3 that can lose files after a reboot.
Default: false
setUseFsync in interface DBOptionsInterface<Options>useFsync - a boolean flag to specify whether to use fsyncpublic Options setDbPaths(Collection<DbPath> dbPaths)
DBOptionsInterfacesetDbPaths in interface DBOptionsInterface<Options>dbPaths - the paths and target sizespublic List<DbPath> dbPaths()
DBOptionsInterfaceCollections.emptyList()dbPaths in interface DBOptionsInterface<Options>public String dbLogDir()
DBOptionsInterfacedbLogDir in interface DBOptionsInterface<Options>public Options setDbLogDir(String dbLogDir)
DBOptionsInterfacesetDbLogDir in interface DBOptionsInterface<Options>dbLogDir - the path to the info log directorypublic String walDir()
DBOptionsInterfacewalDir in interface DBOptionsInterface<Options>public Options setWalDir(String walDir)
DBOptionsInterfacesetWalDir in interface DBOptionsInterface<Options>walDir - the path to the write-ahead-log directory.public long deleteObsoleteFilesPeriodMicros()
DBOptionsInterfacedeleteObsoleteFilesPeriodMicros in interface DBOptionsInterface<Options>deleteObsoleteFilesPeriodMicros in interface MutableDBOptionsInterface<Options>public Options setDeleteObsoleteFilesPeriodMicros(long micros)
DBOptionsInterfacesetDeleteObsoleteFilesPeriodMicros in interface DBOptionsInterface<Options>setDeleteObsoleteFilesPeriodMicros in interface MutableDBOptionsInterface<Options>micros - the time interval in micros@Deprecated public int maxBackgroundCompactions()
MutableDBOptionsInterfacemaxBackgroundCompactions in interface MutableDBOptionsInterface<Options>Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority)public Options setStatistics(Statistics statistics)
DBOptionsInterfaceSets the statistics object which collects metrics about database operations. Statistics objects should not be shared between DB instances as it does not use any locks to prevent concurrent updates.
setStatistics in interface DBOptionsInterface<Options>statistics - The statistics to setRocksDB.open(org.rocksdb.Options, String)public Statistics statistics()
DBOptionsInterfaceReturns statistics object.
statistics in interface DBOptionsInterface<Options>DBOptionsInterface.setStatistics(Statistics)@Deprecated public Options setMaxBackgroundCompactions(int maxBackgroundCompactions)
MutableDBOptionsInterfacesetMaxBackgroundCompactions in interface MutableDBOptionsInterface<Options>maxBackgroundCompactions - the maximum number of background
compaction jobs.Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority),
DBOptionsInterface.maxBackgroundFlushes()public Options setMaxSubcompactions(int maxSubcompactions)
DBOptionsInterfacesetMaxSubcompactions in interface DBOptionsInterface<Options>maxSubcompactions - The maximum number of threads that will
concurrently perform a compaction jobpublic int maxSubcompactions()
DBOptionsInterfacemaxSubcompactions in interface DBOptionsInterface<Options>@Deprecated public int maxBackgroundFlushes()
DBOptionsInterfacemaxBackgroundFlushes in interface DBOptionsInterface<Options>Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority)@Deprecated public Options setMaxBackgroundFlushes(int maxBackgroundFlushes)
DBOptionsInterfacesetMaxBackgroundFlushes in interface DBOptionsInterface<Options>maxBackgroundFlushes - number of max concurrent flush jobsEnv.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority),
MutableDBOptionsInterface.maxBackgroundCompactions()public int maxBackgroundJobs()
MutableDBOptionsInterfacemaxBackgroundJobs in interface MutableDBOptionsInterface<Options>public Options setMaxBackgroundJobs(int maxBackgroundJobs)
MutableDBOptionsInterfacesetMaxBackgroundJobs in interface MutableDBOptionsInterface<Options>maxBackgroundJobs - number of max concurrent background jobspublic long maxLogFileSize()
DBOptionsInterfacemaxLogFileSize in interface DBOptionsInterface<Options>public Options setMaxLogFileSize(long maxLogFileSize)
DBOptionsInterfacesetMaxLogFileSize in interface DBOptionsInterface<Options>maxLogFileSize - the maximum size of a info log file.public long logFileTimeToRoll()
DBOptionsInterfacelogFileTimeToRoll in interface DBOptionsInterface<Options>public Options setLogFileTimeToRoll(long logFileTimeToRoll)
DBOptionsInterfacesetLogFileTimeToRoll in interface DBOptionsInterface<Options>logFileTimeToRoll - the time interval in seconds.public long keepLogFileNum()
DBOptionsInterfacekeepLogFileNum in interface DBOptionsInterface<Options>public Options setKeepLogFileNum(long keepLogFileNum)
DBOptionsInterfacesetKeepLogFileNum in interface DBOptionsInterface<Options>keepLogFileNum - the maximum number of info log files to be kept.public Options setRecycleLogFileNum(long recycleLogFileNum)
DBOptionsInterfacesetRecycleLogFileNum in interface DBOptionsInterface<Options>recycleLogFileNum - the number of log files to keep for recyclingpublic long recycleLogFileNum()
DBOptionsInterfacerecycleLogFileNum in interface DBOptionsInterface<Options>public long maxManifestFileSize()
DBOptionsInterfacemaxManifestFileSize in interface DBOptionsInterface<Options>public Options setMaxManifestFileSize(long maxManifestFileSize)
DBOptionsInterfacesetMaxManifestFileSize in interface DBOptionsInterface<Options>maxManifestFileSize - the size limit of a manifest file.public Options setMaxTableFilesSizeFIFO(long maxTableFilesSize)
ColumnFamilyOptionsInterfacesetMaxTableFilesSizeFIFO in interface ColumnFamilyOptionsInterface<Options>maxTableFilesSize - the size limit of the total sum of table files.public long maxTableFilesSizeFIFO()
ColumnFamilyOptionsInterfacemaxTableFilesSizeFIFO in interface ColumnFamilyOptionsInterface<Options>public int tableCacheNumshardbits()
DBOptionsInterfacetableCacheNumshardbits in interface DBOptionsInterface<Options>public Options setTableCacheNumshardbits(int tableCacheNumshardbits)
DBOptionsInterfacesetTableCacheNumshardbits in interface DBOptionsInterface<Options>tableCacheNumshardbits - the number of chardspublic long walTtlSeconds()
DBOptionsInterfacewalTtlSeconds in interface DBOptionsInterface<Options>DBOptionsInterface.walSizeLimitMB()public Options setWalTtlSeconds(long walTtlSeconds)
DBOptionsInterfaceDBOptionsInterface.walTtlSeconds() and DBOptionsInterface.walSizeLimitMB() affect how archived logs
will be deleted.
setWalTtlSeconds in interface DBOptionsInterface<Options>walTtlSeconds - the ttl secondsDBOptionsInterface.setWalSizeLimitMB(long)public long walSizeLimitMB()
DBOptionsInterfaceDBOptionsInterface.walTtlSeconds() and #walSizeLimitMB() affect how archived logs
will be deleted.
walSizeLimitMB in interface DBOptionsInterface<Options>DBOptionsInterface.walSizeLimitMB()public Options setMaxWriteBatchGroupSizeBytes(long maxWriteBatchGroupSizeBytes)
DBOptionsInterfacesetMaxWriteBatchGroupSizeBytes in interface DBOptionsInterface<Options>maxWriteBatchGroupSizeBytes - the maximum limit of number of bytes, see description.public long maxWriteBatchGroupSizeBytes()
DBOptionsInterfacemaxWriteBatchGroupSizeBytes in interface DBOptionsInterface<Options>public Options setWalSizeLimitMB(long sizeLimitMB)
DBOptionsInterfacesetWalSizeLimitMB in interface DBOptionsInterface<Options>sizeLimitMB - size limit in mega-bytes.DBOptionsInterface.setWalSizeLimitMB(long)public long manifestPreallocationSize()
DBOptionsInterfacemanifestPreallocationSize in interface DBOptionsInterface<Options>public Options setManifestPreallocationSize(long size)
DBOptionsInterfacesetManifestPreallocationSize in interface DBOptionsInterface<Options>size - the size in bytepublic Options setUseDirectReads(boolean useDirectReads)
DBOptionsInterfacesetUseDirectReads in interface DBOptionsInterface<Options>useDirectReads - if true, then direct read is enabledpublic boolean useDirectReads()
DBOptionsInterfaceuseDirectReads in interface DBOptionsInterface<Options>public Options setUseDirectIoForFlushAndCompaction(boolean useDirectIoForFlushAndCompaction)
DBOptionsInterfacesetUseDirectIoForFlushAndCompaction in interface DBOptionsInterface<Options>useDirectIoForFlushAndCompaction - if true, then direct
I/O will be enabled for background flush and compactionspublic boolean useDirectIoForFlushAndCompaction()
DBOptionsInterfaceuseDirectIoForFlushAndCompaction in interface DBOptionsInterface<Options>public Options setAllowFAllocate(boolean allowFAllocate)
DBOptionsInterfacesetAllowFAllocate in interface DBOptionsInterface<Options>allowFAllocate - false if fallocate() calls are bypassedpublic boolean allowFAllocate()
DBOptionsInterfaceallowFAllocate in interface DBOptionsInterface<Options>public boolean allowMmapReads()
DBOptionsInterfaceallowMmapReads in interface DBOptionsInterface<Options>public Options setAllowMmapReads(boolean allowMmapReads)
DBOptionsInterfacesetAllowMmapReads in interface DBOptionsInterface<Options>allowMmapReads - true if mmap reads are allowed.public boolean allowMmapWrites()
DBOptionsInterfaceallowMmapWrites in interface DBOptionsInterface<Options>public Options setAllowMmapWrites(boolean allowMmapWrites)
DBOptionsInterfacesetAllowMmapWrites in interface DBOptionsInterface<Options>allowMmapWrites - true if mmap writes are allowd.public boolean isFdCloseOnExec()
DBOptionsInterfaceisFdCloseOnExec in interface DBOptionsInterface<Options>public Options setIsFdCloseOnExec(boolean isFdCloseOnExec)
DBOptionsInterfacesetIsFdCloseOnExec in interface DBOptionsInterface<Options>isFdCloseOnExec - true if child process inheriting open
files is disabled.public int statsDumpPeriodSec()
MutableDBOptionsInterfacestatsDumpPeriodSec in interface MutableDBOptionsInterface<Options>public Options setStatsDumpPeriodSec(int statsDumpPeriodSec)
MutableDBOptionsInterfacesetStatsDumpPeriodSec in interface MutableDBOptionsInterface<Options>statsDumpPeriodSec - time interval in seconds.public Options setStatsPersistPeriodSec(int statsPersistPeriodSec)
MutableDBOptionsInterfacestatsPersistPeriodSec
Default: 600setStatsPersistPeriodSec in interface MutableDBOptionsInterface<Options>statsPersistPeriodSec - time interval in seconds.public int statsPersistPeriodSec()
MutableDBOptionsInterfacestatsPersistPeriodSecstatsPersistPeriodSec in interface MutableDBOptionsInterface<Options>public Options setStatsHistoryBufferSize(long statsHistoryBufferSize)
MutableDBOptionsInterfacestatsHistoryBufferSize
Default: 1MBsetStatsHistoryBufferSize in interface MutableDBOptionsInterface<Options>statsHistoryBufferSize - the size of the buffer.public long statsHistoryBufferSize()
MutableDBOptionsInterfacestatsHistoryBufferSizestatsHistoryBufferSize in interface MutableDBOptionsInterface<Options>public boolean adviseRandomOnOpen()
DBOptionsInterfaceadviseRandomOnOpen in interface DBOptionsInterface<Options>public Options setAdviseRandomOnOpen(boolean adviseRandomOnOpen)
DBOptionsInterfacesetAdviseRandomOnOpen in interface DBOptionsInterface<Options>adviseRandomOnOpen - true if hinting random access is on.public Options setDbWriteBufferSize(long dbWriteBufferSize)
DBOptionsInterfaceColumnFamilyOptions.writeBufferSize(),
which enforces a limit for a single memtable.
This feature is disabled by default. Specify a non-zero value
to enable it.
Default: 0 (disabled)setDbWriteBufferSize in interface DBOptionsInterface<Options>dbWriteBufferSize - the size of the write bufferpublic Options setWriteBufferManager(WriteBufferManager writeBufferManager)
DBOptionsInterfaceWriteBufferManager to control memory usage across
multiple column families and/or DB instances.
Check
https://github.com/facebook/rocksdb/wiki/Write-Buffer-Manager
for more details on when to use itsetWriteBufferManager in interface DBOptionsInterface<Options>writeBufferManager - The WriteBufferManager to usepublic WriteBufferManager writeBufferManager()
DBOptionsInterfaceWriteBufferManager used by it. writeBufferManager in interface DBOptionsInterface<Options>public long dbWriteBufferSize()
DBOptionsInterfaceColumnFamilyOptions.writeBufferSize(),
which enforces a limit for a single memtable.
This feature is disabled by default. Specify a non-zero value
to enable it.
Default: 0 (disabled)dbWriteBufferSize in interface DBOptionsInterface<Options>public Options setAccessHintOnCompactionStart(AccessHint accessHint)
DBOptionsInterfaceAccessHint.NORMALsetAccessHintOnCompactionStart in interface DBOptionsInterface<Options>accessHint - The access hintpublic AccessHint accessHintOnCompactionStart()
DBOptionsInterfaceAccessHint.NORMALaccessHintOnCompactionStart in interface DBOptionsInterface<Options>public Options setCompactionReadaheadSize(long compactionReadaheadSize)
MutableDBOptionsInterfacesetCompactionReadaheadSize in interface MutableDBOptionsInterface<Options>compactionReadaheadSize - The compaction read-ahead sizepublic long compactionReadaheadSize()
MutableDBOptionsInterfacecompactionReadaheadSize in interface MutableDBOptionsInterface<Options>public Options setRandomAccessMaxBufferSize(long randomAccessMaxBufferSize)
DBOptionsInterfaceMutableDBOptionsInterface.compactionReadaheadSize() value and
always try to read ahead.
With read-ahead we always pre-allocate buffer to the size instead of
growing it up to a limit.
This option is currently honored only on Windows
Default: 1 Mb
Special value: 0 - means do not maintain per instance buffer. Allocate
per request buffer and avoid locking.setRandomAccessMaxBufferSize in interface DBOptionsInterface<Options>randomAccessMaxBufferSize - the maximum size of the random access
bufferpublic long randomAccessMaxBufferSize()
DBOptionsInterfaceMutableDBOptionsInterface.compactionReadaheadSize() value and
always try to read ahead. With read-ahead we always pre-allocate buffer
to the size instead of growing it up to a limit.
This option is currently honored only on Windows
Default: 1 Mb
Special value: 0 - means do not maintain per instance buffer. Allocate
per request buffer and avoid locking.randomAccessMaxBufferSize in interface DBOptionsInterface<Options>public Options setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
MutableDBOptionsInterfacesetWritableFileMaxBufferSize in interface MutableDBOptionsInterface<Options>writableFileMaxBufferSize - the maximum buffer sizepublic long writableFileMaxBufferSize()
MutableDBOptionsInterfacewritableFileMaxBufferSize in interface MutableDBOptionsInterface<Options>public boolean useAdaptiveMutex()
DBOptionsInterfaceuseAdaptiveMutex in interface DBOptionsInterface<Options>public Options setUseAdaptiveMutex(boolean useAdaptiveMutex)
DBOptionsInterfacesetUseAdaptiveMutex in interface DBOptionsInterface<Options>useAdaptiveMutex - true if adaptive mutex is used.public long bytesPerSync()
MutableDBOptionsInterfacebytesPerSync in interface MutableDBOptionsInterface<Options>public Options setBytesPerSync(long bytesPerSync)
MutableDBOptionsInterfacesetBytesPerSync in interface MutableDBOptionsInterface<Options>bytesPerSync - size in bytespublic Options setWalBytesPerSync(long walBytesPerSync)
MutableDBOptionsInterfaceMutableDBOptionsInterface.setBytesPerSync(long) , but applies to WAL files
Default: 0, turned offsetWalBytesPerSync in interface MutableDBOptionsInterface<Options>walBytesPerSync - size in bytespublic long walBytesPerSync()
MutableDBOptionsInterfaceMutableDBOptionsInterface.bytesPerSync() , but applies to WAL files
Default: 0, turned offwalBytesPerSync in interface MutableDBOptionsInterface<Options>public Options setStrictBytesPerSync(boolean strictBytesPerSync)
MutableDBOptionsInterfaceMutableDBOptionsInterface.walBytesPerSync()
bytes submitted for writeback at any given time, and SST files have at most
MutableDBOptionsInterface.bytesPerSync() bytes pending writeback at any given time. This
can be used to handle cases where processing speed exceeds I/O speed
during file generation, which can lead to a huge sync when the file is
finished, even with MutableDBOptionsInterface.bytesPerSync() / MutableDBOptionsInterface.walBytesPerSync()
properly configured.
- If `sync_file_range` is supported it achieves this by waiting for any
prior `sync_file_range`s to finish before proceeding. In this way,
processing (compression, etc.) can proceed uninhibited in the gap
between `sync_file_range`s, and we block only when I/O falls
behind.
- Otherwise the `WritableFile::Sync` method is used. Note this mechanism
always blocks, thus preventing the interleaving of I/O and processing.
Note: Enabling this option does not provide any additional persistence
guarantees, as it may use `sync_file_range`, which does not write out
metadata.
Default: falsesetStrictBytesPerSync in interface MutableDBOptionsInterface<Options>strictBytesPerSync - the bytes per syncpublic boolean strictBytesPerSync()
MutableDBOptionsInterfaceMutableDBOptionsInterface.setStrictBytesPerSync(boolean)strictBytesPerSync in interface MutableDBOptionsInterface<Options>public Options setListeners(List<AbstractEventListener> listeners)
DBOptionsInterfaceEventListeners whose callback functions
will be called when specific RocksDB event happens.
Note: the RocksJava API currently only supports EventListeners implemented in Java.
It could be extended in future to also support adding/removing EventListeners implemented in
C++.setListeners in interface DBOptionsInterface<Options>listeners - the listeners who should be notified on various events.public List<AbstractEventListener> listeners()
DBOptionsInterfaceEventListeners whose callback functions
will be called when specific RocksDB event happens.
Note: the RocksJava API currently only supports EventListeners implemented in Java.
It could be extended in future to also support adding/removing EventListeners implemented in
C++.listeners in interface DBOptionsInterface<Options>public Options setEnableThreadTracking(boolean enableThreadTracking)
DBOptionsInterfacesetEnableThreadTracking in interface DBOptionsInterface<Options>enableThreadTracking - true to enable trackingpublic boolean enableThreadTracking()
DBOptionsInterfaceenableThreadTracking in interface DBOptionsInterface<Options>public Options setDelayedWriteRate(long delayedWriteRate)
MutableDBOptionsInterfaceColumnFamilyOptions.softPendingCompactionBytesLimit() or
ColumnFamilyOptions.level0SlowdownWritesTrigger() is triggered,
or we are writing to the last mem table allowed and we allow more than 3
mem tables. It is calculated using size of user write requests before
compression. RocksDB may decide to slow down more if the compaction still
gets behind further.
If the value is 0, we will infer a value from `rater_limiter` value
if it is not empty, or 16MB if `rater_limiter` is empty. Note that
if users change the rate in `rate_limiter` after DB is opened,
`delayed_write_rate` won't be adjusted.
Unit: bytes per second.
Default: 0
Dynamically changeable through RocksDB.setDBOptions(MutableDBOptions).setDelayedWriteRate in interface MutableDBOptionsInterface<Options>delayedWriteRate - the rate in bytes per secondpublic long delayedWriteRate()
MutableDBOptionsInterfaceColumnFamilyOptions.softPendingCompactionBytesLimit() or
ColumnFamilyOptions.level0SlowdownWritesTrigger() is triggered,
or we are writing to the last mem table allowed and we allow more than 3
mem tables. It is calculated using size of user write requests before
compression. RocksDB may decide to slow down more if the compaction still
gets behind further.
If the value is 0, we will infer a value from `rater_limiter` value
if it is not empty, or 16MB if `rater_limiter` is empty. Note that
if users change the rate in `rate_limiter` after DB is opened,
`delayed_write_rate` won't be adjusted.
Unit: bytes per second.
Default: 0
Dynamically changeable through RocksDB.setDBOptions(MutableDBOptions).delayedWriteRate in interface MutableDBOptionsInterface<Options>public Options setEnablePipelinedWrite(boolean enablePipelinedWrite)
DBOptionsInterfaceDBOptionsInterface.enablePipelinedWrite() is true, separate write thread queue is
maintained for WAL write and memtable write. A write thread first enter WAL
writer queue and then memtable writer queue. Pending thread on the WAL
writer queue thus only have to wait for previous writers to finish their
WAL writing but not the memtable writing. Enabling the feature may improve
write throughput and reduce latency of the prepare phase of two-phase
commit.
Default: falsesetEnablePipelinedWrite in interface DBOptionsInterface<Options>enablePipelinedWrite - true to enabled pipelined writespublic boolean enablePipelinedWrite()
DBOptionsInterfaceDBOptionsInterface.setEnablePipelinedWrite(boolean).enablePipelinedWrite in interface DBOptionsInterface<Options>public Options setUnorderedWrite(boolean unorderedWrite)
DBOptionsInterfaceDBOptionsInterface.unorderedWrite() to true trades higher write throughput with
relaxing the immutability guarantee of snapshots. This violates the
repeatability one expects from ::Get from a snapshot, as well as
::MultiGet and Iterator's consistent-point-in-time view property.
If the application cannot tolerate the relaxed guarantees, it can implement
its own mechanisms to work around that and yet benefit from the higher
throughput. Using TransactionDB with WRITE_PREPARED write policy and
DBOptionsInterface.twoWriteQueues() true is one way to achieve immutable snapshots despite
unordered_write.
By default, i.e., when it is false, rocksdb does not advance the sequence
number for new snapshots unless all the writes with lower sequence numbers
are already finished. This provides the immutability that we except from
snapshots. Moreover, since Iterator and MultiGet internally depend on
snapshots, the snapshot immutability results into Iterator and MultiGet
offering consistent-point-in-time view. If set to true, although
Read-Your-Own-Write property is still provided, the snapshot immutability
property is relaxed: the writes issued after the snapshot is obtained (with
larger sequence numbers) will be still not visible to the reads from that
snapshot, however, there still might be pending writes (with lower sequence
number) that will change the state visible to the snapshot after they are
landed to the memtable.setUnorderedWrite in interface DBOptionsInterface<Options>unorderedWrite - true to enabled unordered writepublic boolean unorderedWrite()
DBOptionsInterfaceDBOptionsInterface.setUnorderedWrite(boolean).unorderedWrite in interface DBOptionsInterface<Options>public Options setAllowConcurrentMemtableWrite(boolean allowConcurrentMemtableWrite)
DBOptionsInterfaceDBOptionsInterface.setEnableWriteThreadAdaptiveYield(boolean) if you are going to use
this feature.
Default: truesetAllowConcurrentMemtableWrite in interface DBOptionsInterface<Options>allowConcurrentMemtableWrite - true to enable concurrent writes
for the memtablepublic boolean allowConcurrentMemtableWrite()
DBOptionsInterfaceDBOptionsInterface.setEnableWriteThreadAdaptiveYield(boolean) if you are going to use
this feature.
Default: trueallowConcurrentMemtableWrite in interface DBOptionsInterface<Options>public Options setEnableWriteThreadAdaptiveYield(boolean enableWriteThreadAdaptiveYield)
DBOptionsInterfaceDBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. This can substantially improve throughput for concurrent workloads,
regardless of whether DBOptionsInterface.allowConcurrentMemtableWrite() is enabled.
Default: truesetEnableWriteThreadAdaptiveYield in interface DBOptionsInterface<Options>enableWriteThreadAdaptiveYield - true to enable adaptive yield for the
write threadspublic boolean enableWriteThreadAdaptiveYield()
DBOptionsInterfaceDBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. This can substantially improve throughput for concurrent workloads,
regardless of whether DBOptionsInterface.allowConcurrentMemtableWrite() is enabled.
Default: trueenableWriteThreadAdaptiveYield in interface DBOptionsInterface<Options>public Options setWriteThreadMaxYieldUsec(long writeThreadMaxYieldUsec)
DBOptionsInterfaceDBOptionsInterface.writeThreadSlowYieldUsec() is
set properly) increasing this value is likely to increase RocksDB
throughput at the expense of increased CPU usage.
Default: 100setWriteThreadMaxYieldUsec in interface DBOptionsInterface<Options>writeThreadMaxYieldUsec - maximum number of microsecondspublic long writeThreadMaxYieldUsec()
DBOptionsInterfaceDBOptionsInterface.writeThreadSlowYieldUsec() is
set properly) increasing this value is likely to increase RocksDB
throughput at the expense of increased CPU usage.
Default: 100writeThreadMaxYieldUsec in interface DBOptionsInterface<Options>public Options setWriteThreadSlowYieldUsec(long writeThreadSlowYieldUsec)
DBOptionsInterfacesetWriteThreadSlowYieldUsec in interface DBOptionsInterface<Options>writeThreadSlowYieldUsec - the latency in microsecondspublic long writeThreadSlowYieldUsec()
DBOptionsInterfacewriteThreadSlowYieldUsec in interface DBOptionsInterface<Options>public Options setSkipStatsUpdateOnDbOpen(boolean skipStatsUpdateOnDbOpen)
DBOptionsInterfacesetSkipStatsUpdateOnDbOpen in interface DBOptionsInterface<Options>skipStatsUpdateOnDbOpen - true if updating stats will be skippedpublic boolean skipStatsUpdateOnDbOpen()
DBOptionsInterfaceskipStatsUpdateOnDbOpen in interface DBOptionsInterface<Options>public Options setSkipCheckingSstFileSizesOnDbOpen(boolean skipCheckingSstFileSizesOnDbOpen)
DBOptionsInterfaceRocksDB.open(String) will not fetch and check sizes of all sst files.
This may significantly speed up startup if there are many sst files,
especially when using non-default Env with expensive GetFileSize().
We'll still check that all required sst files exist.
If paranoid_checks is false, this option is ignored, and sst files are
not checked at all.
Default: falsesetSkipCheckingSstFileSizesOnDbOpen in interface DBOptionsInterface<Options>skipCheckingSstFileSizesOnDbOpen - if true, then SST file sizes will not be checked
when calling RocksDB.open(String).public boolean skipCheckingSstFileSizesOnDbOpen()
DBOptionsInterfaceRocksDB.open(String) will not fetch and check sizes of all sst files.
This may significantly speed up startup if there are many sst files,
especially when using non-default Env with expensive GetFileSize().
We'll still check that all required sst files exist.
If paranoid_checks is false, this option is ignored, and sst files are
not checked at all.
Default: falseskipCheckingSstFileSizesOnDbOpen in interface DBOptionsInterface<Options>RocksDB.open(String).public Options setWalRecoveryMode(WALRecoveryMode walRecoveryMode)
DBOptionsInterfaceWALRecoveryMode.PointInTimeRecoverysetWalRecoveryMode in interface DBOptionsInterface<Options>walRecoveryMode - The WAL recover modepublic WALRecoveryMode walRecoveryMode()
DBOptionsInterfaceWALRecoveryMode.PointInTimeRecoverywalRecoveryMode in interface DBOptionsInterface<Options>public Options setAllow2pc(boolean allow2pc)
DBOptionsInterfacesetAllow2pc in interface DBOptionsInterface<Options>allow2pc - true if two-phase-commit is enabledpublic boolean allow2pc()
DBOptionsInterfaceallow2pc in interface DBOptionsInterface<Options>public Options setRowCache(Cache rowCache)
DBOptionsInterfacesetRowCache in interface DBOptionsInterface<Options>rowCache - The global row cachepublic Cache rowCache()
DBOptionsInterfacerowCache in interface DBOptionsInterface<Options>public Options setWalFilter(AbstractWalFilter walFilter)
DBOptionsInterfacesetWalFilter in interface DBOptionsInterface<Options>walFilter - the filter for processing WALs during recovery.public WalFilter walFilter()
DBOptionsInterfaceDBOptionsInterface.setWalFilter(AbstractWalFilter).walFilter in interface DBOptionsInterface<Options>public Options setFailIfOptionsFileError(boolean failIfOptionsFileError)
DBOptionsInterfacesetFailIfOptionsFileError in interface DBOptionsInterface<Options>failIfOptionsFileError - true if we should fail if there is an error
in the options filepublic boolean failIfOptionsFileError()
DBOptionsInterfacefailIfOptionsFileError in interface DBOptionsInterface<Options>public Options setDumpMallocStats(boolean dumpMallocStats)
DBOptionsInterfacesetDumpMallocStats in interface DBOptionsInterface<Options>dumpMallocStats - true if malloc stats should be printed to LOGpublic boolean dumpMallocStats()
DBOptionsInterfacedumpMallocStats in interface DBOptionsInterface<Options>public Options setAvoidFlushDuringRecovery(boolean avoidFlushDuringRecovery)
DBOptionsInterfacesetAvoidFlushDuringRecovery in interface DBOptionsInterface<Options>avoidFlushDuringRecovery - true to try to avoid (but not guarantee
not to) flush during recoverypublic boolean avoidFlushDuringRecovery()
DBOptionsInterfaceavoidFlushDuringRecovery in interface DBOptionsInterface<Options>public Options setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
MutableDBOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.setAvoidFlushDuringShutdown in interface MutableDBOptionsInterface<Options>avoidFlushDuringShutdown - true if we should avoid flush during
shutdownpublic boolean avoidFlushDuringShutdown()
MutableDBOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.avoidFlushDuringShutdown in interface MutableDBOptionsInterface<Options>public Options setAllowIngestBehind(boolean allowIngestBehind)
DBOptionsInterfacesetAllowIngestBehind in interface DBOptionsInterface<Options>allowIngestBehind - true to allow ingest behind, false to disallow.public boolean allowIngestBehind()
DBOptionsInterfaceDBOptionsInterface.setAllowIngestBehind(boolean).allowIngestBehind in interface DBOptionsInterface<Options>public Options setTwoWriteQueues(boolean twoWriteQueues)
DBOptionsInterfacesetTwoWriteQueues in interface DBOptionsInterface<Options>twoWriteQueues - true to enable two write queues, false otherwise.public boolean twoWriteQueues()
DBOptionsInterfacetwoWriteQueues in interface DBOptionsInterface<Options>public Options setManualWalFlush(boolean manualWalFlush)
DBOptionsInterfacesetManualWalFlush in interface DBOptionsInterface<Options>manualWalFlush - true to set disable automatic WAL flushing,
false otherwise.public boolean manualWalFlush()
DBOptionsInterfaceDBOptionsInterface.setManualWalFlush(boolean).manualWalFlush in interface DBOptionsInterface<Options>public MemTableConfig memTableConfig()
ColumnFamilyOptionsInterfacememTableConfig in interface ColumnFamilyOptionsInterface<Options>public Options setMemTableConfig(MemTableConfig config)
ColumnFamilyOptionsInterfacesetMemTableConfig in interface ColumnFamilyOptionsInterface<Options>config - the mem-table config.public Options setRateLimiter(RateLimiter rateLimiter)
DBOptionsInterfacesetRateLimiter in interface DBOptionsInterface<Options>rateLimiter - RateLimiter instance.public Options setSstFileManager(SstFileManager sstFileManager)
DBOptionsInterfacesetSstFileManager in interface DBOptionsInterface<Options>sstFileManager - The SST File Manager for the db.public Options setLogger(Logger logger)
DBOptionsInterfaceAny internal progress/error information generated by the db will be written to the Logger if it is non-nullptr, or to a file stored in the same directory as the DB contents if info_log is nullptr.
Default: nullptr
setLogger in interface DBOptionsInterface<Options>logger - Logger instance.public Options setInfoLogLevel(InfoLogLevel infoLogLevel)
DBOptionsInterfaceSets the RocksDB log level. Default level is INFO
setInfoLogLevel in interface DBOptionsInterface<Options>infoLogLevel - log level to set.public InfoLogLevel infoLogLevel()
DBOptionsInterfaceReturns currently set log level.
infoLogLevel in interface DBOptionsInterface<Options>InfoLogLevel instance.public String memTableFactoryName()
ColumnFamilyOptionsInterfacememTableFactoryName in interface ColumnFamilyOptionsInterface<Options>ColumnFamilyOptionsInterface.setTableFormatConfig(org.rocksdb.TableFormatConfig)public TableFormatConfig tableFormatConfig()
ColumnFamilyOptionsInterfacetableFormatConfig in interface ColumnFamilyOptionsInterface<Options>public Options setTableFormatConfig(TableFormatConfig config)
ColumnFamilyOptionsInterfacesetTableFormatConfig in interface ColumnFamilyOptionsInterface<Options>config - the table format config.public String tableFactoryName()
tableFactoryName in interface ColumnFamilyOptionsInterface<Options>public Options setCfPaths(Collection<DbPath> cfPaths)
ColumnFamilyOptionsInterfacesetCfPaths in interface ColumnFamilyOptionsInterface<Options>cfPaths - collection of paths for SST files.public List<DbPath> cfPaths()
cfPaths in interface ColumnFamilyOptionsInterface<Options>public Options useFixedLengthPrefixExtractor(int n)
ColumnFamilyOptionsInterfaceuseFixedLengthPrefixExtractor in interface ColumnFamilyOptionsInterface<Options>n - use the first n bytes of a key as its prefix.public Options useCappedPrefixExtractor(int n)
ColumnFamilyOptionsInterfaceuseCappedPrefixExtractor in interface ColumnFamilyOptionsInterface<Options>n - use the first n bytes of a key as its prefix.public CompressionType compressionType()
MutableColumnFamilyOptionsInterfacecompressionType in interface MutableColumnFamilyOptionsInterface<Options>public Options setCompressionPerLevel(List<CompressionType> compressionLevels)
AdvancedColumnFamilyOptionsInterfaceDifferent levels can have different compression policies. There are cases where most lower levels would like to use quick compression algorithms while the higher levels (which have more data) use compression algorithms that have better compression but could be slower. This array, if non-empty, should have an entry for each level of the database; these override the value specified in the previous field 'compression'.
NOTICEIf level_compaction_dynamic_level_bytes=true,
compression_per_level[0] still determines L0,
but other elements of the array are based on base level
(the level L0 files are merged to), and may not
match the level users see from info log for metadata.
If L0 files are merged to level - n,
then, for i>0, compression_per_level[i]
determines compaction type for level n+i-1.
For example, if we have 5 levels, and we determine to
merge L0 data to L4 (which means L1..L3
will be empty), then the new files go to L4 uses
compression type compression_per_level[1].
If now L0 is merged to L2. Data goes to
L2 will be compressed according to
compression_per_level[1], L3 using
compression_per_level[2]and L4 using
compression_per_level[3]. Compaction for each
level can change when data grows.
Default: empty
setCompressionPerLevel in interface AdvancedColumnFamilyOptionsInterface<Options>compressionLevels - list of
CompressionType instances.public List<CompressionType> compressionPerLevel()
AdvancedColumnFamilyOptionsInterfaceReturn the currently set CompressionType
per instances.
See: AdvancedColumnFamilyOptionsInterface.setCompressionPerLevel(java.util.List)
compressionPerLevel in interface AdvancedColumnFamilyOptionsInterface<Options>CompressionType
instances.public Options setCompressionType(CompressionType compressionType)
MutableColumnFamilyOptionsInterfacesetCompressionType in interface MutableColumnFamilyOptionsInterface<Options>compressionType - Compression Type.public Options setBottommostCompressionType(CompressionType bottommostCompressionType)
ColumnFamilyOptionsInterfaceCompressionType.DISABLE_COMPRESSION_OPTIONsetBottommostCompressionType in interface ColumnFamilyOptionsInterface<Options>bottommostCompressionType - The compression type to use for the
bottommost levelpublic CompressionType bottommostCompressionType()
ColumnFamilyOptionsInterfaceCompressionType.DISABLE_COMPRESSION_OPTIONbottommostCompressionType in interface ColumnFamilyOptionsInterface<Options>public Options setBottommostCompressionOptions(CompressionOptions bottommostCompressionOptions)
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.bottommostCompressionType() if it is enabled.
To enable it, please see the definition of
CompressionOptions.setBottommostCompressionOptions in interface ColumnFamilyOptionsInterface<Options>bottommostCompressionOptions - the bottom most compression options.public CompressionOptions bottommostCompressionOptions()
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.setBottommostCompressionOptions(CompressionOptions).bottommostCompressionOptions in interface ColumnFamilyOptionsInterface<Options>public Options setCompressionOptions(CompressionOptions compressionOptions)
ColumnFamilyOptionsInterfacesetCompressionOptions in interface ColumnFamilyOptionsInterface<Options>compressionOptions - The compression optionspublic CompressionOptions compressionOptions()
ColumnFamilyOptionsInterfacecompressionOptions in interface ColumnFamilyOptionsInterface<Options>public CompactionStyle compactionStyle()
AdvancedColumnFamilyOptionsInterfacecompactionStyle in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setCompactionStyle(CompactionStyle compactionStyle)
AdvancedColumnFamilyOptionsInterfacesetCompactionStyle in interface AdvancedColumnFamilyOptionsInterface<Options>compactionStyle - Compaction style.public int numLevels()
AdvancedColumnFamilyOptionsInterfacenumLevels in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setNumLevels(int numLevels)
AdvancedColumnFamilyOptionsInterfacesetNumLevels in interface AdvancedColumnFamilyOptionsInterface<Options>numLevels - the number of levels.public int levelZeroFileNumCompactionTrigger()
ColumnFamilyOptionsInterfacelevelZeroFileNumCompactionTrigger in interface ColumnFamilyOptionsInterface<Options>public Options setLevelZeroFileNumCompactionTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroFileNumCompactionTrigger in interface ColumnFamilyOptionsInterface<Options>numFiles - the number of files in level-0 to trigger compaction.public int levelZeroSlowdownWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroSlowdownWritesTrigger in interface ColumnFamilyOptionsInterface<Options>public Options setLevelZeroSlowdownWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroSlowdownWritesTrigger in interface ColumnFamilyOptionsInterface<Options>numFiles - soft limit on number of level-0 files.public int levelZeroStopWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroStopWritesTrigger in interface ColumnFamilyOptionsInterface<Options>public Options setLevelZeroStopWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroStopWritesTrigger in interface ColumnFamilyOptionsInterface<Options>numFiles - the hard limit of the number of level-0 files.public long targetFileSizeBase()
AdvancedMutableColumnFamilyOptionsInterfacetargetFileSizeBase in interface AdvancedMutableColumnFamilyOptionsInterface<Options>AdvancedMutableColumnFamilyOptionsInterface.targetFileSizeMultiplier()public Options setTargetFileSizeBase(long targetFileSizeBase)
AdvancedMutableColumnFamilyOptionsInterfacesetTargetFileSizeBase in interface AdvancedMutableColumnFamilyOptionsInterface<Options>targetFileSizeBase - the target size of a level-0 file.AdvancedMutableColumnFamilyOptionsInterface.setTargetFileSizeMultiplier(int)public int targetFileSizeMultiplier()
AdvancedMutableColumnFamilyOptionsInterfacetargetFileSizeMultiplier in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setTargetFileSizeMultiplier(int multiplier)
AdvancedMutableColumnFamilyOptionsInterfacesetTargetFileSizeMultiplier in interface AdvancedMutableColumnFamilyOptionsInterface<Options>multiplier - the size ratio between a level-(L+1) file
and level-L file.public Options setMaxBytesForLevelBase(long maxBytesForLevelBase)
MutableColumnFamilyOptionsInterfacesetMaxBytesForLevelBase in interface MutableColumnFamilyOptionsInterface<Options>maxBytesForLevelBase - maximum bytes for level base.AdvancedMutableColumnFamilyOptionsInterface.setMaxBytesForLevelMultiplier(double)public long maxBytesForLevelBase()
MutableColumnFamilyOptionsInterfacemaxBytesForLevelBase in interface MutableColumnFamilyOptionsInterface<Options>AdvancedMutableColumnFamilyOptionsInterface.maxBytesForLevelMultiplier()public Options setLevelCompactionDynamicLevelBytes(boolean enableLevelCompactionDynamicLevelBytes)
AdvancedColumnFamilyOptionsInterfaceIf true, RocksDB will pick target size of each level
dynamically. We will pick a base level b >= 1. L0 will be
directly merged into level b, instead of always into level 1.
Level 1 to b-1 need to be empty. We try to pick b and its target
size so that
At the same time max_bytes_for_level_multiplier and max_bytes_for_level_multiplier_additional are still satisfied.
With this option on, from an empty DB, we make last level the base
level, which means merging L0 data into the last level, until it exceeds
max_bytes_for_level_base. And then we make the second last level to be
base level, to start to merge L0 data to second last level, with its
target size to be 1/max_bytes_for_level_multiplier of the last
levels extra size. After the data accumulates more so that we need to
move the base level to the third last one, and so on.
Example
For example, assume max_bytes_for_level_multiplier=10,
num_levels=6, and max_bytes_for_level_base=10MB.
Target sizes of level 1 to 5 starts with:
[- - - - 10MB]
with base level is level. Target sizes of level 1 to 4 are not applicable because they will not be used. Until the size of Level 5 grows to more than 10MB, say 11MB, we make base target to level 4 and now the targets looks like:
[- - - 1.1MB 11MB]
While data are accumulated, size targets are tuned based on actual data of level 5. When level 5 has 50MB of data, the target is like:
[- - - 5MB 50MB]
Until level 5's actual size is more than 100MB, say 101MB. Now if we keep level 4 to be the base level, its target size needs to be 10.1MB, which doesn't satisfy the target size range. So now we make level 3 the target size and the target sizes of the levels look like:
[- - 1.01MB 10.1MB 101MB]
In the same way, while level 5 further grows, all levels' targets grow, like
[- - 5MB 50MB 500MB]
Until level 5 exceeds 1000MB and becomes 1001MB, we make level 2 the base level and make levels' target sizes like this:
[- 1.001MB 10.01MB 100.1MB 1001MB]
and go on...
By doing it, we give max_bytes_for_level_multiplier a priority
against max_bytes_for_level_base, for a more predictable LSM tree
shape. It is useful to limit worse case space amplification.
max_bytes_for_level_multiplier_additional is ignored with
this flag on.
Turning this feature on or off for an existing DB can cause unexpected LSM tree structure so it's not recommended.
Caution: this option is experimental
Default: false
setLevelCompactionDynamicLevelBytes in interface AdvancedColumnFamilyOptionsInterface<Options>enableLevelCompactionDynamicLevelBytes - boolean value indicating
if LevelCompactionDynamicLevelBytes shall be enabled.public boolean levelCompactionDynamicLevelBytes()
AdvancedColumnFamilyOptionsInterfaceReturn if LevelCompactionDynamicLevelBytes is enabled.
For further information see
AdvancedColumnFamilyOptionsInterface.setLevelCompactionDynamicLevelBytes(boolean)
levelCompactionDynamicLevelBytes in interface AdvancedColumnFamilyOptionsInterface<Options>levelCompactionDynamicLevelBytes is enabled.public double maxBytesForLevelMultiplier()
ColumnFamilyOptionsInterfacemaxBytesForLevelMultiplier in interface AdvancedMutableColumnFamilyOptionsInterface<Options>maxBytesForLevelMultiplier in interface ColumnFamilyOptionsInterface<Options>public Options setMaxBytesForLevelMultiplier(double multiplier)
ColumnFamilyOptionsInterfacesetMaxBytesForLevelMultiplier in interface AdvancedMutableColumnFamilyOptionsInterface<Options>setMaxBytesForLevelMultiplier in interface ColumnFamilyOptionsInterface<Options>multiplier - the ratio between the total size of level-(L+1)
files and the total size of level-L files for all L.public long maxCompactionBytes()
AdvancedColumnFamilyOptionsInterfacemaxCompactionBytes in interface AdvancedColumnFamilyOptionsInterface<Options>maxCompactionBytes in interface MutableColumnFamilyOptionsInterface<Options>MutableColumnFamilyOptionsInterface.setMaxCompactionBytes(long)public Options setMaxCompactionBytes(long maxCompactionBytes)
AdvancedColumnFamilyOptionsInterfacesetMaxCompactionBytes in interface AdvancedColumnFamilyOptionsInterface<Options>setMaxCompactionBytes in interface MutableColumnFamilyOptionsInterface<Options>maxCompactionBytes - the compaction size limitMutableColumnFamilyOptionsInterface.maxCompactionBytes()public long arenaBlockSize()
AdvancedMutableColumnFamilyOptionsInterfacearenaBlockSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setArenaBlockSize(long arenaBlockSize)
AdvancedMutableColumnFamilyOptionsInterfacesetArenaBlockSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>arenaBlockSize - the size of an arena blockpublic boolean disableAutoCompactions()
MutableColumnFamilyOptionsInterfacedisableAutoCompactions in interface MutableColumnFamilyOptionsInterface<Options>public Options setDisableAutoCompactions(boolean disableAutoCompactions)
MutableColumnFamilyOptionsInterfacesetDisableAutoCompactions in interface MutableColumnFamilyOptionsInterface<Options>disableAutoCompactions - true if auto-compactions are disabled.public long maxSequentialSkipInIterations()
AdvancedMutableColumnFamilyOptionsInterfacemaxSequentialSkipInIterations in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxSequentialSkipInIterations in interface AdvancedMutableColumnFamilyOptionsInterface<Options>maxSequentialSkipInIterations - the number of keys could
be skipped in a iteration.public boolean inplaceUpdateSupport()
AdvancedColumnFamilyOptionsInterfaceinplaceUpdateSupport in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setInplaceUpdateSupport(boolean inplaceUpdateSupport)
AdvancedColumnFamilyOptionsInterfacesetInplaceUpdateSupport in interface AdvancedColumnFamilyOptionsInterface<Options>inplaceUpdateSupport - true if thread-safe inplace updates
are allowed.public long inplaceUpdateNumLocks()
AdvancedMutableColumnFamilyOptionsInterfaceinplaceUpdateNumLocks in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
AdvancedMutableColumnFamilyOptionsInterfacesetInplaceUpdateNumLocks in interface AdvancedMutableColumnFamilyOptionsInterface<Options>inplaceUpdateNumLocks - the number of locks used for
inplace updates.public double memtablePrefixBloomSizeRatio()
AdvancedMutableColumnFamilyOptionsInterfacememtablePrefixBloomSizeRatio in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
AdvancedMutableColumnFamilyOptionsInterfacesetMemtablePrefixBloomSizeRatio in interface AdvancedMutableColumnFamilyOptionsInterface<Options>memtablePrefixBloomSizeRatio - the ratio of memtable used by the
bloom filter, 0 means no bloom filterpublic boolean memtableWholeKeyFiltering()
AdvancedMutableColumnFamilyOptionsInterfacememtableWholeKeyFiltering in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMemtableWholeKeyFiltering(boolean memtableWholeKeyFiltering)
AdvancedMutableColumnFamilyOptionsInterfacesetMemtableWholeKeyFiltering in interface AdvancedMutableColumnFamilyOptionsInterface<Options>memtableWholeKeyFiltering - true if whole key bloom filter is enabled
in memtablepublic int bloomLocality()
AdvancedColumnFamilyOptionsInterfacebloomLocality in interface AdvancedColumnFamilyOptionsInterface<Options>AdvancedColumnFamilyOptionsInterface.setBloomLocality(int)public Options setBloomLocality(int bloomLocality)
AdvancedColumnFamilyOptionsInterfacesetBloomLocality in interface AdvancedColumnFamilyOptionsInterface<Options>bloomLocality - the level of locality of bloom-filter probes.public long maxSuccessiveMerges()
AdvancedMutableColumnFamilyOptionsInterfacemaxSuccessiveMerges in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxSuccessiveMerges(long maxSuccessiveMerges)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxSuccessiveMerges in interface AdvancedMutableColumnFamilyOptionsInterface<Options>maxSuccessiveMerges - the maximum number of successive merges.public int minWriteBufferNumberToMerge()
AdvancedColumnFamilyOptionsInterfaceminWriteBufferNumberToMerge in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
AdvancedColumnFamilyOptionsInterfacesetMinWriteBufferNumberToMerge in interface AdvancedColumnFamilyOptionsInterface<Options>minWriteBufferNumberToMerge - the minimum number of write buffers
that will be merged together.public Options setOptimizeFiltersForHits(boolean optimizeFiltersForHits)
AdvancedColumnFamilyOptionsInterfaceThis flag specifies that the implementation should optimize the filters mainly for cases where keys are found rather than also optimize for keys missed. This would be used in cases where the application knows that there are very few misses or the performance in the case of misses is not important.
For now, this flag allows us to not store filters for the last level i.e the largest level which contains data of the LSM store. For keys which are hits, the filters in this level are not useful because we will search for the data anyway.
NOTE: the filters in other levels are still useful even for key hit because they tell us whether to look in that level or go to the higher level.
Default: false
setOptimizeFiltersForHits in interface AdvancedColumnFamilyOptionsInterface<Options>optimizeFiltersForHits - boolean value indicating if this flag is set.public boolean optimizeFiltersForHits()
AdvancedColumnFamilyOptionsInterfaceReturns the current state of the optimize_filters_for_hits
setting.
optimizeFiltersForHits in interface AdvancedColumnFamilyOptionsInterface<Options>optimize_filters_for_hits was set.public Options setMemtableHugePageSize(long memtableHugePageSize)
AdvancedMutableColumnFamilyOptionsInterfacesetMemtableHugePageSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>memtableHugePageSize - The page size of the huge
page tlbpublic long memtableHugePageSize()
AdvancedMutableColumnFamilyOptionsInterfacememtableHugePageSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
AdvancedMutableColumnFamilyOptionsInterfacesetSoftPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<Options>softPendingCompactionBytesLimit - The soft limit to impose on
compactionpublic long softPendingCompactionBytesLimit()
AdvancedMutableColumnFamilyOptionsInterfacesoftPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
AdvancedMutableColumnFamilyOptionsInterfacesetHardPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<Options>hardPendingCompactionBytesLimit - The hard limit to impose on
compactionpublic long hardPendingCompactionBytesLimit()
AdvancedMutableColumnFamilyOptionsInterfacehardPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
MutableColumnFamilyOptionsInterfacesetLevel0FileNumCompactionTrigger in interface MutableColumnFamilyOptionsInterface<Options>level0FileNumCompactionTrigger - The number of files to trigger
level-0 compactionpublic int level0FileNumCompactionTrigger()
MutableColumnFamilyOptionsInterfacelevel0FileNumCompactionTrigger in interface MutableColumnFamilyOptionsInterface<Options>public Options setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
AdvancedMutableColumnFamilyOptionsInterfacesetLevel0SlowdownWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<Options>level0SlowdownWritesTrigger - The soft limit on the number of
level-0 filespublic int level0SlowdownWritesTrigger()
AdvancedMutableColumnFamilyOptionsInterfacelevel0SlowdownWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setLevel0StopWritesTrigger(int level0StopWritesTrigger)
AdvancedMutableColumnFamilyOptionsInterfacesetLevel0StopWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<Options>level0StopWritesTrigger - The maximum number of level-0 filespublic int level0StopWritesTrigger()
AdvancedMutableColumnFamilyOptionsInterfacelevel0StopWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxBytesForLevelMultiplierAdditional in interface AdvancedMutableColumnFamilyOptionsInterface<Options>maxBytesForLevelMultiplierAdditional - The max-size multipliers
for each levelpublic int[] maxBytesForLevelMultiplierAdditional()
AdvancedMutableColumnFamilyOptionsInterfacemaxBytesForLevelMultiplierAdditional in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setParanoidFileChecks(boolean paranoidFileChecks)
AdvancedMutableColumnFamilyOptionsInterfacesetParanoidFileChecks in interface AdvancedMutableColumnFamilyOptionsInterface<Options>paranoidFileChecks - true to enable paranoid file checkspublic boolean paranoidFileChecks()
AdvancedMutableColumnFamilyOptionsInterfaceparanoidFileChecks in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxWriteBufferNumberToMaintain(int maxWriteBufferNumberToMaintain)
AdvancedColumnFamilyOptionsInterfaceAdvancedMutableColumnFamilyOptionsInterface.maxWriteBufferNumber(),
this parameter does not affect flushing.
This controls the minimum amount of write history that will be available
in memory for conflict checking when Transactions are used.
When using an OptimisticTransactionDB:
If this value is too low, some transactions may fail at commit time due
to not being able to determine whether there were any write conflicts.
When using a TransactionDB:
If Transaction::SetSnapshot is used, TransactionDB will read either
in-memory write buffers or SST files to do write-conflict checking.
Increasing this value can reduce the number of reads to SST files
done for conflict detection.
Setting this value to 0 will cause write buffers to be freed immediately
after they are flushed.
If this value is set to -1,
AdvancedMutableColumnFamilyOptionsInterface.maxWriteBufferNumber()
will be used.
Default:
If using a TransactionDB/OptimisticTransactionDB, the default value will
be set to the value of
AdvancedMutableColumnFamilyOptionsInterface.maxWriteBufferNumber()
if it is not explicitly set by the user. Otherwise, the default is 0.setMaxWriteBufferNumberToMaintain in interface AdvancedColumnFamilyOptionsInterface<Options>maxWriteBufferNumberToMaintain - The maximum number of write
buffers to maintainpublic int maxWriteBufferNumberToMaintain()
AdvancedColumnFamilyOptionsInterfacemaxWriteBufferNumberToMaintain in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setCompactionPriority(CompactionPriority compactionPriority)
AdvancedColumnFamilyOptionsInterfaceAdvancedColumnFamilyOptionsInterface.compactionStyle() == CompactionStyle.LEVEL,
for each level, which files are prioritized to be picked to compact.
Default: CompactionPriority.ByCompensatedSizesetCompactionPriority in interface AdvancedColumnFamilyOptionsInterface<Options>compactionPriority - The compaction prioritypublic CompactionPriority compactionPriority()
AdvancedColumnFamilyOptionsInterfacecompactionPriority in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setReportBgIoStats(boolean reportBgIoStats)
AdvancedMutableColumnFamilyOptionsInterfacesetReportBgIoStats in interface AdvancedMutableColumnFamilyOptionsInterface<Options>reportBgIoStats - true to enable reportingpublic boolean reportBgIoStats()
AdvancedMutableColumnFamilyOptionsInterfacereportBgIoStats in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setTtl(long ttl)
AdvancedMutableColumnFamilyOptionsInterfaceMutableDBOptionsInterface.maxOpenFiles() to be
set to -1.
Enabled only for level compaction for now.
Default: 0 (disabled)
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setTtl in interface AdvancedMutableColumnFamilyOptionsInterface<Options>ttl - the time-to-live.public long ttl()
AdvancedMutableColumnFamilyOptionsInterfaceAdvancedMutableColumnFamilyOptionsInterface.setTtl(long).ttl in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setPeriodicCompactionSeconds(long periodicCompactionSeconds)
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setPeriodicCompactionSeconds in interface AdvancedMutableColumnFamilyOptionsInterface<Options>periodicCompactionSeconds - the periodic compaction in seconds.public long periodicCompactionSeconds()
AdvancedMutableColumnFamilyOptionsInterfaceAdvancedMutableColumnFamilyOptionsInterface.setPeriodicCompactionSeconds(long).periodicCompactionSeconds in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setCompactionOptionsUniversal(CompactionOptionsUniversal compactionOptionsUniversal)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsUniversal in interface AdvancedColumnFamilyOptionsInterface<Options>compactionOptionsUniversal - The Universal Style compaction optionspublic CompactionOptionsUniversal compactionOptionsUniversal()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsUniversal in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setCompactionOptionsFIFO(CompactionOptionsFIFO compactionOptionsFIFO)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsFIFO in interface AdvancedColumnFamilyOptionsInterface<Options>compactionOptionsFIFO - The FIFO compaction optionspublic CompactionOptionsFIFO compactionOptionsFIFO()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsFIFO in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setForceConsistencyChecks(boolean forceConsistencyChecks)
AdvancedColumnFamilyOptionsInterfacesetForceConsistencyChecks in interface AdvancedColumnFamilyOptionsInterface<Options>forceConsistencyChecks - true to force consistency checkspublic boolean forceConsistencyChecks()
AdvancedColumnFamilyOptionsInterfaceforceConsistencyChecks in interface AdvancedColumnFamilyOptionsInterface<Options>public Options setAtomicFlush(boolean atomicFlush)
DBOptionsInterfaceRocksDB.flush(FlushOptions, List).
For auto-triggered flush, RocksDB atomically flushes ALL column families.
Currently, any WAL-enabled writes after atomic flush may be replayed
independently if the process crashes later and tries to recover.setAtomicFlush in interface DBOptionsInterface<Options>atomicFlush - true to enable atomic flush of multiple column families.public boolean atomicFlush()
DBOptionsInterfaceDBOptionsInterface.setAtomicFlush(boolean).atomicFlush in interface DBOptionsInterface<Options>public Options setAvoidUnnecessaryBlockingIO(boolean avoidUnnecessaryBlockingIO)
DBOptionsInterfaceReadOptions.setBackgroundPurgeOnIteratorCleanup(boolean).setAvoidUnnecessaryBlockingIO in interface DBOptionsInterface<Options>avoidUnnecessaryBlockingIO - If true, working thread may avoid doing unnecessary
operation.public boolean avoidUnnecessaryBlockingIO()
DBOptionsInterfaceReadOptions.setBackgroundPurgeOnIteratorCleanup(boolean).avoidUnnecessaryBlockingIO in interface DBOptionsInterface<Options>public Options setPersistStatsToDisk(boolean persistStatsToDisk)
DBOptionsInterfacesetPersistStatsToDisk in interface DBOptionsInterface<Options>persistStatsToDisk - true if stats should be persisted to hidden column family.public boolean persistStatsToDisk()
DBOptionsInterfacepersistStatsToDisk in interface DBOptionsInterface<Options>public Options setWriteDbidToManifest(boolean writeDbidToManifest)
DBOptionsInterfacesetWriteDbidToManifest in interface DBOptionsInterface<Options>writeDbidToManifest - if true, then DB ID will be written to Manifest file.public boolean writeDbidToManifest()
DBOptionsInterfacewriteDbidToManifest in interface DBOptionsInterface<Options>public Options setLogReadaheadSize(long logReadaheadSize)
DBOptionsInterfacesetLogReadaheadSize in interface DBOptionsInterface<Options>logReadaheadSize - the number of bytes to prefetch when reading the log.public long logReadaheadSize()
DBOptionsInterfacelogReadaheadSize in interface DBOptionsInterface<Options>public Options setBestEffortsRecovery(boolean bestEffortsRecovery)
DBOptionsInterfacesetBestEffortsRecovery in interface DBOptionsInterface<Options>bestEffortsRecovery - if true, RocksDB will use best-efforts mode when recovering.public boolean bestEffortsRecovery()
DBOptionsInterfacebestEffortsRecovery in interface DBOptionsInterface<Options>public Options setMaxBgErrorResumeCount(int maxBgerrorResumeCount)
DBOptionsInterfacesetMaxBgErrorResumeCount in interface DBOptionsInterface<Options>maxBgerrorResumeCount - maximum number of times db resume should be called when IO Error
happens.public int maxBgerrorResumeCount()
DBOptionsInterfacemaxBgerrorResumeCount in interface DBOptionsInterface<Options>public Options setBgerrorResumeRetryInterval(long bgerrorResumeRetryInterval)
DBOptionsInterfacesetBgerrorResumeRetryInterval in interface DBOptionsInterface<Options>bgerrorResumeRetryInterval - how many microseconds to wait between DB resume attempts.public long bgerrorResumeRetryInterval()
DBOptionsInterfacebgerrorResumeRetryInterval in interface DBOptionsInterface<Options>public Options setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory)
ColumnFamilyOptionsInterfacesetSstPartitionerFactory in interface ColumnFamilyOptionsInterface<Options>sstPartitionerFactory - The factory referencepublic SstPartitionerFactory sstPartitionerFactory()
ColumnFamilyOptionsInterfacesstPartitionerFactory in interface ColumnFamilyOptionsInterface<Options>public Options setCompactionThreadLimiter(ConcurrentTaskLimiter compactionThreadLimiter)
ColumnFamilyOptionsInterfacesetCompactionThreadLimiter in interface ColumnFamilyOptionsInterface<Options>compactionThreadLimiter - The compaction thread limiter.public ConcurrentTaskLimiter compactionThreadLimiter()
ColumnFamilyOptionsInterfacecompactionThreadLimiter in interface ColumnFamilyOptionsInterface<Options>public Options setEnableBlobFiles(boolean enableBlobFiles)
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setEnableBlobFiles in interface AdvancedMutableColumnFamilyOptionsInterface<Options>enableBlobFiles - true iff blob files should be enabledpublic boolean enableBlobFiles()
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).enableBlobFiles in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMinBlobSize(long minBlobSize)
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setMinBlobSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>minBlobSize - the size of the smallest value to be stored separately in a blob filepublic long minBlobSize()
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).minBlobSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobFileSize(long blobFileSize)
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setBlobFileSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>blobFileSize - the size limit for blob filespublic long blobFileSize()
AdvancedMutableColumnFamilyOptionsInterfaceblobFileSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobCompressionType(CompressionType compressionType)
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setBlobCompressionType in interface AdvancedMutableColumnFamilyOptionsInterface<Options>compressionType - the compression algorithm to use.public CompressionType blobCompressionType()
AdvancedMutableColumnFamilyOptionsInterfaceblobCompressionType in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setEnableBlobGarbageCollection(boolean enableBlobGarbageCollection)
AdvancedMutableColumnFamilyOptionsInterfacesetEnableBlobGarbageCollection in interface AdvancedMutableColumnFamilyOptionsInterface<Options>enableBlobGarbageCollection - the new enabled/disabled state of blob garbage collectionpublic boolean enableBlobGarbageCollection()
AdvancedMutableColumnFamilyOptionsInterfaceenableBlobGarbageCollection in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobGarbageCollectionAgeCutoff(double blobGarbageCollectionAgeCutoff)
AdvancedMutableColumnFamilyOptionsInterfacesetBlobGarbageCollectionAgeCutoff in interface AdvancedMutableColumnFamilyOptionsInterface<Options>blobGarbageCollectionAgeCutoff - the new age cutoffpublic double blobGarbageCollectionAgeCutoff()
AdvancedMutableColumnFamilyOptionsInterfaceblobGarbageCollectionAgeCutoff in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobGarbageCollectionForceThreshold(double blobGarbageCollectionForceThreshold)
AdvancedMutableColumnFamilyOptionsInterfaceAdvancedMutableColumnFamilyOptionsInterface.blobGarbageCollectionAgeCutoff() above. This option is
currently only supported with leveled compactions.
Note that AdvancedMutableColumnFamilyOptionsInterface.enableBlobGarbageCollection() has to be set in order for this
option to have any effect.
Default: 1.0
Dynamically changeable through the SetOptions() APIsetBlobGarbageCollectionForceThreshold in interface AdvancedMutableColumnFamilyOptionsInterface<Options>blobGarbageCollectionForceThreshold - new value for the thresholdpublic double blobGarbageCollectionForceThreshold()
AdvancedMutableColumnFamilyOptionsInterfaceAdvancedMutableColumnFamilyOptionsInterface.blobGarbageCollectionForceThreshold()blobGarbageCollectionForceThreshold in interface AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobCompactionReadaheadSize(long blobCompactionReadaheadSize)
AdvancedMutableColumnFamilyOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setBlobCompactionReadaheadSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>blobCompactionReadaheadSize - the compaction readahead for blob filespublic long blobCompactionReadaheadSize()
AdvancedMutableColumnFamilyOptionsInterfaceblobCompactionReadaheadSize in interface AdvancedMutableColumnFamilyOptionsInterface<Options>protected final void disposeInternal(long handle)
disposeInternal in class RocksObjectCopyright © 2022. All rights reserved.