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 |
---|---|
CompressionType |
bottommostCompressionType()
Compression algorithm that will be used for the bottommost level that
contain files.
|
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 |
setBottommostCompressionType(CompressionType bottommostCompressionType)
Compression algorithm that will be used for the bottommost level that
contain files.
|
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 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 setCompressionOptions(CompressionOptions compressionOptions)
compressionOptions
- The compression optionsCompressionOptions compressionOptions()