public class ColumnFamilyOptions extends RocksObject implements ColumnFamilyOptionsInterface<ColumnFamilyOptions>, MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>
RocksDB (i.e., RocksDB.open()).
As a descendant 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| 构造器和说明 |
|---|
ColumnFamilyOptions()
Construct ColumnFamilyOptions.
|
ColumnFamilyOptions(ColumnFamilyOptions other)
Copy constructor for ColumnFamilyOptions.
|
ColumnFamilyOptions(Options options)
Constructor from Options
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
arenaBlockSize()
The size of one block in arena memory allocation.
|
long |
blobCompactionReadaheadSize()
Get compaction readahead for blob files.
|
CompressionType |
blobCompressionType()
Get the compression algorithm to use for large values stored in blob files.
|
long |
blobFileSize()
Get the size limit for blob files.
|
int |
blobFileStartingLevel()
Get the starting LSM tree level to enable blob files.
|
double |
blobGarbageCollectionAgeCutoff()
Get the 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.
|
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
|
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 |
disableAutoCompactions()
Disable automatic compactions.
|
protected void |
disposeInternal(long handle) |
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()
Get enabled/disables state for garbage collection of blobs.
|
double |
experimentalMempurgeThreshold()
Threshold used in the MemPurge (memtable garbage collection)
feature.
|
boolean |
forceConsistencyChecks()
By default, RocksDB runs consistency checks on the LSM every time the LSM
changes (Flush, Compaction, AddFile).
|
static ColumnFamilyOptions |
getColumnFamilyOptionsFromProps(ConfigOptions cfgOpts,
java.util.Properties properties)
Method to get a options instance by using pre-configured
property values.
|
static ColumnFamilyOptions |
getColumnFamilyOptionsFromProps(java.util.Properties properties)
Method to get a options instance by using pre-configured
property values.
|
long |
hardPendingCompactionBytesLimit()
All writes are stopped if estimated bytes needed to be compaction exceed
this threshold.
|
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.
|
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.
|
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)
|
long |
maxSequentialSkipInIterations()
An iteration->Next() sequentially skips over keys with the same
user-key unless this option is set.
|
long |
maxSuccessiveMerges()
Maximum number of successive merge operations on a key in the memtable.
|
long |
maxTableFilesSizeFIFO()
FIFO compaction option.
|
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.
|
ColumnFamilyOptions |
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. |
ColumnFamilyOptions |
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
|
ColumnFamilyOptions |
optimizeForSmallDb()
Use this if your DB is very small (like under 1GB) and you don't want to
spend lots of memory for memtables.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
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 |
paranoidFileChecks()
After writing every SST file, reopen it and read all the keys.
|
long |
periodicCompactionSeconds()
Get the periodicCompactionSeconds.
|
PrepopulateBlobCache |
prepopulateBlobCache()
Get the prepopulate blob cache option.
|
boolean |
reportBgIoStats()
Determine whether IO stats in compactions and flushes are being measured
|
ColumnFamilyOptions |
setArenaBlockSize(long arenaBlockSize)
The size of one block in arena memory allocation.
|
ColumnFamilyOptions |
setBlobCompactionReadaheadSize(long blobCompactionReadaheadSize)
Set compaction readahead for blob files.
|
ColumnFamilyOptions |
setBlobCompressionType(CompressionType compressionType)
Set the compression algorithm to use for large values stored in blob files.
|
ColumnFamilyOptions |
setBlobFileSize(long blobFileSize)
Set the size limit for blob files.
|
ColumnFamilyOptions |
setBlobFileStartingLevel(int blobFileStartingLevel)
Set a certain LSM tree level to enable blob files.
|
ColumnFamilyOptions |
setBlobGarbageCollectionAgeCutoff(double blobGarbageCollectionAgeCutoff)
Set the cutoff in terms of blob file age for garbage collection.
|
ColumnFamilyOptions |
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
blobGarbageCollectionAgeCutoff() above. |
ColumnFamilyOptions |
setBloomLocality(int bloomLocality)
Control locality of bloom filter probes to improve cache miss rate.
|
ColumnFamilyOptions |
setBottommostCompressionOptions(CompressionOptions bottommostCompressionOptions)
Set the options for compression algorithms used by
ColumnFamilyOptionsInterface.bottommostCompressionType() if it is enabled. |
ColumnFamilyOptions |
setBottommostCompressionType(CompressionType bottommostCompressionType)
Compression algorithm that will be used for the bottommost level that
contain files.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
A single CompactionFilter instance to call into during compaction.
|
ColumnFamilyOptions |
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. |
ColumnFamilyOptions |
setCompactionOptionsFIFO(CompactionOptionsFIFO compactionOptionsFIFO)
The options for FIFO compaction style
|
ColumnFamilyOptions |
setCompactionOptionsUniversal(CompactionOptionsUniversal compactionOptionsUniversal)
Set the options needed to support Universal Style compactions
|
ColumnFamilyOptions |
setCompactionPriority(CompactionPriority compactionPriority)
If level
AdvancedColumnFamilyOptionsInterface.compactionStyle() == CompactionStyle.LEVEL,
for each level, which files are prioritized to be picked to compact. |
ColumnFamilyOptions |
setCompactionStyle(CompactionStyle compactionStyle)
Set compaction style for DB.
|
ColumnFamilyOptions |
setCompactionThreadLimiter(ConcurrentTaskLimiter compactionThreadLimiter)
Compaction concurrent thread limiter for the column family.
|
ColumnFamilyOptions |
setComparator(AbstractComparator comparator)
Use the specified comparator for key ordering.
|
ColumnFamilyOptions |
setComparator(BuiltinComparator builtinComparator)
Set
BuiltinComparator to be used with RocksDB. |
ColumnFamilyOptions |
setCompressionOptions(CompressionOptions compressionOptions)
Set the different options for compression algorithms
|
ColumnFamilyOptions |
setCompressionPerLevel(java.util.List<CompressionType> compressionLevels)
Different levels can have different compression
policies.
|
ColumnFamilyOptions |
setCompressionType(CompressionType compressionType)
Compress blocks using the specified compression algorithm.
|
ColumnFamilyOptions |
setDisableAutoCompactions(boolean disableAutoCompactions)
Disable automatic compactions.
|
ColumnFamilyOptions |
setEnableBlobFiles(boolean enableBlobFiles)
When set, large values (blobs) are written to separate blob files, and only
pointers to them are stored in SST files.
|
ColumnFamilyOptions |
setEnableBlobGarbageCollection(boolean enableBlobGarbageCollection)
Enable/disable garbage collection of blobs.
|
ColumnFamilyOptions |
setExperimentalMempurgeThreshold(double experimentalMempurgeThreshold)
Threshold used in the MemPurge (memtable garbage collection)
feature.
|
ColumnFamilyOptions |
setForceConsistencyChecks(boolean forceConsistencyChecks)
By default, RocksDB runs consistency checks on the LSM every time the LSM
changes (Flush, Compaction, AddFile).
|
ColumnFamilyOptions |
setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
All writes are stopped if estimated bytes needed to be compaction exceed
this threshold.
|
ColumnFamilyOptions |
setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
Number of locks used for inplace update
Default: 10000, if inplace_update_support = true, else 0.
|
ColumnFamilyOptions |
setInplaceUpdateSupport(boolean inplaceUpdateSupport)
Allows thread-safe inplace updates.
|
ColumnFamilyOptions |
setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
Number of files to trigger level-0 compaction.
|
ColumnFamilyOptions |
setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
Soft limit on number of level-0 files.
|
ColumnFamilyOptions |
setLevel0StopWritesTrigger(int level0StopWritesTrigger)
Maximum number of level-0 files.
|
ColumnFamilyOptions |
setLevelCompactionDynamicLevelBytes(boolean enableLevelCompactionDynamicLevelBytes)
If
true, RocksDB will pick target size of each level
dynamically. |
ColumnFamilyOptions |
setLevelZeroFileNumCompactionTrigger(int numFiles)
Number of files to trigger level-0 compaction.
|
ColumnFamilyOptions |
setLevelZeroSlowdownWritesTrigger(int numFiles)
Soft limit on number of level-0 files.
|
ColumnFamilyOptions |
setLevelZeroStopWritesTrigger(int numFiles)
Maximum number of level-0 files.
|
ColumnFamilyOptions |
setMaxBytesForLevelBase(long maxBytesForLevelBase)
The upper-bound of the total size of level-1 files in bytes.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
Different max-size multipliers for different levels.
|
ColumnFamilyOptions |
setMaxCompactionBytes(long maxCompactionBytes)
Maximum size of each compaction (not guarantee)
|
ColumnFamilyOptions |
setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
An iteration->Next() sequentially skips over keys with the same
user-key unless this option is set.
|
ColumnFamilyOptions |
setMaxSuccessiveMerges(long maxSuccessiveMerges)
Maximum number of successive merge operations on a key in the memtable.
|
ColumnFamilyOptions |
setMaxTableFilesSizeFIFO(long maxTableFilesSize)
FIFO compaction option.
|
ColumnFamilyOptions |
setMaxWriteBufferNumber(int maxWriteBufferNumber)
The maximum number of write buffers that are built up in memory.
|
ColumnFamilyOptions |
setMaxWriteBufferNumberToMaintain(int maxWriteBufferNumberToMaintain)
The total maximum number of write buffers to maintain in memory including
copies of buffers that have already been flushed.
|
ColumnFamilyOptions |
setMemTableConfig(MemTableConfig memTableConfig)
Set the config for mem-table.
|
ColumnFamilyOptions |
setMemtableHugePageSize(long memtableHugePageSize)
Page size for huge page TLB for bloom in memtable.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
setMemtableWholeKeyFiltering(boolean memtableWholeKeyFiltering)
Enable whole key bloom filter in memtable.
|
ColumnFamilyOptions |
setMergeOperator(MergeOperator mergeOperator)
Set the merge operator to be used for merging two different key/value
pairs that share the same key.
|
ColumnFamilyOptions |
setMergeOperatorName(java.lang.String name)
Set the merge operator to be used for merging two merge operands
of the same key.
|
ColumnFamilyOptions |
setMinBlobSize(long minBlobSize)
Set the size of the smallest value to be stored separately in a blob file.
|
ColumnFamilyOptions |
setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
The minimum number of write buffers that will be merged together
before writing to storage.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
setParanoidFileChecks(boolean paranoidFileChecks)
After writing every SST file, reopen it and read all the keys.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
setPrepopulateBlobCache(PrepopulateBlobCache prepopulateBlobCache)
Set a certain prepopulate blob cache option.
|
ColumnFamilyOptions |
setReportBgIoStats(boolean reportBgIoStats)
Measure IO stats in compactions and flushes, if true.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory)
If non-nullptr, use the specified factory for a function to determine the
partitioning of sst files.
|
ColumnFamilyOptions |
setTableFormatConfig(TableFormatConfig tableFormatConfig)
Set the config for table format.
|
ColumnFamilyOptions |
setTargetFileSizeBase(long targetFileSizeBase)
The target file size for compaction.
|
ColumnFamilyOptions |
setTargetFileSizeMultiplier(int multiplier)
targetFileSizeMultiplier defines the size ratio between a
level-L file and level-(L+1) file.
|
ColumnFamilyOptions |
setTtl(long ttl)
Non-bottom-level files older than TTL will go through the compaction
process.
|
ColumnFamilyOptions |
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.
|
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
|
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.
|
ColumnFamilyOptions |
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.
|
ColumnFamilyOptions |
useFixedLengthPrefixExtractor(int n)
This prefix-extractor uses the first n bytes of a key as its prefix.
|
long |
writeBufferSize()
Return size of write buffer size.
|
disposeInternal, getNativeHandleclose, disOwnNativeHandle, isOwningHandlepublic ColumnFamilyOptions()
This constructor will create (by allocating a block of memory)
an rocksdb::ColumnFamilyOptions in the c++ side.
public ColumnFamilyOptions(ColumnFamilyOptions other)
NOTE: This does a shallow copy, which means comparator, merge_operator, compaction_filter, compaction_filter_factory and other pointers will be cloned!
other - The ColumnFamilyOptions to copy.public ColumnFamilyOptions(Options options)
options - The options.public static ColumnFamilyOptions getColumnFamilyOptionsFromProps(java.util.Properties properties)
Method to get a options instance by using pre-configured property values. If one or many values are undefined in the context of RocksDB the method will return a null value.
Note: Property keys can be derived from
getter methods within the options class. Example: the method
writeBufferSize() has a property key:
write_buffer_size.
properties - Properties instance.instance
or null.java.lang.IllegalArgumentException - if null or empty
Properties instance is passed to the method call.public static ColumnFamilyOptions getColumnFamilyOptionsFromProps(ConfigOptions cfgOpts, java.util.Properties properties)
Method to get a options instance by using pre-configured property values. If one or many values are undefined in the context of RocksDB the method will return a null value.
Note: Property keys can be derived from
getter methods within the options class. Example: the method
writeBufferSize() has a property key:
write_buffer_size.
cfgOpts - ConfigOptions controlling how the properties are parsed.properties - Properties instance.instance
or null.java.lang.IllegalArgumentException - if null or empty
Properties instance is passed to the method call.public ColumnFamilyOptions oldDefaults(int majorVersion, int minorVersion)
ColumnFamilyOptionsInterfaceoldDefaults 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>majorVersion - The major version to recover default values of optionsminorVersion - The minor version to recover default values of optionspublic ColumnFamilyOptions optimizeForSmallDb()
ColumnFamilyOptionsInterfaceoptimizeForSmallDb 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions optimizeForSmallDb(Cache cache)
ColumnFamilyOptionsInterfaceoptimizeForSmallDb 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>cache - An optional cache object is passed in to be used as the block cachepublic ColumnFamilyOptions optimizeForPointLookup(long blockCacheSizeMb)
ColumnFamilyOptionsInterfaceoptimizeForPointLookup 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>blockCacheSizeMb - Block cache size in MBpublic ColumnFamilyOptions 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<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>memtableMemoryBudget - memory budget in bytespublic ColumnFamilyOptions 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<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>memtableMemoryBudget - memory budget in bytespublic ColumnFamilyOptions setComparator(BuiltinComparator builtinComparator)
ColumnFamilyOptionsInterfaceBuiltinComparator to be used with RocksDB.
Note: Comparator can be set once upon database creation.
Default: BytewiseComparator.
setComparator 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>builtinComparator - a BuiltinComparator type.public ColumnFamilyOptions 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<ColumnFamilyOptions>comparator - java instance.public ColumnFamilyOptions 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<ColumnFamilyOptions>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 ColumnFamilyOptions 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<ColumnFamilyOptions>mergeOperator - MergeOperator instance.public ColumnFamilyOptions 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<ColumnFamilyOptions>compactionFilter - AbstractCompactionFilter instance.public AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter()
ColumnFamilyOptionsInterfacecompactionFilter 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>compactionFilterFactory - AbstractCompactionFilterFactory instance.public AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory()
ColumnFamilyOptionsInterfacecompactionFilterFactory 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>writeBufferSize - the size of write buffer.public long writeBufferSize()
MutableColumnFamilyOptionsInterfacewriteBufferSize 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>MutableColumnFamilyOptionsInterface.setWriteBufferSize(long)public ColumnFamilyOptions setMaxWriteBufferNumber(int maxWriteBufferNumber)
setMaxWriteBufferNumber 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxWriteBufferNumber - maximum number of write buffers.public int maxWriteBufferNumber()
maxWriteBufferNumber 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>AdvancedMutableColumnFamilyOptionsInterface.setMaxWriteBufferNumber(int)public ColumnFamilyOptions setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
AdvancedColumnFamilyOptionsInterfacesetMinWriteBufferNumberToMerge 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>minWriteBufferNumberToMerge - the minimum number of write buffers
that will be merged together.public int minWriteBufferNumberToMerge()
AdvancedColumnFamilyOptionsInterfaceminWriteBufferNumberToMerge 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>n - use the first n bytes of a key as its prefix.public ColumnFamilyOptions useCappedPrefixExtractor(int n)
ColumnFamilyOptionsInterfaceuseCappedPrefixExtractor 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>n - use the first n bytes of a key as its prefix.public ColumnFamilyOptions setCompressionType(CompressionType compressionType)
MutableColumnFamilyOptionsInterfaceDefault: SNAPPY_COMPRESSION, which gives lightweight but fast compression.
setCompressionType 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>compressionType - Compression Type.public CompressionType compressionType()
MutableColumnFamilyOptionsInterfaceDefault: SNAPPY_COMPRESSION, which gives lightweight but fast compression.
compressionType 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>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<ColumnFamilyOptions>CompressionType
instances.public ColumnFamilyOptions setBottommostCompressionType(CompressionType bottommostCompressionType)
ColumnFamilyOptionsInterfacesetBottommostCompressionType 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>bottommostCompressionType - The compression type to use for the
bottommost levelpublic CompressionType bottommostCompressionType()
ColumnFamilyOptionsInterfacebottommostCompressionType 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBottommostCompressionOptions(CompressionOptions bottommostCompressionOptions)
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.bottommostCompressionType() if it is enabled.
To enable it, please see the definition of
CompressionOptions.
setBottommostCompressionOptions 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>bottommostCompressionOptions - the bottom most compression options.public CompressionOptions bottommostCompressionOptions()
ColumnFamilyOptionsInterface
See ColumnFamilyOptionsInterface.setBottommostCompressionOptions(CompressionOptions).
bottommostCompressionOptions 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompressionOptions(CompressionOptions compressionOptions)
ColumnFamilyOptionsInterfacesetCompressionOptions 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>compressionOptions - The compression optionspublic CompressionOptions compressionOptions()
ColumnFamilyOptionsInterfacecompressionOptions 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setNumLevels(int numLevels)
AdvancedColumnFamilyOptionsInterfacesetNumLevels 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>numLevels - the number of levels.public int numLevels()
AdvancedColumnFamilyOptionsInterfacenumLevels 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevelZeroFileNumCompactionTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroFileNumCompactionTrigger 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>numFiles - the number of files in level-0 to trigger compaction.public int levelZeroFileNumCompactionTrigger()
ColumnFamilyOptionsInterfacelevelZeroFileNumCompactionTrigger 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevelZeroSlowdownWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroSlowdownWritesTrigger 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>numFiles - soft limit on number of level-0 files.public int levelZeroSlowdownWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroSlowdownWritesTrigger 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevelZeroStopWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroStopWritesTrigger 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>numFiles - the hard limit of the number of level-0 files.public int levelZeroStopWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroStopWritesTrigger 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setTargetFileSizeBase(long targetFileSizeBase)
setTargetFileSizeBase 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>targetFileSizeBase - the target size of a level-0 file.AdvancedMutableColumnFamilyOptionsInterface.setTargetFileSizeMultiplier(int)public long targetFileSizeBase()
targetFileSizeBase 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>AdvancedMutableColumnFamilyOptionsInterface.targetFileSizeMultiplier()public ColumnFamilyOptions setTargetFileSizeMultiplier(int multiplier)
setTargetFileSizeMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>multiplier - the size ratio between a level-(L+1) file
and level-L file.public int targetFileSizeMultiplier()
targetFileSizeMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxBytesForLevelBase(long maxBytesForLevelBase)
MutableColumnFamilyOptionsInterfacesetMaxBytesForLevelBase 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxBytesForLevelBase - maximum bytes for level base.
See AdvancedMutableColumnFamilyOptionsInterface.setMaxBytesForLevelMultiplier(double)
public long maxBytesForLevelBase()
MutableColumnFamilyOptionsInterfacemaxBytesForLevelBase 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>
See AdvancedMutableColumnFamilyOptionsInterface.maxBytesForLevelMultiplier()
public ColumnFamilyOptions 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<ColumnFamilyOptions>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<ColumnFamilyOptions>levelCompactionDynamicLevelBytes is enabled.public ColumnFamilyOptions setMaxBytesForLevelMultiplier(double multiplier)
ColumnFamilyOptionsInterfacesetMaxBytesForLevelMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>setMaxBytesForLevelMultiplier 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>multiplier - the ratio between the total size of level-(L+1)
files and the total size of level-L files for all L.public double maxBytesForLevelMultiplier()
ColumnFamilyOptionsInterfacemaxBytesForLevelMultiplier 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxBytesForLevelMultiplier 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxCompactionBytes(long maxCompactionBytes)
AdvancedColumnFamilyOptionsInterfacesetMaxCompactionBytes 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>setMaxCompactionBytes 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxCompactionBytes - the compaction size limitMutableColumnFamilyOptionsInterface.maxCompactionBytes()public long maxCompactionBytes()
AdvancedColumnFamilyOptionsInterfacemaxCompactionBytes 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>maxCompactionBytes 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>MutableColumnFamilyOptionsInterface.setMaxCompactionBytes(long)public ColumnFamilyOptions 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<ColumnFamilyOptions>arenaBlockSize - the size of an arena blockpublic 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<ColumnFamilyOptions>public ColumnFamilyOptions setDisableAutoCompactions(boolean disableAutoCompactions)
MutableColumnFamilyOptionsInterfacesetDisableAutoCompactions 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>disableAutoCompactions - true if auto-compactions are disabled.public boolean disableAutoCompactions()
MutableColumnFamilyOptionsInterfacedisableAutoCompactions 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompactionStyle(CompactionStyle compactionStyle)
AdvancedColumnFamilyOptionsInterfaceDefault: LEVEL.
setCompactionStyle 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionStyle - Compaction style.public CompactionStyle compactionStyle()
AdvancedColumnFamilyOptionsInterfacecompactionStyle 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxTableFilesSizeFIFO(long maxTableFilesSize)
ColumnFamilyOptionsInterfacesetMaxTableFilesSizeFIFO 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>maxTableFilesSize - the size limit of the total sum of table files.public long maxTableFilesSizeFIFO()
ColumnFamilyOptionsInterfacemaxTableFilesSizeFIFO 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
setMaxSequentialSkipInIterations 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxSequentialSkipInIterations - the number of keys could
be skipped in an iteration.public long maxSequentialSkipInIterations()
maxSequentialSkipInIterations 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public MemTableConfig memTableConfig()
ColumnFamilyOptionsInterfacememTableConfig 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMemTableConfig(MemTableConfig memTableConfig)
ColumnFamilyOptionsInterfacesetMemTableConfig 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>memTableConfig - the mem-table config.public java.lang.String memTableFactoryName()
ColumnFamilyOptionsInterfacememTableFactoryName 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>ColumnFamilyOptionsInterface.setTableFormatConfig(org.rocksdb.TableFormatConfig)public TableFormatConfig tableFormatConfig()
ColumnFamilyOptionsInterfacetableFormatConfig 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setTableFormatConfig(TableFormatConfig tableFormatConfig)
ColumnFamilyOptionsInterfacesetTableFormatConfig 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>tableFormatConfig - the table format config.public java.lang.String tableFactoryName()
tableFactoryName 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCfPaths(java.util.Collection<DbPath> cfPaths)
ColumnFamilyOptionsInterfaceIf left empty, db_paths will be used. Default: empty
setCfPaths 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>cfPaths - collection of paths for SST files.public java.util.List<DbPath> cfPaths()
cfPaths 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setInplaceUpdateSupport(boolean inplaceUpdateSupport)
AdvancedColumnFamilyOptionsInterfacesetInplaceUpdateSupport 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>inplaceUpdateSupport - true if thread-safe inplace updates
are allowed.public boolean inplaceUpdateSupport()
AdvancedColumnFamilyOptionsInterfaceinplaceUpdateSupport 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
setInplaceUpdateNumLocks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>inplaceUpdateNumLocks - the number of locks used for
inplace updates.public long inplaceUpdateNumLocks()
inplaceUpdateNumLocks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
Default: 0 (disabled)
setMemtablePrefixBloomSizeRatio 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>memtablePrefixBloomSizeRatio - the ratio of memtable used by the
bloom filter, 0 means no bloom filterpublic double memtablePrefixBloomSizeRatio()
Default: 0 (disabled)
memtablePrefixBloomSizeRatio 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setExperimentalMempurgeThreshold(double experimentalMempurgeThreshold)
Default: 0.0 (disabled)
setExperimentalMempurgeThreshold 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>experimentalMempurgeThreshold - the threshold used by
the MemPurge decider.public double experimentalMempurgeThreshold()
Default: 0 (disabled)
experimentalMempurgeThreshold 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMemtableWholeKeyFiltering(boolean memtableWholeKeyFiltering)
Default: false (disabled)
setMemtableWholeKeyFiltering 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>memtableWholeKeyFiltering - true if whole key bloom filter is enabled
in memtablepublic boolean memtableWholeKeyFiltering()
memtableWholeKeyFiltering 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBloomLocality(int bloomLocality)
AdvancedColumnFamilyOptionsInterfacesetBloomLocality 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>bloomLocality - the level of locality of bloom-filter probes.public int bloomLocality()
AdvancedColumnFamilyOptionsInterfacebloomLocality 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>AdvancedColumnFamilyOptionsInterface.setBloomLocality(int)public ColumnFamilyOptions 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<ColumnFamilyOptions>maxSuccessiveMerges - the maximum number of successive merges.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<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>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<ColumnFamilyOptions>optimize_filters_for_hits was set.public ColumnFamilyOptions setMemtableHugePageSize(long memtableHugePageSize)
setMemtableHugePageSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>memtableHugePageSize - The page size of the huge
page tlbpublic long memtableHugePageSize()
memtableHugePageSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
Default: 64GB
setSoftPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>softPendingCompactionBytesLimit - The soft limit to impose on
compactionpublic long softPendingCompactionBytesLimit()
Default: 64GB
softPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
Default: 256GB
setHardPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>hardPendingCompactionBytesLimit - The hard limit to impose on
compactionpublic long hardPendingCompactionBytesLimit()
Default: 256GB
hardPendingCompactionBytesLimit 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
MutableColumnFamilyOptionsInterfaceDefault: 4
setLevel0FileNumCompactionTrigger 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>level0FileNumCompactionTrigger - The number of files to trigger
level-0 compactionpublic int level0FileNumCompactionTrigger()
MutableColumnFamilyOptionsInterfaceDefault: 4
level0FileNumCompactionTrigger 在接口中 MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
setLevel0SlowdownWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>level0SlowdownWritesTrigger - The soft limit on the number of
level-0 filespublic int level0SlowdownWritesTrigger()
level0SlowdownWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevel0StopWritesTrigger(int level0StopWritesTrigger)
setLevel0StopWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>level0StopWritesTrigger - The maximum number of level-0 filespublic int level0StopWritesTrigger()
level0StopWritesTrigger 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
Default: 1
setMaxBytesForLevelMultiplierAdditional 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxBytesForLevelMultiplierAdditional - The max-size multipliers
for each levelpublic int[] maxBytesForLevelMultiplierAdditional()
Default: 1
maxBytesForLevelMultiplierAdditional 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setParanoidFileChecks(boolean paranoidFileChecks)
Default: false
setParanoidFileChecks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>paranoidFileChecks - true to enable paranoid file checkspublic boolean paranoidFileChecks()
Default: false
paranoidFileChecks 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>maxWriteBufferNumberToMaintain - The maximum number of write
buffers to maintainpublic int maxWriteBufferNumberToMaintain()
AdvancedColumnFamilyOptionsInterfacemaxWriteBufferNumberToMaintain 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompactionPriority(CompactionPriority compactionPriority)
AdvancedColumnFamilyOptionsInterfaceAdvancedColumnFamilyOptionsInterface.compactionStyle() == CompactionStyle.LEVEL,
for each level, which files are prioritized to be picked to compact.
Default: CompactionPriority.ByCompensatedSize
setCompactionPriority 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionPriority - The compaction prioritypublic CompactionPriority compactionPriority()
AdvancedColumnFamilyOptionsInterfacecompactionPriority 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setReportBgIoStats(boolean reportBgIoStats)
Default: false
setReportBgIoStats 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>reportBgIoStats - true to enable reportingpublic boolean reportBgIoStats()
reportBgIoStats 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>ttl - the time-to-live.public long ttl()
See AdvancedMutableColumnFamilyOptionsInterface.setTtl(long).
ttl 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions 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<ColumnFamilyOptions>periodicCompactionSeconds - the periodic compaction in seconds.public long periodicCompactionSeconds()
See AdvancedMutableColumnFamilyOptionsInterface.setPeriodicCompactionSeconds(long).
periodicCompactionSeconds 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompactionOptionsUniversal(CompactionOptionsUniversal compactionOptionsUniversal)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsUniversal 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionOptionsUniversal - The Universal Style compaction optionspublic CompactionOptionsUniversal compactionOptionsUniversal()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsUniversal 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompactionOptionsFIFO(CompactionOptionsFIFO compactionOptionsFIFO)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsFIFO 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionOptionsFIFO - The FIFO compaction optionspublic CompactionOptionsFIFO compactionOptionsFIFO()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsFIFO 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setForceConsistencyChecks(boolean forceConsistencyChecks)
AdvancedColumnFamilyOptionsInterfaceDefault: true
setForceConsistencyChecks 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>forceConsistencyChecks - false to disable consistency checkspublic boolean forceConsistencyChecks()
AdvancedColumnFamilyOptionsInterfaceforceConsistencyChecks 在接口中 AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory)
ColumnFamilyOptionsInterfaceDefault: nullptr
setSstPartitionerFactory 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>sstPartitionerFactory - The factory referencepublic ColumnFamilyOptions setCompactionThreadLimiter(ConcurrentTaskLimiter compactionThreadLimiter)
ColumnFamilyOptionsInterfacesetCompactionThreadLimiter 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionThreadLimiter - The compaction thread limiter.public ConcurrentTaskLimiter compactionThreadLimiter()
ColumnFamilyOptionsInterfacecompactionThreadLimiter 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public SstPartitionerFactory sstPartitionerFactory()
ColumnFamilyOptionsInterfacesstPartitionerFactory 在接口中 ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setEnableBlobFiles(boolean enableBlobFiles)
Default: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setEnableBlobFiles 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>enableBlobFiles - true iff blob files should be enabledpublic boolean enableBlobFiles()
Default: false
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
enableBlobFiles 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMinBlobSize(long minBlobSize)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setMinBlobSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>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<ColumnFamilyOptions>public ColumnFamilyOptions setBlobFileSize(long blobFileSize)
Default: 256 MB
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobFileSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>blobFileSize - the new size limit for blob filespublic long blobFileSize()
Default: 256 MB
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
blobFileSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBlobCompressionType(CompressionType compressionType)
Default: no compression
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobCompressionType 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>compressionType - the compression algorithm to usepublic CompressionType blobCompressionType()
Default: no compression
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
blobCompressionType 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setEnableBlobGarbageCollection(boolean enableBlobGarbageCollection)
Default: false
setEnableBlobGarbageCollection 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>enableBlobGarbageCollection - true iff blob garbage collection is to be enabledpublic boolean enableBlobGarbageCollection()
Default: false
enableBlobGarbageCollection 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBlobGarbageCollectionAgeCutoff(double blobGarbageCollectionAgeCutoff)
Default: 0.25
setBlobGarbageCollectionAgeCutoff 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>blobGarbageCollectionAgeCutoff - the new blob garbage collection age cutoffpublic double blobGarbageCollectionAgeCutoff()
Default: 0.25
blobGarbageCollectionAgeCutoff 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBlobGarbageCollectionForceThreshold(double blobGarbageCollectionForceThreshold)
blobGarbageCollectionAgeCutoff() above. This option is
currently only supported with leveled compactions.
Note that 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<ColumnFamilyOptions>blobGarbageCollectionForceThreshold - new value for the thresholdpublic double blobGarbageCollectionForceThreshold()
blobGarbageCollectionForceThreshold()blobGarbageCollectionForceThreshold 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBlobCompactionReadaheadSize(long blobCompactionReadaheadSize)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobCompactionReadaheadSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>blobCompactionReadaheadSize - the compaction readahead for blob filespublic long blobCompactionReadaheadSize()
blobCompactionReadaheadSize 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBlobFileStartingLevel(int blobFileStartingLevel)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setBlobFileStartingLevel 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>blobFileStartingLevel - the starting level to enable blob filespublic int blobFileStartingLevel()
Default: 0
blobFileStartingLevel 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setPrepopulateBlobCache(PrepopulateBlobCache prepopulateBlobCache)
Default: 0
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).
setPrepopulateBlobCache 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>prepopulateBlobCache - prepopulate the blob cache optionpublic PrepopulateBlobCache prepopulateBlobCache()
Default: 0
prepopulateBlobCache 在接口中 AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>protected final void disposeInternal(long handle)
disposeInternal 在类中 RocksObject