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 java.util.Map<java.lang.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.
|
int |
baseBackgroundCompactions()
Suggested number of concurrent background compaction jobs, submitted to
the default LOW priority thread pool.
|
protected MutableDBOptions |
build(java.lang.String[] keys,
java.lang.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()
Returns the maximum number of concurrent background compaction jobs,
submitted to the default LOW priority thread pool.
|
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.
|
void |
setBaseBackgroundCompactions(int baseBackgroundCompactions)
Suggested number of concurrent background compaction jobs, submitted to
the default LOW priority thread pool.
|
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)
Specifies the maximum number of concurrent background compaction jobs,
submitted to the default LOW priority thread pool.
|
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.
|
MutableDBOptions.MutableDBOptionsBuilder |
setStatsDumpPeriodSec(int statsDumpPeriodSec)
if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 600 (10 minutes)
|
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 |
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, setLong
protected MutableDBOptions.MutableDBOptionsBuilder self()
self
in class AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>
protected java.util.Map<java.lang.String,org.rocksdb.MutableDBOptions.MutableDBOptionKey> allKeys()
AbstractMutableOptions.AbstractMutableOptionsBuilder
allKeys
in class AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>
protected MutableDBOptions build(java.lang.String[] keys, java.lang.String[] values)
AbstractMutableOptions.AbstractMutableOptionsBuilder
AbstractMutableOptions
.build
in class AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>
keys
- the keysvalues
- the valuespublic MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundJobs(int maxBackgroundJobs)
MutableDBOptionsInterface
setMaxBackgroundJobs
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
maxBackgroundJobs
- number of max concurrent background jobspublic int maxBackgroundJobs()
MutableDBOptionsInterface
maxBackgroundJobs
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public void setBaseBackgroundCompactions(int baseBackgroundCompactions)
MutableDBOptionsInterface
setBaseBackgroundCompactions
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
baseBackgroundCompactions
- Suggested number of background compaction
jobspublic int baseBackgroundCompactions()
MutableDBOptionsInterface
baseBackgroundCompactions
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundCompactions(int maxBackgroundCompactions)
MutableDBOptionsInterface
setMaxBackgroundCompactions
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
maxBackgroundCompactions
- the maximum number of background
compaction jobs.Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, Priority)
,
DBOptionsInterface.maxBackgroundFlushes()
public int maxBackgroundCompactions()
MutableDBOptionsInterface
maxBackgroundCompactions
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, Priority)
public MutableDBOptions.MutableDBOptionsBuilder setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
MutableDBOptionsInterface
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.setAvoidFlushDuringShutdown
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
avoidFlushDuringShutdown
- true if we should avoid flush during
shutdownpublic boolean avoidFlushDuringShutdown()
MutableDBOptionsInterface
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.avoidFlushDuringShutdown
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
MutableDBOptionsInterface
setWritableFileMaxBufferSize
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
writableFileMaxBufferSize
- the maximum buffer sizepublic long writableFileMaxBufferSize()
MutableDBOptionsInterface
writableFileMaxBufferSize
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setDelayedWriteRate(long delayedWriteRate)
MutableDBOptionsInterface
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.
Unit: bytes per second.
Default: 16MB/ssetDelayedWriteRate
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
delayedWriteRate
- the rate in bytes per secondpublic long delayedWriteRate()
MutableDBOptionsInterface
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.
Unit: bytes per second.
Default: 16MB/sdelayedWriteRate
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setMaxTotalWalSize(long maxTotalWalSize)
MutableDBOptionsInterface
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
setMaxTotalWalSize
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
maxTotalWalSize
- max total wal size.public long maxTotalWalSize()
MutableDBOptionsInterface
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
maxTotalWalSize
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setDeleteObsoleteFilesPeriodMicros(long micros)
MutableDBOptionsInterface
setDeleteObsoleteFilesPeriodMicros
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
micros
- the time interval in microspublic long deleteObsoleteFilesPeriodMicros()
MutableDBOptionsInterface
deleteObsoleteFilesPeriodMicros
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setStatsDumpPeriodSec(int statsDumpPeriodSec)
MutableDBOptionsInterface
setStatsDumpPeriodSec
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
statsDumpPeriodSec
- time interval in seconds.public int statsDumpPeriodSec()
MutableDBOptionsInterface
statsDumpPeriodSec
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setMaxOpenFiles(int maxOpenFiles)
MutableDBOptionsInterface
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: 5000setMaxOpenFiles
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
maxOpenFiles
- the maximum number of open files.public int maxOpenFiles()
MutableDBOptionsInterface
target_file_size_base
and target_file_size_multiplier
for level-based compaction. For universal-style compaction, you can usually
set it to -1.maxOpenFiles
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setBytesPerSync(long bytesPerSync)
MutableDBOptionsInterface
setBytesPerSync
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
bytesPerSync
- size in bytespublic long bytesPerSync()
MutableDBOptionsInterface
bytesPerSync
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setWalBytesPerSync(long walBytesPerSync)
MutableDBOptionsInterface
MutableDBOptionsInterface.setBytesPerSync(long)
, but applies to WAL files
Default: 0, turned offsetWalBytesPerSync
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
walBytesPerSync
- size in bytespublic long walBytesPerSync()
MutableDBOptionsInterface
MutableDBOptionsInterface.bytesPerSync()
, but applies to WAL files
Default: 0, turned offwalBytesPerSync
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
public MutableDBOptions.MutableDBOptionsBuilder setCompactionReadaheadSize(long compactionReadaheadSize)
MutableDBOptionsInterface
DBOptionsInterface.newTableReaderForCompactionInputs()
to true.
Default: 0setCompactionReadaheadSize
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
compactionReadaheadSize
- The compaction read-ahead sizepublic long compactionReadaheadSize()
MutableDBOptionsInterface
DBOptionsInterface.newTableReaderForCompactionInputs()
to true.
Default: 0compactionReadaheadSize
in interface MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>