Class MutableDBOptions.MutableDBOptionsBuilder
- java.lang.Object
-
- org.rocksdb.AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>
-
- org.rocksdb.MutableDBOptions.MutableDBOptionsBuilder
-
- All Implemented Interfaces:
MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
- Enclosing class:
- MutableDBOptions
public static class MutableDBOptions.MutableDBOptionsBuilder extends AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey> implements MutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,org.rocksdb.MutableDBOptions.MutableDBOptionKey>allKeys()Get all of the possible keysbooleanavoidFlushDuringShutdown()By default RocksDB will flush all memtables on DB close if there are unpersisted data (i.e.intbaseBackgroundCompactions()NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the value of max_background_jobs.protected MutableDBOptionsbuild(java.lang.String[] keys, java.lang.String[] values)Construct a sub-class instance ofAbstractMutableOptions.longbytesPerSync()Allows OS to incrementally sync files to disk while they are being written, asynchronously, in the background.longcompactionReadaheadSize()If non-zero, we perform bigger reads when doing compaction.longdelayedWriteRate()The limited write rate to DB ifColumnFamilyOptions.softPendingCompactionBytesLimit()orColumnFamilyOptions.level0SlowdownWritesTrigger()is triggered, or we are writing to the last mem table allowed and we allow more than 3 mem tables.longdeleteObsoleteFilesPeriodMicros()The periodicity when obsolete files get deleted.intmaxBackgroundCompactions()Deprecated.intmaxBackgroundJobs()Returns the maximum number of concurrent background jobs (both flushes and compactions combined).intmaxOpenFiles()Number of open files that can be used by the DB.longmaxTotalWalSize()Returns the max total wal size.protected MutableDBOptions.MutableDBOptionsBuilderself()MutableDBOptions.MutableDBOptionsBuildersetAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)By default RocksDB will flush all memtables on DB close if there are unpersisted data (i.e.voidsetBaseBackgroundCompactions(int baseBackgroundCompactions)Deprecated.MutableDBOptions.MutableDBOptionsBuildersetBytesPerSync(long bytesPerSync)Allows OS to incrementally sync files to disk while they are being written, asynchronously, in the background.MutableDBOptions.MutableDBOptionsBuildersetCompactionReadaheadSize(long compactionReadaheadSize)If non-zero, we perform bigger reads when doing compaction.MutableDBOptions.MutableDBOptionsBuildersetDelayedWriteRate(long delayedWriteRate)The limited write rate to DB ifColumnFamilyOptions.softPendingCompactionBytesLimit()orColumnFamilyOptions.level0SlowdownWritesTrigger()is triggered, or we are writing to the last mem table allowed and we allow more than 3 mem tables.MutableDBOptions.MutableDBOptionsBuildersetDeleteObsoleteFilesPeriodMicros(long micros)The periodicity when obsolete files get deleted.MutableDBOptions.MutableDBOptionsBuildersetMaxBackgroundCompactions(int maxBackgroundCompactions)Deprecated.MutableDBOptions.MutableDBOptionsBuildersetMaxBackgroundJobs(int maxBackgroundJobs)Specifies the maximum number of concurrent background jobs (both flushes and compactions combined).MutableDBOptions.MutableDBOptionsBuildersetMaxOpenFiles(int maxOpenFiles)Number of open files that can be used by the DB.MutableDBOptions.MutableDBOptionsBuildersetMaxTotalWalSize(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.MutableDBOptionsBuildersetStatsDumpPeriodSec(int statsDumpPeriodSec)if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec Default: 600 (10 minutes)MutableDBOptions.MutableDBOptionsBuildersetStatsHistoryBufferSize(long statsHistoryBufferSize)If not zero, periodically take stats snapshots and store in memory, the memory size for stats snapshots is capped atstatsHistoryBufferSizeDefault: 1MBMutableDBOptions.MutableDBOptionsBuildersetStatsPersistPeriodSec(int statsPersistPeriodSec)If not zero, dump rocksdb.stats to RocksDB everystatsPersistPeriodSecDefault: 600MutableDBOptions.MutableDBOptionsBuildersetStrictBytesPerSync(boolean strictBytesPerSync)When true, guarantees WAL files have at mostMutableDBOptionsInterface.walBytesPerSync()bytes submitted for writeback at any given time, and SST files have at mostMutableDBOptionsInterface.bytesPerSync()bytes pending writeback at any given time.MutableDBOptions.MutableDBOptionsBuildersetWalBytesPerSync(long walBytesPerSync)Same asMutableDBOptionsInterface.setBytesPerSync(long), but applies to WAL files Default: 0, turned offMutableDBOptions.MutableDBOptionsBuildersetWritableFileMaxBufferSize(long writableFileMaxBufferSize)This is the maximum buffer size that is used by WritableFileWriter.intstatsDumpPeriodSec()If not zero, dump rocksdb.stats to LOG every stats_dump_period_sec Default: 600 (10 minutes)longstatsHistoryBufferSize()If not zero, periodically take stats snapshots and store in memory, the memory size for stats snapshots is capped atstatsHistoryBufferSizeintstatsPersistPeriodSec()If not zero, dump rocksdb.stats to RocksDB everystatsPersistPeriodSecbooleanstrictBytesPerSync()Return the strict byte limit per sync.longwalBytesPerSync()Same asMutableDBOptionsInterface.bytesPerSync(), but applies to WAL files Default: 0, turned offlongwritableFileMaxBufferSize()This is the maximum buffer size that is used by WritableFileWriter.-
Methods inherited from class org.rocksdb.AbstractMutableOptions.AbstractMutableOptionsBuilder
build, fromString, getBoolean, getDouble, getEnum, getInt, getIntArray, getLong, setBoolean, setDouble, setEnum, setInt, setIntArray, setLong
-
-
-
-
Method Detail
-
self
protected MutableDBOptions.MutableDBOptionsBuilder self()
- Specified by:
selfin classAbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>
-
allKeys
protected java.util.Map<java.lang.String,org.rocksdb.MutableDBOptions.MutableDBOptionKey> allKeys()
Description copied from class:AbstractMutableOptions.AbstractMutableOptionsBuilderGet all of the possible keys- Specified by:
allKeysin classAbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>- Returns:
- A map of all keys, indexed by name.
-
build
protected MutableDBOptions build(java.lang.String[] keys, java.lang.String[] values)
Description copied from class:AbstractMutableOptions.AbstractMutableOptionsBuilderConstruct a sub-class instance ofAbstractMutableOptions.- Specified by:
buildin classAbstractMutableOptions.AbstractMutableOptionsBuilder<MutableDBOptions,MutableDBOptions.MutableDBOptionsBuilder,org.rocksdb.MutableDBOptions.MutableDBOptionKey>- Parameters:
keys- the keysvalues- the values- Returns:
- an instance of the options.
-
setMaxBackgroundJobs
public MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundJobs(int maxBackgroundJobs)
Description copied from interface:MutableDBOptionsInterfaceSpecifies the maximum number of concurrent background jobs (both flushes and compactions combined). Default: 2- Specified by:
setMaxBackgroundJobsin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
maxBackgroundJobs- number of max concurrent background jobs- Returns:
- the instance of the current object.
-
maxBackgroundJobs
public int maxBackgroundJobs()
Description copied from interface:MutableDBOptionsInterfaceReturns the maximum number of concurrent background jobs (both flushes and compactions combined). Default: 2- Specified by:
maxBackgroundJobsin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the maximum number of concurrent background jobs.
-
setBaseBackgroundCompactions
@Deprecated public void setBaseBackgroundCompactions(int baseBackgroundCompactions)
Deprecated.Description copied from interface:MutableDBOptionsInterfaceNOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the value of max_background_jobs. This option is ignored. Suggested number of concurrent background compaction jobs, submitted to the default LOW priority thread pool. Default: -1- Specified by:
setBaseBackgroundCompactionsin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
baseBackgroundCompactions- Suggested number of background compaction jobs
-
baseBackgroundCompactions
public int baseBackgroundCompactions()
Description copied from interface:MutableDBOptionsInterfaceNOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the value of max_background_jobs. This option is ignored. Suggested number of concurrent background compaction jobs, submitted to the default LOW priority thread pool. Default: -1- Specified by:
baseBackgroundCompactionsin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- Suggested number of background compaction jobs
-
setMaxBackgroundCompactions
@Deprecated public MutableDBOptions.MutableDBOptionsBuilder setMaxBackgroundCompactions(int maxBackgroundCompactions)
Deprecated.Description copied from interface:MutableDBOptionsInterfaceNOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the value of max_background_jobs. For backwards compatibility we will set `max_background_jobs = max_background_compactions + max_background_flushes` in the case where user sets at least one of `max_background_compactions` or `max_background_flushes` (we replace -1 by 1 in case one option is unset). Specifies 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- Specified by:
setMaxBackgroundCompactionsin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
maxBackgroundCompactions- the maximum number of background compaction jobs.- Returns:
- the instance of the current object.
- See Also:
Env.setBackgroundThreads(int),Env.setBackgroundThreads(int, Priority),DBOptionsInterface.maxBackgroundFlushes()
-
maxBackgroundCompactions
@Deprecated public int maxBackgroundCompactions()
Deprecated.Description copied from interface:MutableDBOptionsInterfaceNOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the value of max_background_jobs. For backwards compatibility we will set `max_background_jobs = max_background_compactions + max_background_flushes` in the case where user sets at least one of `max_background_compactions` or `max_background_flushes` (we replace -1 by 1 in case one option is unset). Returns 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- Specified by:
maxBackgroundCompactionsin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the maximum number of concurrent background compaction jobs.
- See Also:
Env.setBackgroundThreads(int),Env.setBackgroundThreads(int, Priority)
-
setAvoidFlushDuringShutdown
public MutableDBOptions.MutableDBOptionsBuilder setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
Description copied from interface:MutableDBOptionsInterfaceBy 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. Unpersisted data WILL BE LOST. DEFAULT: false Dynamically changeable throughRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)API.- Specified by:
setAvoidFlushDuringShutdownin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
avoidFlushDuringShutdown- true if we should avoid flush during shutdown- Returns:
- the reference to the current options.
-
avoidFlushDuringShutdown
public boolean avoidFlushDuringShutdown()
Description copied from interface:MutableDBOptionsInterfaceBy 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. Unpersisted data WILL BE LOST. DEFAULT: false Dynamically changeable throughRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)API.- Specified by:
avoidFlushDuringShutdownin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- true if we should avoid flush during shutdown
-
setWritableFileMaxBufferSize
public MutableDBOptions.MutableDBOptionsBuilder setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
Description copied from interface:MutableDBOptionsInterfaceThis is the maximum buffer size that is used by WritableFileWriter. On Windows, we need to maintain an aligned buffer for writes. We allow the buffer to grow until it's size hits the limit. Default: 1024 * 1024 (1 MB)- Specified by:
setWritableFileMaxBufferSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
writableFileMaxBufferSize- the maximum buffer size- Returns:
- the reference to the current options.
-
writableFileMaxBufferSize
public long writableFileMaxBufferSize()
Description copied from interface:MutableDBOptionsInterfaceThis is the maximum buffer size that is used by WritableFileWriter. On Windows, we need to maintain an aligned buffer for writes. We allow the buffer to grow until it's size hits the limit. Default: 1024 * 1024 (1 MB)- Specified by:
writableFileMaxBufferSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the maximum buffer size
-
setDelayedWriteRate
public MutableDBOptions.MutableDBOptionsBuilder setDelayedWriteRate(long delayedWriteRate)
Description copied from interface:MutableDBOptionsInterfaceThe limited write rate to DB ifColumnFamilyOptions.softPendingCompactionBytesLimit()orColumnFamilyOptions.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 throughRocksDB.setDBOptions(MutableDBOptions).- Specified by:
setDelayedWriteRatein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
delayedWriteRate- the rate in bytes per second- Returns:
- the reference to the current options.
-
delayedWriteRate
public long delayedWriteRate()
Description copied from interface:MutableDBOptionsInterfaceThe limited write rate to DB ifColumnFamilyOptions.softPendingCompactionBytesLimit()orColumnFamilyOptions.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 throughRocksDB.setDBOptions(MutableDBOptions).- Specified by:
delayedWriteRatein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the rate in bytes per second
-
setMaxTotalWalSize
public MutableDBOptions.MutableDBOptionsBuilder setMaxTotalWalSize(long maxTotalWalSize)
Description copied from interface: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
- Specified by:
setMaxTotalWalSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
maxTotalWalSize- max total wal size.- Returns:
- the instance of the current object.
-
maxTotalWalSize
public long maxTotalWalSize()
Description copied from interface: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
- Specified by:
maxTotalWalSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- max total wal size
-
setDeleteObsoleteFilesPeriodMicros
public MutableDBOptions.MutableDBOptionsBuilder setDeleteObsoleteFilesPeriodMicros(long micros)
Description copied from interface:MutableDBOptionsInterfaceThe periodicity when obsolete files get deleted. The default value is 6 hours. The files that get out of scope by compaction process will still get automatically delete on every compaction, regardless of this setting- Specified by:
setDeleteObsoleteFilesPeriodMicrosin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
micros- the time interval in micros- Returns:
- the instance of the current object.
-
deleteObsoleteFilesPeriodMicros
public long deleteObsoleteFilesPeriodMicros()
Description copied from interface:MutableDBOptionsInterfaceThe periodicity when obsolete files get deleted. The default value is 6 hours. The files that get out of scope by compaction process will still get automatically delete on every compaction, regardless of this setting- Specified by:
deleteObsoleteFilesPeriodMicrosin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the time interval in micros when obsolete files will be deleted.
-
setStatsDumpPeriodSec
public MutableDBOptions.MutableDBOptionsBuilder setStatsDumpPeriodSec(int statsDumpPeriodSec)
Description copied from interface:MutableDBOptionsInterfaceif not zero, dump rocksdb.stats to LOG every stats_dump_period_sec Default: 600 (10 minutes)- Specified by:
setStatsDumpPeriodSecin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
statsDumpPeriodSec- time interval in seconds.- Returns:
- the instance of the current object.
-
statsDumpPeriodSec
public int statsDumpPeriodSec()
Description copied from interface:MutableDBOptionsInterfaceIf not zero, dump rocksdb.stats to LOG every stats_dump_period_sec Default: 600 (10 minutes)- Specified by:
statsDumpPeriodSecin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- time interval in seconds.
-
setStatsPersistPeriodSec
public MutableDBOptions.MutableDBOptionsBuilder setStatsPersistPeriodSec(int statsPersistPeriodSec)
Description copied from interface:MutableDBOptionsInterfaceIf not zero, dump rocksdb.stats to RocksDB everystatsPersistPeriodSecDefault: 600- Specified by:
setStatsPersistPeriodSecin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
statsPersistPeriodSec- time interval in seconds.- Returns:
- the instance of the current object.
-
statsPersistPeriodSec
public int statsPersistPeriodSec()
Description copied from interface:MutableDBOptionsInterfaceIf not zero, dump rocksdb.stats to RocksDB everystatsPersistPeriodSec- Specified by:
statsPersistPeriodSecin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- time interval in seconds.
-
setStatsHistoryBufferSize
public MutableDBOptions.MutableDBOptionsBuilder setStatsHistoryBufferSize(long statsHistoryBufferSize)
Description copied from interface:MutableDBOptionsInterfaceIf not zero, periodically take stats snapshots and store in memory, the memory size for stats snapshots is capped atstatsHistoryBufferSizeDefault: 1MB- Specified by:
setStatsHistoryBufferSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
statsHistoryBufferSize- the size of the buffer.- Returns:
- the instance of the current object.
-
statsHistoryBufferSize
public long statsHistoryBufferSize()
Description copied from interface:MutableDBOptionsInterfaceIf not zero, periodically take stats snapshots and store in memory, the memory size for stats snapshots is capped atstatsHistoryBufferSize- Specified by:
statsHistoryBufferSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the size of the buffer.
-
setMaxOpenFiles
public MutableDBOptions.MutableDBOptionsBuilder setMaxOpenFiles(int maxOpenFiles)
Description copied from interface:MutableDBOptionsInterfaceNumber of open files that can be used by the DB. You may need to increase this if your database has a large working set. Value -1 means files opened are always kept open. You can estimate number of files based ontarget_file_size_baseandtarget_file_size_multiplierfor level-based compaction. For universal-style compaction, you can usually set it to -1. Default: -1- Specified by:
setMaxOpenFilesin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
maxOpenFiles- the maximum number of open files.- Returns:
- the instance of the current object.
-
maxOpenFiles
public int maxOpenFiles()
Description copied from interface:MutableDBOptionsInterfaceNumber of open files that can be used by the DB. You may need to increase this if your database has a large working set. Value -1 means files opened are always kept open. You can estimate number of files based ontarget_file_size_baseandtarget_file_size_multiplierfor level-based compaction. For universal-style compaction, you can usually set it to -1. Default: -1- Specified by:
maxOpenFilesin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the maximum number of open files.
-
setBytesPerSync
public MutableDBOptions.MutableDBOptionsBuilder setBytesPerSync(long bytesPerSync)
Description copied from interface:MutableDBOptionsInterfaceAllows OS to incrementally sync files to disk while they are being written, asynchronously, in the background. Issue one request for every bytes_per_sync written. 0 turns it off. Default: 0- Specified by:
setBytesPerSyncin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
bytesPerSync- size in bytes- Returns:
- the instance of the current object.
-
bytesPerSync
public long bytesPerSync()
Description copied from interface:MutableDBOptionsInterfaceAllows OS to incrementally sync files to disk while they are being written, asynchronously, in the background. Issue one request for every bytes_per_sync written. 0 turns it off. Default: 0- Specified by:
bytesPerSyncin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- size in bytes
-
setWalBytesPerSync
public MutableDBOptions.MutableDBOptionsBuilder setWalBytesPerSync(long walBytesPerSync)
Description copied from interface:MutableDBOptionsInterfaceSame asMutableDBOptionsInterface.setBytesPerSync(long), but applies to WAL files Default: 0, turned off- Specified by:
setWalBytesPerSyncin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
walBytesPerSync- size in bytes- Returns:
- the instance of the current object.
-
walBytesPerSync
public long walBytesPerSync()
Description copied from interface:MutableDBOptionsInterfaceSame asMutableDBOptionsInterface.bytesPerSync(), but applies to WAL files Default: 0, turned off- Specified by:
walBytesPerSyncin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- size in bytes
-
setStrictBytesPerSync
public MutableDBOptions.MutableDBOptionsBuilder setStrictBytesPerSync(boolean strictBytesPerSync)
Description copied from interface:MutableDBOptionsInterfaceWhen true, guarantees WAL files have at mostMutableDBOptionsInterface.walBytesPerSync()bytes submitted for writeback at any given time, and SST files have at mostMutableDBOptionsInterface.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 withMutableDBOptionsInterface.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- Specified by:
setStrictBytesPerSyncin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
strictBytesPerSync- the bytes per sync- Returns:
- the instance of the current object.
-
strictBytesPerSync
public boolean strictBytesPerSync()
Description copied from interface:MutableDBOptionsInterfaceReturn the strict byte limit per sync. SeeMutableDBOptionsInterface.setStrictBytesPerSync(boolean)- Specified by:
strictBytesPerSyncin interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- the limit in bytes.
-
setCompactionReadaheadSize
public MutableDBOptions.MutableDBOptionsBuilder setCompactionReadaheadSize(long compactionReadaheadSize)
Description copied from interface:MutableDBOptionsInterfaceIf non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. When non-zero, we also forceDBOptionsInterface.newTableReaderForCompactionInputs()to true. Default: 0- Specified by:
setCompactionReadaheadSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Parameters:
compactionReadaheadSize- The compaction read-ahead size- Returns:
- the reference to the current options.
-
compactionReadaheadSize
public long compactionReadaheadSize()
Description copied from interface:MutableDBOptionsInterfaceIf non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. When non-zero, we also forceDBOptionsInterface.newTableReaderForCompactionInputs()to true. Default: 0- Specified by:
compactionReadaheadSizein interfaceMutableDBOptionsInterface<MutableDBOptions.MutableDBOptionsBuilder>- Returns:
- The compaction read-ahead size
-
-