public static class MutableDBOptions.MutableDBOptionsBuilder extends AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey> implements MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,org.rocksdb.MutableDBOptions.MutableDBOptionKey> |
allKeys()
Get all of the possible keys
|
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.
|
int |
baseBackgroundCompactions()
NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the
value of max_background_jobs.
|
protected MutableDBOptions |
build(String[] keys,
String[] values)
Construct a sub-class instance of
AbstractMutableOptions. |
long |
bytesPerSync()
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
long |
compactionReadaheadSize()
If non-zero, we perform bigger reads when doing compaction.
|
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.
|
int |
maxBackgroundCompactions()
Deprecated.
|
int |
maxBackgroundJobs()
Returns the maximum number of concurrent background jobs (both flushes
and compactions combined).
|
int |
maxOpenFiles()
Number of open files that can be used by the DB.
|
long |
maxTotalWalSize()
Returns the max total wal size.
|
protected MutableDBOptions.MutableDBOptionsBuilder |
self() |
MutableDBOptions.MutableDBOptionsBuilder |
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.
|
void |
setBaseBackgroundCompactions(int baseBackgroundCompactions)
Deprecated.
|
MutableDBOptions.MutableDBOptionsBuilder |
setBytesPerSync(long bytesPerSync)
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
MutableDBOptions.MutableDBOptionsBuilder |
setCompactionReadaheadSize(long compactionReadaheadSize)
If non-zero, we perform bigger reads when doing compaction.
|
MutableDBOptions.MutableDBOptionsBuilder |
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. |
MutableDBOptions.MutableDBOptionsBuilder |
setDeleteObsoleteFilesPeriodMicros(long micros)
The periodicity when obsolete files get deleted.
|
MutableDBOptions.MutableDBOptionsBuilder |
setMaxBackgroundCompactions(int maxBackgroundCompactions)
Deprecated.
|
MutableDBOptions.MutableDBOptionsBuilder |
setMaxBackgroundJobs(int maxBackgroundJobs)
Specifies the maximum number of concurrent background jobs (both flushes
and compactions combined).
|
MutableDBOptions.MutableDBOptionsBuilder |
setMaxOpenFiles(int maxOpenFiles)
Number of open files that can be used by the DB.
|
MutableDBOptions.MutableDBOptionsBuilder |
setMaxTotalWalSize(long maxTotalWalSize)
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 (i.e. the ones that are causing all the space amplification).
|
MutableDBOptions.MutableDBOptionsBuilder |
setStatsDumpPeriodSec(int statsDumpPeriodSec)
if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 600 (10 minutes)
|
MutableDBOptions.MutableDBOptionsBuilder |
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 |
MutableDBOptions.MutableDBOptionsBuilder |
setStatsPersistPeriodSec(int statsPersistPeriodSec)
If not zero, dump rocksdb.stats to RocksDB every
statsPersistPeriodSec
Default: 600 |
MutableDBOptions.MutableDBOptionsBuilder |
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. |
MutableDBOptions.MutableDBOptionsBuilder |
setWalBytesPerSync(long walBytesPerSync)
Same as
MutableDBOptionsInterface.setBytesPerSync(long) , but applies to WAL files
Default: 0, turned off |
MutableDBOptions.MutableDBOptionsBuilder |
setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
This is the maximum buffer size that is used by WritableFileWriter.
|
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.
|
long |
walBytesPerSync()
Same as
MutableDBOptionsInterface.bytesPerSync() , but applies to WAL files
Default: 0, turned off |
long |
writableFileMaxBufferSize()
This is the maximum buffer size that is used by WritableFileWriter.
|
build, fromString, getBoolean, getDouble, getEnum, getInt, getIntArray, getLong, setBoolean, setDouble, setEnum, setInt, setIntArray, setLongprotected MutableDBOptions.MutableDBOptionsBuilder self()
self in class AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>protected Map<String,org.rocksdb.MutableDBOptions.MutableDBOptionKey> allKeys()
AbstractMutableOptions.AbstractMutableOptionsBuilderallKeys in class AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>protected MutableDBOptions build(String[] keys, String[] values)
AbstractMutableOptions.AbstractMutableOptionsBuilderAbstractMutableOptions.build in class AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>keys - the keysvalues - the valuespublic MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundJobs(int maxBackgroundJobs)
MutableDBOptionsInterfacesetMaxBackgroundJobs in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>maxBackgroundJobs - number of max concurrent background jobspublic int maxBackgroundJobs()
MutableDBOptionsInterfacemaxBackgroundJobs in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>@Deprecated public void setBaseBackgroundCompactions(int baseBackgroundCompactions)
MutableDBOptionsInterfacesetBaseBackgroundCompactions in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>baseBackgroundCompactions - Suggested number of background compaction
jobspublic int baseBackgroundCompactions()
MutableDBOptionsInterfacebaseBackgroundCompactions in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>@Deprecated public MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundCompactions(int maxBackgroundCompactions)
MutableDBOptionsInterfacesetMaxBackgroundCompactions in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>maxBackgroundCompactions - the maximum number of background
compaction jobs.Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority),
DBOptionsInterface.maxBackgroundFlushes()@Deprecated public int maxBackgroundCompactions()
MutableDBOptionsInterfacemaxBackgroundCompactions in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority)public MutableDBOptions.MutableDBOptionsBuilder setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
MutableDBOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.setAvoidFlushDuringShutdown in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>avoidFlushDuringShutdown - true if we should avoid flush during
shutdownpublic boolean avoidFlushDuringShutdown()
MutableDBOptionsInterfaceRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.avoidFlushDuringShutdown in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
MutableDBOptionsInterfacesetWritableFileMaxBufferSize in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>writableFileMaxBufferSize - the maximum buffer sizepublic long writableFileMaxBufferSize()
MutableDBOptionsInterfacewritableFileMaxBufferSize in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder 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<MutableDBOptions.MutableDBOptionsBuilder>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<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setMaxTotalWalSize(long maxTotalWalSize)
MutableDBOptionsInterfaceOnce 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 (i.e. the ones that are causing all the space amplification).
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] * 2
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<MutableDBOptions.MutableDBOptionsBuilder>maxTotalWalSize - max total wal size.public long maxTotalWalSize()
MutableDBOptionsInterfaceReturns the max total wal 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 (i.e. the ones that are causing all the space amplification).
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] * 2
maxTotalWalSize in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setDeleteObsoleteFilesPeriodMicros(long micros)
MutableDBOptionsInterfacesetDeleteObsoleteFilesPeriodMicros in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>micros - the time interval in microspublic long deleteObsoleteFilesPeriodMicros()
MutableDBOptionsInterfacedeleteObsoleteFilesPeriodMicros in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setStatsDumpPeriodSec(int statsDumpPeriodSec)
MutableDBOptionsInterfacesetStatsDumpPeriodSec in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>statsDumpPeriodSec - time interval in seconds.public int statsDumpPeriodSec()
MutableDBOptionsInterfacestatsDumpPeriodSec in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setStatsPersistPeriodSec(int statsPersistPeriodSec)
MutableDBOptionsInterfacestatsPersistPeriodSec
Default: 600setStatsPersistPeriodSec in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>statsPersistPeriodSec - time interval in seconds.public int statsPersistPeriodSec()
MutableDBOptionsInterfacestatsPersistPeriodSecstatsPersistPeriodSec in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setStatsHistoryBufferSize(long statsHistoryBufferSize)
MutableDBOptionsInterfacestatsHistoryBufferSize
Default: 1MBsetStatsHistoryBufferSize in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>statsHistoryBufferSize - the size of the buffer.public long statsHistoryBufferSize()
MutableDBOptionsInterfacestatsHistoryBufferSizestatsHistoryBufferSize in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder 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<MutableDBOptions.MutableDBOptionsBuilder>maxOpenFiles - the maximum number of open files.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<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setBytesPerSync(long bytesPerSync)
MutableDBOptionsInterfacesetBytesPerSync in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>bytesPerSync - size in bytespublic long bytesPerSync()
MutableDBOptionsInterfacebytesPerSync in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setWalBytesPerSync(long walBytesPerSync)
MutableDBOptionsInterfaceMutableDBOptionsInterface.setBytesPerSync(long) , but applies to WAL files
Default: 0, turned offsetWalBytesPerSync in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>walBytesPerSync - size in bytespublic long walBytesPerSync()
MutableDBOptionsInterfaceMutableDBOptionsInterface.bytesPerSync() , but applies to WAL files
Default: 0, turned offwalBytesPerSync in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder 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<MutableDBOptions.MutableDBOptionsBuilder>strictBytesPerSync - the bytes per syncpublic boolean strictBytesPerSync()
MutableDBOptionsInterfaceMutableDBOptionsInterface.setStrictBytesPerSync(boolean)strictBytesPerSync in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setCompactionReadaheadSize(long compactionReadaheadSize)
MutableDBOptionsInterfaceDBOptionsInterface.newTableReaderForCompactionInputs() to true.
Default: 0setCompactionReadaheadSize in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>compactionReadaheadSize - The compaction read-ahead sizepublic long compactionReadaheadSize()
MutableDBOptionsInterfaceDBOptionsInterface.newTableReaderForCompactionInputs() to true.
Default: 0compactionReadaheadSize in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>Copyright © 2021. All rights reserved.