public interface ColumnFamilyOptionsInterface<T extends ColumnFamilyOptionsInterface> extends AdvancedColumnFamilyOptionsInterface<T>
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET
Default memtable memory budget used with the following methods:
optimizeLevelStyleCompaction()
optimizeUniversalStyleCompaction()
|
Modifier and Type | Method and Description |
---|---|
CompressionOptions |
bottommostCompressionOptions()
Get the bottom most compression options.
|
CompressionType |
bottommostCompressionType()
Compression algorithm that will be used for the bottommost level that
contain files.
|
AbstractCompactionFilter<? extends AbstractSlice<?>> |
compactionFilter()
Accessor for the CompactionFilter instance in use.
|
AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> |
compactionFilterFactory()
Accessor for the CompactionFilterFactory instance in use.
|
CompressionOptions |
compressionOptions()
Get the different options for compression algorithms
|
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.
|
double |
maxBytesForLevelMultiplier()
The ratio between the total size of level-(L+1) files and the total
size of level-L files for all L.
|
long |
maxTableFilesSizeFIFO()
FIFO compaction option.
|
MemTableConfig |
memTableConfig()
Get the config for mem-table.
|
java.lang.String |
memTableFactoryName()
Returns the name of the current mem table representation.
|
T |
optimizeForPointLookup(long blockCacheSizeMb)
Use this if you don't need to keep the data sorted, i.e.
|
T |
optimizeForSmallDb()
Use this if your DB is very small (like under 1GB) and you don't want to
spend lots of memory for memtables.
|
T |
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.
|
T |
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.
|
T |
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.
|
T |
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.
|
T |
setBottommostCompressionOptions(CompressionOptions compressionOptions)
Set the options for compression algorithms used by
bottommostCompressionType() if it is enabled. |
T |
setBottommostCompressionType(CompressionType bottommostCompressionType)
Compression algorithm that will be used for the bottommost level that
contain files.
|
T |
setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
A single CompactionFilter instance to call into during compaction.
|
T |
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. |
T |
setComparator(AbstractComparator<? extends AbstractSlice<?>> comparator)
Use the specified comparator for key ordering.
|
T |
setComparator(BuiltinComparator builtinComparator)
Set
BuiltinComparator to be used with RocksDB. |
T |
setCompressionOptions(CompressionOptions compressionOptions)
Set the different options for compression algorithms
|
T |
setLevelZeroFileNumCompactionTrigger(int numFiles)
Number of files to trigger level-0 compaction.
|
T |
setLevelZeroSlowdownWritesTrigger(int numFiles)
Soft limit on number of level-0 files.
|
T |
setLevelZeroStopWritesTrigger(int numFiles)
Maximum number of level-0 files.
|
T |
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.
|
T |
setMaxTableFilesSizeFIFO(long maxTableFilesSize)
FIFO compaction option.
|
T |
setMemTableConfig(MemTableConfig memTableConfig)
Set the config for mem-table.
|
T |
setMergeOperator(MergeOperator mergeOperator)
Set the merge operator to be used for merging two different key/value
pairs that share the same key.
|
T |
setMergeOperatorName(java.lang.String name)
Set the merge operator to be used for merging two merge operands
of the same key.
|
T |
setTableFormatConfig(TableFormatConfig config)
Set the config for table format.
|
java.lang.String |
tableFactoryName() |
TableFormatConfig |
tableFormatConfig()
Get the config for table format.
|
T |
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.
|
T |
useFixedLengthPrefixExtractor(int n)
This prefix-extractor uses the first n bytes of a key as its prefix.
|
bloomLocality, compactionOptionsFIFO, compactionOptionsUniversal, compactionPriority, compactionStyle, compressionPerLevel, forceConsistencyChecks, inplaceUpdateSupport, levelCompactionDynamicLevelBytes, maxCompactionBytes, maxWriteBufferNumberToMaintain, minWriteBufferNumberToMerge, numLevels, optimizeFiltersForHits, setBloomLocality, setCompactionOptionsFIFO, setCompactionOptionsUniversal, setCompactionPriority, setCompactionStyle, setCompressionPerLevel, setForceConsistencyChecks, setInplaceUpdateSupport, setLevelCompactionDynamicLevelBytes, setMaxCompactionBytes, setMaxWriteBufferNumberToMaintain, setMinWriteBufferNumberToMerge, setNumLevels, setOptimizeFiltersForHits
static final long DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET
T optimizeForSmallDb()
T optimizeForPointLookup(long blockCacheSizeMb)
blockCacheSizeMb
- Block cache size in MBT 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. 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
T 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. 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
memtableMemoryBudget
- memory budget in bytesT 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. 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
T 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. 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
memtableMemoryBudget
- memory budget in bytesT setComparator(BuiltinComparator builtinComparator)
BuiltinComparator
to be used with RocksDB.
Note: Comparator can be set once upon database creation.
Default: BytewiseComparator.builtinComparator
- a BuiltinComparator
type.T setComparator(AbstractComparator<? extends AbstractSlice<?>> comparator)
comparator
- java instance.T setMergeOperatorName(java.lang.String name)
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.
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".T setMergeOperator(MergeOperator mergeOperator)
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.
mergeOperator
- MergeOperator
instance.T setCompactionFilter(AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter)
setCompactionFilterFactory(AbstractCompactionFilterFactory)
instead.
The client should specify only set one of the two.
setCompactionFilter(AbstractCompactionFilter)
takes precedence
over 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.compactionFilter
- AbstractCompactionFilter
instance.AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter()
T setCompactionFilterFactory(AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory)
AbstractCompactionFilter
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.compactionFilterFactory
- AbstractCompactionFilterFactory
instance.AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory()
T useFixedLengthPrefixExtractor(int n)
n
- use the first n bytes of a key as its prefix.T useCappedPrefixExtractor(int n)
n
- use the first n bytes of a key as its prefix.T setLevelZeroFileNumCompactionTrigger(int numFiles)
numFiles
- the number of files in level-0 to trigger compaction.int levelZeroFileNumCompactionTrigger()
T setLevelZeroSlowdownWritesTrigger(int numFiles)
numFiles
- soft limit on number of level-0 files.int levelZeroSlowdownWritesTrigger()
T setLevelZeroStopWritesTrigger(int numFiles)
numFiles
- the hard limit of the number of level-0 files.int levelZeroStopWritesTrigger()
T setMaxBytesForLevelMultiplier(double multiplier)
multiplier
- the ratio between the total size of level-(L+1)
files and the total size of level-L files for all L.double maxBytesForLevelMultiplier()
T setMaxTableFilesSizeFIFO(long maxTableFilesSize)
maxTableFilesSize
- the size limit of the total sum of table files.long maxTableFilesSizeFIFO()
MemTableConfig memTableConfig()
T setMemTableConfig(MemTableConfig memTableConfig)
memTableConfig
- the mem-table config.java.lang.IllegalArgumentException
- thrown on 32-Bit platforms
while overflowing the underlying platform specific value.java.lang.String memTableFactoryName()
setTableFormatConfig(org.rocksdb.TableFormatConfig)
TableFormatConfig tableFormatConfig()
T setTableFormatConfig(TableFormatConfig config)
config
- the table format config.java.lang.String tableFactoryName()
T setBottommostCompressionType(CompressionType bottommostCompressionType)
CompressionType.DISABLE_COMPRESSION_OPTION
bottommostCompressionType
- The compression type to use for the
bottommost levelCompressionType bottommostCompressionType()
CompressionType.DISABLE_COMPRESSION_OPTION
T setBottommostCompressionOptions(CompressionOptions compressionOptions)
bottommostCompressionType()
if it is enabled.
To enable it, please see the definition of
CompressionOptions
.compressionOptions
- the bottom most compression options.CompressionOptions bottommostCompressionOptions()
setBottommostCompressionOptions(CompressionOptions)
.T setCompressionOptions(CompressionOptions compressionOptions)
compressionOptions
- The compression optionsCompressionOptions compressionOptions()