public interface MutableDBOptionsInterface<T extends MutableDBOptionsInterface<T>>
Modifier and Type | Method and Description |
---|---|
boolean |
avoidFlushDuringShutdown()
By default RocksDB will flush all memtables on DB close if there are
unpersisted data (i.e.
|
int |
baseBackgroundCompactions()
NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the
value of max_background_jobs.
|
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.
|
T |
setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
By default RocksDB will flush all memtables on DB close if there are
unpersisted data (i.e.
|
void |
setBaseBackgroundCompactions(int baseBackgroundCompactions)
Deprecated.
|
T |
setBytesPerSync(long bytesPerSync)
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
T |
setCompactionReadaheadSize(long compactionReadaheadSize)
If non-zero, we perform bigger reads when doing compaction.
|
T |
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. |
T |
setDeleteObsoleteFilesPeriodMicros(long micros)
The periodicity when obsolete files get deleted.
|
T |
setMaxBackgroundCompactions(int maxBackgroundCompactions)
Deprecated.
|
T |
setMaxBackgroundJobs(int maxBackgroundJobs)
Specifies the maximum number of concurrent background jobs (both flushes
and compactions combined).
|
T |
setMaxOpenFiles(int maxOpenFiles)
Number of open files that can be used by the DB.
|
T |
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.
|
T |
setStatsDumpPeriodSec(int statsDumpPeriodSec)
if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 600 (10 minutes)
|
T |
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 |
T |
setStatsPersistPeriodSec(int statsPersistPeriodSec)
If not zero, dump rocksdb.stats to RocksDB every
statsPersistPeriodSec
Default: 600 |
T |
setStrictBytesPerSync(boolean strictBytesPerSync)
When true, guarantees WAL files have at most
walBytesPerSync()
bytes submitted for writeback at any given time, and SST files have at most
bytesPerSync() bytes pending writeback at any given time. |
T |
setWalBytesPerSync(long walBytesPerSync)
Same as
setBytesPerSync(long) , but applies to WAL files
Default: 0, turned off |
T |
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
bytesPerSync() , but applies to WAL files
Default: 0, turned off |
long |
writableFileMaxBufferSize()
This is the maximum buffer size that is used by WritableFileWriter.
|
T setMaxBackgroundJobs(int maxBackgroundJobs)
maxBackgroundJobs
- number of max concurrent background jobsint maxBackgroundJobs()
@Deprecated void setBaseBackgroundCompactions(int baseBackgroundCompactions)
setMaxBackgroundJobs(int)
baseBackgroundCompactions
- Suggested number of background compaction
jobsint baseBackgroundCompactions()
@Deprecated T setMaxBackgroundCompactions(int maxBackgroundCompactions)
setMaxBackgroundJobs(int)
maxBackgroundCompactions
- the maximum number of background
compaction jobs.Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, Priority)
,
DBOptionsInterface.maxBackgroundFlushes()
@Deprecated int maxBackgroundCompactions()
setMaxBackgroundJobs(int)
Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, Priority)
T setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.avoidFlushDuringShutdown
- true if we should avoid flush during
shutdownboolean avoidFlushDuringShutdown()
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.T setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
writableFileMaxBufferSize
- the maximum buffer sizelong writableFileMaxBufferSize()
T setDelayedWriteRate(long delayedWriteRate)
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. 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
- the rate in bytes per secondlong delayedWriteRate()
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. 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)
.T 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).
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
maxTotalWalSize
- max total wal size.long maxTotalWalSize()
Returns 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
T setDeleteObsoleteFilesPeriodMicros(long micros)
micros
- the time interval in microslong deleteObsoleteFilesPeriodMicros()
T setStatsDumpPeriodSec(int statsDumpPeriodSec)
statsDumpPeriodSec
- time interval in seconds.int statsDumpPeriodSec()
T setStatsPersistPeriodSec(int statsPersistPeriodSec)
statsPersistPeriodSec
Default: 600statsPersistPeriodSec
- time interval in seconds.int statsPersistPeriodSec()
statsPersistPeriodSec
T setStatsHistoryBufferSize(long statsHistoryBufferSize)
statsHistoryBufferSize
Default: 1MBstatsHistoryBufferSize
- the size of the buffer.long statsHistoryBufferSize()
statsHistoryBufferSize
T setMaxOpenFiles(int maxOpenFiles)
target_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
- the maximum number of open files.int maxOpenFiles()
target_file_size_base
and target_file_size_multiplier
for level-based compaction. For universal-style compaction, you can usually
set it to -1.
Default: -1T setBytesPerSync(long bytesPerSync)
bytesPerSync
- size in byteslong bytesPerSync()
T setWalBytesPerSync(long walBytesPerSync)
setBytesPerSync(long)
, but applies to WAL files
Default: 0, turned offwalBytesPerSync
- size in byteslong walBytesPerSync()
bytesPerSync()
, but applies to WAL files
Default: 0, turned offT setStrictBytesPerSync(boolean strictBytesPerSync)
walBytesPerSync()
bytes submitted for writeback at any given time, and SST files have at most
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 bytesPerSync()
/ 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: falsestrictBytesPerSync
- the bytes per syncboolean strictBytesPerSync()
setStrictBytesPerSync(boolean)
T setCompactionReadaheadSize(long compactionReadaheadSize)
DBOptionsInterface.newTableReaderForCompactionInputs()
to true.
Default: 0compactionReadaheadSize
- The compaction read-ahead sizelong compactionReadaheadSize()
DBOptionsInterface.newTableReaderForCompactionInputs()
to true.
Default: 0