public class ColumnFamilyOptions extends RocksObject implements ColumnFamilyOptionsInterface<ColumnFamilyOptions>, MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>
RocksDB (i.e., RocksDB.open()).
If AbstractNativeReference.dispose() function is not called, then it will be GC'd
automatically and native resources will be released as part of the process.nativeHandle_owningHandle_DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET| Constructor and Description |
|---|
ColumnFamilyOptions()
Construct ColumnFamilyOptions.
|
ColumnFamilyOptions(ColumnFamilyOptions other)
Copy constructor for ColumnFamilyOptions.
|
ColumnFamilyOptions(Options options)
Constructor from Options
|
| Modifier and Type | Method and Description |
|---|---|
long |
arenaBlockSize()
The size of one block in arena memory allocation.
|
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.
|
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
|
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 |
forceConsistencyChecks()
In debug mode, RocksDB run consistency checks on the LSM every time the LSM
change (Flush, Compaction, AddFile).
|
static ColumnFamilyOptions |
getColumnFamilyOptionsFromProps(ConfigOptions cfgOpts,
Properties properties)
Method to get a options instance by using pre-configured
property values.
|
static ColumnFamilyOptions |
getColumnFamilyOptionsFromProps(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.
|
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.
|
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.
|
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 |
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(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(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 |
setForceConsistencyChecks(boolean forceConsistencyChecks)
In debug mode, RocksDB run consistency checks on the LSM every time the LSM
change (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 |
setMergeOperator(MergeOperator mergeOperator)
Set the merge operator to be used for merging two different key/value
pairs that share the same key.
|
ColumnFamilyOptions |
setMergeOperatorName(String name)
Set the merge operator to be used for merging two merge operands
of the same key.
|
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 |
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
|
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, isOwningHandledispose, finalizepublic ColumnFamilyOptions()
rocksdb::ColumnFamilyOptions in the c++ side.public ColumnFamilyOptions(ColumnFamilyOptions other)
other - The ColumnFamilyOptions to copy.public ColumnFamilyOptions(Options options)
options - The options.public static ColumnFamilyOptions getColumnFamilyOptionsFromProps(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.IllegalArgumentException - if null or empty
Properties instance is passed to the method call.public static ColumnFamilyOptions getColumnFamilyOptionsFromProps(ConfigOptions cfgOpts, 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.IllegalArgumentException - if null or empty
Properties instance is passed to the method call.public ColumnFamilyOptions oldDefaults(int majorVersion, int minorVersion)
ColumnFamilyOptionsInterfaceoldDefaults in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>majorVersion - the major versionminorVersion - the minor versionpublic ColumnFamilyOptions optimizeForSmallDb()
ColumnFamilyOptionsInterfaceoptimizeForSmallDb in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions optimizeForSmallDb(Cache cache)
ColumnFamilyOptionsInterfaceoptimizeForSmallDb in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>cache - optional cache object to be used as the block cachepublic ColumnFamilyOptions optimizeForPointLookup(long blockCacheSizeMb)
ColumnFamilyOptionsInterfaceoptimizeForPointLookup in interface 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 in interface 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 in interface 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 in interface 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 in interface 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 in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>builtinComparator - a BuiltinComparator type.public ColumnFamilyOptions setComparator(AbstractComparator comparator)
ColumnFamilyOptionsInterfacesetComparator in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>comparator - java instance.public ColumnFamilyOptions setMergeOperatorName(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 in interface 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 in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>mergeOperator - MergeOperator instance.public ColumnFamilyOptions setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.setCompactionFilterFactory(AbstractCompactionFilterFactory)
instead.
The client should specify only set one of the two.
ColumnFamilyOptionsInterface.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 in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionFilter - AbstractCompactionFilter instance.public AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter()
ColumnFamilyOptionsInterfacecompactionFilter in interface 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 in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionFilterFactory - AbstractCompactionFilterFactory instance.public AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory()
ColumnFamilyOptionsInterfacecompactionFilterFactory in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setWriteBufferSize(long writeBufferSize)
MutableColumnFamilyOptionsInterfacemax_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: 64MBsetWriteBufferSize in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>writeBufferSize - the size of write buffer.public long writeBufferSize()
MutableColumnFamilyOptionsInterfacewriteBufferSize in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>MutableColumnFamilyOptionsInterface.setWriteBufferSize(long)public ColumnFamilyOptions setMaxWriteBufferNumber(int maxWriteBufferNumber)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxWriteBufferNumber in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxWriteBufferNumber - maximum number of write buffers.public int maxWriteBufferNumber()
AdvancedMutableColumnFamilyOptionsInterfacemaxWriteBufferNumber in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>AdvancedMutableColumnFamilyOptionsInterface.setMaxWriteBufferNumber(int)public ColumnFamilyOptions setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
AdvancedColumnFamilyOptionsInterfacesetMinWriteBufferNumberToMerge in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>minWriteBufferNumberToMerge - the minimum number of write buffers
that will be merged together.public int minWriteBufferNumberToMerge()
AdvancedColumnFamilyOptionsInterfaceminWriteBufferNumberToMerge in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions useFixedLengthPrefixExtractor(int n)
ColumnFamilyOptionsInterfaceuseFixedLengthPrefixExtractor in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>n - use the first n bytes of a key as its prefix.public ColumnFamilyOptions useCappedPrefixExtractor(int n)
ColumnFamilyOptionsInterfaceuseCappedPrefixExtractor in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>n - use the first n bytes of a key as its prefix.public ColumnFamilyOptions setCompressionType(CompressionType compressionType)
MutableColumnFamilyOptionsInterfacesetCompressionType in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>compressionType - Compression Type.public CompressionType compressionType()
MutableColumnFamilyOptionsInterfacecompressionType in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompressionPerLevel(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 in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compressionLevels - list of
CompressionType instances.public List<CompressionType> compressionPerLevel()
AdvancedColumnFamilyOptionsInterfaceReturn the currently set CompressionType
per instances.
See: AdvancedColumnFamilyOptionsInterface.setCompressionPerLevel(java.util.List)
compressionPerLevel in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>CompressionType
instances.public ColumnFamilyOptions setBottommostCompressionType(CompressionType bottommostCompressionType)
ColumnFamilyOptionsInterfaceCompressionType.DISABLE_COMPRESSION_OPTIONsetBottommostCompressionType in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>bottommostCompressionType - The compression type to use for the
bottommost levelpublic CompressionType bottommostCompressionType()
ColumnFamilyOptionsInterfaceCompressionType.DISABLE_COMPRESSION_OPTIONbottommostCompressionType in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBottommostCompressionOptions(CompressionOptions bottommostCompressionOptions)
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.bottommostCompressionType() if it is enabled.
To enable it, please see the definition of
CompressionOptions.setBottommostCompressionOptions in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>bottommostCompressionOptions - the bottom most compression options.public CompressionOptions bottommostCompressionOptions()
ColumnFamilyOptionsInterfaceColumnFamilyOptionsInterface.setBottommostCompressionOptions(CompressionOptions).bottommostCompressionOptions in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompressionOptions(CompressionOptions compressionOptions)
ColumnFamilyOptionsInterfacesetCompressionOptions in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>compressionOptions - The compression optionspublic CompressionOptions compressionOptions()
ColumnFamilyOptionsInterfacecompressionOptions in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setNumLevels(int numLevels)
AdvancedColumnFamilyOptionsInterfacesetNumLevels in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>numLevels - the number of levels.public int numLevels()
AdvancedColumnFamilyOptionsInterfacenumLevels in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevelZeroFileNumCompactionTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroFileNumCompactionTrigger in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>numFiles - the number of files in level-0 to trigger compaction.public int levelZeroFileNumCompactionTrigger()
ColumnFamilyOptionsInterfacelevelZeroFileNumCompactionTrigger in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevelZeroSlowdownWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroSlowdownWritesTrigger in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>numFiles - soft limit on number of level-0 files.public int levelZeroSlowdownWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroSlowdownWritesTrigger in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevelZeroStopWritesTrigger(int numFiles)
ColumnFamilyOptionsInterfacesetLevelZeroStopWritesTrigger in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>numFiles - the hard limit of the number of level-0 files.public int levelZeroStopWritesTrigger()
ColumnFamilyOptionsInterfacelevelZeroStopWritesTrigger in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setTargetFileSizeBase(long targetFileSizeBase)
AdvancedMutableColumnFamilyOptionsInterfacesetTargetFileSizeBase in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>targetFileSizeBase - the target size of a level-0 file.AdvancedMutableColumnFamilyOptionsInterface.setTargetFileSizeMultiplier(int)public long targetFileSizeBase()
AdvancedMutableColumnFamilyOptionsInterfacetargetFileSizeBase in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>AdvancedMutableColumnFamilyOptionsInterface.targetFileSizeMultiplier()public ColumnFamilyOptions setTargetFileSizeMultiplier(int multiplier)
AdvancedMutableColumnFamilyOptionsInterfacesetTargetFileSizeMultiplier in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>multiplier - the size ratio between a level-(L+1) file
and level-L file.public int targetFileSizeMultiplier()
AdvancedMutableColumnFamilyOptionsInterfacetargetFileSizeMultiplier in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxBytesForLevelBase(long maxBytesForLevelBase)
MutableColumnFamilyOptionsInterfacesetMaxBytesForLevelBase in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxBytesForLevelBase - maximum bytes for level base.AdvancedMutableColumnFamilyOptionsInterface.setMaxBytesForLevelMultiplier(double)public long maxBytesForLevelBase()
MutableColumnFamilyOptionsInterfacemaxBytesForLevelBase in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>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 in interface 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 in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>levelCompactionDynamicLevelBytes is enabled.public ColumnFamilyOptions setMaxBytesForLevelMultiplier(double multiplier)
ColumnFamilyOptionsInterfacesetMaxBytesForLevelMultiplier in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>setMaxBytesForLevelMultiplier in interface 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 in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxBytesForLevelMultiplier in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxCompactionBytes(long maxCompactionBytes)
AdvancedColumnFamilyOptionsInterfacesetMaxCompactionBytes in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>setMaxCompactionBytes in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxCompactionBytes - the compaction size limitMutableColumnFamilyOptionsInterface.maxCompactionBytes()public long maxCompactionBytes()
AdvancedColumnFamilyOptionsInterfacemaxCompactionBytes in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>maxCompactionBytes in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>MutableColumnFamilyOptionsInterface.setMaxCompactionBytes(long)public ColumnFamilyOptions setArenaBlockSize(long arenaBlockSize)
AdvancedMutableColumnFamilyOptionsInterfacesetArenaBlockSize in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>arenaBlockSize - the size of an arena blockpublic long arenaBlockSize()
AdvancedMutableColumnFamilyOptionsInterfacearenaBlockSize in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setDisableAutoCompactions(boolean disableAutoCompactions)
MutableColumnFamilyOptionsInterfacesetDisableAutoCompactions in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>disableAutoCompactions - true if auto-compactions are disabled.public boolean disableAutoCompactions()
MutableColumnFamilyOptionsInterfacedisableAutoCompactions in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompactionStyle(CompactionStyle compactionStyle)
AdvancedColumnFamilyOptionsInterfacesetCompactionStyle in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionStyle - Compaction style.public CompactionStyle compactionStyle()
AdvancedColumnFamilyOptionsInterfacecompactionStyle in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxTableFilesSizeFIFO(long maxTableFilesSize)
ColumnFamilyOptionsInterfacesetMaxTableFilesSizeFIFO in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>maxTableFilesSize - the size limit of the total sum of table files.public long maxTableFilesSizeFIFO()
ColumnFamilyOptionsInterfacemaxTableFilesSizeFIFO in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxSequentialSkipInIterations in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxSequentialSkipInIterations - the number of keys could
be skipped in a iteration.public long maxSequentialSkipInIterations()
AdvancedMutableColumnFamilyOptionsInterfacemaxSequentialSkipInIterations in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public MemTableConfig memTableConfig()
ColumnFamilyOptionsInterfacememTableConfig in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMemTableConfig(MemTableConfig memTableConfig)
ColumnFamilyOptionsInterfacesetMemTableConfig in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>memTableConfig - the mem-table config.public String memTableFactoryName()
ColumnFamilyOptionsInterfacememTableFactoryName in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>ColumnFamilyOptionsInterface.setTableFormatConfig(org.rocksdb.TableFormatConfig)public TableFormatConfig tableFormatConfig()
ColumnFamilyOptionsInterfacetableFormatConfig in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setTableFormatConfig(TableFormatConfig tableFormatConfig)
ColumnFamilyOptionsInterfacesetTableFormatConfig in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>tableFormatConfig - the table format config.public String tableFactoryName()
tableFactoryName in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCfPaths(Collection<DbPath> cfPaths)
ColumnFamilyOptionsInterfacesetCfPaths in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>cfPaths - collection of paths for SST files.public List<DbPath> cfPaths()
cfPaths in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setInplaceUpdateSupport(boolean inplaceUpdateSupport)
AdvancedColumnFamilyOptionsInterfacesetInplaceUpdateSupport in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>inplaceUpdateSupport - true if thread-safe inplace updates
are allowed.public boolean inplaceUpdateSupport()
AdvancedColumnFamilyOptionsInterfaceinplaceUpdateSupport in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
AdvancedMutableColumnFamilyOptionsInterfacesetInplaceUpdateNumLocks in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>inplaceUpdateNumLocks - the number of locks used for
inplace updates.public long inplaceUpdateNumLocks()
AdvancedMutableColumnFamilyOptionsInterfaceinplaceUpdateNumLocks in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
AdvancedMutableColumnFamilyOptionsInterfacesetMemtablePrefixBloomSizeRatio in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>memtablePrefixBloomSizeRatio - The ratiopublic double memtablePrefixBloomSizeRatio()
AdvancedMutableColumnFamilyOptionsInterfacememtablePrefixBloomSizeRatio in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setBloomLocality(int bloomLocality)
AdvancedColumnFamilyOptionsInterfacesetBloomLocality in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>bloomLocality - the level of locality of bloom-filter probes.public int bloomLocality()
AdvancedColumnFamilyOptionsInterfacebloomLocality in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>AdvancedColumnFamilyOptionsInterface.setBloomLocality(int)public ColumnFamilyOptions setMaxSuccessiveMerges(long maxSuccessiveMerges)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxSuccessiveMerges in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxSuccessiveMerges - the maximum number of successive merges.public long maxSuccessiveMerges()
AdvancedMutableColumnFamilyOptionsInterfacemaxSuccessiveMerges in interface 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 in interface 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 in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>optimize_filters_for_hits was set.public ColumnFamilyOptions setMemtableHugePageSize(long memtableHugePageSize)
AdvancedMutableColumnFamilyOptionsInterfacesetMemtableHugePageSize in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>memtableHugePageSize - The page size of the huge
page tlbpublic long memtableHugePageSize()
AdvancedMutableColumnFamilyOptionsInterfacememtableHugePageSize in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
AdvancedMutableColumnFamilyOptionsInterfacesetSoftPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>softPendingCompactionBytesLimit - The soft limit to impose on
compactionpublic long softPendingCompactionBytesLimit()
AdvancedMutableColumnFamilyOptionsInterfacesoftPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
AdvancedMutableColumnFamilyOptionsInterfacesetHardPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>hardPendingCompactionBytesLimit - The hard limit to impose on
compactionpublic long hardPendingCompactionBytesLimit()
AdvancedMutableColumnFamilyOptionsInterfacehardPendingCompactionBytesLimit in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
MutableColumnFamilyOptionsInterfacesetLevel0FileNumCompactionTrigger in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>level0FileNumCompactionTrigger - The number of files to trigger
level-0 compactionpublic int level0FileNumCompactionTrigger()
MutableColumnFamilyOptionsInterfacelevel0FileNumCompactionTrigger in interface MutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
AdvancedMutableColumnFamilyOptionsInterfacesetLevel0SlowdownWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>level0SlowdownWritesTrigger - The soft limit on the number of
level-0 filespublic int level0SlowdownWritesTrigger()
AdvancedMutableColumnFamilyOptionsInterfacelevel0SlowdownWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setLevel0StopWritesTrigger(int level0StopWritesTrigger)
AdvancedMutableColumnFamilyOptionsInterfacesetLevel0StopWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>level0StopWritesTrigger - The maximum number of level-0 filespublic int level0StopWritesTrigger()
AdvancedMutableColumnFamilyOptionsInterfacelevel0StopWritesTrigger in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
AdvancedMutableColumnFamilyOptionsInterfacesetMaxBytesForLevelMultiplierAdditional in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>maxBytesForLevelMultiplierAdditional - The max-size multipliers
for each levelpublic int[] maxBytesForLevelMultiplierAdditional()
AdvancedMutableColumnFamilyOptionsInterfacemaxBytesForLevelMultiplierAdditional in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setParanoidFileChecks(boolean paranoidFileChecks)
AdvancedMutableColumnFamilyOptionsInterfacesetParanoidFileChecks in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>paranoidFileChecks - true to enable paranoid file checkspublic boolean paranoidFileChecks()
AdvancedMutableColumnFamilyOptionsInterfaceparanoidFileChecks in interface 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 in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>maxWriteBufferNumberToMaintain - The maximum number of write
buffers to maintainpublic int maxWriteBufferNumberToMaintain()
AdvancedColumnFamilyOptionsInterfacemaxWriteBufferNumberToMaintain in interface 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.ByCompensatedSizesetCompactionPriority in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionPriority - The compaction prioritypublic CompactionPriority compactionPriority()
AdvancedColumnFamilyOptionsInterfacecompactionPriority in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setReportBgIoStats(boolean reportBgIoStats)
AdvancedMutableColumnFamilyOptionsInterfacesetReportBgIoStats in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>reportBgIoStats - true to enable reportingpublic boolean reportBgIoStats()
AdvancedMutableColumnFamilyOptionsInterfacereportBgIoStats in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setTtl(long ttl)
AdvancedMutableColumnFamilyOptionsInterfaceMutableDBOptionsInterface.maxOpenFiles() to be
set to -1.
Enabled only for level compaction for now.
Default: 0 (disabled)
Dynamically changeable through
RocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).setTtl in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>ttl - the time-to-live.public long ttl()
AdvancedMutableColumnFamilyOptionsInterfaceAdvancedMutableColumnFamilyOptionsInterface.setTtl(long).ttl in interface AdvancedMutableColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompactionOptionsUniversal(CompactionOptionsUniversal compactionOptionsUniversal)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsUniversal in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionOptionsUniversal - The Universal Style compaction optionspublic CompactionOptionsUniversal compactionOptionsUniversal()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsUniversal in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setCompactionOptionsFIFO(CompactionOptionsFIFO compactionOptionsFIFO)
AdvancedColumnFamilyOptionsInterfacesetCompactionOptionsFIFO in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionOptionsFIFO - The FIFO compaction optionspublic CompactionOptionsFIFO compactionOptionsFIFO()
AdvancedColumnFamilyOptionsInterfacecompactionOptionsFIFO in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setForceConsistencyChecks(boolean forceConsistencyChecks)
AdvancedColumnFamilyOptionsInterfacesetForceConsistencyChecks in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>forceConsistencyChecks - true to force consistency checkspublic boolean forceConsistencyChecks()
AdvancedColumnFamilyOptionsInterfaceforceConsistencyChecks in interface AdvancedColumnFamilyOptionsInterface<ColumnFamilyOptions>public ColumnFamilyOptions setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory)
ColumnFamilyOptionsInterfacesetSstPartitionerFactory in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>sstPartitionerFactory - The factory referencepublic ColumnFamilyOptions setCompactionThreadLimiter(ConcurrentTaskLimiter compactionThreadLimiter)
ColumnFamilyOptionsInterfacesetCompactionThreadLimiter in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>compactionThreadLimiter - The compaction thread limiter.public ConcurrentTaskLimiter compactionThreadLimiter()
ColumnFamilyOptionsInterfacecompactionThreadLimiter in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>public SstPartitionerFactory sstPartitionerFactory()
ColumnFamilyOptionsInterfacesstPartitionerFactory in interface ColumnFamilyOptionsInterface<ColumnFamilyOptions>protected final void disposeInternal(long handle)
disposeInternal in class RocksObjectCopyright © 2021. All rights reserved.