public class Options extends RocksObject implements DBOptionsInterface<Options>, MutableDBOptionsInterface<Options>, ColumnFamilyOptionsInterface<Options>, MutableColumnFamilyOptionsInterface<Options>
RocksDB (i.e., RocksDB.open()).
As a descendent of AbstractNativeReference, this class is AutoCloseable
and will be automatically released if opened in the preamble of a try with resources block.
nativeHandle_owningHandle_DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET| 构造器和说明 |
|---|
Options()
Construct options for opening a RocksDB.
|
Options(DBOptions dbOptions,
ColumnFamilyOptions columnFamilyOptions)
Construct options for opening a RocksDB.
|
Options(Options other)
Copy constructor for ColumnFamilyOptions.
|
| 限定符和类型 | 方法和说明 |
|---|---|
AccessHint |
accessHintOnCompactionStart()
Specify the file access pattern once a compaction is started.
|
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 |
allow2pc()
if set to false then recovery will fail when a prepared
transaction is encountered in the WAL
Default: false
|
boolean |
allowConcurrentMemtableWrite()
If true, allow multi-writers to update mem tables in parallel.
|
boolean |
allowFAllocate()
Whether fallocate calls are allowed
|
boolean |
allowIngestBehind()
Returns true if ingest behind is allowed.
|
boolean |
allowMmapReads()
Allow the OS to mmap file for reading sst tables.
|
boolean |
allowMmapWrites()
Allow the OS to mmap file for writing.
|
long |
arenaBlockSize()
The size of one block in arena memory allocation.
|
boolean |
atomicFlush()
Determine if atomic flush of multiple column families is enabled.
|
boolean |
avoidFlushDuringRecovery()
By default RocksDB replay WAL logs and flush them on DB open, which may
create very small SST files.
|
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.
|
boolean |
avoidUnnecessaryBlockingIO()
If true, working thread may avoid doing unnecessary and long-latency
operation (such as deleting obsolete files directly or deleting memtable)
and will instead schedule a background job to do it.
|
boolean |
bestEffortsRecovery()
By default, RocksDB recovery fails if any table file referenced in
MANIFEST are missing after scanning the MANIFEST.
|
long |
bgerrorResumeRetryInterval()
If max_bgerror_resume_count is ≥ 2, db resume is called multiple times.
|
long |
blobCompactionReadaheadSize()
Get compaction readahead for blob files.
|
CompressionType |
blobCompressionType()
Get the compression algorithm in use for large values stored in blob files.
|
long |
blobFileSize()
The size limit for blob files.
|
int |
blobFileStartingLevel()
Get the starting LSM tree level to enable blob files.
|
double |
blobGarbageCollectionAgeCutoff()
Get cutoff in terms of blob file age for garbage collection.
|
double |
blobGarbageCollectionForceThreshold()
Get the current value for the
#blobGarbageCollectionForceThreshold |
int |
bloomLocality()
Control locality of bloom filter probes to improve cache miss rate.
|
CompressionOptions |
bottommostCompressionOptions()
Get the bottom most compression options.
|
CompressionType |
bottommostCompressionType()
Compression algorithm that will be used for the bottommost level that
contain files.
|
long |
bytesPerSync()
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
java.util.List<DbPath> |
cfPaths() |
AbstractCompactionFilter<? extends AbstractSlice<?>> |
compactionFilter()
Accessor for the CompactionFilter instance in use.
|
AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> |
compactionFilterFactory()
Accessor for the CompactionFilterFactory instance in use.
|
CompactionOptionsFIFO |
compactionOptionsFIFO()
The options for FIFO compaction style
|
CompactionOptionsUniversal |
compactionOptionsUniversal()
The options needed to support Universal Style compactions
|
CompactionPriority |
compactionPriority()
Get the Compaction priority if level compaction
is used for all levels
|
long |
compactionReadaheadSize()
If non-zero, we perform bigger reads when doing compaction.
|
CompactionStyle |
compactionStyle()
Compaction style for DB.
|
ConcurrentTaskLimiter |
compactionThreadLimiter()
Get compaction thread limiter
|
CompressionOptions |
compressionOptions()
Get the different options for compression algorithms
|
java.util.List<CompressionType> |
compressionPerLevel()
Return the currently set
CompressionType
per instances. |
CompressionType |
compressionType()
Compress blocks using the specified compression algorithm.
|
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.String |
dbLogDir()
Returns the directory of info log.
|
java.util.List<DbPath> |
dbPaths()
A list of paths where SST files can be put into, with its target size.
|
long |
dbWriteBufferSize()
Amount of data to build up in memtables across all column
families before writing to disk.
|
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.
|
boolean |
disableAutoCompactions()
Disable automatic compactions.
|
protected void |
disposeInternal(long handle) |
boolean |
dumpMallocStats()
If true, then print malloc stats together with rocksdb.stats
when printing to LOG.
|
boolean |
enableBlobFiles()
When set, large values (blobs) are written to separate blob files, and only
pointers to them are stored in SST files.
|
boolean |
enableBlobGarbageCollection()
Query whether garbage collection of blobs is enabled.Blob GC is performed as part of
compaction.
|
boolean |
enablePipelinedWrite()
Returns true if pipelined writes are enabled.
|
boolean |
enableThreadTracking()
If true, then the status of the threads involved in this DB will
be tracked and available via GetThreadList() API.
|
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.
|
double |
experimentalMempurgeThreshold()
Threshold used in the MemPurge (memtable garbage collection)
feature.
|
boolean |
failIfOptionsFileError()
If true, then DB::Open / CreateColumnFamily / DropColumnFamily
/ SetOptions will fail if options file is not detected or properly
persisted.
|
boolean |
forceConsistencyChecks()
By default, RocksDB runs consistency checks on the LSM every time the LSM
changes (Flush, Compaction, AddFile).
|
Env |
getEnv()
Returns the set RocksEnv instance.
|
static java.lang.String |
getOptionStringFromProps(java.util.Properties properties)
Converts the input properties into a Options-style formatted string
|
long |
hardPendingCompactionBytesLimit()
All writes are stopped if estimated bytes needed to be compaction exceed
this threshold.
|
InfoLogLevel |
infoLogLevel()
Returns currently set log level.
|
long |
inplaceUpdateNumLocks()
Number of locks used for inplace update
Default: 10000, if inplace_update_support = true, else 0.
|
boolean |
inplaceUpdateSupport()
Allows thread-safe inplace updates.
|
boolean |
isFdCloseOnExec()
Disable child process inherit open files.
|
long |
keepLogFileNum()
Returns the maximum number of info log files to be kept.
|
int |
level0FileNumCompactionTrigger()
Number of files to trigger level-0 compaction.
|
int |
level0SlowdownWritesTrigger()
Soft limit on number of level-0 files.
|
int |
level0StopWritesTrigger()
Maximum number of level-0 files.
|
boolean |
levelCompactionDynamicLevelBytes()
Return if
LevelCompactionDynamicLevelBytes is enabled. |
int |
levelZeroFileNumCompactionTrigger()
The number of files in level 0 to trigger compaction from level-0 to
level-1.
|
int |
levelZeroSlowdownWritesTrigger()
Soft limit on the number of level-0 files.
|
int |
levelZeroStopWritesTrigger()
Maximum number of level-0 files.
|
java.util.List<AbstractEventListener> |
listeners()
Sets the
EventListeners whose callback functions
will be called when specific RocksDB event happens. |
long |
logFileTimeToRoll()
Returns the time interval for the info log file to roll (in seconds).
|
long |
logReadaheadSize()
The number of bytes to prefetch when reading the log.
|
long |
manifestPreallocationSize()
Number of bytes to preallocate (via fallocate) the manifest
files.
|
boolean |
manualWalFlush()
Returns true if automatic WAL flushing is disabled.
|
int |
maxBackgroundCompactions()
已过时。
|
int |
maxBackgroundFlushes()
已过时。
|
int |
maxBackgroundJobs()
Returns the maximum number of concurrent background jobs (both flushes
and compactions combined).
|
int |
maxBgerrorResumeCount()
It defines how many times db resume is called by a separate thread when
background retryable IO Error happens.
|
long |
maxBytesForLevelBase()
The upper-bound of the total size of level-1 files in bytes.
|
double |
maxBytesForLevelMultiplier()
The ratio between the total size of level-(L+1) files and the total
size of level-L files for all L.
|
int[] |
maxBytesForLevelMultiplierAdditional()
Different max-size multipliers for different levels.
|
long |
maxCompactionBytes()
Control maximum size of each compaction (not guaranteed)
|
int |
maxFileOpeningThreads()
If
MutableDBOptionsInterface.maxOpenFiles() is -1, DB will open all
files on DB::Open(). |
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 |
maxSequentialSkipInIterations()
An iteration->Next() sequentially skips over keys with the same
user-key unless this option is set.
|
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 |
maxSuccessiveMerges()
Maximum number of successive merge operations on a key in the memtable.
|
long |
maxTableFilesSizeFIFO()
FIFO compaction option.
|
long |
maxTotalWalSize()
Returns the max total write-ahead log size.
|
long |
maxWriteBatchGroupSizeBytes()
The maximum limit of number of bytes that are written in a single batch
of WAL or memtable write.
|
int |
maxWriteBufferNumber()
Returns maximum number of write buffers.
|
int |
maxWriteBufferNumberToMaintain()
The total maximum number of write buffers to maintain in memory including
copies of buffers that have already been flushed.
|
MemTableConfig |
memTableConfig()
Get the config for mem-table.
|
java.lang.String |
memTableFactoryName()
Returns the name of the current mem table representation.
|
long |
memtableHugePageSize()
Page size for huge page TLB for bloom in memtable.
|
double |
memtablePrefixBloomSizeRatio()
if prefix_extractor is set and memtable_prefix_bloom_size_ratio is not 0,
create prefix bloom for memtable with the size of
write_buffer_size * memtable_prefix_bloom_size_ratio.
|
boolean |
memtableWholeKeyFiltering()
Returns whether whole key bloom filter is enabled in memtable
|
long |
minBlobSize()
Get the size of the smallest value to be stored separately in a blob file.
|
int |
minWriteBufferNumberToMerge()
The minimum number of write buffers that will be merged together
before writing to storage.
|
int |
numLevels()
If level-styled compaction is used, then this number determines
the total number of levels.
|
Options |
oldDefaults(int majorVersion,
int minorVersion)
The function recovers options to a previous version.
|
boolean |
optimizeFiltersForHits()
Returns the current state of the
optimize_filters_for_hits
setting. |
Options |
optimizeForPointLookup(long blockCacheSizeMb)
Use this if you don't need to keep the data sorted, i.e. you'll never use
an iterator, only Put() and Get() API calls
|
Options |
optimizeForSmallDb()
Use this if your DB is very small (like under 1GB) and you don't want to
spend lots of memory for memtables.
|
Options |
optimizeForSmallDb(Cache cache)
Some functions that make it easier to optimize RocksDB
Use this if your DB is very small (like under 1GB) and you don't want to
spend lots of memory for memtables.
|
Options |
optimizeLevelStyleCompaction()
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
Options |
optimizeLevelStyleCompaction(long memtableMemoryBudget)
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
Options |
optimizeUniversalStyleCompaction()
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
Options |
optimizeUniversalStyleCompaction(long memtableMemoryBudget)
Default values for some parameters in ColumnFamilyOptions are not
optimized for heavy workloads and big datasets, which means you might
observe write stalls under some conditions.
|
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.
|
boolean |
paranoidFileChecks()
After writing every SST file, reopen it and read all the keys.
|
long |
periodicCompactionSeconds()
Get the periodicCompactionSeconds.
|
boolean |
persistStatsToDisk()
If true, automatically persist stats to a hidden column family (column
family name: ___rocksdb_stats_history___) every
stats_persist_period_sec seconds; otherwise, write to an in-memory
struct.
|
Options |
prepareForBulkLoad()
Set appropriate parameters for bulk loading.
|
PrepopulateBlobCache |
prepopulateBlobCache()
Get the prepopulate blob cache option.
|
long |
randomAccessMaxBufferSize()
This is a maximum buffer size that is used by WinMmapReadableFile in
unbuffered disk I/O mode.
|
long |
recycleLogFileNum()
Recycle log files.
|
boolean |
reportBgIoStats()
Determine whether IO stats in compactions and flushes are being measured
|
Cache |
rowCache()
A global cache for table-level rows.
|
Options |
setAccessHintOnCompactionStart(AccessHint accessHint)
Specify the file access pattern once a compaction is started.
|
Options |
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.
|
Options |
setAllow2pc(boolean allow2pc)
if set to false then recovery will fail when a prepared
transaction is encountered in the WAL
Default: false
|
Options |
setAllowConcurrentMemtableWrite(boolean allowConcurrentMemtableWrite)
If true, allow multi-writers to update mem tables in parallel.
|
Options |
setAllowFAllocate(boolean allowFAllocate)
Whether fallocate calls are allowed
|
Options |
setAllowIngestBehind(boolean allowIngestBehind)
Set this option to true during creation of database if you want
to be able to ingest behind (call IngestExternalFile() skipping keys
that already exist, rather than overwriting matching keys).
|
Options |
setAllowMmapReads(boolean allowMmapReads)
Allow the OS to mmap file for reading sst tables.
|
Options |
setAllowMmapWrites(boolean allowMmapWrites)
Allow the OS to mmap file for writing.
|
Options |
setArenaBlockSize(long arenaBlockSize)
The size of one block in arena memory allocation.
|
Options |
setAtomicFlush(boolean atomicFlush)
If true, RocksDB supports flushing multiple column families and committing
their results atomically to MANIFEST.
|
Options |
setAvoidFlushDuringRecovery(boolean avoidFlushDuringRecovery)
By default RocksDB replay WAL logs and flush them on DB open, which may
create very small SST files.
|
Options |
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.
|
Options |
setAvoidUnnecessaryBlockingIO(boolean avoidUnnecessaryBlockingIO)
If true, working thread may avoid doing unnecessary and long-latency
operation (such as deleting obsolete files directly or deleting memtable)
and will instead schedule a background job to do it.
|
Options |
setBestEffortsRecovery(boolean bestEffortsRecovery)
By default, RocksDB recovery fails if any table file referenced in
MANIFEST are missing after scanning the MANIFEST.
|
Options |
setBgerrorResumeRetryInterval(long bgerrorResumeRetryInterval)
If max_bgerror_resume_count is ≥ 2, db resume is called multiple times.
|
Options |
setBlobCompactionReadaheadSize(long blobCompactionReadaheadSize)
Set compaction readahead for blob files.
|
Options |
setBlobCompressionType(CompressionType compressionType)
Set the compression algorithm to use for large values stored in blob files.
|
Options |
setBlobFileSize(long blobFileSize)
Set the size limit for blob files.
|
Options |
setBlobFileStartingLevel(int blobFileStartingLevel)
Set a certain LSM tree level to enable blob files.
|
Options |
setBlobGarbageCollectionAgeCutoff(double blobGarbageCollectionAgeCutoff)
Set cutoff in terms of blob file age for garbage collection.
|
Options |
setBlobGarbageCollectionForceThreshold(double blobGarbageCollectionForceThreshold)
If the ratio of garbage in the oldest blob files exceeds this threshold,
targeted compactions are scheduled in order to force garbage collecting
the blob files in question, assuming they are all eligible based on the
value of
AdvancedMutableColumnFamilyOptionsInterface.blobGarbageCollectionAgeCutoff() above. |
Options |
setBloomLocality(int bloomLocality)
Control locality of bloom filter probes to improve cache miss rate.
|
Options |
setBottommostCompressionOptions(CompressionOptions bottommostCompressionOptions)
Set the options for compression algorithms used by
ColumnFamilyOptionsInterface.bottommostCompressionType() if it is enabled. |
Options |
setBottommostCompressionType(CompressionType bottommostCompressionType)
Compression algorithm that will be used for the bottommost level that
contain files.
|
Options |
setBytesPerSync(long bytesPerSync)
Allows OS to incrementally sync files to disk while they are being
written, asynchronously, in the background.
|
Options |
setCfPaths(java.util.Collection<DbPath> cfPaths)
A list of paths where SST files for this column family
can be put into, with its target size.
|
Options |
setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
A single CompactionFilter instance to call into during compaction.
|
Options |
setCompactionFilterFactory(AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory)
This is a factory that provides
AbstractCompactionFilter objects
which allow an application to modify/delete a key-value during background
compaction. |
Options |
setCompactionOptionsFIFO(CompactionOptionsFIFO compactionOptionsFIFO)
The options for FIFO compaction style
|
Options |
setCompactionOptionsUniversal(CompactionOptionsUniversal compactionOptionsUniversal)
Set the options needed to support Universal Style compactions
|
Options |
setCompactionPriority(CompactionPriority compactionPriority)
If level
AdvancedColumnFamilyOptionsInterface.compactionStyle() == CompactionStyle.LEVEL,
for each level, which files are prioritized to be picked to compact. |
Options |
setCompactionReadaheadSize(long compactionReadaheadSize)
If non-zero, we perform bigger reads when doing compaction.
|
Options |
setCompactionStyle(CompactionStyle compactionStyle)
Set compaction style for DB.
|
Options |
setCompactionThreadLimiter(ConcurrentTaskLimiter compactionThreadLimiter)
Compaction concurrent thread limiter for the column family.
|
Options |
setComparator(AbstractComparator comparator)
Use the specified comparator for key ordering.
|
Options |
setComparator(BuiltinComparator builtinComparator)
Set
BuiltinComparator to be used with RocksDB. |
Options |
setCompressionOptions(CompressionOptions compressionOptions)
Set the different options for compression algorithms
|
Options |
setCompressionPerLevel(java.util.List<CompressionType> compressionLevels)
Different levels can have different compression
policies.
|
Options |
setCompressionType(CompressionType compressionType)
Compress blocks using the specified compression algorithm.
|
Options |
setCreateIfMissing(boolean flag)
If this value is set to true, then the database will be created
if it is missing during
RocksDB.open(). |
Options |
setCreateMissingColumnFamilies(boolean flag)
If true, missing column families will be automatically created
Default: false
|
Options |
setDbLogDir(java.lang.String dbLogDir)
This specifies the info LOG dir.
|
Options |
setDbPaths(java.util.Collection<DbPath> dbPaths)
A list of paths where SST files can be put into, with its target size.
|
Options |
setDbWriteBufferSize(long dbWriteBufferSize)
Amount of data to build up in memtables across all column
families before writing to disk.
|
Options |
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. |
Options |
setDeleteObsoleteFilesPeriodMicros(long micros)
The periodicity when obsolete files get deleted.
|
Options |
setDisableAutoCompactions(boolean disableAutoCompactions)
Disable automatic compactions.
|
Options |
setDumpMallocStats(boolean dumpMallocStats)
If true, then print malloc stats together with rocksdb.stats
when printing to LOG.
|
Options |
setEnableBlobFiles(boolean enableBlobFiles)
When set, large values (blobs) are written to separate blob files, and only
pointers to them are stored in SST files.
|
Options |
setEnableBlobGarbageCollection(boolean enableBlobGarbageCollection)
Enable/disable garbage collection of blobs.
|
Options |
setEnablePipelinedWrite(boolean enablePipelinedWrite)
By default, a single write thread queue is maintained.
|
Options |
setEnableThreadTracking(boolean enableThreadTracking)
If true, then the status of the threads involved in this DB will
be tracked and available via GetThreadList() API.
|
Options |
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. |
Options |
setEnv(Env env)
Use the specified object to interact with the environment,
e.g. to read/write files, schedule background work, etc.
|
Options |
setErrorIfExists(boolean errorIfExists)
If true, an error will be thrown during RocksDB.open() if the
database already exists.
|
Options |
setExperimentalMempurgeThreshold(double experimentalMempurgeThreshold)
Threshold used in the MemPurge (memtable garbage collection)
feature.
|
Options |
setFailIfOptionsFileError(boolean failIfOptionsFileError)
If true, then DB::Open / CreateColumnFamily / DropColumnFamily
/ SetOptions will fail if options file is not detected or properly
persisted.
|
Options |
setForceConsistencyChecks(boolean forceConsistencyChecks)
By default, RocksDB runs consistency checks on the LSM every time the LSM
changes (Flush, Compaction, AddFile).
|
Options |
setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
All writes are stopped if estimated bytes needed to be compaction exceed
this threshold.
|
Options |
setIncreaseParallelism(int totalThreads)
By default, RocksDB uses only one background thread for flush and
compaction.
|
Options |
setInfoLogLevel(InfoLogLevel infoLogLevel)
Sets the RocksDB log level.
|
Options |
setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
Number of locks used for inplace update
Default: 10000, if inplace_update_support = true, else 0.
|
Options |
setInplaceUpdateSupport(boolean inplaceUpdateSupport)
Allows thread-safe inplace updates.
|
Options |
setIsFdCloseOnExec(boolean isFdCloseOnExec)
Disable child process inherit open files.
|
Options |
setKeepLogFileNum(long keepLogFileNum)
Specifies the maximum number of info log files to be kept.
|
Options |
setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
Number of files to trigger level-0 compaction.
|
Options |
setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
Soft limit on number of level-0 files.
|
Options |
setLevel0StopWritesTrigger(int level0StopWritesTrigger)
Maximum number of level-0 files.
|
Options |
setLevelCompactionDynamicLevelBytes(boolean enableLevelCompactionDynamicLevelBytes)
If
true, RocksDB will pick target size of each level
dynamically. |
Options |
setLevelZeroFileNumCompactionTrigger(int numFiles)
Number of files to trigger level-0 compaction.
|
Options |
setLevelZeroSlowdownWritesTrigger(int numFiles)
Soft limit on number of level-0 files.
|
Options |
setLevelZeroStopWritesTrigger(int numFiles)
Maximum number of level-0 files.
|
Options |
setListeners(java.util.List<AbstractEventListener> listeners)
Sets the
EventListeners whose callback functions
will be called when specific RocksDB event happens. |
Options |
setLogFileTimeToRoll(long logFileTimeToRoll)
Specifies the time interval for the info log file to roll (in seconds).
|
Options |
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.
|
Options |
setLogReadaheadSize(long logReadaheadSize)
The number of bytes to prefetch when reading the log.
|
Options |
setManifestPreallocationSize(long size)
Number of bytes to preallocate (via fallocate) the manifest
files.
|
Options |
setManualWalFlush(boolean manualWalFlush)
If true WAL is not flushed automatically after each write.
|
Options |
setMaxBackgroundCompactions(int maxBackgroundCompactions)
已过时。
|
Options |
setMaxBackgroundFlushes(int maxBackgroundFlushes)
已过时。
|
Options |
setMaxBackgroundJobs(int maxBackgroundJobs)
Specifies the maximum number of concurrent background jobs (both flushes
and compactions combined).
|
Options |
setMaxBgErrorResumeCount(int maxBgerrorResumeCount)
It defines how many times db resume is called by a separate thread when
background retryable IO Error happens.
|
Options |
setMaxBytesForLevelBase(long maxBytesForLevelBase)
The upper-bound of the total size of level-1 files in bytes.
|
Options |
setMaxBytesForLevelMultiplier(double multiplier)
The ratio between the total size of level-(L+1) files and the total
size of level-L files for all L.
|
Options |
setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
Different max-size multipliers for different levels.
|
Options |
setMaxCompactionBytes(long maxCompactionBytes)
Maximum size of each compaction (not guarantee)
|
Options |
setMaxFileOpeningThreads(int maxFileOpeningThreads)
If
MutableDBOptionsInterface.maxOpenFiles() is -1, DB will open
all files on DB::Open(). |
Options |
setMaxLogFileSize(long maxLogFileSize)
Specifies the maximum size of a info log file.
|
Options |
setMaxManifestFileSize(long maxManifestFileSize)
Manifest file is rolled over on reaching this limit.
|
Options |
setMaxOpenFiles(int maxOpenFiles)
Number of open files that can be used by the DB.
|
Options |
setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
An iteration->Next() sequentially skips over keys with the same
user-key unless this option is set.
|
Options |
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.
|
Options |
setMaxSuccessiveMerges(long maxSuccessiveMerges)
Maximum number of successive merge operations on a key in the memtable.
|
Options |
setMaxTableFilesSizeFIFO(long maxTableFilesSize)
FIFO compaction option.
|
Options |
setMaxTotalWalSize(long maxTotalWalSize)
Set the max total write-ahead log size.
|
Options |
setMaxWriteBatchGroupSizeBytes(long maxWriteBatchGroupSizeBytes)
The maximum limit of number of bytes that are written in a single batch
of WAL or memtable write.
|
Options |
setMaxWriteBufferNumber(int maxWriteBufferNumber)
The maximum number of write buffers that are built up in memory.
|
Options |
setMaxWriteBufferNumberToMaintain(int maxWriteBufferNumberToMaintain)
The total maximum number of write buffers to maintain in memory including
copies of buffers that have already been flushed.
|
Options |
setMemTableConfig(MemTableConfig config)
Set the config for mem-table.
|
Options |
setMemtableHugePageSize(long memtableHugePageSize)
Page size for huge page TLB for bloom in memtable.
|
Options |
setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
if prefix_extractor is set and memtable_prefix_bloom_size_ratio is not 0,
create prefix bloom for memtable with the size of
write_buffer_size * memtable_prefix_bloom_size_ratio.
|
Options |
setMemtableWholeKeyFiltering(boolean memtableWholeKeyFiltering)
Enable whole key bloom filter in memtable.
|
Options |
setMergeOperator(MergeOperator mergeOperator)
Set the merge operator to be used for merging two different key/value
pairs that share the same key.
|
Options |
setMergeOperatorName(java.lang.String name)
Set the merge operator to be used for merging two merge operands
of the same key.
|
Options |
setMinBlobSize(long minBlobSize)
Set the size of the smallest value to be stored separately in a blob file.
|
Options |
setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
The minimum number of write buffers that will be merged together
before writing to storage.
|
Options |
setNumLevels(int numLevels)
Set the number of levels for this database
If level-styled compaction is used, then this number determines
the total number of levels.
|
Options |
setOptimizeFiltersForHits(boolean optimizeFiltersForHits)
This flag specifies that the implementation should optimize the filters
mainly for cases where keys are found rather than also optimize for keys
missed.
|
Options |
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.
|
Options |
setParanoidFileChecks(boolean paranoidFileChecks)
After writing every SST file, reopen it and read all the keys.
|
Options |
setPeriodicCompactionSeconds(long periodicCompactionSeconds)
Files older than this value will be picked up for compaction, and
re-written to the same level as they were before.
|
Options |
setPersistStatsToDisk(boolean persistStatsToDisk)
If true, automatically persist stats to a hidden column family (column
family name: ___rocksdb_stats_history___) every
stats_persist_period_sec seconds; otherwise, write to an in-memory
struct.
|
Options |
setPrepopulateBlobCache(PrepopulateBlobCache prepopulateBlobCache)
Set a certain prepopulate blob cache option.
|
Options |
setRandomAccessMaxBufferSize(long randomAccessMaxBufferSize)
This is a maximum buffer size that is used by WinMmapReadableFile in
unbuffered disk I/O mode.
|
Options |
setRateLimiter(RateLimiter rateLimiter)
Use to control write rate of flush and compaction.
|
Options |
setRecycleLogFileNum(long recycleLogFileNum)
Recycle log files.
|
Options |
setReportBgIoStats(boolean reportBgIoStats)
Measure IO stats in compactions and flushes, if true.
|
Options |
setRowCache(Cache rowCache)
A global cache for table-level rows.
|
Options |
setSkipCheckingSstFileSizesOnDbOpen(boolean skipCheckingSstFileSizesOnDbOpen)
If true, then
RocksDB.open(String) will not fetch and check sizes of all sst files. |
Options |
setSkipStatsUpdateOnDbOpen(boolean skipStatsUpdateOnDbOpen)
If true, then DB::Open() will not update the statistics used to optimize
compaction decision by loading table properties from many files.
|
Options |
setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
All writes will be slowed down to at least delayed_write_rate if estimated
bytes needed to be compaction exceed this threshold.
|
Options |
setSstFileManager(SstFileManager sstFileManager)
Use to track SST files and control their file deletion rate.
|
Options |
setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory)
If non-nullptr, use the specified factory for a function to determine the
partitioning of sst files.
|
Options |
setStatistics(Statistics statistics)
Sets the statistics object which collects metrics about database operations.
|
Options |
setStatsDumpPeriodSec(int statsDumpPeriodSec)
if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
Default: 600 (10 minutes)
|
Options |
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 |
Options |
setStatsPersistPeriodSec(int statsPersistPeriodSec)
If not zero, dump rocksdb.stats to RocksDB every
statsPersistPeriodSec
Default: 600 |
Options |
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. |
Options |
setTableCacheNumshardbits(int tableCacheNumshardbits)
Number of shards used for table cache.
|
Options |
setTableFormatConfig(TableFormatConfig config)
Set the config for table format.
|
Options |
setTargetFileSizeBase(long targetFileSizeBase)
The target file size for compaction.
|
Options |
setTargetFileSizeMultiplier(int multiplier)
targetFileSizeMultiplier defines the size ratio between a
level-L file and level-(L+1) file.
|
Options |
setTtl(long ttl)
Non-bottom-level files older than TTL will go through the compaction
process.
|
Options |
setTwoWriteQueues(boolean twoWriteQueues)
If enabled it uses two queues for writes, one for the ones with
disable_memtable and one for the ones that also write to memtable.
|
Options |
setUnorderedWrite(boolean unorderedWrite)
Setting
DBOptionsInterface.unorderedWrite() to true trades higher write throughput with
relaxing the immutability guarantee of snapshots. |
Options |
setUseAdaptiveMutex(boolean useAdaptiveMutex)
Use adaptive mutex, which spins in the user space before resorting
to kernel.
|
Options |
setUseDirectIoForFlushAndCompaction(boolean useDirectIoForFlushAndCompaction)
Enable the OS to use direct reads and writes in flush and
compaction
Default: false
|
Options |
setUseDirectReads(boolean useDirectReads)
Enable the OS to use direct I/O for reading sst tables.
|
Options |
setUseFsync(boolean useFsync)
If true, then every store to stable storage will issue a fsync.
|
Options |
setWalBytesPerSync(long walBytesPerSync)
Same as
MutableDBOptionsInterface.setBytesPerSync(long) , but applies to WAL files
Default: 0, turned off |
Options |
setWalDir(java.lang.String walDir)
This specifies the absolute dir path for write-ahead logs (WAL).
|
Options |
setWalFilter(AbstractWalFilter walFilter)
A filter object supplied to be invoked while processing write-ahead-logs
(WALs) during recovery.
|
Options |
setWalRecoveryMode(WALRecoveryMode walRecoveryMode)
Recovery mode to control the consistency while replaying WAL
Default:
WALRecoveryMode.PointInTimeRecovery |
Options |
setWalSizeLimitMB(long sizeLimitMB)
WalTtlSeconds() and walSizeLimitMB() affect how archived logs
will be deleted.
|
Options |
setWalTtlSeconds(long walTtlSeconds)
DBOptionsInterface.walTtlSeconds() and DBOptionsInterface.walSizeLimitMB() affect how archived logs
will be deleted. |
Options |
setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
This is the maximum buffer size that is used by WritableFileWriter.
|
Options |
setWriteBufferManager(WriteBufferManager writeBufferManager)
Use passed
WriteBufferManager to control memory usage across
multiple column families and/or DB instances. |
Options |
setWriteBufferSize(long writeBufferSize)
Amount of data to build up in memory (backed by an unsorted log
on disk) before converting to a sorted on-disk file.
|
Options |
setWriteDbidToManifest(boolean writeDbidToManifest)
Historically DB ID has always been stored in Identity File in DB folder.
|
Options |
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.
|
Options |
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.
|
boolean |
skipCheckingSstFileSizesOnDbOpen()
If true, then
RocksDB.open(String) will not fetch and check sizes of all sst files. |
boolean |
skipStatsUpdateOnDbOpen()
If true, then DB::Open() will not update the statistics used to optimize
compaction decision by loading table properties from many files.
|
long |
softPendingCompactionBytesLimit()
All writes will be slowed down to at least delayed_write_rate if estimated
bytes needed to be compaction exceed this threshold.
|
SstPartitionerFactory |
sstPartitionerFactory()
Get SST partitioner factory
|
Statistics |
statistics()
Returns statistics object.
|
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.
|
int |
tableCacheNumshardbits()
Number of shards used for table cache.
|
java.lang.String |
tableFactoryName() |
TableFormatConfig |
tableFormatConfig()
Get the config for table format.
|
long |
targetFileSizeBase()
The target file size for compaction.
|
int |
targetFileSizeMultiplier()
targetFileSizeMultiplier defines the size ratio between a
level-(L+1) file and level-L file.
|
long |
ttl()
Get the TTL for Non-bottom-level files that will go through the compaction
process.
|
boolean |
twoWriteQueues()
Returns true if two write queues are enabled.
|
boolean |
unorderedWrite()
Returns true if unordered write are enabled.
|
boolean |
useAdaptiveMutex()
Use adaptive mutex, which spins in the user space before resorting
to kernel.
|
Options |
useCappedPrefixExtractor(int n)
Same as fixed length prefix extractor, except that when slice is
shorter than the fixed length, it will use the full key.
|
boolean |
useDirectIoForFlushAndCompaction()
Enable the OS to use direct reads and writes in flush and
compaction
|
boolean |
useDirectReads()
Enable the OS to use direct I/O for reading sst tables.
|
Options |
useFixedLengthPrefixExtractor(int n)
This prefix-extractor uses the first n bytes of a key as its prefix.
|
boolean |
useFsync()
If true, then every store to stable storage will issue a fsync.
|
long |
walBytesPerSync()
Same as
MutableDBOptionsInterface.bytesPerSync() , but applies to WAL files
Default: 0, turned off |
java.lang.String |
walDir()
Returns the path to the write-ahead-logs (WAL) directory.
|
WalFilter |
walFilter()
Get's the filter for processing WALs during recovery.
|
WALRecoveryMode |
walRecoveryMode()
Recovery mode to control the consistency while replaying WAL
Default:
WALRecoveryMode.PointInTimeRecovery |
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 |
writableFileMaxBufferSize()
This is the maximum buffer size that is used by WritableFileWriter.
|
WriteBufferManager |
writeBufferManager()
Reference to
WriteBufferManager used by it. |
long |
writeBufferSize()
Return size of write buffer size.
|
boolean |
writeDbidToManifest()
Historically DB ID has always been stored in Identity File in DB folder.
|
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, getNativeHandleclose, disOwnNativeHandle, isOwningHandlepublic Options()
This constructor will create (by allocating a block of memory)
an rocksdb::Options in the c++ side.
public Options(DBOptions dbOptions, ColumnFamilyOptions columnFamilyOptions)
dbOptions - DBOptions instancecolumnFamilyOptions - ColumnFamilyOptions
instancepublic Options(Options other)
NOTE: This does a shallow copy, which means comparator, merge_operator and other pointers will be cloned!
other - The Options to copy.public static java.lang.String getOptionStringFromProps(java.util.Properties properties)
properties - The set of properties to convertpublic Options setIncreaseParallelism(int totalThreads)
DBOptionsInterfaceBy 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 在接口中 DBOptionsInterface<Options>totalThreads - The total number of threads to be used by RocksDB.
A good value is the number of cores.public Options setCreateIfMissing(boolean flag)
DBOptionsInterfaceRocksDB.open().
Default: falsesetCreateIfMissing 在接口中 DBOptionsInterface<Options>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 Options setCreateMissingColumnFamilies(boolean flag)
DBOptionsInterfaceIf true, missing column families will be automatically created
Default: false
setCreateMissingColumnFamilies 在接口中 DBOptionsInterface<Options>flag - a flag indicating if missing column families shall be
created automatically.public Options setEnv(Env env)
DBOptionsInterfaceEnv.getDefault()setEnv 在接口中 DBOptionsInterface<Options>env - Env instance.public Env getEnv()
DBOptionsInterfacegetEnv 在接口中 DBOptionsInterface<Options>RocksEnv instance set in the options.public Options prepareForBulkLoad()
Set appropriate parameters for bulk loading. The reason that this is a function that returns "this" instead of a constructor is to enable chaining of multiple similar calls in the future.
All data will be in level 0 without any automatic compaction. It's recommended to manually call CompactRange(NULL, NULL) before reading from the database, because otherwise the read can be very slow.
public boolean createIfMissing()
DBOptionsInterfacecreateIfMissing 在接口中 DBOptionsInterface<Options>DBOptionsInterface.setCreateIfMissing(boolean)public boolean createMissingColumnFamilies()
DBOptionsInterfacecreateMissingColumnFamilies 在接口中 DBOptionsInterface<Options>DBOptionsInterface.setCreateMissingColumnFamilies(boolean)public Options oldDefaults(int majorVersion, int minorVersion)
ColumnFamilyOptionsInterfaceoldDefaults 在接口中 ColumnFamilyOptionsInterface<Options>majorVersion - The major version to recover default values of optionsminorVersion - The minor version to recover default values of optionspublic Options optimizeForSmallDb()
DBOptionsInterfaceoptimizeForSmallDb 在接口中 ColumnFamilyOptionsInterface<Options>optimizeForSmallDb 在接口中 DBOptionsInterface<Options>public Options optimizeForSmallDb(Cache cache)
ColumnFamilyOptionsInterfaceoptimizeForSmallDb 在接口中 ColumnFamilyOptionsInterface<Options>cache - An optional cache object is passed in to be used as the block cachepublic Options optimizeForPointLookup(long blockCacheSizeMb)
ColumnFamilyOptionsInterfaceoptimizeForPointLookup 在接口中 ColumnFamilyOptionsInterface<Options>blockCacheSizeMb - Block cache size in MBpublic Options optimizeLevelStyleCompaction()
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for level style compaction.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeLevelStyleCompaction 在接口中 ColumnFamilyOptionsInterface<Options>public Options optimizeLevelStyleCompaction(long memtableMemoryBudget)
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for level style compaction.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeLevelStyleCompaction 在接口中 ColumnFamilyOptionsInterface<Options>memtableMemoryBudget - memory budget in bytespublic Options optimizeUniversalStyleCompaction()
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for universal style compaction.
Universal style compaction is focused on reducing Write Amplification Factor for big data sets, but increases Space Amplification.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeUniversalStyleCompaction 在接口中 ColumnFamilyOptionsInterface<Options>public Options optimizeUniversalStyleCompaction(long memtableMemoryBudget)
ColumnFamilyOptionsInterfaceDefault values for some parameters in ColumnFamilyOptions are not optimized for heavy workloads and big datasets, which means you might observe write stalls under some conditions. As a starting point for tuning RocksDB options, use the following for universal style compaction.
Universal style compaction is focused on reducing Write Amplification Factor for big data sets, but increases Space Amplification.
Make sure to also call IncreaseParallelism(), which will provide the biggest performance gains.
Note: we might use more memory than memtable_memory_budget during high write rate period
optimizeUniversalStyleCompaction 在接口中 ColumnFamilyOptionsInterface<Options>memtableMemoryBudget - memory budget in bytespublic Options setComparator(BuiltinComparator builtinComparator)
ColumnFamilyOptionsInterfaceBuiltinComparator to be used with RocksDB.
Note: Comparator can be set once upon database creation.
Default: BytewiseComparator.
setComparator 在接口中 ColumnFamilyOptionsInterface<Options>builtinComparator - a BuiltinComparator type.public Options setComparator(AbstractComparator comparator)
ColumnFamilyOptionsInterfaceComparator should not be disposed before options instances using this comparator is disposed. If dispose() function is not called, then comparator object will be GC'd automatically.
Comparator instance can be re-used in multiple options instances.
setComparator 在接口中 ColumnFamilyOptionsInterface<Options>comparator - java instance.public Options setMergeOperatorName(java.lang.String name)
ColumnFamilyOptionsInterfaceSet the merge operator to be used for merging two merge operands of the same key. The merge function is invoked during compaction and at lookup time, if multiple key/value pairs belonging to the same key are found in the database.
setMergeOperatorName 在接口中 ColumnFamilyOptionsInterface<Options>name - the name of the merge function, as defined by
the MergeOperators factory (see utilities/MergeOperators.h)
The merge function is specified by name and must be one of the
standard merge operators provided by RocksDB. The available
operators are "put", "uint64add", "stringappend" and "stringappendtest".public Options setMergeOperator(MergeOperator mergeOperator)
ColumnFamilyOptionsInterfaceSet the merge operator to be used for merging two different key/value pairs that share the same key. The merge function is invoked during compaction and at lookup time, if multiple key/value pairs belonging to the same key are found in the database.
setMergeOperator 在接口中 ColumnFamilyOptionsInterface<Options>mergeOperator - MergeOperator instance.public Options setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
ColumnFamilyOptionsInterface
If the client requires a new compaction filter to be used for different
compaction runs, it can specify call
ColumnFamilyOptionsInterface.setCompactionFilterFactory(AbstractCompactionFilterFactory)
instead.
The client should specify only set one of the two.
{#setCompactionFilter(AbstractCompactionFilter)} takes precedence
over ColumnFamilyOptionsInterface.setCompactionFilterFactory(AbstractCompactionFilterFactory)
if the client specifies both.
If multithreaded compaction is being used, the supplied CompactionFilter instance may be used from different threads concurrently and so should be thread-safe.
setCompactionFilter 在接口中 ColumnFamilyOptionsInterface<Options>compactionFilter - AbstractCompactionFilter instance.public AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter()
ColumnFamilyOptionsInterfacecompactionFilter 在接口中 ColumnFamilyOptionsInterface<Options>public Options setCompactionFilterFactory(AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory)
ColumnFamilyOptionsInterfaceAbstractCompactionFilter objects
which allow an application to modify/delete a key-value during background
compaction.
A new filter will be created on each compaction run. If multithreaded compaction is being used, each created CompactionFilter will only be used from a single thread and so does not need to be thread-safe.
setCompactionFilterFactory 在接口中 ColumnFamilyOptionsInterface<Options>compactionFilterFactory - AbstractCompactionFilterFactory instance.public AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory()
ColumnFamilyOptionsInterfacecompactionFilterFactory 在接口中 ColumnFamilyOptionsInterface<Options>public Options setWriteBufferSize(long writeBufferSize)
MutableColumnFamilyOptionsInterface
Larger values increase performance, especially during bulk loads.
Up to max_write_buffer_number write buffers may be held in memory
at the same time, so you may wish to adjust this parameter
to control memory usage.
Also, a larger write buffer will result in a longer recovery time the next time the database is opened.
Default: 64MB
setWriteBufferSize 在接口中 MutableColumnFamilyOptionsInterface<Options>writeBufferSize - the size of write buffer.public long writeBufferSize()
MutableColumnFamilyOptionsInterfacewriteBufferSize 在接口中 MutableColumnFamilyOptionsInterface<Options>MutableColumnFamilyOptionsInterface.setWriteBufferSize(long)public Options setMaxWriteBufferNumber(int maxWriteBufferNumber)
setMaxWriteBufferNumber 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>maxWriteBufferNumber - maximum number of write buffers.public int maxWriteBufferNumber()
maxWriteBufferNumber 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>AdvancedMutableColumnFamilyOptionsInterface.setMaxWriteBufferNumber(int)public boolean errorIfExists()
DBOptionsInterfaceerrorIfExists 在接口中 DBOptionsInterface<Options>public Options setErrorIfExists(boolean errorIfExists)
DBOptionsInterfacesetErrorIfExists 在接口中 DBOptionsInterface<Options>errorIfExists - if true, an exception will be thrown
during RocksDB.open() if the database already exists.RocksDB.open(org.rocksdb.Options, String)public boolean paranoidChecks()
DBOptionsInterfaceparanoidChecks 在接口中 DBOptionsInterface<Options>public Options setParanoidChecks(boolean paranoidChecks)
DBOptionsInterfacesetParanoidChecks 在接口中 DBOptionsInterface<Options>paranoidChecks - a flag to indicate whether paranoid-check
is on.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<Options>public Options setMaxFileOpeningThreads(int maxFileOpeningThreads)
DBOptionsInterfaceMutableDBOptionsInterface.maxOpenFiles() is -1, DB will open
all files on DB::Open(). You can use this option to increase the number
of threads used to open the files.
Default: 16setMaxFileOpeningThreads 在接口中 DBOptionsInterface<Options>maxFileOpeningThreads - the maximum number of threads to use to
open filespublic int maxFileOpeningThreads()
DBOptionsInterfaceMutableDBOptionsInterface.maxOpenFiles() is -1, DB will open all
files on DB::Open(). You can use this option to increase the number of
threads used to open the files.
Default: 16maxFileOpeningThreads 在接口中 DBOptionsInterface<Options>public Options 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<Options>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<Options>public Options 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<Options>maxOpenFiles - the maximum number of open files.public boolean useFsync()
DBOptionsInterfaceIf 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 在接口中 DBOptionsInterface<Options>public Options setUseFsync(boolean useFsync)
DBOptionsInterfaceIf 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 在接口中 DBOptionsInterface<Options>useFsync - a boolean flag to specify whether to use fsyncpublic Options setDbPaths(java.util.Collection<DbPath> dbPaths)
DBOptionsInterfacesetDbPaths 在接口中 DBOptionsInterface<Options>dbPaths - the paths and target sizespublic java.util.List<DbPath> dbPaths()
DBOptionsInterfaceCollections.emptyList()dbPaths 在接口中 DBOptionsInterface<Options>public java.lang.String dbLogDir()
DBOptionsInterfacedbLogDir 在接口中 DBOptionsInterface<Options>public Options setDbLogDir(java.lang.String dbLogDir)
DBOptionsInterfacesetDbLogDir 在接口中 DBOptionsInterface<Options>dbLogDir - the path to the info log directorypublic java.lang.String walDir()
DBOptionsInterfacewalDir 在接口中 DBOptionsInterface<Options>public Options setWalDir(java.lang.String walDir)
DBOptionsInterfacesetWalDir 在接口中 DBOptionsInterface<Options>walDir - the path to the write-ahead-log directory.public long deleteObsoleteFilesPeriodMicros()
DBOptionsInterfacedeleteObsoleteFilesPeriodMicros 在接口中 DBOptionsInterface<Options>deleteObsoleteFilesPeriodMicros 在接口中 MutableDBOptionsInterface<Options>public Options setDeleteObsoleteFilesPeriodMicros(long micros)
DBOptionsInterfacesetDeleteObsoleteFilesPeriodMicros 在接口中 DBOptionsInterface<Options>setDeleteObsoleteFilesPeriodMicros 在接口中 MutableDBOptionsInterface<Options>micros - the time interval in micros@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<Options>Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority)public Options setStatistics(Statistics statistics)
DBOptionsInterfaceSets the 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.
setStatistics 在接口中 DBOptionsInterface<Options>statistics - The statistics to setRocksDB.open(org.rocksdb.Options, String)public Statistics statistics()
DBOptionsInterfaceReturns statistics object.
statistics 在接口中 DBOptionsInterface<Options>DBOptionsInterface.setStatistics(Statistics)@Deprecated public Options 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<Options>maxBackgroundCompactions - the maximum number of background
compaction jobs.Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority),
DBOptionsInterface.maxBackgroundFlushes()public Options setMaxSubcompactions(int maxSubcompactions)
DBOptionsInterfacesetMaxSubcompactions 在接口中 DBOptionsInterface<Options>maxSubcompactions - The maximum number of threads that will
concurrently perform a compaction jobpublic int maxSubcompactions()
DBOptionsInterfacemaxSubcompactions 在接口中 DBOptionsInterface<Options>@Deprecated public int maxBackgroundFlushes()
DBOptionsInterfacemaxBackgroundFlushes 在接口中 DBOptionsInterface<Options>Env.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority)@Deprecated public Options setMaxBackgroundFlushes(int maxBackgroundFlushes)
DBOptionsInterfacesetMaxBackgroundFlushes 在接口中 DBOptionsInterface<Options>maxBackgroundFlushes - number of max concurrent flush jobsEnv.setBackgroundThreads(int),
Env.setBackgroundThreads(int, Priority),
MutableDBOptionsInterface.maxBackgroundCompactions()public int maxBackgroundJobs()
MutableDBOptionsInterfacemaxBackgroundJobs 在接口中 MutableDBOptionsInterface<Options>public Options setMaxBackgroundJobs(int maxBackgroundJobs)
MutableDBOptionsInterfacesetMaxBackgroundJobs 在接口中 MutableDBOptionsInterface<Options>maxBackgroundJobs - number of max concurrent background jobspublic long maxLogFileSize()
DBOptionsInterfacemaxLogFileSize 在接口中 DBOptionsInterface<Options>public Options setMaxLogFileSize(long maxLogFileSize)
DBOptionsInterfacesetMaxLogFileSize 在接口中 DBOptionsInterface<Options>maxLogFileSize - the maximum size of a info log file.public long logFileTimeToRoll()
DBOptionsInterfacelogFileTimeToRoll 在接口中 DBOptionsInterface<Options>public Options setLogFileTimeToRoll(long logFileTimeToRoll)
DBOptionsInterfacesetLogFileTimeToRoll 在接口中 DBOptionsInterface<Options>logFileTimeToRoll - the time interval in seconds.public long keepLogFileNum()
DBOptionsInterfacekeepLogFileNum 在接口中 DBOptionsInterface<Options>public Options setKeepLogFileNum(long keepLogFileNum)
DBOptionsInterfacesetKeepLogFileNum 在接口中 DBOptionsInterface<Options>keepLogFileNum - the maximum number of info log files to be kept.public Options setRecycleLogFileNum(long recycleLogFileNum)
DBOptionsInterfacesetRecycleLogFileNum 在接口中 DBOptionsInterface<Options>recycleLogFileNum - the number of log files to keep for recyclingpublic long recycleLogFileNum()
DBOptionsInterfacerecycleLogFileNum 在接口中 DBOptionsInterface<Options>public long maxManifestFileSize()
DBOptionsInterfacemaxManifestFileSize 在接口中 DBOptionsInterface<Options>public Options setMaxManifestFileSize(long maxManifestFileSize)
DBOptionsInterfacesetMaxManifestFileSize 在接口中 DBOptionsInterface<Options>maxManifestFileSize - the size limit of a manifest file.public Options setMaxTableFilesSizeFIFO(long maxTableFilesSize)
ColumnFamilyOptionsInterfacesetMaxTableFilesSizeFIFO 在接口中 ColumnFamilyOptionsInterface<Options>maxTableFilesSize - the size limit of the total sum of table files.public long maxTableFilesSizeFIFO()
ColumnFamilyOptionsInterfacemaxTableFilesSizeFIFO 在接口中 ColumnFamilyOptionsInterface<Options>public int tableCacheNumshardbits()
DBOptionsInterfacetableCacheNumshardbits 在接口中 DBOptionsInterface<Options>public Options setTableCacheNumshardbits(int tableCacheNumshardbits)
DBOptionsInterfacesetTableCacheNumshardbits 在接口中 DBOptionsInterface<Options>tableCacheNumshardbits - the number of chardspublic long walTtlSeconds()
DBOptionsInterfacewalTtlSeconds 在接口中 DBOptionsInterface<Options>DBOptionsInterface.walSizeLimitMB()public Options setWalTtlSeconds(long walTtlSeconds)
DBOptionsInterfaceDBOptionsInterface.walTtlSeconds() and DBOptionsInterface.walSizeLimitMB() affect how archived logs
will be deleted.
setWalTtlSeconds 在接口中 DBOptionsInterface<Options>walTtlSeconds - the ttl secondsDBOptionsInterface.setWalSizeLimitMB(long)public long walSizeLimitMB()
DBOptionsInterfaceDBOptionsInterface.walTtlSeconds() and #walSizeLimitMB() affect how archived logs
will be deleted.
walSizeLimitMB 在接口中 DBOptionsInterface<Options>DBOptionsInterface.walSizeLimitMB()public Options setMaxWriteBatchGroupSizeBytes(long maxWriteBatchGroupSizeBytes)
DBOptionsInterfacesetMaxWriteBatchGroupSizeBytes 在接口中 DBOptionsInterface<Options>maxWriteBatchGroupSizeBytes - the maximum limit of number of bytes, see description.public long maxWriteBatchGroupSizeBytes()
DBOptionsInterfacemaxWriteBatchGroupSizeBytes 在接口中 DBOptionsInterface<Options>public Options setWalSizeLimitMB(long sizeLimitMB)
DBOptionsInterfacesetWalSizeLimitMB 在接口中 DBOptionsInterface<Options>sizeLimitMB - size limit in mega-bytes.DBOptionsInterface.setWalSizeLimitMB(long)public long manifestPreallocationSize()
DBOptionsInterfacemanifestPreallocationSize 在接口中 DBOptionsInterface<Options>public Options setManifestPreallocationSize(long size)
DBOptionsInterfacesetManifestPreallocationSize 在接口中 DBOptionsInterface<Options>size - the size in bytepublic Options setUseDirectReads(boolean useDirectReads)
DBOptionsInterfacesetUseDirectReads 在接口中 DBOptionsInterface<Options>useDirectReads - if true, then direct read is enabledpublic boolean useDirectReads()
DBOptionsInterfaceuseDirectReads 在接口中 DBOptionsInterface<Options>public Options setUseDirectIoForFlushAndCompaction(boolean useDirectIoForFlushAndCompaction)
DBOptionsInterfacesetUseDirectIoForFlushAndCompaction 在接口中 DBOptionsInterface<Options>useDirectIoForFlushAndCompaction - if true, then direct
I/O will be enabled for background flush and compactionspublic boolean useDirectIoForFlushAndCompaction()
DBOptionsInterfaceuseDirectIoForFlushAndCompaction 在接口中 DBOptionsInterface<Options>public Options setAllowFAllocate(boolean allowFAllocate)
DBOptionsInterfacesetAllowFAllocate 在接口中 DBOptionsInterface<Options>allowFAllocate - false if fallocate() calls are bypassedpublic boolean allowFAllocate()
DBOptionsInterfaceallowFAllocate 在接口中 DBOptionsInterface<Options>public boolean allowMmapReads()
DBOptionsInterfaceallowMmapReads 在接口中 DBOptionsInterface<Options>public Options setAllowMmapReads(boolean allowMmapReads)
DBOptionsInterfacesetAllowMmapReads 在接口中 DBOptionsInterface<Options>allowMmapReads - true if mmap reads are allowed.public boolean allowMmapWrites()
DBOptionsInterfaceallowMmapWrites 在接口中 DBOptionsInterface<Options>public Options setAllowMmapWrites(boolean allowMmapWrites)
DBOptionsInterfacesetAllowMmapWrites 在接口中 DBOptionsInterface<Options>allowMmapWrites - true if mmap writes are allowd.public boolean isFdCloseOnExec()
DBOptionsInterfaceisFdCloseOnExec 在接口中 DBOptionsInterface<Options>public Options setIsFdCloseOnExec(boolean isFdCloseOnExec)
DBOptionsInterfacesetIsFdCloseOnExec 在接口中 DBOptionsInterface<Options>isFdCloseOnExec - true if child process inheriting open
files is disabled.public int statsDumpPeriodSec()
MutableDBOptionsInterfacestatsDumpPeriodSec 在接口中 MutableDBOptionsInterface<Options>public Options setStatsDumpPeriodSec(int statsDumpPeriodSec)
MutableDBOptionsInterfacesetStatsDumpPeriodSec 在接口中 MutableDBOptionsInterface<Options>statsDumpPeriodSec - time interval in seconds.public Options setStatsPersistPeriodSec(int statsPersistPeriodSec)
MutableDBOptionsInterfacestatsPersistPeriodSec
Default: 600setStatsPersistPeriodSec 在接口中 MutableDBOptionsInterface<Options>statsPersistPeriodSec - time interval in seconds.public int statsPersistPeriodSec()
MutableDBOptionsInterfacestatsPersistPeriodSecstatsPersistPeriodSec 在接口中 MutableDBOptionsInterface<Options>public Options setStatsHistoryBufferSize(long statsHistoryBufferSize)
MutableDBOptionsInterfacestatsHistoryBufferSize
Default: 1MBsetStatsHistoryBufferSize 在接口中 MutableDBOptionsInterface<Options>statsHistoryBufferSize - the size of the buffer.public long statsHistoryBufferSize()
MutableDBOptionsInterfacestatsHistoryBufferSizestatsHistoryBufferSize 在接口中 MutableDBOptionsInterface<Options>public boolean adviseRandomOnOpen()
DBOptionsInterfaceadviseRandomOnOpen 在接口中 DBOptionsInterface<Options>public Options setAdviseRandomOnOpen(boolean adviseRandomOnOpen)
DBOptionsInterfacesetAdviseRandomOnOpen 在接口中 DBOptionsInterface<Options>adviseRandomOnOpen - true if hinting random access is on.public Options setDbWriteBufferSize(long dbWriteBufferSize)
DBOptionsInterfaceColumnFamilyOptions.writeBufferSize(),
which enforces a limit for a single memtable.
This feature is disabled by default. Specify a non-zero value
to enable it.
Default: 0 (disabled)setDbWriteBufferSize 在接口中 DBOptionsInterface<Options>dbWriteBufferSize - the size of the write bufferpublic Options setWriteBufferManager(WriteBufferManager writeBufferManager)
DBOptionsInterfaceWriteBufferManager to control memory usage across
multiple column families and/or DB instances.
Check
https://github.com/facebook/rocksdb/wiki/Write-Buffer-Manager
for more details on when to use itsetWriteBufferManager 在接口中 DBOptionsInterface<Options>writeBufferManager - The WriteBufferManager to usepublic WriteBufferManager writeBufferManager()
DBOptionsInterfaceWriteBufferManager used by it. writeBufferManager 在接口中 DBOptionsInterface<Options>public long dbWriteBufferSize()
DBOptionsInterfaceColumnFamilyOptions.writeBufferSize(),
which enforces a limit for a single memtable.
This feature is disabled by default. Specify a non-zero value
to enable it.
Default: 0 (disabled)dbWriteBufferSize 在接口中 DBOptionsInterface<Options>public Options setAccessHintOnCompactionStart(AccessHint accessHint)
DBOptionsInterfaceAccessHint.NORMALsetAccessHintOnCompactionStart 在接口中 DBOptionsInterface<Options>accessHint - The access hintpublic AccessHint accessHintOnCompactionStart()
DBOptionsInterfaceAccessHint.NORMALaccessHintOnCompactionStart 在接口中 DBOptionsInterface<Options>public Options setCompactionReadaheadSize(long compactionReadaheadSize)
MutableDBOptionsInterfaceThat way RocksDB's compaction is doing sequential instead of random reads.
Default: 0
setCompactionReadaheadSize 在接口中 MutableDBOptionsInterface<Options>compactionReadaheadSize - The compaction read-ahead sizepublic long compactionReadaheadSize()
MutableDBOptionsInterfaceThat way RocksDB's compaction is doing sequential instead of random reads.
Default: 0
compactionReadaheadSize 在接口中 MutableDBOptionsInterface<Options>public Options setRandomAccessMaxBufferSize(long randomAccessMaxBufferSize)
DBOptionsInterfaceMutableDBOptionsInterface.compactionReadaheadSize() value and
always try to read ahead.
With read-ahead we always pre-allocate buffer to the size instead of
growing it up to a limit.
This option is currently honored only on Windows
Default: 1 Mb
Special value: 0 - means do not maintain per instance buffer. Allocate
per request buffer and avoid locking.setRandomAccessMaxBufferSize 在接口中 DBOptionsInterface<Options>randomAccessMaxBufferSize - the maximum size of the random access
bufferpublic long randomAccessMaxBufferSize()
DBOptionsInterfaceMutableDBOptionsInterface.compactionReadaheadSize() value and
always try to read ahead. With read-ahead we always pre-allocate buffer
to the size instead of growing it up to a limit.
This option is currently honored only on Windows
Default: 1 Mb
Special value: 0 - means do not maintain per instance buffer. Allocate
per request buffer and avoid locking.randomAccessMaxBufferSize 在接口中 DBOptionsInterface<Options>public Options setWritableFileMaxBufferSize(long writableFileMaxBufferSize)
MutableDBOptionsInterfaceDefault: 1024 * 1024 (1 MB)
setWritableFileMaxBufferSize 在接口中 MutableDBOptionsInterface<Options>writableFileMaxBufferSize - the maximum buffer sizepublic long writableFileMaxBufferSize()
MutableDBOptionsInterfaceDefault: 1024 * 1024 (1 MB)
writableFileMaxBufferSize 在接口中 MutableDBOptionsInterface<Options>public boolean useAdaptiveMutex()
DBOptionsInterfaceuseAdaptiveMutex 在接口中 DBOptionsInterface<Options>public Options setUseAdaptiveMutex(boolean useAdaptiveMutex)
DBOptionsInterfacesetUseAdaptiveMutex 在接口中 DBOptionsInterface<Options>useAdaptiveMutex - true if adaptive mutex is used.public long bytesPerSync()
MutableDBOptionsInterfacebytesPerSync 在接口中 MutableDBOptionsInterface<Options>public Options setBytesPerSync(long bytesPerSync)
MutableDBOptionsInterfacesetBytesPerSync 在接口中 MutableDBOptionsInterface<Options>bytesPerSync - size in bytespublic Options setWalBytesPerSync(long walBytesPerSync)
MutableDBOptionsInterfaceMutableDBOptionsInterface.setBytesPerSync(long) , but applies to WAL files
Default: 0, turned off
setWalBytesPerSync 在接口中 MutableDBOptionsInterface<Options>walBytesPerSync - size in bytespublic long walBytesPerSync()
MutableDBOptionsInterfaceMutableDBOptionsInterface.bytesPerSync() , but applies to WAL files
Default: 0, turned off
walBytesPerSync 在接口中 MutableDBOptionsInterface<Options>public Options 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<Options>strictBytesPerSync - the bytes per syncpublic boolean strictBytesPerSync()
MutableDBOptionsInterface
See MutableDBOptionsInterface.setStrictBytesPerSync(boolean)
strictBytesPerSync 在接口中 MutableDBOptionsInterface<Options>public Options setListeners(java.util.List<AbstractEventListener> listeners)
DBOptionsInterfaceEventListeners whose callback functions
will be called when specific RocksDB event happens.
Note: the RocksJava API currently only supports EventListeners implemented in Java.
It could be extended in future to also support adding/removing EventListeners implemented in
C++.setListeners 在接口中 DBOptionsInterface<Options>listeners - the listeners who should be notified on various events.public java.util.List<AbstractEventListener> listeners()
DBOptionsInterfaceEventListeners whose callback functions
will be called when specific RocksDB event happens.
Note: the RocksJava API currently only supports EventListeners implemented in Java.
It could be extended in future to also support adding/removing EventListeners implemented in
C++.listeners 在接口中 DBOptionsInterface<Options>public Options setEnableThreadTracking(boolean enableThreadTracking)
DBOptionsInterfacesetEnableThreadTracking 在接口中 DBOptionsInterface<Options>enableThreadTracking - true to enable trackingpublic boolean enableThreadTracking()
DBOptionsInterfaceenableThreadTracking 在接口中 DBOptionsInterface<Options>public Options 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<Options>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<Options>public Options setEnablePipelinedWrite(boolean enablePipelinedWrite)
DBOptionsInterfaceDBOptionsInterface.enablePipelinedWrite() is true, separate write thread queue is
maintained for WAL write and memtable write. A write thread first enter WAL
writer queue and then memtable writer queue. Pending thread on the WAL
writer queue thus only have to wait for previous writers to finish their
WAL writing but not the memtable writing. Enabling the feature may improve
write throughput and reduce latency of the prepare phase of two-phase
commit.
Default: falsesetEnablePipelinedWrite 在接口中 DBOptionsInterface<Options>enablePipelinedWrite - true to enabled pipelined writespublic boolean enablePipelinedWrite()
DBOptionsInterfaceDBOptionsInterface.setEnablePipelinedWrite(boolean).enablePipelinedWrite 在接口中 DBOptionsInterface<Options>public Options setUnorderedWrite(boolean unorderedWrite)
DBOptionsInterfaceDBOptionsInterface.unorderedWrite() to true trades higher write throughput with
relaxing the immutability guarantee of snapshots. This violates the
repeatability one expects from ::Get from a snapshot, as well as
::MultiGet and Iterator's consistent-point-in-time view property.
If the application cannot tolerate the relaxed guarantees, it can implement
its own mechanisms to work around that and yet benefit from the higher
throughput. Using TransactionDB with WRITE_PREPARED write policy and
DBOptionsInterface.twoWriteQueues() true is one way to achieve immutable snapshots despite
unordered_write.
By default, i.e., when it is false, rocksdb does not advance the sequence
number for new snapshots unless all the writes with lower sequence numbers
are already finished. This provides the immutability that we except from
snapshots. Moreover, since Iterator and MultiGet internally depend on
snapshots, the snapshot immutability results into Iterator and MultiGet
offering consistent-point-in-time view. If set to true, although
Read-Your-Own-Write property is still provided, the snapshot immutability
property is relaxed: the writes issued after the snapshot is obtained (with
larger sequence numbers) will be still not visible to the reads from that
snapshot, however, there still might be pending writes (with lower sequence
number) that will change the state visible to the snapshot after they are
landed to the memtable.setUnorderedWrite 在接口中 DBOptionsInterface<Options>unorderedWrite - true to enabled unordered writepublic boolean unorderedWrite()
DBOptionsInterfaceDBOptionsInterface.setUnorderedWrite(boolean).unorderedWrite 在接口中 DBOptionsInterface<Options>public Options setAllowConcurrentMemtableWrite(boolean allowConcurrentMemtableWrite)
DBOptionsInterfaceDBOptionsInterface.setEnableWriteThreadAdaptiveYield(boolean) if you are going to use
this feature.
Default: truesetAllowConcurrentMemtableWrite 在接口中 DBOptionsInterface<Options>allowConcurrentMemtableWrite - true to enable concurrent writes
for the memtablepublic boolean allowConcurrentMemtableWrite()
DBOptionsInterfaceDBOptionsInterface.setEnableWriteThreadAdaptiveYield(boolean) if you are going to use
this feature.
Default: trueallowConcurrentMemtableWrite 在接口中 DBOptionsInterface<Options>public Options setEnableWriteThreadAdaptiveYield(boolean enableWriteThreadAdaptiveYield)
DBOptionsInterfaceDBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. This can substantially improve throughput for concurrent workloads,
regardless of whether DBOptionsInterface.allowConcurrentMemtableWrite() is enabled.
Default: truesetEnableWriteThreadAdaptiveYield 在接口中 DBOptionsInterface<Options>enableWriteThreadAdaptiveYield - true to enable adaptive yield for the
write threadspublic boolean enableWriteThreadAdaptiveYield()
DBOptionsInterfaceDBOptionsInterface.writeThreadMaxYieldUsec() before blocking on a
mutex. This can substantially improve throughput for concurrent workloads,
regardless of whether DBOptionsInterface.allowConcurrentMemtableWrite() is enabled.
Default: trueenableWriteThreadAdaptiveYield 在接口中 DBOptionsInterface<Options>public Options setWriteThreadMaxYieldUsec(long writeThreadMaxYieldUsec)
DBOptionsInterfaceDBOptionsInterface.writeThreadSlowYieldUsec() is
set properly) increasing this value is likely to increase RocksDB
throughput at the expense of increased CPU usage.
Default: 100setWriteThreadMaxYieldUsec 在接口中 DBOptionsInterface<Options>writeThreadMaxYieldUsec - maximum number of microsecondspublic long writeThreadMaxYieldUsec()
DBOptionsInterfaceDBOptionsInterface.writeThreadSlowYieldUsec() is
set properly) increasing this value is likely to increase RocksDB
throughput at the expense of increased CPU usage.
Default: 100writeThreadMaxYieldUsec 在接口中 DBOptionsInterface<Options>public Options setWriteThreadSlowYieldUsec(long writeThreadSlowYieldUsec)
DBOptionsInterfacesetWriteThreadSlowYieldUsec 在接口中 DBOptionsInterface<Options>writeThreadSlowYieldUsec - the latency in microsecondspublic long writeThreadSlowYieldUsec()
DBOptionsInterfacewriteThreadSlowYieldUsec 在接口中 DBOptionsInterface<Options>public Options setSkipStatsUpdateOnDbOpen(boolean skipStatsUpdateOnDbOpen)
DBOptionsInterfacesetSkipStatsUpdateOnDbOpen 在接口中 DBOptionsInterface<Options>skipStatsUpdateOnDbOpen - true if updating stats will be skippedpublic boolean skipStatsUpdateOnDbOpen()
DBOptionsInterfaceskipStatsUpdateOnDbOpen 在接口中 DBOptionsInterface<Options>public Options setSkipCheckingSstFileSizesOnDbOpen(boolean skipCheckingSstFileSizesOnDbOpen)
DBOptionsInterfaceRocksDB.open(String) will not fetch and check sizes of all sst files.
This may significantly speed up startup if there are many sst files,
especially when using non-default Env with expensive GetFileSize().
We'll still check that all required sst files exist.
If paranoid_checks is false, this option is ignored, and sst files are
not checked at all.
Default: falsesetSkipCheckingSstFileSizesOnDbOpen 在接口中 DBOptionsInterface<Options>skipCheckingSstFileSizesOnDbOpen - if true, then SST file sizes will not be checked
when calling RocksDB.open(String).public boolean skipCheckingSstFileSizesOnDbOpen()
DBOptionsInterfaceRocksDB.open(String) will not fetch and check sizes of all sst files.
This may significantly speed up startup if there are many sst files,
especially when using non-default Env with expensive GetFileSize().
We'll still check that all required sst files exist.
If paranoid_checks is false, this option is ignored, and sst files are
not checked at all.
Default: falseskipCheckingSstFileSizesOnDbOpen 在接口中 DBOptionsInterface<Options>RocksDB.open(String).public Options setWalRecoveryMode(WALRecoveryMode walRecoveryMode)
DBOptionsInterfaceWALRecoveryMode.PointInTimeRecoverysetWalRecoveryMode 在接口中 DBOptionsInterface<Options>walRecoveryMode - The WAL recover modepublic WALRecoveryMode walRecoveryMode()
DBOptionsInterfaceWALRecoveryMode.PointInTimeRecoverywalRecoveryMode 在接口中 DBOptionsInterface<Options>public Options setAllow2pc(boolean allow2pc)
DBOptionsInterfacesetAllow2pc 在接口中 DBOptionsInterface<Options>allow2pc - true if two-phase-commit is enabledpublic boolean allow2pc()
DBOptionsInterfaceallow2pc 在接口中 DBOptionsInterface<Options>public Options setRowCache(Cache rowCache)
DBOptionsInterfacesetRowCache 在接口中 DBOptionsInterface<Options>rowCache - The global row cachepublic Cache rowCache()
DBOptionsInterfacerowCache 在接口中 DBOptionsInterface<Options>public Options setWalFilter(AbstractWalFilter walFilter)
DBOptionsInterfacesetWalFilter 在接口中 DBOptionsInterface<Options>walFilter - the filter for processing WALs during recovery.public WalFilter walFilter()
DBOptionsInterfaceDBOptionsInterface.setWalFilter(AbstractWalFilter).walFilter 在接口中 DBOptionsInterface<Options>public Options setFailIfOptionsFileError(boolean failIfOptionsFileError)
DBOptionsInterfacesetFailIfOptionsFileError 在接口中 DBOptionsInterface<Options>failIfOptionsFileError - true if we should fail if there is an error
in the options filepublic boolean failIfOptionsFileError()
DBOptionsInterfacefailIfOptionsFileError 在接口中 DBOptionsInterface<Options>public Options setDumpMallocStats(boolean dumpMallocStats)
DBOptionsInterfacesetDumpMallocStats 在接口中 DBOptionsInterface<Options>dumpMallocStats - true if malloc stats should be printed to LOGpublic boolean dumpMallocStats()
DBOptionsInterfacedumpMallocStats 在接口中 DBOptionsInterface<Options>public Options setAvoidFlushDuringRecovery(boolean avoidFlushDuringRecovery)
DBOptionsInterfacesetAvoidFlushDuringRecovery 在接口中 DBOptionsInterface<Options>avoidFlushDuringRecovery - true to try to avoid (but not guarantee
not to) flush during recoverypublic boolean avoidFlushDuringRecovery()
DBOptionsInterfaceavoidFlushDuringRecovery 在接口中 DBOptionsInterface<Options>public Options setAvoidFlushDuringShutdown(boolean avoidFlushDuringShutdown)
MutableDBOptionsInterfaceDEFAULT: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.
setAvoidFlushDuringShutdown 在接口中 MutableDBOptionsInterface<Options>avoidFlushDuringShutdown - true if we should avoid flush during
shutdownpublic boolean avoidFlushDuringShutdown()
MutableDBOptionsInterfaceDEFAULT: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)
API.
avoidFlushDuringShutdown 在接口中 MutableDBOptionsInterface<Options>public Options setAllowIngestBehind(boolean allowIngestBehind)
DBOptionsInterfacesetAllowIngestBehind 在接口中 DBOptionsInterface<Options>allowIngestBehind - true to allow ingest behind, false to disallow.public boolean allowIngestBehind()
DBOptionsInterfaceDBOptionsInterface.setAllowIngestBehind(boolean).allowIngestBehind 在接口中 DBOptionsInterface<Options>public Options setTwoWriteQueues(boolean twoWriteQueues)
DBOptionsInterfacesetTwoWriteQueues 在接口中 DBOptionsInterface<Options>twoWriteQueues - true to enable two write queues, false otherwise.public boolean twoWriteQueues()
DBOptionsInterfacetwoWriteQueues 在接口中 DBOptionsInterface<Options>public Options setManualWalFlush(boolean manualWalFlush)
DBOptionsInterfacesetManualWalFlush 在接口中 DBOptionsInterface<Options>manualWalFlush - true to set disable automatic WAL flushing,
false otherwise.public boolean manualWalFlush()
DBOptionsInterfaceDBOptionsInterface.setManualWalFlush(boolean).manualWalFlush 在接口中 DBOptionsInterface<Options>public MemTableConfig memTableConfig()
ColumnFamilyOptionsInterfacememTableConfig 在接口中 ColumnFamilyOptionsInterface<Options>public Options setMemTableConfig(MemTableConfig config)
ColumnFamilyOptionsInterfacesetMemTableConfig 在接口中 ColumnFamilyOptionsInterface<Options>config - the mem-table config.public Options setRateLimiter(RateLimiter rateLimiter)
DBOptionsInterfacesetRateLimiter 在接口中 DBOptionsInterface<Options>rateLimiter - RateLimiter instance.public Options setSstFileManager(SstFileManager sstFileManager)
DBOptionsInterfacesetSstFileManager 在接口中 DBOptionsInterface<Options>sstFileManager - The SST File Manager for the db.public Options setLogger(Logger logger)
DBOptionsInterfaceAny 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 在接口中 DBOptionsInterface<Options>logger - Logger instance.public Options setInfoLogLevel(InfoLogLevel infoLogLevel)
DBOptionsInterfaceSets the RocksDB log level. Default level is INFO
setInfoLogLevel 在接口中 DBOptionsInterface<Options>infoLogLevel - log level to set.public InfoLogLevel infoLogLevel()
DBOptionsInterfaceReturns currently set log level.
infoLogLevel 在接口中 DBOptionsInterface<Options>InfoLogLevel instance.public java.lang.String memTableFactoryName()
ColumnFamilyOptionsInterfacememTableFactoryName 在接口中 ColumnFamilyOptionsInterface<Options>ColumnFamilyOptionsInterface.setTableFormatConfig(org.rocksdb.TableFormatConfig)public TableFormatConfig tableFormatConfig()
ColumnFamilyOptionsInterfacetableFormatConfig 在接口中 ColumnFamilyOptionsInterface<Options>public Options setTableFormatConfig(TableFormatConfig config)
ColumnFamilyOptionsInterfacesetTableFormatConfig 在接口中 ColumnFamilyOptionsInterface<Options>config - the table format config.public java.lang.String tableFactoryName()
tableFactoryName 在接口中 ColumnFamilyOptionsInterface<Options>public Options setCfPaths(java.util.Collection<DbPath> cfPaths)
ColumnFamilyOptionsInterfaceIf left empty, db_paths will be used. Default: empty
setCfPaths 在接口中 ColumnFamilyOptionsInterface<Options>cfPaths - collection of paths for SST files.public java.util.List<DbPath> cfPaths()
cfPaths 在接口中 ColumnFamilyOptionsInterface<Options>public Options useFixedLengthPrefixExtractor(int n)
ColumnFamilyOptionsInterfaceIn some hash-based memtable representation such as HashLinkedList and HashSkipList, prefixes are used to partition the keys into several buckets. Prefix extractor is used to specify how to extract the prefix given a key.
useFixedLengthPrefixExtractor 在接口中 ColumnFamilyOptionsInterface<Options>n - use the first n bytes of a key as its prefix.public Options useCappedPrefixExtractor(int n)
ColumnFamilyOptionsInterfaceuseCappedPrefixExtractor 在接口中 ColumnFamilyOptionsInterface<Options>n - use the first n bytes of a key as its prefix.public CompressionType compressionType()
MutableColumnFamilyOptionsInterfaceDefault: SNAPPY_COMPRESSION, which gives lightweight but fast compression.
compressionType 在接口中 MutableColumnFamilyOptionsInterface<Options>public Options setCompressionPerLevel(java.util.List<CompressionType> compressionLevels)
AdvancedColumnFamilyOptionsInterfaceDifferent levels can have different compression policies. There are cases where most lower levels would like to use quick compression algorithms while the higher levels (which have more data) use compression algorithms that have better compression but could be slower. This array, if non-empty, should have an entry for each level of the database; these override the value specified in the previous field 'compression'.
NOTICEIf level_compaction_dynamic_level_bytes=true,
compression_per_level[0] still determines L0,
but other elements of the array are based on base level
(the level L0 files are merged to), and may not
match the level users see from info log for metadata.
If L0 files are merged to level - n,
then, for i>0, compression_per_level[i]
determines compaction type for level n+i-1.
For example, if we have 5 levels, and we determine to
merge L0 data to L4 (which means L1..L3
will be empty), then the new files go to L4 uses
compression type compression_per_level[1].
If now L0 is merged to L2. Data goes to
L2 will be compressed according to
compression_per_level[1], L3 using
compression_per_level[2]and L4 using
compression_per_level[3]. Compaction for each
level can change when data grows.
Default: empty
setCompressionPerLevel 在接口中 AdvancedColumnFamilyOptionsInterface<Options>compressionLevels - list of
CompressionType instances.public java.util.List<CompressionType> compressionPerLevel()
AdvancedColumnFamilyOptionsInterfaceReturn the currently set CompressionType
per instances.
See: AdvancedColumnFamilyOptionsInterface.setCompressionPerLevel(java.util.List)
compressionPerLevel 在接口中 AdvancedColumnFamilyOptionsInterface<Options>CompressionType
instances.public Options setCompressionType(CompressionType compressionType)
MutableColumnFamilyOptionsInterfaceDefault: SNAPPY_COMPRESSION, which gives lightweight but fast compression.
setCompressionType 在接口中 MutableColumnFamilyOptionsInterface<Options>compressionType - Compression Type.public Options setBottommostCompressionType(CompressionType bottommostCompressionType)
ColumnFamilyOptionsInterfacesetBottommostCompressionType 在接口中 ColumnFamilyOptionsInterface<Options>bottommostCompressionType - The compression type to use for the
bottommost levelpublic CompressionType bottommostCompressionType()
ColumnFamilyOptionsInterfacebottommostCompressionType 在接口中 ColumnFamilyOptionsInterface<Options>public Options setBottommostCompressionOptions(CompressionOptions bottommostCompressionOptions)
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.bottommostCompressionType() if it is enabled.
To enable it, please see the definition of
CompressionOptions.
setBottommostCompressionOptions 在接口中 ColumnFamilyOptionsInterface<Options>bottommostCompressionOptions - the bottom most compression options.public CompressionOptions bottommostCompressionOptions()
ColumnFamilyOptionsInterface
See ColumnFamilyOptionsInterface.setBottommostCompressionOptions(CompressionOptions).
bottommostCompressionOptions 在接口中 ColumnFamilyOptionsInterface<Options>public Options setCompressionOptions(CompressionOptions compressionOptions)
ColumnFamilyOptionsInterfacesetCompressionOptions 在接口中 ColumnFamilyOptionsInterface<Options>compressionOptions - The compression optionspublic CompressionOptions compressionOptions()
ColumnFamilyOptionsInterfacecompressionOptions 在接口中 ColumnFamilyOptionsInterface<Options>public CompactionStyle compactionStyle()
AdvancedColumnFamilyOptionsInterfacecompactionStyle 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setCompactionStyle(CompactionStyle compactionStyle)
AdvancedColumnFamilyOptionsInterfaceDefault: LEVEL.
setCompactionStyle 在接口中 AdvancedColumnFamilyOptionsInterface<Options>compactionStyle - Compaction style.public int numLevels()
AdvancedColumnFamilyOptionsInterfacenumLevels 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setNumLevels(int numLevels)
AdvancedColumnFamilyOptionsInterfacesetNumLevels 在接口中 AdvancedColumnFamilyOptionsInterface<Options>numLevels - the number of levels.public int levelZeroFileNumCompactionTrigger()
ColumnFamilyOptionsInterfacelevelZeroFileNumCompactionTrigger 在接口中 ColumnFamilyOptionsInterface<Options>public Options setLevelZeroFileNumCompactionTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroFileNumCompactionTrigger 在接口中 ColumnFamilyOptionsInterface<Options>numFiles - the number of files in level-0 to trigger compaction.public int levelZeroSlowdownWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroSlowdownWritesTrigger 在接口中 ColumnFamilyOptionsInterface<Options>public Options setLevelZeroSlowdownWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroSlowdownWritesTrigger 在接口中 ColumnFamilyOptionsInterface<Options>numFiles - soft limit on number of level-0 files.public int levelZeroStopWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroStopWritesTrigger 在接口中 ColumnFamilyOptionsInterface<Options>public Options setLevelZeroStopWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroStopWritesTrigger 在接口中 ColumnFamilyOptionsInterface<Options>numFiles - the hard limit of the number of level-0 files.public long targetFileSizeBase()
targetFileSizeBase 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>AdvancedMutableColumnFamilyOptionsInterface.targetFileSizeMultiplier()public Options setTargetFileSizeBase(long targetFileSizeBase)
setTargetFileSizeBase 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>targetFileSizeBase - the target size of a level-0 file.AdvancedMutableColumnFamilyOptionsInterface.setTargetFileSizeMultiplier(int)public int targetFileSizeMultiplier()
targetFileSizeMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setTargetFileSizeMultiplier(int multiplier)
setTargetFileSizeMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>multiplier - the size ratio between a level-(L+1) file
and level-L file.public Options setMaxBytesForLevelBase(long maxBytesForLevelBase)
MutableColumnFamilyOptionsInterfacesetMaxBytesForLevelBase 在接口中 MutableColumnFamilyOptionsInterface<Options>maxBytesForLevelBase - maximum bytes for level base.
See AdvancedMutableColumnFamilyOptionsInterface.setMaxBytesForLevelMultiplier(double)
public long maxBytesForLevelBase()
MutableColumnFamilyOptionsInterfacemaxBytesForLevelBase 在接口中 MutableColumnFamilyOptionsInterface<Options>
See AdvancedMutableColumnFamilyOptionsInterface.maxBytesForLevelMultiplier()
public Options setLevelCompactionDynamicLevelBytes(boolean enableLevelCompactionDynamicLevelBytes)
AdvancedColumnFamilyOptionsInterfaceIf true, RocksDB will pick target size of each level
dynamically. We will pick a base level b >= 1. L0 will be
directly merged into level b, instead of always into level 1.
Level 1 to b-1 need to be empty. We try to pick b and its target
size so that
At the same time max_bytes_for_level_multiplier and max_bytes_for_level_multiplier_additional are still satisfied.
With this option on, from an empty DB, we make last level the base
level, which means merging L0 data into the last level, until it exceeds
max_bytes_for_level_base. And then we make the second last level to be
base level, to start to merge L0 data to second last level, with its
target size to be 1/max_bytes_for_level_multiplier of the last
levels extra size. After the data accumulates more so that we need to
move the base level to the third last one, and so on.
Example
For example, assume max_bytes_for_level_multiplier=10,
num_levels=6, and max_bytes_for_level_base=10MB.
Target sizes of level 1 to 5 starts with:
[- - - - 10MB]
with base level is level. Target sizes of level 1 to 4 are not applicable because they will not be used. Until the size of Level 5 grows to more than 10MB, say 11MB, we make base target to level 4 and now the targets looks like:
[- - - 1.1MB 11MB]
While data are accumulated, size targets are tuned based on actual data of level 5. When level 5 has 50MB of data, the target is like:
[- - - 5MB 50MB]
Until level 5's actual size is more than 100MB, say 101MB. Now if we keep level 4 to be the base level, its target size needs to be 10.1MB, which doesn't satisfy the target size range. So now we make level 3 the target size and the target sizes of the levels look like:
[- - 1.01MB 10.1MB 101MB]
In the same way, while level 5 further grows, all levels' targets grow, like
[- - 5MB 50MB 500MB]
Until level 5 exceeds 1000MB and becomes 1001MB, we make level 2 the base level and make levels' target sizes like this:
[- 1.001MB 10.01MB 100.1MB 1001MB]
and go on...
By doing it, we give max_bytes_for_level_multiplier a priority
against max_bytes_for_level_base, for a more predictable LSM tree
shape. It is useful to limit worse case space amplification.
max_bytes_for_level_multiplier_additional is ignored with
this flag on.
Turning this feature on or off for an existing DB can cause unexpected LSM tree structure so it's not recommended.
Caution: this option is experimental
Default: false
setLevelCompactionDynamicLevelBytes 在接口中 AdvancedColumnFamilyOptionsInterface<Options>enableLevelCompactionDynamicLevelBytes - boolean value indicating
if LevelCompactionDynamicLevelBytes shall be enabled.public boolean levelCompactionDynamicLevelBytes()
AdvancedColumnFamilyOptionsInterfaceReturn if LevelCompactionDynamicLevelBytes is enabled.
For further information see
AdvancedColumnFamilyOptionsInterface.setLevelCompactionDynamicLevelBytes(boolean)
levelCompactionDynamicLevelBytes 在接口中 AdvancedColumnFamilyOptionsInterface<Options>levelCompactionDynamicLevelBytes is enabled.public double maxBytesForLevelMultiplier()
ColumnFamilyOptionsInterfacemaxBytesForLevelMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>maxBytesForLevelMultiplier 在接口中 ColumnFamilyOptionsInterface<Options>public Options setMaxBytesForLevelMultiplier(double multiplier)
ColumnFamilyOptionsInterfacesetMaxBytesForLevelMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>setMaxBytesForLevelMultiplier 在接口中 ColumnFamilyOptionsInterface<Options>multiplier - the ratio between the total size of level-(L+1)
files and the total size of level-L files for all L.public long maxCompactionBytes()
AdvancedColumnFamilyOptionsInterfacemaxCompactionBytes 在接口中 AdvancedColumnFamilyOptionsInterface<Options>maxCompactionBytes 在接口中 MutableColumnFamilyOptionsInterface<Options>MutableColumnFamilyOptionsInterface.setMaxCompactionBytes(long)public Options setMaxCompactionBytes(long maxCompactionBytes)
AdvancedColumnFamilyOptionsInterfacesetMaxCompactionBytes 在接口中 AdvancedColumnFamilyOptionsInterface<Options>setMaxCompactionBytes 在接口中 MutableColumnFamilyOptionsInterface<Options>maxCompactionBytes - the compaction size limitMutableColumnFamilyOptionsInterface.maxCompactionBytes()public long arenaBlockSize()
There are two additional restriction of the specified size: (1) size should be in the range of [4096, 2 << 30] and (2) be the multiple of the CPU word (which helps with the memory alignment).
We'll automatically check and adjust the size number to make sure it conforms to the restrictions. Default: 0
arenaBlockSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setArenaBlockSize(long arenaBlockSize)
There are two additional restriction of the specified size: (1) size should be in the range of [4096, 2 << 30] and (2) be the multiple of the CPU word (which helps with the memory alignment).
We'll automatically check and adjust the size number to make sure it conforms to the restrictions. Default: 0
setArenaBlockSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>arenaBlockSize - the size of an arena blockpublic boolean disableAutoCompactions()
MutableColumnFamilyOptionsInterfacedisableAutoCompactions 在接口中 MutableColumnFamilyOptionsInterface<Options>public Options setDisableAutoCompactions(boolean disableAutoCompactions)
MutableColumnFamilyOptionsInterfacesetDisableAutoCompactions 在接口中 MutableColumnFamilyOptionsInterface<Options>disableAutoCompactions - true if auto-compactions are disabled.public long maxSequentialSkipInIterations()
maxSequentialSkipInIterations 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
setMaxSequentialSkipInIterations 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>maxSequentialSkipInIterations - the number of keys could
be skipped in an iteration.public boolean inplaceUpdateSupport()
AdvancedColumnFamilyOptionsInterfaceinplaceUpdateSupport 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setInplaceUpdateSupport(boolean inplaceUpdateSupport)
AdvancedColumnFamilyOptionsInterfacesetInplaceUpdateSupport 在接口中 AdvancedColumnFamilyOptionsInterface<Options>inplaceUpdateSupport - true if thread-safe inplace updates
are allowed.public long inplaceUpdateNumLocks()
inplaceUpdateNumLocks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
setInplaceUpdateNumLocks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>inplaceUpdateNumLocks - the number of locks used for
inplace updates.public double memtablePrefixBloomSizeRatio()
Default: 0 (disabled)
memtablePrefixBloomSizeRatio 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
Default: 0 (disabled)
setMemtablePrefixBloomSizeRatio 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>memtablePrefixBloomSizeRatio - the ratio of memtable used by the
bloom filter, 0 means no bloom filterpublic double experimentalMempurgeThreshold()
Default: 0 (disabled)
experimentalMempurgeThreshold 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setExperimentalMempurgeThreshold(double experimentalMempurgeThreshold)
Default: 0.0 (disabled)
setExperimentalMempurgeThreshold 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>experimentalMempurgeThreshold - the threshold used by
the MemPurge decider.public boolean memtableWholeKeyFiltering()
memtableWholeKeyFiltering 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMemtableWholeKeyFiltering(boolean memtableWholeKeyFiltering)
Default: false (disabled)
setMemtableWholeKeyFiltering 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>memtableWholeKeyFiltering - true if whole key bloom filter is enabled
in memtablepublic int bloomLocality()
AdvancedColumnFamilyOptionsInterfacebloomLocality 在接口中 AdvancedColumnFamilyOptionsInterface<Options>AdvancedColumnFamilyOptionsInterface.setBloomLocality(int)public Options setBloomLocality(int bloomLocality)
AdvancedColumnFamilyOptionsInterfacesetBloomLocality 在接口中 AdvancedColumnFamilyOptionsInterface<Options>bloomLocality - the level of locality of bloom-filter probes.public long maxSuccessiveMerges()
When a merge operation is added to the memtable and the maximum number of successive merges is reached, the value of the key will be calculated and inserted into the memtable instead of the merge operation. This will ensure that there are never more than max_successive_merges merge operations in the memtable.
Default: 0 (disabled)
maxSuccessiveMerges 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxSuccessiveMerges(long maxSuccessiveMerges)
When a merge operation is added to the memtable and the maximum number of successive merges is reached, the value of the key will be calculated and inserted into the memtable instead of the merge operation. This will ensure that there are never more than max_successive_merges merge operations in the memtable.
Default: 0 (disabled)
setMaxSuccessiveMerges 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>maxSuccessiveMerges - the maximum number of successive merges.public int minWriteBufferNumberToMerge()
AdvancedColumnFamilyOptionsInterfaceminWriteBufferNumberToMerge 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
AdvancedColumnFamilyOptionsInterfacesetMinWriteBufferNumberToMerge 在接口中 AdvancedColumnFamilyOptionsInterface<Options>minWriteBufferNumberToMerge - the minimum number of write buffers
that will be merged together.public Options setOptimizeFiltersForHits(boolean optimizeFiltersForHits)
AdvancedColumnFamilyOptionsInterfaceThis flag specifies that the implementation should optimize the filters mainly for cases where keys are found rather than also optimize for keys missed. This would be used in cases where the application knows that there are very few misses or the performance in the case of misses is not important.
For now, this flag allows us to not store filters for the last level i.e the largest level which contains data of the LSM store. For keys which are hits, the filters in this level are not useful because we will search for the data anyway.
NOTE: the filters in other levels are still useful even for key hit because they tell us whether to look in that level or go to the higher level.
Default: false
setOptimizeFiltersForHits 在接口中 AdvancedColumnFamilyOptionsInterface<Options>optimizeFiltersForHits - boolean value indicating if this flag is set.public boolean optimizeFiltersForHits()
AdvancedColumnFamilyOptionsInterfaceReturns the current state of the optimize_filters_for_hits
setting.
optimizeFiltersForHits 在接口中 AdvancedColumnFamilyOptionsInterface<Options>optimize_filters_for_hits was set.public Options setMemtableHugePageSize(long memtableHugePageSize)
setMemtableHugePageSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>memtableHugePageSize - The page size of the huge
page tlbpublic long memtableHugePageSize()
memtableHugePageSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
Default: 64GB
setSoftPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>softPendingCompactionBytesLimit - The soft limit to impose on
compactionpublic long softPendingCompactionBytesLimit()
Default: 64GB
softPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
Default: 256GB
setHardPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>hardPendingCompactionBytesLimit - The hard limit to impose on
compactionpublic long hardPendingCompactionBytesLimit()
Default: 256GB
hardPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
MutableColumnFamilyOptionsInterfaceDefault: 4
setLevel0FileNumCompactionTrigger 在接口中 MutableColumnFamilyOptionsInterface<Options>level0FileNumCompactionTrigger - The number of files to trigger
level-0 compactionpublic int level0FileNumCompactionTrigger()
MutableColumnFamilyOptionsInterfaceDefault: 4
level0FileNumCompactionTrigger 在接口中 MutableColumnFamilyOptionsInterface<Options>public Options setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
setLevel0SlowdownWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>level0SlowdownWritesTrigger - The soft limit on the number of
level-0 filespublic int level0SlowdownWritesTrigger()
level0SlowdownWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setLevel0StopWritesTrigger(int level0StopWritesTrigger)
setLevel0StopWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>level0StopWritesTrigger - The maximum number of level-0 filespublic int level0StopWritesTrigger()
level0StopWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
Default: 1
setMaxBytesForLevelMultiplierAdditional 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>maxBytesForLevelMultiplierAdditional - The max-size multipliers
for each levelpublic int[] maxBytesForLevelMultiplierAdditional()
Default: 1
maxBytesForLevelMultiplierAdditional 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setParanoidFileChecks(boolean paranoidFileChecks)
Default: false
setParanoidFileChecks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>paranoidFileChecks - true to enable paranoid file checkspublic boolean paranoidFileChecks()
Default: false
paranoidFileChecks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMaxWriteBufferNumberToMaintain(int maxWriteBufferNumberToMaintain)
AdvancedColumnFamilyOptionsInterfaceAdvancedMutableColumnFamilyOptionsInterface.maxWriteBufferNumber(),
this parameter does not affect flushing.
This controls the minimum amount of write history that will be available
in memory for conflict checking when Transactions are used.
When using an OptimisticTransactionDB: If this value is too low, some transactions may fail at commit time due to not being able to determine whether there were any write conflicts.
When using a TransactionDB: If Transaction::SetSnapshot is used, TransactionDB will read either in-memory write buffers or SST files to do write-conflict checking. Increasing this value can reduce the number of reads to SST files done for conflict detection.
Setting this value to 0 will cause write buffers to be freed immediately
after they are flushed.
If this value is set to -1,
AdvancedMutableColumnFamilyOptionsInterface.maxWriteBufferNumber()
will be used.
Default:
If using a TransactionDB/OptimisticTransactionDB, the default value will
be set to the value of
AdvancedMutableColumnFamilyOptionsInterface.maxWriteBufferNumber()
if it is not explicitly set by the user. Otherwise, the default is 0.
setMaxWriteBufferNumberToMaintain 在接口中 AdvancedColumnFamilyOptionsInterface<Options>maxWriteBufferNumberToMaintain - The maximum number of write
buffers to maintainpublic int maxWriteBufferNumberToMaintain()
AdvancedColumnFamilyOptionsInterfacemaxWriteBufferNumberToMaintain 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setCompactionPriority(CompactionPriority compactionPriority)
AdvancedColumnFamilyOptionsInterfaceAdvancedColumnFamilyOptionsInterface.compactionStyle() == CompactionStyle.LEVEL,
for each level, which files are prioritized to be picked to compact.
Default: CompactionPriority.ByCompensatedSize
setCompactionPriority 在接口中 AdvancedColumnFamilyOptionsInterface<Options>compactionPriority - The compaction prioritypublic CompactionPriority compactionPriority()
AdvancedColumnFamilyOptionsInterfacecompactionPriority 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setReportBgIoStats(boolean reportBgIoStats)
Default: false
setReportBgIoStats 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>reportBgIoStats - true to enable reportingpublic boolean reportBgIoStats()
reportBgIoStats 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setTtl(long ttl)
MutableDBOptionsInterface.maxOpenFiles() to be
set to -1.
Enabled only for level compaction for now.
Default: 0 (disabled)
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setTtl 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>ttl - the time-to-live.public long ttl()
See AdvancedMutableColumnFamilyOptionsInterface.setTtl(long).
ttl 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setPeriodicCompactionSeconds(long periodicCompactionSeconds)
A file's age is computed by looking at file_creation_time or creation_time table properties in order, if they have valid non-zero values; if not, the age is based on the file's last modified time (given by the underlying Env).
Supported in Level and FIFO compaction. In FIFO compaction, this option has the same meaning as TTL and whichever stricter will be used. Pre-req: max_open_file == -1. unit: seconds. Ex: 7 days = 7 * 24 * 60 * 60
Values: 0: Turn off Periodic compactions. UINT64_MAX - 1 (i.e 0xfffffffffffffffe): Let RocksDB control this feature as needed. For now, RocksDB will change this value to 30 days (i.e 30 * 24 * 60 * 60) so that every file goes through the compaction process at least once every 30 days if not compacted sooner. In FIFO compaction, since the option has the same meaning as ttl, when this value is left default, and ttl is left to 0, 30 days will be used. Otherwise, min(ttl, periodic_compaction_seconds) will be used.
Default: 0xfffffffffffffffe (allow RocksDB to auto-tune)
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setPeriodicCompactionSeconds 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>periodicCompactionSeconds - the periodic compaction in seconds.public long periodicCompactionSeconds()
See AdvancedMutableColumnFamilyOptionsInterface.setPeriodicCompactionSeconds(long).
periodicCompactionSeconds 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setCompactionOptionsUniversal(CompactionOptionsUniversal compactionOptionsUniversal)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsUniversal 在接口中 AdvancedColumnFamilyOptionsInterface<Options>compactionOptionsUniversal - The Universal Style compaction optionspublic CompactionOptionsUniversal compactionOptionsUniversal()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsUniversal 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setCompactionOptionsFIFO(CompactionOptionsFIFO compactionOptionsFIFO)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsFIFO 在接口中 AdvancedColumnFamilyOptionsInterface<Options>compactionOptionsFIFO - The FIFO compaction optionspublic CompactionOptionsFIFO compactionOptionsFIFO()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsFIFO 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setForceConsistencyChecks(boolean forceConsistencyChecks)
AdvancedColumnFamilyOptionsInterfaceDefault: true
setForceConsistencyChecks 在接口中 AdvancedColumnFamilyOptionsInterface<Options>forceConsistencyChecks - false to disable consistency checkspublic boolean forceConsistencyChecks()
AdvancedColumnFamilyOptionsInterfaceforceConsistencyChecks 在接口中 AdvancedColumnFamilyOptionsInterface<Options>public Options setAtomicFlush(boolean atomicFlush)
DBOptionsInterfaceRocksDB.flush(FlushOptions, List).
For auto-triggered flush, RocksDB atomically flushes ALL column families.
Currently, any WAL-enabled writes after atomic flush may be replayed
independently if the process crashes later and tries to recover.setAtomicFlush 在接口中 DBOptionsInterface<Options>atomicFlush - true to enable atomic flush of multiple column families.public boolean atomicFlush()
DBOptionsInterfaceDBOptionsInterface.setAtomicFlush(boolean).atomicFlush 在接口中 DBOptionsInterface<Options>public Options setAvoidUnnecessaryBlockingIO(boolean avoidUnnecessaryBlockingIO)
DBOptionsInterfaceReadOptions.setBackgroundPurgeOnIteratorCleanup(boolean).setAvoidUnnecessaryBlockingIO 在接口中 DBOptionsInterface<Options>avoidUnnecessaryBlockingIO - If true, working thread may avoid doing unnecessary
operation.public boolean avoidUnnecessaryBlockingIO()
DBOptionsInterfaceReadOptions.setBackgroundPurgeOnIteratorCleanup(boolean).avoidUnnecessaryBlockingIO 在接口中 DBOptionsInterface<Options>public Options setPersistStatsToDisk(boolean persistStatsToDisk)
DBOptionsInterfacesetPersistStatsToDisk 在接口中 DBOptionsInterface<Options>persistStatsToDisk - true if stats should be persisted to hidden column family.public boolean persistStatsToDisk()
DBOptionsInterfacepersistStatsToDisk 在接口中 DBOptionsInterface<Options>public Options setWriteDbidToManifest(boolean writeDbidToManifest)
DBOptionsInterfacesetWriteDbidToManifest 在接口中 DBOptionsInterface<Options>writeDbidToManifest - if true, then DB ID will be written to Manifest file.public boolean writeDbidToManifest()
DBOptionsInterfacewriteDbidToManifest 在接口中 DBOptionsInterface<Options>public Options setLogReadaheadSize(long logReadaheadSize)
DBOptionsInterfacesetLogReadaheadSize 在接口中 DBOptionsInterface<Options>logReadaheadSize - the number of bytes to prefetch when reading the log.public long logReadaheadSize()
DBOptionsInterfacelogReadaheadSize 在接口中 DBOptionsInterface<Options>public Options setBestEffortsRecovery(boolean bestEffortsRecovery)
DBOptionsInterfacesetBestEffortsRecovery 在接口中 DBOptionsInterface<Options>bestEffortsRecovery - if true, RocksDB will use best-efforts mode when recovering.public boolean bestEffortsRecovery()
DBOptionsInterfacebestEffortsRecovery 在接口中 DBOptionsInterface<Options>public Options setMaxBgErrorResumeCount(int maxBgerrorResumeCount)
DBOptionsInterfacesetMaxBgErrorResumeCount 在接口中 DBOptionsInterface<Options>maxBgerrorResumeCount - maximum number of times db resume should be called when IO Error
happens.public int maxBgerrorResumeCount()
DBOptionsInterfacemaxBgerrorResumeCount 在接口中 DBOptionsInterface<Options>public Options setBgerrorResumeRetryInterval(long bgerrorResumeRetryInterval)
DBOptionsInterfacesetBgerrorResumeRetryInterval 在接口中 DBOptionsInterface<Options>bgerrorResumeRetryInterval - how many microseconds to wait between DB resume attempts.public long bgerrorResumeRetryInterval()
DBOptionsInterfacebgerrorResumeRetryInterval 在接口中 DBOptionsInterface<Options>public Options setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory)
ColumnFamilyOptionsInterfaceDefault: nullptr
setSstPartitionerFactory 在接口中 ColumnFamilyOptionsInterface<Options>sstPartitionerFactory - The factory referencepublic SstPartitionerFactory sstPartitionerFactory()
ColumnFamilyOptionsInterfacesstPartitionerFactory 在接口中 ColumnFamilyOptionsInterface<Options>public Options setCompactionThreadLimiter(ConcurrentTaskLimiter compactionThreadLimiter)
ColumnFamilyOptionsInterfacesetCompactionThreadLimiter 在接口中 ColumnFamilyOptionsInterface<Options>compactionThreadLimiter - The compaction thread limiter.public ConcurrentTaskLimiter compactionThreadLimiter()
ColumnFamilyOptionsInterfacecompactionThreadLimiter 在接口中 ColumnFamilyOptionsInterface<Options>public Options setEnableBlobFiles(boolean enableBlobFiles)
Default: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setEnableBlobFiles 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>enableBlobFiles - true iff blob files should be enabledpublic boolean enableBlobFiles()
Default: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
enableBlobFiles 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setMinBlobSize(long minBlobSize)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setMinBlobSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>minBlobSize - the size of the smallest value to be stored separately in a blob filepublic long minBlobSize()
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
minBlobSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobFileSize(long blobFileSize)
Default: 256 MB
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobFileSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>blobFileSize - the size limit for blob filespublic long blobFileSize()
blobFileSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobCompressionType(CompressionType compressionType)
Default: no compression
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobCompressionType 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>compressionType - the compression algorithm to use.public CompressionType blobCompressionType()
blobCompressionType 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setEnableBlobGarbageCollection(boolean enableBlobGarbageCollection)
Default: false
setEnableBlobGarbageCollection 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>enableBlobGarbageCollection - the new enabled/disabled state of blob garbage collectionpublic boolean enableBlobGarbageCollection()
Default: false
enableBlobGarbageCollection 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobGarbageCollectionAgeCutoff(double blobGarbageCollectionAgeCutoff)
Default: 0.25
setBlobGarbageCollectionAgeCutoff 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>blobGarbageCollectionAgeCutoff - the new age cutoffpublic double blobGarbageCollectionAgeCutoff()
Default: 0.25
blobGarbageCollectionAgeCutoff 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobGarbageCollectionForceThreshold(double blobGarbageCollectionForceThreshold)
AdvancedMutableColumnFamilyOptionsInterface.blobGarbageCollectionAgeCutoff() above. This option is
currently only supported with leveled compactions.
Note that AdvancedMutableColumnFamilyOptionsInterface.enableBlobGarbageCollection() has to be set in order for this
option to have any effect.
Default: 1.0
Dynamically changeable through the SetOptions() API
setBlobGarbageCollectionForceThreshold 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>blobGarbageCollectionForceThreshold - new value for the thresholdpublic double blobGarbageCollectionForceThreshold()
#blobGarbageCollectionForceThresholdblobGarbageCollectionForceThreshold 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobCompactionReadaheadSize(long blobCompactionReadaheadSize)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobCompactionReadaheadSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>blobCompactionReadaheadSize - the compaction readahead for blob filespublic long blobCompactionReadaheadSize()
blobCompactionReadaheadSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setBlobFileStartingLevel(int blobFileStartingLevel)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobFileStartingLevel 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>blobFileStartingLevel - the starting level to enable blob filespublic int blobFileStartingLevel()
Default: 0
blobFileStartingLevel 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>public Options setPrepopulateBlobCache(PrepopulateBlobCache prepopulateBlobCache)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setPrepopulateBlobCache 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>prepopulateBlobCache - prepopulate the blob cache optionpublic PrepopulateBlobCache prepopulateBlobCache()
Default: 0
prepopulateBlobCache 在接口中 AdvancedMutableColumnFamilyOptionsInterface<Options>protected final void disposeInternal(long handle)
disposeInternal 在类中 RocksObject