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 |
allowMmapReads()
Allow the OS to mmap file for reading sst tables.
|
boolean |
allowMmapWrites()
Allow the OS to mmap file for writing.
|
boolean |
allowOsBuffer()
Data being read from file storage may be buffered in the OS
Default: true
|
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.
|
java.lang.Object |
createStatistics()
Creates statistics object which collects metrics about database operations.
|
java.lang.String |
dbLogDir()
Returns the directory of info log.
|
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.
|
boolean |
errorIfExists()
If true, an error will be thrown during RocksDB.open() if the
database already exists.
|
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.
|
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.
|
java.lang.Object |
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.
|
java.lang.Object |
setAllowMmapReads(boolean allowMmapReads)
Allow the OS to mmap file for reading sst tables.
|
java.lang.Object |
setAllowMmapWrites(boolean allowMmapWrites)
Allow the OS to mmap file for writing.
|
java.lang.Object |
setAllowOsBuffer(boolean allowOsBuffer)
Data being read from file storage may be buffered in the OS
Default: true
|
java.lang.Object |
setBytesPerSync(long bytesPerSync)
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
java.lang.Object |
setCreateIfMissing(boolean flag)
If this value is set to true, then the database will be created
if it is missing during
RocksDB.open() . |
java.lang.Object |
setCreateMissingColumnFamilies(boolean flag)
If true, missing column families will be automatically created
|
java.lang.Object |
setDbLogDir(java.lang.String dbLogDir)
This specifies the info LOG dir.
|
java.lang.Object |
setDeleteObsoleteFilesPeriodMicros(long micros)
The periodicity when obsolete files get deleted.
|
java.lang.Object |
setDisableDataSync(boolean disableDataSync)
If true, then the contents of manifest and data files are
not synced to stable storage.
|
java.lang.Object |
setErrorIfExists(boolean errorIfExists)
If true, an error will be thrown during RocksDB.open() if the
database already exists.
|
java.lang.Object |
setIncreaseParallelism(int totalThreads)
By default, RocksDB uses only one background thread for flush and
compaction.
|
java.lang.Object |
setInfoLogLevel(InfoLogLevel infoLogLevel)
Sets the RocksDB log level.
|
java.lang.Object |
setIsFdCloseOnExec(boolean isFdCloseOnExec)
Disable child process inherit open files.
|
java.lang.Object |
setKeepLogFileNum(long keepLogFileNum)
Specifies the maximum number of info log files to be kept.
|
java.lang.Object |
setLogFileTimeToRoll(long logFileTimeToRoll)
Specifies the time interval for the info log file to roll (in seconds).
|
java.lang.Object |
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.
|
java.lang.Object |
setManifestPreallocationSize(long size)
Number of bytes to preallocate (via fallocate) the manifest
files.
|
java.lang.Object |
setMaxBackgroundCompactions(int maxBackgroundCompactions)
Specifies the maximum number of concurrent background compaction jobs,
submitted to the default LOW priority thread pool.
|
java.lang.Object |
setMaxBackgroundFlushes(int maxBackgroundFlushes)
Specifies the maximum number of concurrent background flush jobs.
|
java.lang.Object |
setMaxLogFileSize(long maxLogFileSize)
Specifies the maximum size of a info log file.
|
java.lang.Object |
setMaxManifestFileSize(long maxManifestFileSize)
Manifest file is rolled over on reaching this limit.
|
java.lang.Object |
setMaxOpenFiles(int maxOpenFiles)
Number of open files that can be used by the DB.
|
java.lang.Object |
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.
|
java.lang.Object |
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.
|
java.lang.Object |
setRateLimiterConfig(RateLimiterConfig config)
Use to control write rate of flush and compaction.
|
java.lang.Object |
setStatsDumpPeriodSec(int statsDumpPeriodSec)
if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 3600 (1 hour)
|
java.lang.Object |
setTableCacheNumshardbits(int tableCacheNumshardbits)
Number of shards used for table cache.
|
java.lang.Object |
setUseAdaptiveMutex(boolean useAdaptiveMutex)
Use adaptive mutex, which spins in the user space before resorting
to kernel.
|
java.lang.Object |
setUseFsync(boolean useFsync)
If true, then every store to stable storage will issue a fsync.
|
java.lang.Object |
setWalDir(java.lang.String walDir)
This specifies the absolute dir path for write-ahead logs (WAL).
|
java.lang.Object |
setWalSizeLimitMB(long sizeLimitMB)
WalTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted.
|
java.lang.Object |
setWalTtlSeconds(long walTtlSeconds)
walTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted. |
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 |
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()
walTtlSeconds() and #walSizeLimitMB() affect how archived logs
will be deleted. |
long |
walTtlSeconds()
WalTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted.
|
java.lang.Object setIncreaseParallelism(int totalThreads)
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.
totalThreads
- The total number of threads to be used by RocksDB.
A good value is the number of cores.java.lang.Object setCreateIfMissing(boolean flag)
RocksDB.open()
.
Default: falseflag
- 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)
boolean createIfMissing()
setCreateIfMissing(boolean)
java.lang.Object setCreateMissingColumnFamilies(boolean flag)
If true, missing column families will be automatically created
Default: false
flag
- a flag indicating if missing column families shall be
created automatically.boolean createMissingColumnFamilies()
setCreateMissingColumnFamilies(boolean)
java.lang.Object setErrorIfExists(boolean errorIfExists)
errorIfExists
- if true, an exception will be thrown
during RocksDB.open()
if the database already exists.RocksDB.open(org.rocksdb.Options, String)
boolean errorIfExists()
java.lang.Object setParanoidChecks(boolean paranoidChecks)
paranoidChecks
- a flag to indicate whether paranoid-check
is on.boolean paranoidChecks()
java.lang.Object setRateLimiterConfig(RateLimiterConfig config)
config
- rate limiter config.java.lang.Object 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.
Default: nullptr
logger
- Logger
instance.java.lang.Object setInfoLogLevel(InfoLogLevel infoLogLevel)
Sets the RocksDB log level. Default level is INFO
infoLogLevel
- log level to set.InfoLogLevel infoLogLevel()
Returns currently set log level.
InfoLogLevel
instance.java.lang.Object 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: 5000maxOpenFiles
- 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.java.lang.Object 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
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
java.lang.Object createStatistics()
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.
RocksDB.open(org.rocksdb.Options, String)
Statistics statisticsPtr()
Returns statistics object. Calls createStatistics()
if
C++ returns nullptr
for statistics.
createStatistics()
java.lang.Object setDisableDataSync(boolean disableDataSync)
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
disableDataSync
- a boolean flag to specify whether to
disable data sync.boolean disableDataSync()
java.lang.Object setUseFsync(boolean useFsync)
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
useFsync
- a boolean flag to specify whether to use fsyncboolean useFsync()
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.
java.lang.Object setDbLogDir(java.lang.String dbLogDir)
dbLogDir
- the path to the info log directoryjava.lang.String dbLogDir()
java.lang.Object setWalDir(java.lang.String walDir)
walDir
- the path to the write-ahead-log directory.java.lang.String walDir()
java.lang.Object setDeleteObsoleteFilesPeriodMicros(long micros)
micros
- the time interval in microslong deleteObsoleteFilesPeriodMicros()
java.lang.Object setMaxBackgroundCompactions(int maxBackgroundCompactions)
maxBackgroundCompactions
- the maximum number of background
compaction jobs.Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
,
maxBackgroundFlushes()
int maxBackgroundCompactions()
Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
java.lang.Object setMaxBackgroundFlushes(int maxBackgroundFlushes)
maxBackgroundFlushes
- number of max concurrent flush jobsEnv.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
,
maxBackgroundCompactions()
int maxBackgroundFlushes()
Env.setBackgroundThreads(int)
,
Env.setBackgroundThreads(int, int)
java.lang.Object setMaxLogFileSize(long maxLogFileSize)
maxLogFileSize
- the maximum size of a info log file.java.lang.IllegalArgumentException
- thrown on 32-Bit platforms
while overflowing the underlying platform specific value.long maxLogFileSize()
java.lang.Object setLogFileTimeToRoll(long logFileTimeToRoll)
logFileTimeToRoll
- the time interval in seconds.java.lang.IllegalArgumentException
- thrown on 32-Bit platforms
while overflowing the underlying platform specific value.long logFileTimeToRoll()
java.lang.Object setKeepLogFileNum(long keepLogFileNum)
keepLogFileNum
- the maximum number of info log files to be kept.java.lang.IllegalArgumentException
- thrown on 32-Bit platforms
while overflowing the underlying platform specific value.long keepLogFileNum()
java.lang.Object setMaxManifestFileSize(long maxManifestFileSize)
maxManifestFileSize
- the size limit of a manifest file.long maxManifestFileSize()
java.lang.Object setTableCacheNumshardbits(int tableCacheNumshardbits)
tableCacheNumshardbits
- the number of chardsint tableCacheNumshardbits()
java.lang.Object setWalTtlSeconds(long walTtlSeconds)
walTtlSeconds()
and walSizeLimitMB()
affect how archived logs
will be deleted.
walTtlSeconds
- the ttl secondssetWalSizeLimitMB(long)
long walTtlSeconds()
walSizeLimitMB()
java.lang.Object setWalSizeLimitMB(long sizeLimitMB)
sizeLimitMB
- size limit in mega-bytes.setWalSizeLimitMB(long)
long walSizeLimitMB()
walTtlSeconds()
and #walSizeLimitMB()
affect how archived logs
will be deleted.
walSizeLimitMB()
java.lang.Object setManifestPreallocationSize(long size)
size
- the size in bytejava.lang.IllegalArgumentException
- thrown on 32-Bit platforms
while overflowing the underlying platform specific value.long manifestPreallocationSize()
java.lang.Object setAllowOsBuffer(boolean allowOsBuffer)
allowOsBuffer
- if true, then OS buffering is allowed.boolean allowOsBuffer()
java.lang.Object setAllowMmapReads(boolean allowMmapReads)
allowMmapReads
- true if mmap reads are allowed.boolean allowMmapReads()
java.lang.Object setAllowMmapWrites(boolean allowMmapWrites)
allowMmapWrites
- true if mmap writes are allowd.boolean allowMmapWrites()
java.lang.Object setIsFdCloseOnExec(boolean isFdCloseOnExec)
isFdCloseOnExec
- true if child process inheriting open
files is disabled.boolean isFdCloseOnExec()
java.lang.Object setStatsDumpPeriodSec(int statsDumpPeriodSec)
statsDumpPeriodSec
- time interval in seconds.int statsDumpPeriodSec()
java.lang.Object setAdviseRandomOnOpen(boolean adviseRandomOnOpen)
adviseRandomOnOpen
- true if hinting random access is on.boolean adviseRandomOnOpen()
java.lang.Object setUseAdaptiveMutex(boolean useAdaptiveMutex)
useAdaptiveMutex
- true if adaptive mutex is used.boolean useAdaptiveMutex()
java.lang.Object setBytesPerSync(long bytesPerSync)
bytesPerSync
- size in byteslong bytesPerSync()