public static class MutableDBOptions.MutableDBOptionsBuilder extends AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey> implements MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
| 限定符和类型 | 方法和说明 |
|---|---|
protected java.util.Map<java.lang.String,org.rocksdb.MutableDBOptions.MutableDBOptionKey> |
allKeys()
Get all 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.
|
protected MutableDBOptions |
build(java.lang.String[] keys,
java.lang.String[] values)
Construct a subclass 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()
已过时。
|
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 write-ahead log 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.
|
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)
已过时。
|
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)
Set the max total write-ahead log size.
|
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, fromParsed, getBoolean, getDouble, getEnum, getInt, getIntArray, getLong, getUnknown, setBoolean, setDouble, setEnum, setInt, setIntArray, setLongprotected MutableDBOptions.MutableDBOptionsBuilder self()
self 在类中 AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>protected java.util.Map<java.lang.String,org.rocksdb.MutableDBOptions.MutableDBOptionKey> allKeys()
allKeys 在类中 AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>protected MutableDBOptions build(java.lang.String[] keys, java.lang.String[] values)
AbstractMutableOptions.build 在类中 AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>keys - the keysvalues - the valuespublic MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundJobs(int maxBackgroundJobs)
MutableDBOptionsInterfacesetMaxBackgroundJobs 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>maxBackgroundJobs - number of max concurrent background jobspublic int maxBackgroundJobs()
MutableDBOptionsInterfacemaxBackgroundJobs 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>@Deprecated public MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundCompactions(int maxBackgroundCompactions)
MutableDBOptionsInterfaceSpecifies the maximum number of concurrent background compaction jobs, submitted to the default LOW priority thread pool. If you're increasing this, also consider increasing number of threads in LOW priority thread pool. For more information, see Default: -1
setMaxBackgroundCompactions 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>maxBackgroundCompactions - the maximum number of background
compaction jobs.Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority),
DBOptionsInterface.maxBackgroundFlushes()@Deprecated public int maxBackgroundCompactions()
MutableDBOptionsInterfaceReturns the maximum number of concurrent background compaction jobs, submitted to the default LOW priority thread pool. When increasing this number, we may also want to consider increasing number of threads in LOW priority thread pool. Default: -1
maxBackgroundCompactions 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority)public MutableDBOptions.MutableDBOptionsBuilder setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
MutableDBOptionsInterfaceDEFAULT: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.
setAvoidFlushDuringShutdown 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>avoidFlushDuringShutdown - true if we should avoid flush during
shutdownpublic boolean avoidFlushDuringShutdown()
MutableDBOptionsInterfaceDEFAULT: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.
avoidFlushDuringShutdown 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
MutableDBOptionsInterfaceDefault: 1024 * 1024 (1 MB)
setWritableFileMaxBufferSize 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>writableFileMaxBufferSize - the maximum buffer sizepublic long writableFileMaxBufferSize()
MutableDBOptionsInterfaceDefault: 1024 * 1024 (1 MB)
writableFileMaxBufferSize 在接口中 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 在接口中 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 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder 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 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>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 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setDeleteObsoleteFilesPeriodMicros(long micros)
MutableDBOptionsInterfacesetDeleteObsoleteFilesPeriodMicros 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>micros - the time interval in microspublic long deleteObsoleteFilesPeriodMicros()
MutableDBOptionsInterfacedeleteObsoleteFilesPeriodMicros 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setStatsDumpPeriodSec(int statsDumpPeriodSec)
MutableDBOptionsInterfacesetStatsDumpPeriodSec 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>statsDumpPeriodSec - time interval in seconds.public int statsDumpPeriodSec()
MutableDBOptionsInterfacestatsDumpPeriodSec 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setStatsPersistPeriodSec(int statsPersistPeriodSec)
MutableDBOptionsInterfacestatsPersistPeriodSec
Default: 600setStatsPersistPeriodSec 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>statsPersistPeriodSec - time interval in seconds.public int statsPersistPeriodSec()
MutableDBOptionsInterfacestatsPersistPeriodSecstatsPersistPeriodSec 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setStatsHistoryBufferSize(long statsHistoryBufferSize)
MutableDBOptionsInterfacestatsHistoryBufferSize
Default: 1MBsetStatsHistoryBufferSize 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>statsHistoryBufferSize - the size of the buffer.public long statsHistoryBufferSize()
MutableDBOptionsInterfacestatsHistoryBufferSizestatsHistoryBufferSize 在接口中 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 在接口中 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 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setBytesPerSync(long bytesPerSync)
MutableDBOptionsInterfacesetBytesPerSync 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>bytesPerSync - size in bytespublic long bytesPerSync()
MutableDBOptionsInterfacebytesPerSync 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setWalBytesPerSync(long walBytesPerSync)
MutableDBOptionsInterfaceMutableDBOptionsInterface.setBytesPerSync(long) , but applies to WAL files
Default: 0, turned off
setWalBytesPerSync 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>walBytesPerSync - size in bytespublic long walBytesPerSync()
MutableDBOptionsInterfaceMutableDBOptionsInterface.bytesPerSync() , but applies to WAL files
Default: 0, turned off
walBytesPerSync 在接口中 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: false
setStrictBytesPerSync 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>strictBytesPerSync - the bytes per syncpublic boolean strictBytesPerSync()
MutableDBOptionsInterface
See MutableDBOptionsInterface.setStrictBytesPerSync(boolean)
strictBytesPerSync 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>public MutableDBOptions.MutableDBOptionsBuilder setCompactionReadaheadSize(long compactionReadaheadSize)
MutableDBOptionsInterfaceThat way RocksDB's compaction is doing sequential instead of random reads.
Default: 0
setCompactionReadaheadSize 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>compactionReadaheadSize - The compaction read-ahead sizepublic long compactionReadaheadSize()
MutableDBOptionsInterfaceThat way RocksDB's compaction is doing sequential instead of random reads.
Default: 0
compactionReadaheadSize 在接口中 MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>