public class ColumnFamilyOptions extends RocksObject implements ColumnFamilyOptionsInterface, MutableColumnFamilyOptionsInterface
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_
DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET
Constructor and Description |
---|
ColumnFamilyOptions()
Construct ColumnFamilyOptions.
|
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.
|
CompactionStyle |
compactionStyle()
Compaction style for DB.
|
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) |
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.
|
double |
hardRateLimit()
Puts are delayed 1ms at a time when any level has a compaction score that
exceeds hard_rate_limit.
|
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.
|
int |
maxBytesForLevelMultiplier()
The ratio between the total size of level-(L+1) files and the total
size of level-L files for all L.
|
int[] |
maxBytesForLevelMultiplierAdditional()
Different max-size multipliers for different levels.
|
long |
maxCompactionBytes()
Control maximum size of each compaction (not guaranteed)
|
int |
maxMemCompactionLevel()
This does nothing anymore.
|
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.
|
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.
|
int |
minPartialMergeOperands()
The number of partial merge operands to accumulate before partial
merge will be performed.
|
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.
|
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.
|
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 |
purgeRedundantKvsWhileFlush()
Purge duplicate/deleted keys when a memtable is flushed to storage.
|
int |
rateLimitDelayMaxMilliseconds()
The maximum time interval a put will be stalled when hard_rate_limit
is enforced.
|
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 |
setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter) |
ColumnFamilyOptions |
setCompactionStyle(CompactionStyle compactionStyle)
Set compaction style for DB.
|
ColumnFamilyOptions |
setComparator(AbstractComparator<? extends AbstractSlice<?>> comparator)
Use the specified comparator for key ordering.
|
ColumnFamilyOptions |
setComparator(BuiltinComparator builtinComparator)
Set
BuiltinComparator to be used with RocksDB. |
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 |
setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
All writes are stopped if estimated bytes needed to be compaction exceed
this threshold.
|
ColumnFamilyOptions |
setHardRateLimit(double hardRateLimit)
Puts are delayed 1ms at a time when any level has a compaction score that
exceeds hard_rate_limit.
|
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(int 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 |
setMaxMemCompactionLevel(int maxMemCompactionLevel)
This does nothing anymore.
|
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 |
setMemTableConfig(MemTableConfig config)
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(java.lang.String name)
Set the merge operator to be used for merging two merge operands
of the same key.
|
ColumnFamilyOptions |
setMinPartialMergeOperands(int minPartialMergeOperands)
The number of partial merge operands to accumulate before partial
merge will be performed.
|
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 |
setPurgeRedundantKvsWhileFlush(boolean purgeRedundantKvsWhileFlush)
Purge duplicate/deleted keys when a memtable is flushed to storage.
|
ColumnFamilyOptions |
setRateLimitDelayMaxMilliseconds(int rateLimitDelayMaxMilliseconds)
The maximum time interval a put will be stalled when hard_rate_limit
is enforced.
|
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 |
setSoftRateLimit(double softRateLimit)
Puts are delayed 0-1 ms when any level has a compaction score that exceeds
soft_rate_limit.
|
ColumnFamilyOptions |
setTableFormatConfig(TableFormatConfig config)
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 |
setVerifyChecksumsInCompaction(boolean verifyChecksumsInCompaction)
If true, compaction will verify checksum on every read that happens
as part of compaction
Default: true
|
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.
|
double |
softRateLimit()
Puts are delayed 0-1 ms when any level has a compaction score that exceeds
soft_rate_limit.
|
java.lang.String |
tableFactoryName() |
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.
|
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.
|
boolean |
verifyChecksumsInCompaction()
If true, compaction will verify checksum on every read that happens
as part of compaction
Default: true
|
long |
writeBufferSize()
Return size of write buffer size.
|
disposeInternal
close, disOwnNativeHandle, isOwningHandle
dispose, finalize
public ColumnFamilyOptions()
rocksdb::DBOptions
in the c++ side.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 ColumnFamilyOptions optimizeForPointLookup(long blockCacheSizeMb)
ColumnFamilyOptionsInterface
optimizeForPointLookup
in interface ColumnFamilyOptionsInterface
blockCacheSizeMb
- Block cache size in MBpublic ColumnFamilyOptions optimizeLevelStyleCompaction()
ColumnFamilyOptionsInterface
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. 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
public ColumnFamilyOptions optimizeLevelStyleCompaction(long memtableMemoryBudget)
ColumnFamilyOptionsInterface
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. 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
memtableMemoryBudget
- memory budget in bytespublic ColumnFamilyOptions optimizeUniversalStyleCompaction()
ColumnFamilyOptionsInterface
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. 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
public ColumnFamilyOptions optimizeUniversalStyleCompaction(long memtableMemoryBudget)
ColumnFamilyOptionsInterface
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. 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
memtableMemoryBudget
- memory budget in bytespublic ColumnFamilyOptions setComparator(BuiltinComparator builtinComparator)
ColumnFamilyOptionsInterface
BuiltinComparator
to be used with RocksDB.
Note: Comparator can be set once upon database creation.
Default: BytewiseComparator.setComparator
in interface ColumnFamilyOptionsInterface
builtinComparator
- a BuiltinComparator
type.public ColumnFamilyOptions setComparator(AbstractComparator<? extends AbstractSlice<?>> comparator)
ColumnFamilyOptionsInterface
setComparator
in interface ColumnFamilyOptionsInterface
comparator
- java instance.public ColumnFamilyOptions setMergeOperatorName(java.lang.String name)
ColumnFamilyOptionsInterface
Set 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
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)
ColumnFamilyOptionsInterface
Set 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
mergeOperator
- MergeOperator
instance.public ColumnFamilyOptions setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
public ColumnFamilyOptions setWriteBufferSize(long writeBufferSize)
MutableColumnFamilyOptionsInterface
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: 4MBsetWriteBufferSize
in interface MutableColumnFamilyOptionsInterface
writeBufferSize
- the size of write buffer.public long writeBufferSize()
MutableColumnFamilyOptionsInterface
writeBufferSize
in interface MutableColumnFamilyOptionsInterface
MutableColumnFamilyOptionsInterface.setWriteBufferSize(long)
public ColumnFamilyOptions setMaxWriteBufferNumber(int maxWriteBufferNumber)
MutableColumnFamilyOptionsInterface
setMaxWriteBufferNumber
in interface MutableColumnFamilyOptionsInterface
maxWriteBufferNumber
- maximum number of write buffers.public int maxWriteBufferNumber()
MutableColumnFamilyOptionsInterface
maxWriteBufferNumber
in interface MutableColumnFamilyOptionsInterface
MutableColumnFamilyOptionsInterface.setMaxWriteBufferNumber(int)
public ColumnFamilyOptions setMinWriteBufferNumberToMerge(int minWriteBufferNumberToMerge)
ColumnFamilyOptionsInterface
setMinWriteBufferNumberToMerge
in interface ColumnFamilyOptionsInterface
minWriteBufferNumberToMerge
- the minimum number of write buffers
that will be merged together.public int minWriteBufferNumberToMerge()
ColumnFamilyOptionsInterface
minWriteBufferNumberToMerge
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions useFixedLengthPrefixExtractor(int n)
ColumnFamilyOptionsInterface
useFixedLengthPrefixExtractor
in interface ColumnFamilyOptionsInterface
n
- use the first n bytes of a key as its prefix.public ColumnFamilyOptions useCappedPrefixExtractor(int n)
ColumnFamilyOptionsInterface
useCappedPrefixExtractor
in interface ColumnFamilyOptionsInterface
n
- use the first n bytes of a key as its prefix.public ColumnFamilyOptions setCompressionType(CompressionType compressionType)
ColumnFamilyOptionsInterface
setCompressionType
in interface ColumnFamilyOptionsInterface
compressionType
- Compression Type.public CompressionType compressionType()
ColumnFamilyOptionsInterface
compressionType
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setCompressionPerLevel(java.util.List<CompressionType> compressionLevels)
ColumnFamilyOptionsInterface
Different 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 ColumnFamilyOptionsInterface
compressionLevels
- list of
CompressionType
instances.public java.util.List<CompressionType> compressionPerLevel()
ColumnFamilyOptionsInterface
Return the currently set CompressionType
per instances.
See: ColumnFamilyOptionsInterface.setCompressionPerLevel(java.util.List)
compressionPerLevel
in interface ColumnFamilyOptionsInterface
CompressionType
instances.public ColumnFamilyOptions setNumLevels(int numLevels)
ColumnFamilyOptionsInterface
setNumLevels
in interface ColumnFamilyOptionsInterface
numLevels
- the number of levels.public int numLevels()
ColumnFamilyOptionsInterface
numLevels
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setLevelZeroFileNumCompactionTrigger(int numFiles)
ColumnFamilyOptionsInterface
setLevelZeroFileNumCompactionTrigger
in interface ColumnFamilyOptionsInterface
numFiles
- the number of files in level-0 to trigger compaction.public int levelZeroFileNumCompactionTrigger()
ColumnFamilyOptionsInterface
levelZeroFileNumCompactionTrigger
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setLevelZeroSlowdownWritesTrigger(int numFiles)
ColumnFamilyOptionsInterface
setLevelZeroSlowdownWritesTrigger
in interface ColumnFamilyOptionsInterface
numFiles
- soft limit on number of level-0 files.public int levelZeroSlowdownWritesTrigger()
ColumnFamilyOptionsInterface
levelZeroSlowdownWritesTrigger
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setLevelZeroStopWritesTrigger(int numFiles)
ColumnFamilyOptionsInterface
setLevelZeroStopWritesTrigger
in interface ColumnFamilyOptionsInterface
numFiles
- the hard limit of the number of level-0 files.public int levelZeroStopWritesTrigger()
ColumnFamilyOptionsInterface
levelZeroStopWritesTrigger
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setMaxMemCompactionLevel(int maxMemCompactionLevel)
ColumnFamilyOptionsInterface
setMaxMemCompactionLevel
in interface ColumnFamilyOptionsInterface
maxMemCompactionLevel
- Unused.public int maxMemCompactionLevel()
ColumnFamilyOptionsInterface
maxMemCompactionLevel
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setTargetFileSizeBase(long targetFileSizeBase)
MutableColumnFamilyOptionsInterface
setTargetFileSizeBase
in interface MutableColumnFamilyOptionsInterface
targetFileSizeBase
- the target size of a level-0 file.MutableColumnFamilyOptionsInterface.setTargetFileSizeMultiplier(int)
public long targetFileSizeBase()
MutableColumnFamilyOptionsInterface
targetFileSizeBase
in interface MutableColumnFamilyOptionsInterface
MutableColumnFamilyOptionsInterface.targetFileSizeMultiplier()
public ColumnFamilyOptions setTargetFileSizeMultiplier(int multiplier)
MutableColumnFamilyOptionsInterface
setTargetFileSizeMultiplier
in interface MutableColumnFamilyOptionsInterface
multiplier
- the size ratio between a level-(L+1) file
and level-L file.public int targetFileSizeMultiplier()
MutableColumnFamilyOptionsInterface
targetFileSizeMultiplier
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setMaxBytesForLevelBase(long maxBytesForLevelBase)
MutableColumnFamilyOptionsInterface
setMaxBytesForLevelBase
in interface MutableColumnFamilyOptionsInterface
maxBytesForLevelBase
- maximum bytes for level base.MutableColumnFamilyOptionsInterface.setMaxBytesForLevelMultiplier(int)
public long maxBytesForLevelBase()
MutableColumnFamilyOptionsInterface
maxBytesForLevelBase
in interface MutableColumnFamilyOptionsInterface
MutableColumnFamilyOptionsInterface.maxBytesForLevelMultiplier()
public ColumnFamilyOptions setLevelCompactionDynamicLevelBytes(boolean enableLevelCompactionDynamicLevelBytes)
ColumnFamilyOptionsInterface
If 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.
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 ColumnFamilyOptionsInterface
enableLevelCompactionDynamicLevelBytes
- boolean value indicating
if LevelCompactionDynamicLevelBytes
shall be enabled.public boolean levelCompactionDynamicLevelBytes()
ColumnFamilyOptionsInterface
Return if LevelCompactionDynamicLevelBytes
is enabled.
For further information see
ColumnFamilyOptionsInterface.setLevelCompactionDynamicLevelBytes(boolean)
levelCompactionDynamicLevelBytes
in interface ColumnFamilyOptionsInterface
levelCompactionDynamicLevelBytes
is enabled.public ColumnFamilyOptions setMaxBytesForLevelMultiplier(int multiplier)
ColumnFamilyOptionsInterface
setMaxBytesForLevelMultiplier
in interface ColumnFamilyOptionsInterface
setMaxBytesForLevelMultiplier
in interface MutableColumnFamilyOptionsInterface
multiplier
- the ratio between the total size of level-(L+1)
files and the total size of level-L files for all L.MutableColumnFamilyOptionsInterface.setMaxBytesForLevelBase(long)
public int maxBytesForLevelMultiplier()
ColumnFamilyOptionsInterface
maxBytesForLevelMultiplier
in interface ColumnFamilyOptionsInterface
maxBytesForLevelMultiplier
in interface MutableColumnFamilyOptionsInterface
MutableColumnFamilyOptionsInterface.maxBytesForLevelBase()
public ColumnFamilyOptions setMaxCompactionBytes(long maxCompactionBytes)
ColumnFamilyOptionsInterface
setMaxCompactionBytes
in interface ColumnFamilyOptionsInterface
setMaxCompactionBytes
in interface MutableColumnFamilyOptionsInterface
maxCompactionBytes
- the compaction size limitMutableColumnFamilyOptionsInterface.maxCompactionBytes()
public long maxCompactionBytes()
ColumnFamilyOptionsInterface
maxCompactionBytes
in interface ColumnFamilyOptionsInterface
maxCompactionBytes
in interface MutableColumnFamilyOptionsInterface
MutableColumnFamilyOptionsInterface.setMaxCompactionBytes(long)
public ColumnFamilyOptions setSoftRateLimit(double softRateLimit)
ColumnFamilyOptionsInterface
setSoftRateLimit
in interface ColumnFamilyOptionsInterface
setSoftRateLimit
in interface MutableColumnFamilyOptionsInterface
softRateLimit
- the soft-rate-limit of a compaction score
for put delay.public double softRateLimit()
ColumnFamilyOptionsInterface
softRateLimit
in interface ColumnFamilyOptionsInterface
softRateLimit
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setHardRateLimit(double hardRateLimit)
ColumnFamilyOptionsInterface
setHardRateLimit
in interface ColumnFamilyOptionsInterface
setHardRateLimit
in interface MutableColumnFamilyOptionsInterface
hardRateLimit
- the hard-rate-limit of a compaction score for put
delay.public double hardRateLimit()
ColumnFamilyOptionsInterface
hardRateLimit
in interface ColumnFamilyOptionsInterface
hardRateLimit
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setRateLimitDelayMaxMilliseconds(int rateLimitDelayMaxMilliseconds)
ColumnFamilyOptionsInterface
setRateLimitDelayMaxMilliseconds
in interface ColumnFamilyOptionsInterface
rateLimitDelayMaxMilliseconds
- the maximum time interval a put
will be stalled.public int rateLimitDelayMaxMilliseconds()
ColumnFamilyOptionsInterface
rateLimitDelayMaxMilliseconds
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setArenaBlockSize(long arenaBlockSize)
MutableColumnFamilyOptionsInterface
setArenaBlockSize
in interface MutableColumnFamilyOptionsInterface
arenaBlockSize
- the size of an arena blockpublic long arenaBlockSize()
MutableColumnFamilyOptionsInterface
arenaBlockSize
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setDisableAutoCompactions(boolean disableAutoCompactions)
MutableColumnFamilyOptionsInterface
setDisableAutoCompactions
in interface MutableColumnFamilyOptionsInterface
disableAutoCompactions
- true if auto-compactions are disabled.public boolean disableAutoCompactions()
MutableColumnFamilyOptionsInterface
disableAutoCompactions
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setPurgeRedundantKvsWhileFlush(boolean purgeRedundantKvsWhileFlush)
ColumnFamilyOptionsInterface
setPurgeRedundantKvsWhileFlush
in interface ColumnFamilyOptionsInterface
purgeRedundantKvsWhileFlush
- true if purging keys is disabled.public boolean purgeRedundantKvsWhileFlush()
ColumnFamilyOptionsInterface
purgeRedundantKvsWhileFlush
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setCompactionStyle(CompactionStyle compactionStyle)
ColumnFamilyOptionsInterface
setCompactionStyle
in interface ColumnFamilyOptionsInterface
compactionStyle
- Compaction style.public CompactionStyle compactionStyle()
ColumnFamilyOptionsInterface
compactionStyle
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setMaxTableFilesSizeFIFO(long maxTableFilesSize)
ColumnFamilyOptionsInterface
setMaxTableFilesSizeFIFO
in interface ColumnFamilyOptionsInterface
maxTableFilesSize
- the size limit of the total sum of table files.public long maxTableFilesSizeFIFO()
ColumnFamilyOptionsInterface
maxTableFilesSizeFIFO
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setVerifyChecksumsInCompaction(boolean verifyChecksumsInCompaction)
MutableColumnFamilyOptionsInterface
setVerifyChecksumsInCompaction
in interface MutableColumnFamilyOptionsInterface
verifyChecksumsInCompaction
- true if compaction verifies
checksum on every read.public boolean verifyChecksumsInCompaction()
MutableColumnFamilyOptionsInterface
verifyChecksumsInCompaction
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
MutableColumnFamilyOptionsInterface
setMaxSequentialSkipInIterations
in interface MutableColumnFamilyOptionsInterface
maxSequentialSkipInIterations
- the number of keys could
be skipped in a iteration.public long maxSequentialSkipInIterations()
MutableColumnFamilyOptionsInterface
maxSequentialSkipInIterations
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setMemTableConfig(MemTableConfig config)
ColumnFamilyOptionsInterface
setMemTableConfig
in interface ColumnFamilyOptionsInterface
config
- the mem-table config.public java.lang.String memTableFactoryName()
ColumnFamilyOptionsInterface
memTableFactoryName
in interface ColumnFamilyOptionsInterface
ColumnFamilyOptionsInterface.setTableFormatConfig(org.rocksdb.TableFormatConfig)
public ColumnFamilyOptions setTableFormatConfig(TableFormatConfig config)
ColumnFamilyOptionsInterface
setTableFormatConfig
in interface ColumnFamilyOptionsInterface
config
- the table format config.public java.lang.String tableFactoryName()
tableFactoryName
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setInplaceUpdateSupport(boolean inplaceUpdateSupport)
ColumnFamilyOptionsInterface
setInplaceUpdateSupport
in interface ColumnFamilyOptionsInterface
inplaceUpdateSupport
- true if thread-safe inplace updates
are allowed.public boolean inplaceUpdateSupport()
ColumnFamilyOptionsInterface
inplaceUpdateSupport
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
MutableColumnFamilyOptionsInterface
setInplaceUpdateNumLocks
in interface MutableColumnFamilyOptionsInterface
inplaceUpdateNumLocks
- the number of locks used for
inplace updates.public long inplaceUpdateNumLocks()
MutableColumnFamilyOptionsInterface
inplaceUpdateNumLocks
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
MutableColumnFamilyOptionsInterface
setMemtablePrefixBloomSizeRatio
in interface MutableColumnFamilyOptionsInterface
memtablePrefixBloomSizeRatio
- The ratiopublic double memtablePrefixBloomSizeRatio()
MutableColumnFamilyOptionsInterface
memtablePrefixBloomSizeRatio
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setBloomLocality(int bloomLocality)
ColumnFamilyOptionsInterface
setBloomLocality
in interface ColumnFamilyOptionsInterface
bloomLocality
- the level of locality of bloom-filter probes.public int bloomLocality()
ColumnFamilyOptionsInterface
bloomLocality
in interface ColumnFamilyOptionsInterface
ColumnFamilyOptionsInterface.setBloomLocality(int)
public ColumnFamilyOptions setMaxSuccessiveMerges(long maxSuccessiveMerges)
MutableColumnFamilyOptionsInterface
setMaxSuccessiveMerges
in interface MutableColumnFamilyOptionsInterface
maxSuccessiveMerges
- the maximum number of successive merges.public long maxSuccessiveMerges()
MutableColumnFamilyOptionsInterface
maxSuccessiveMerges
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setMinPartialMergeOperands(int minPartialMergeOperands)
ColumnFamilyOptionsInterface
setMinPartialMergeOperands
in interface ColumnFamilyOptionsInterface
minPartialMergeOperands
- min partial merge operandspublic int minPartialMergeOperands()
ColumnFamilyOptionsInterface
minPartialMergeOperands
in interface ColumnFamilyOptionsInterface
public ColumnFamilyOptions setOptimizeFiltersForHits(boolean optimizeFiltersForHits)
ColumnFamilyOptionsInterface
This 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 ColumnFamilyOptionsInterface
optimizeFiltersForHits
- boolean value indicating if this flag is set.public boolean optimizeFiltersForHits()
ColumnFamilyOptionsInterface
Returns the current state of the optimize_filters_for_hits
setting.
optimizeFiltersForHits
in interface ColumnFamilyOptionsInterface
optimize_filters_for_hits
was set.public ColumnFamilyOptions setMemtableHugePageSize(long memtableHugePageSize)
MutableColumnFamilyOptionsInterface
setMemtableHugePageSize
in interface MutableColumnFamilyOptionsInterface
memtableHugePageSize
- The page size of the huge
page tlbpublic long memtableHugePageSize()
MutableColumnFamilyOptionsInterface
memtableHugePageSize
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
MutableColumnFamilyOptionsInterface
setSoftPendingCompactionBytesLimit
in interface MutableColumnFamilyOptionsInterface
softPendingCompactionBytesLimit
- The soft limit to impose on
compactionpublic long softPendingCompactionBytesLimit()
MutableColumnFamilyOptionsInterface
softPendingCompactionBytesLimit
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
MutableColumnFamilyOptionsInterface
setHardPendingCompactionBytesLimit
in interface MutableColumnFamilyOptionsInterface
hardPendingCompactionBytesLimit
- The hard limit to impose on
compactionpublic long hardPendingCompactionBytesLimit()
MutableColumnFamilyOptionsInterface
hardPendingCompactionBytesLimit
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
MutableColumnFamilyOptionsInterface
setLevel0FileNumCompactionTrigger
in interface MutableColumnFamilyOptionsInterface
level0FileNumCompactionTrigger
- The number of files to trigger
level-0 compactionpublic int level0FileNumCompactionTrigger()
MutableColumnFamilyOptionsInterface
level0FileNumCompactionTrigger
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
MutableColumnFamilyOptionsInterface
setLevel0SlowdownWritesTrigger
in interface MutableColumnFamilyOptionsInterface
level0SlowdownWritesTrigger
- The soft limit on the number of
level-0 filespublic int level0SlowdownWritesTrigger()
MutableColumnFamilyOptionsInterface
level0SlowdownWritesTrigger
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setLevel0StopWritesTrigger(int level0StopWritesTrigger)
MutableColumnFamilyOptionsInterface
setLevel0StopWritesTrigger
in interface MutableColumnFamilyOptionsInterface
level0StopWritesTrigger
- The maximum number of level-0 filespublic int level0StopWritesTrigger()
MutableColumnFamilyOptionsInterface
level0StopWritesTrigger
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
MutableColumnFamilyOptionsInterface
setMaxBytesForLevelMultiplierAdditional
in interface MutableColumnFamilyOptionsInterface
maxBytesForLevelMultiplierAdditional
- The max-size multipliers
for each levelpublic int[] maxBytesForLevelMultiplierAdditional()
MutableColumnFamilyOptionsInterface
maxBytesForLevelMultiplierAdditional
in interface MutableColumnFamilyOptionsInterface
public ColumnFamilyOptions setParanoidFileChecks(boolean paranoidFileChecks)
MutableColumnFamilyOptionsInterface
setParanoidFileChecks
in interface MutableColumnFamilyOptionsInterface
paranoidFileChecks
- true to enable paranoid file checkspublic boolean paranoidFileChecks()
MutableColumnFamilyOptionsInterface
paranoidFileChecks
in interface MutableColumnFamilyOptionsInterface
protected final void disposeInternal(long handle)
disposeInternal
in class RocksObject