public class DBOptions extends RocksObject implements DBOptionsInterface
RocksDB
(i.e., RocksDB.open()).
If AbstractNativeReference.dispose()
function is not called, then it will be GC'd
automatically and native resources will be released as part of the process.nativeHandle_
Constructor and Description |
---|
DBOptions()
Construct DBOptions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
adviseRandomOnOpen()
If set true, will hint the underlying file system that the file
access pattern is random, when a sst file is opened.
|
boolean |
allowConcurrentMemtableWrite()
If true, allow multi-writers to update mem tables in parallel.
|
boolean |
allowMmapReads()
Allow the OS to mmap file for reading sst tables.
|
boolean |
allowMmapWrites()
Allow the OS to mmap file for writing.
|
int |
baseBackgroundCompactions()
Suggested number of concurrent background compaction jobs, submitted to
the default LOW priority thread pool.
|
long |
bytesPerSync()
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
boolean |
createIfMissing()
Return true if the create_if_missing flag is set to true.
|
boolean |
createMissingColumnFamilies()
Return true if the create_missing_column_families flag is set
to true.
|
DBOptions |
createStatistics()
Creates statistics object which collects metrics about database operations.
|
java.lang.String |
dbLogDir()
Returns the directory of info log.
|
long |
delayedWriteRate() |
long |
deleteObsoleteFilesPeriodMicros()
The periodicity when obsolete files get deleted.
|
boolean |
disableDataSync()
If true, then the contents of data files are not synced
to stable storage.
|
protected void |
disposeInternal(long handle) |
boolean |
enableWriteThreadAdaptiveYield()
If true, threads synchronizing with the write batch group leader will
wait for up to
DBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. |
boolean |
errorIfExists()
If true, an error will be thrown during RocksDB.open() if the
database already exists.
|
static DBOptions |
getDBOptionsFromProps(java.util.Properties properties)
Method to get a options instance by using pre-configured
property values.
|
InfoLogLevel |
infoLogLevel()
Returns currently set log level.
|
boolean |
isFdCloseOnExec()
Disable child process inherit open files.
|
long |
keepLogFileNum()
Returns the maximum number of info log files to be kept.
|
long |
logFileTimeToRoll()
Returns the time interval for the info log file to roll (in seconds).
|
long |
manifestPreallocationSize()
Number of bytes to preallocate (via fallocate) the manifest
files.
|
int |
maxBackgroundCompactions()
Returns the maximum number of concurrent background compaction jobs,
submitted to the default LOW priority thread pool.
|
int |
maxBackgroundFlushes()
Returns the maximum number of concurrent background flush jobs.
|
long |
maxLogFileSize()
Returns the maximum size of a info log file.
|
long |
maxManifestFileSize()
Manifest file is rolled over on reaching this limit.
|
int |
maxOpenFiles()
Number of open files that can be used by the DB.
|
int |
maxSubcompactions()
This value represents the maximum number of threads that will
concurrently perform a compaction job by breaking it into multiple,
smaller ones that are run simultaneously.
|
long |
maxTotalWalSize()
Returns the max total wal size.
|
boolean |
paranoidChecks()
If true, the implementation will do aggressive checking of the
data it is processing and will stop early if it detects any
errors.
|
DBOptions |
setAdviseRandomOnOpen(boolean adviseRandomOnOpen)
If set true, will hint the underlying file system that the file
access pattern is random, when a sst file is opened.
|
void |
setAllowConcurrentMemtableWrite(boolean allowConcurrentMemtableWrite)
If true, allow multi-writers to update mem tables in parallel.
|
DBOptions |
setAllowMmapReads(boolean allowMmapReads)
Allow the OS to mmap file for reading sst tables.
|
DBOptions |
setAllowMmapWrites(boolean allowMmapWrites)
Allow the OS to mmap file for writing.
|
void |
setBaseBackgroundCompactions(int baseBackgroundCompactions)
Suggested number of concurrent background compaction jobs, submitted to
the default LOW priority thread pool.
|
DBOptions |
setBytesPerSync(long bytesPerSync)
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
DBOptions |
setCreateIfMissing(boolean flag)
If this value is set to true, then the database will be created
if it is missing during
RocksDB.open() . |
DBOptions |
setCreateMissingColumnFamilies(boolean flag)
If true, missing column families will be automatically created
|
DBOptions |
setDbLogDir(java.lang.String dbLogDir)
This specifies the info LOG dir.
|
DBOptions |
setDelayedWriteRate(long delayedWriteRate) |
DBOptions |
setDeleteObsoleteFilesPeriodMicros(long micros)
The periodicity when obsolete files get deleted.
|
DBOptions |
setDisableDataSync(boolean disableDataSync)
If true, then the contents of manifest and data files are
not synced to stable storage.
|
void |
setEnableWriteThreadAdaptiveYield(boolean enableWriteThreadAdaptiveYield)
If true, threads synchronizing with the write batch group leader will
wait for up to
DBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. |
DBOptions |
setErrorIfExists(boolean errorIfExists)
If true, an error will be thrown during RocksDB.open() if the
database already exists.
|
DBOptions |
setIncreaseParallelism(int totalThreads)
By default, RocksDB uses only one background thread for flush and
compaction.
|
DBOptions |
setInfoLogLevel(InfoLogLevel infoLogLevel)
Sets the RocksDB log level.
|
DBOptions |
setIsFdCloseOnExec(boolean isFdCloseOnExec)
Disable child process inherit open files.
|
DBOptions |
setKeepLogFileNum(long keepLogFileNum)
Specifies the maximum number of info log files to be kept.
|
DBOptions |
setLogFileTimeToRoll(long logFileTimeToRoll)
Specifies the time interval for the info log file to roll (in seconds).
|
DBOptions |
setLogger(Logger logger)
Any internal progress/error information generated by
the db will be written to the Logger if it is non-nullptr,
or to a file stored in the same directory as the DB
contents if info_log is nullptr.
|
DBOptions |
setManifestPreallocationSize(long size)
Number of bytes to preallocate (via fallocate) the manifest
files.
|
DBOptions |
setMaxBackgroundCompactions(int maxBackgroundCompactions)
Specifies the maximum number of concurrent background compaction jobs,
submitted to the default LOW priority thread pool.
|
DBOptions |
setMaxBackgroundFlushes(int maxBackgroundFlushes)
Specifies the maximum number of concurrent background flush jobs.
|
DBOptions |
setMaxLogFileSize(long maxLogFileSize)
Specifies the maximum size of a info log file.
|
DBOptions |
setMaxManifestFileSize(long maxManifestFileSize)
Manifest file is rolled over on reaching this limit.
|
DBOptions |
setMaxOpenFiles(int maxOpenFiles)
Number of open files that can be used by the DB.
|
void |
setMaxSubcompactions(int maxSubcompactions)
This value represents the maximum number of threads that will
concurrently perform a compaction job by breaking it into multiple,
smaller ones that are run simultaneously.
|
DBOptions |
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.
|
DBOptions |
setParanoidChecks(boolean paranoidChecks)
If true, the implementation will do aggressive checking of the
data it is processing and will stop early if it detects any
errors.
|
DBOptions |
setRateLimiter(RateLimiter rateLimiter)
Use to control write rate of flush and compaction.
|
DBOptions |
setRateLimiterConfig(RateLimiterConfig config)
Use to control write rate of flush and compaction.
|
DBOptions |
setStatsDumpPeriodSec(int statsDumpPeriodSec)
if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 3600 (1 hour)
|
DBOptions |
setTableCacheNumshardbits(int tableCacheNumshardbits)
Number of shards used for table cache.
|
DBOptions |
setUseAdaptiveMutex(boolean useAdaptiveMutex)
Use adaptive mutex, which spins in the user space before resorting
to kernel.
|
DBOptions |
setUseDirectReads(boolean useDirectReads)
Enable the OS to use direct I/O for reading sst tables.
|
DBOptions |
setUseDirectWrites(boolean useDirectWrites)
Enable the OS to use direct I/O for writing sst tables.
|
DBOptions |
setUseFsync(boolean useFsync)
If true, then every store to stable storage will issue a fsync.
|
DBOptions |
setWalDir(java.lang.String walDir)
This specifies the absolute dir path for write-ahead logs (WAL).
|
DBOptions |
setWalSizeLimitMB(long sizeLimitMB)
WalTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted.
|
DBOptions |
setWalTtlSeconds(long walTtlSeconds)
DBOptionsInterface.walTtlSeconds() and DBOptionsInterface.walSizeLimitMB() affect how archived logs
will be deleted. |
void |
setWriteThreadMaxYieldUsec(long writeThreadMaxYieldUsec)
The maximum number of microseconds that a write operation will use
a yielding spin loop to coordinate with other write threads before
blocking on a mutex.
|
void |
setWriteThreadSlowYieldUsec(long writeThreadSlowYieldUsec)
The latency in microseconds after which a std::this_thread::yield
call (sched_yield on Linux) is considered to be a signal that
other processes or threads would like to use the current core.
|
Statistics |
statisticsPtr()
Returns statistics object.
|
int |
statsDumpPeriodSec()
If not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 3600 (1 hour)
|
int |
tableCacheNumshardbits()
Number of shards used for table cache.
|
boolean |
useAdaptiveMutex()
Use adaptive mutex, which spins in the user space before resorting
to kernel.
|
boolean |
useDirectReads()
Enable the OS to use direct I/O for reading sst tables.
|
boolean |
useDirectWrites()
Enable the OS to use direct I/O for writing sst tables.
|
boolean |
useFsync()
If true, then every store to stable storage will issue a fsync.
|
java.lang.String |
walDir()
Returns the path to the write-ahead-logs (WAL) directory.
|
long |
walSizeLimitMB()
DBOptionsInterface.walTtlSeconds() and #walSizeLimitMB() affect how archived logs
will be deleted. |
long |
walTtlSeconds()
WalTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted.
|
long |
writeThreadMaxYieldUsec()
The maximum number of microseconds that a write operation will use
a yielding spin loop to coordinate with other write threads before
blocking on a mutex.
|
long |
writeThreadSlowYieldUsec()
The latency in microseconds after which a std::this_thread::yield
call (sched_yield on Linux) is considered to be a signal that
other processes or threads would like to use the current core.
|
disposeInternal
close, disOwnNativeHandle, isOwningHandle
dispose, finalize
public DBOptions()
rocksdb::DBOptions
in the c++ side.public static DBOptions getDBOptionsFromProps(java.util.Properties properties)
Method to get a options instance by using pre-configured property values. If one or many values are undefined in the context of RocksDB the method will return a null value.
Note: Property keys can be derived from
getter methods within the options class. Example: the method
allowMmapReads()
has a property key:
allow_mmap_reads
.
properties
- Properties
instance.instance
or null.java.lang.IllegalArgumentException
- if null or empty
Properties
instance is passed to the method call.public DBOptions setIncreaseParallelism(int totalThreads)
DBOptionsInterface
By default, RocksDB uses only one background thread for flush and compaction. Calling this function will set it up such that total of `total_threads` is used.
You almost definitely want to call this function if your system is bottlenecked by RocksDB.
setIncreaseParallelism
in interface DBOptionsInterface
totalThreads
- The total number of threads to be used by RocksDB.
A good value is the number of cores.public DBOptions setCreateIfMissing(boolean flag)
DBOptionsInterface
RocksDB.open()
.
Default: falsesetCreateIfMissing
in interface DBOptionsInterface
flag
- a flag indicating whether to create a database the
specified database in RocksDB.open(org.rocksdb.Options, String)
operation
is missing.RocksDB.open(org.rocksdb.Options, String)
public boolean createIfMissing()
DBOptionsInterface
createIfMissing
in interface DBOptionsInterface
DBOptionsInterface.setCreateIfMissing(boolean)
public DBOptions setCreateMissingColumnFamilies(boolean flag)
DBOptionsInterface
If true, missing column families will be automatically created
Default: false
setCreateMissingColumnFamilies
in interface DBOptionsInterface
flag
- a flag indicating if missing column families shall be
created automatically.public boolean createMissingColumnFamilies()
DBOptionsInterface
createMissingColumnFamilies
in interface DBOptionsInterface
DBOptionsInterface.setCreateMissingColumnFamilies(boolean)
public DBOptions setErrorIfExists(boolean errorIfExists)
DBOptionsInterface
setErrorIfExists
in interface DBOptionsInterface
errorIfExists
- if true, an exception will be thrown
during RocksDB.open()
if the database already exists.RocksDB.open(org.rocksdb.Options, String)
public boolean errorIfExists()
DBOptionsInterface
errorIfExists
in interface DBOptionsInterface
public DBOptions setParanoidChecks(boolean paranoidChecks)
DBOptionsInterface
setParanoidChecks
in interface DBOptionsInterface
paranoidChecks
- a flag to indicate whether paranoid-check
is on.public boolean paranoidChecks()
DBOptionsInterface
paranoidChecks
in interface DBOptionsInterface
public DBOptions setRateLimiterConfig(RateLimiterConfig config)
DBOptionsInterface
setRateLimiterConfig
in interface DBOptionsInterface
config
- rate limiter config.public DBOptions setRateLimiter(RateLimiter rateLimiter)
DBOptionsInterface
setRateLimiter
in interface DBOptionsInterface
rateLimiter
- RateLimiter
instance.public DBOptions setLogger(Logger logger)
DBOptionsInterface
Any internal progress/error information generated by the db will be written to the Logger if it is non-nullptr, or to a file stored in the same directory as the DB contents if info_log is nullptr.
Default: nullptr
setLogger
in interface DBOptionsInterface
logger
- Logger
instance.public DBOptions setInfoLogLevel(InfoLogLevel infoLogLevel)
DBOptionsInterface
Sets the RocksDB log level. Default level is INFO
setInfoLogLevel
in interface DBOptionsInterface
infoLogLevel
- log level to set.public InfoLogLevel infoLogLevel()
DBOptionsInterface
Returns currently set log level.
infoLogLevel
in interface DBOptionsInterface
InfoLogLevel
instance.public DBOptions setMaxOpenFiles(int maxOpenFiles)
DBOptionsInterface
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 DBOptionsInterface
maxOpenFiles
- the maximum number of open files.public int maxOpenFiles()
DBOptionsInterface
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 DBOptionsInterface
public DBOptions setMaxTotalWalSize(long maxTotalWalSize)
DBOptionsInterface
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
Default: 0
setMaxTotalWalSize
in interface DBOptionsInterface
maxTotalWalSize
- max total wal size.public long maxTotalWalSize()
DBOptionsInterface
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 DBOptionsInterface
public DBOptions createStatistics()
DBOptionsInterface
Creates statistics object which collects metrics about database operations. Statistics objects should not be shared between DB instances as it does not use any locks to prevent concurrent updates.
createStatistics
in interface DBOptionsInterface
RocksDB.open(org.rocksdb.Options, String)
public Statistics statisticsPtr()
DBOptionsInterface
Returns statistics object. Calls DBOptionsInterface.createStatistics()
if
C++ returns nullptr
for statistics.
statisticsPtr
in interface DBOptionsInterface
DBOptionsInterface.createStatistics()
public DBOptions setDisableDataSync(boolean disableDataSync)
DBOptionsInterface
If true, then the contents of manifest and data files are not synced to stable storage. Their contents remain in the OS buffers till theOS decides to flush them.
This option is good for bulk-loading of data.
Once the bulk-loading is complete, please issue a sync to the OS to flush all dirty buffers to stable storage.
Default: false
setDisableDataSync
in interface DBOptionsInterface
disableDataSync
- a boolean flag to specify whether to
disable data sync.public boolean disableDataSync()
DBOptionsInterface
disableDataSync
in interface DBOptionsInterface
public DBOptions setUseFsync(boolean useFsync)
DBOptionsInterface
If true, then every store to stable storage will issue a fsync.
If false, then every store to stable storage will issue a fdatasync. This parameter should be set to true while storing data to filesystem like ext3 that can lose files after a reboot.
Default: false
setUseFsync
in interface DBOptionsInterface
useFsync
- a boolean flag to specify whether to use fsyncpublic boolean useFsync()
DBOptionsInterface
If true, then every store to stable storage will issue a fsync.
If false, then every store to stable storage will issue a fdatasync. This parameter should be set to true while storing data to filesystem like ext3 that can lose files after a reboot.
useFsync
in interface DBOptionsInterface
public DBOptions setDbLogDir(java.lang.String dbLogDir)
DBOptionsInterface
setDbLogDir
in interface DBOptionsInterface
dbLogDir
- the path to the info log directorypublic java.lang.String dbLogDir()
DBOptionsInterface
dbLogDir
in interface DBOptionsInterface
public DBOptions setWalDir(java.lang.String walDir)
DBOptionsInterface
setWalDir
in interface DBOptionsInterface
walDir
- the path to the write-ahead-log directory.public java.lang.String walDir()
DBOptionsInterface
walDir
in interface DBOptionsInterface
public DBOptions setDeleteObsoleteFilesPeriodMicros(long micros)
DBOptionsInterface
setDeleteObsoleteFilesPeriodMicros
in interface DBOptionsInterface
micros
- the time interval in microspublic long deleteObsoleteFilesPeriodMicros()
DBOptionsInterface
deleteObsoleteFilesPeriodMicros
in interface DBOptionsInterface
public void setBaseBackgroundCompactions(int baseBackgroundCompactions)
DBOptionsInterface
setBaseBackgroundCompactions
in interface DBOptionsInterface
baseBackgroundCompactions
- Suggested number of background compaction
jobspublic int baseBackgroundCompactions()
DBOptionsInterface
baseBackgroundCompactions
in interface DBOptionsInterface
public DBOptions setMaxBackgroundCompactions(int maxBackgroundCompactions)
DBOptionsInterface
setMaxBackgroundCompactions
in interface DBOptionsInterface
maxBackgroundCompactions
- the maximum number of background
compaction jobs.Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
,
DBOptionsInterface.maxBackgroundFlushes()
public int maxBackgroundCompactions()
DBOptionsInterface
maxBackgroundCompactions
in interface DBOptionsInterface
Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
public void setMaxSubcompactions(int maxSubcompactions)
DBOptionsInterface
setMaxSubcompactions
in interface DBOptionsInterface
maxSubcompactions
- The maximum number of threads that will
concurrently perform a compaction jobpublic int maxSubcompactions()
DBOptionsInterface
maxSubcompactions
in interface DBOptionsInterface
public DBOptions setMaxBackgroundFlushes(int maxBackgroundFlushes)
DBOptionsInterface
setMaxBackgroundFlushes
in interface DBOptionsInterface
maxBackgroundFlushes
- number of max concurrent flush jobsEnv.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
,
DBOptionsInterface.maxBackgroundCompactions()
public int maxBackgroundFlushes()
DBOptionsInterface
maxBackgroundFlushes
in interface DBOptionsInterface
Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
public DBOptions setMaxLogFileSize(long maxLogFileSize)
DBOptionsInterface
setMaxLogFileSize
in interface DBOptionsInterface
maxLogFileSize
- the maximum size of a info log file.public long maxLogFileSize()
DBOptionsInterface
maxLogFileSize
in interface DBOptionsInterface
public DBOptions setLogFileTimeToRoll(long logFileTimeToRoll)
DBOptionsInterface
setLogFileTimeToRoll
in interface DBOptionsInterface
logFileTimeToRoll
- the time interval in seconds.public long logFileTimeToRoll()
DBOptionsInterface
logFileTimeToRoll
in interface DBOptionsInterface
public DBOptions setKeepLogFileNum(long keepLogFileNum)
DBOptionsInterface
setKeepLogFileNum
in interface DBOptionsInterface
keepLogFileNum
- the maximum number of info log files to be kept.public long keepLogFileNum()
DBOptionsInterface
keepLogFileNum
in interface DBOptionsInterface
public DBOptions setMaxManifestFileSize(long maxManifestFileSize)
DBOptionsInterface
setMaxManifestFileSize
in interface DBOptionsInterface
maxManifestFileSize
- the size limit of a manifest file.public long maxManifestFileSize()
DBOptionsInterface
maxManifestFileSize
in interface DBOptionsInterface
public DBOptions setTableCacheNumshardbits(int tableCacheNumshardbits)
DBOptionsInterface
setTableCacheNumshardbits
in interface DBOptionsInterface
tableCacheNumshardbits
- the number of chardspublic int tableCacheNumshardbits()
DBOptionsInterface
tableCacheNumshardbits
in interface DBOptionsInterface
public DBOptions setWalTtlSeconds(long walTtlSeconds)
DBOptionsInterface
DBOptionsInterface.walTtlSeconds()
and DBOptionsInterface.walSizeLimitMB()
affect how archived logs
will be deleted.
setWalTtlSeconds
in interface DBOptionsInterface
walTtlSeconds
- the ttl secondsDBOptionsInterface.setWalSizeLimitMB(long)
public long walTtlSeconds()
DBOptionsInterface
walTtlSeconds
in interface DBOptionsInterface
DBOptionsInterface.walSizeLimitMB()
public DBOptions setWalSizeLimitMB(long sizeLimitMB)
DBOptionsInterface
setWalSizeLimitMB
in interface DBOptionsInterface
sizeLimitMB
- size limit in mega-bytes.DBOptionsInterface.setWalSizeLimitMB(long)
public long walSizeLimitMB()
DBOptionsInterface
DBOptionsInterface.walTtlSeconds()
and #walSizeLimitMB()
affect how archived logs
will be deleted.
walSizeLimitMB
in interface DBOptionsInterface
DBOptionsInterface.walSizeLimitMB()
public DBOptions setManifestPreallocationSize(long size)
DBOptionsInterface
setManifestPreallocationSize
in interface DBOptionsInterface
size
- the size in bytepublic long manifestPreallocationSize()
DBOptionsInterface
manifestPreallocationSize
in interface DBOptionsInterface
public DBOptions setUseDirectReads(boolean useDirectReads)
DBOptionsInterface
setUseDirectReads
in interface DBOptionsInterface
useDirectReads
- if true, then direct read is enabledpublic boolean useDirectReads()
DBOptionsInterface
useDirectReads
in interface DBOptionsInterface
public DBOptions setUseDirectWrites(boolean useDirectWrites)
DBOptionsInterface
setUseDirectWrites
in interface DBOptionsInterface
useDirectWrites
- if true, then direct write is enabledpublic boolean useDirectWrites()
DBOptionsInterface
useDirectWrites
in interface DBOptionsInterface
public DBOptions setAllowMmapReads(boolean allowMmapReads)
DBOptionsInterface
setAllowMmapReads
in interface DBOptionsInterface
allowMmapReads
- true if mmap reads are allowed.public boolean allowMmapReads()
DBOptionsInterface
allowMmapReads
in interface DBOptionsInterface
public DBOptions setAllowMmapWrites(boolean allowMmapWrites)
DBOptionsInterface
setAllowMmapWrites
in interface DBOptionsInterface
allowMmapWrites
- true if mmap writes are allowd.public boolean allowMmapWrites()
DBOptionsInterface
allowMmapWrites
in interface DBOptionsInterface
public DBOptions setIsFdCloseOnExec(boolean isFdCloseOnExec)
DBOptionsInterface
setIsFdCloseOnExec
in interface DBOptionsInterface
isFdCloseOnExec
- true if child process inheriting open
files is disabled.public boolean isFdCloseOnExec()
DBOptionsInterface
isFdCloseOnExec
in interface DBOptionsInterface
public DBOptions setStatsDumpPeriodSec(int statsDumpPeriodSec)
DBOptionsInterface
setStatsDumpPeriodSec
in interface DBOptionsInterface
statsDumpPeriodSec
- time interval in seconds.public int statsDumpPeriodSec()
DBOptionsInterface
statsDumpPeriodSec
in interface DBOptionsInterface
public DBOptions setAdviseRandomOnOpen(boolean adviseRandomOnOpen)
DBOptionsInterface
setAdviseRandomOnOpen
in interface DBOptionsInterface
adviseRandomOnOpen
- true if hinting random access is on.public boolean adviseRandomOnOpen()
DBOptionsInterface
adviseRandomOnOpen
in interface DBOptionsInterface
public DBOptions setUseAdaptiveMutex(boolean useAdaptiveMutex)
DBOptionsInterface
setUseAdaptiveMutex
in interface DBOptionsInterface
useAdaptiveMutex
- true if adaptive mutex is used.public boolean useAdaptiveMutex()
DBOptionsInterface
useAdaptiveMutex
in interface DBOptionsInterface
public DBOptions setBytesPerSync(long bytesPerSync)
DBOptionsInterface
setBytesPerSync
in interface DBOptionsInterface
bytesPerSync
- size in bytespublic long bytesPerSync()
DBOptionsInterface
bytesPerSync
in interface DBOptionsInterface
public void setAllowConcurrentMemtableWrite(boolean allowConcurrentMemtableWrite)
DBOptionsInterface
DBOptionsInterface.setEnableWriteThreadAdaptiveYield(boolean)
if you are going to use
this feature.
Default: falsesetAllowConcurrentMemtableWrite
in interface DBOptionsInterface
allowConcurrentMemtableWrite
- true to enable concurrent writes
for the memtablepublic boolean allowConcurrentMemtableWrite()
DBOptionsInterface
DBOptionsInterface.setEnableWriteThreadAdaptiveYield(boolean)
if you are going to use
this feature.
Default: falseallowConcurrentMemtableWrite
in interface DBOptionsInterface
public void setEnableWriteThreadAdaptiveYield(boolean enableWriteThreadAdaptiveYield)
DBOptionsInterface
DBOptionsInterface.writeThreadMaxYieldUsec()
before blocking on a
mutex. This can substantially improve throughput for concurrent workloads,
regardless of whether DBOptionsInterface.allowConcurrentMemtableWrite()
is enabled.
Default: falsesetEnableWriteThreadAdaptiveYield
in interface DBOptionsInterface
enableWriteThreadAdaptiveYield
- true to enable adaptive yield for the
write threadspublic boolean enableWriteThreadAdaptiveYield()
DBOptionsInterface
DBOptionsInterface.writeThreadMaxYieldUsec()
before blocking on a
mutex. This can substantially improve throughput for concurrent workloads,
regardless of whether DBOptionsInterface.allowConcurrentMemtableWrite()
is enabled.
Default: falseenableWriteThreadAdaptiveYield
in interface DBOptionsInterface
public void setWriteThreadMaxYieldUsec(long writeThreadMaxYieldUsec)
DBOptionsInterface
DBOptionsInterface.writeThreadSlowYieldUsec()
is
set properly) increasing this value is likely to increase RocksDB
throughput at the expense of increased CPU usage.
Default: 100setWriteThreadMaxYieldUsec
in interface DBOptionsInterface
writeThreadMaxYieldUsec
- maximum number of microsecondspublic long writeThreadMaxYieldUsec()
DBOptionsInterface
DBOptionsInterface.writeThreadSlowYieldUsec()
is
set properly) increasing this value is likely to increase RocksDB
throughput at the expense of increased CPU usage.
Default: 100writeThreadMaxYieldUsec
in interface DBOptionsInterface
public void setWriteThreadSlowYieldUsec(long writeThreadSlowYieldUsec)
DBOptionsInterface
setWriteThreadSlowYieldUsec
in interface DBOptionsInterface
writeThreadSlowYieldUsec
- the latency in microsecondspublic long writeThreadSlowYieldUsec()
DBOptionsInterface
writeThreadSlowYieldUsec
in interface DBOptionsInterface
public DBOptions setDelayedWriteRate(long delayedWriteRate)
public long delayedWriteRate()
protected final void disposeInternal(long handle)
disposeInternal
in class RocksObject