Package org.rocksdb
Class MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder
- java.lang.Object
-
- org.rocksdb.AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableColumnFamilyOptions,MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder,org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionKey>
-
- org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder
-
- All Implemented Interfaces:
AdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>,MutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>
- Enclosing class:
- MutableColumnFamilyOptions
public static class MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder extends AbstractMutableOptions.AbstractMutableOptionsBuilder<MutableColumnFamilyOptions,MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder,org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionKey> implements MutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionKey>allKeys()Get all of the possible keyslongarenaBlockSize()The size of one block in arena memory allocation.protected MutableColumnFamilyOptionsbuild(java.lang.String[] keys, java.lang.String[] values)Construct a sub-class instance ofAbstractMutableOptions.CompressionTypecompressionType()Compress blocks using the specified compression algorithm.booleandisableAutoCompactions()Disable automatic compactions.longhardPendingCompactionBytesLimit()All writes are stopped if estimated bytes needed to be compaction exceed this threshold.longinplaceUpdateNumLocks()Number of locks used for inplace update Default: 10000, if inplace_update_support = true, else 0.intlevel0FileNumCompactionTrigger()Number of files to trigger level-0 compaction.intlevel0SlowdownWritesTrigger()Soft limit on number of level-0 files.intlevel0StopWritesTrigger()Maximum number of level-0 files.longmaxBytesForLevelBase()The upper-bound of the total size of level-1 files in bytes.doublemaxBytesForLevelMultiplier()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.longmaxCompactionBytes()We try to limit number of bytes in one compaction to be lower than this threshold.longmaxSequentialSkipInIterations()An iteration->Next() sequentially skips over keys with the same user-key unless this option is set.longmaxSuccessiveMerges()Maximum number of successive merge operations on a key in the memtable.intmaxWriteBufferNumber()Returns maximum number of write buffers.longmemtableHugePageSize()Page size for huge page TLB for bloom in memtable.doublememtablePrefixBloomSizeRatio()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.booleanparanoidFileChecks()After writing every SST file, reopen it and read all the keys.booleanreportBgIoStats()Determine whether IO stats in compactions and flushes are being measuredprotected MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilderself()MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetArenaBlockSize(long arenaBlockSize)The size of one block in arena memory allocation.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetCompressionType(CompressionType compressionType)Compress blocks using the specified compression algorithm.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetDisableAutoCompactions(boolean disableAutoCompactions)Disable automatic compactions.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)All writes are stopped if estimated bytes needed to be compaction exceed this threshold.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetInplaceUpdateNumLocks(long inplaceUpdateNumLocks)Number of locks used for inplace update Default: 10000, if inplace_update_support = true, else 0.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)Number of files to trigger level-0 compaction.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)Soft limit on number of level-0 files.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetLevel0StopWritesTrigger(int level0StopWritesTrigger)Maximum number of level-0 files.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMaxBytesForLevelBase(long maxBytesForLevelBase)The upper-bound of the total size of level-1 files in bytes.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMaxBytesForLevelMultiplier(double maxBytesForLevelMultiplier)The ratio between the total size of level-(L+1) files and the total size of level-L files for all L.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)Different max-size multipliers for different levels.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMaxCompactionBytes(long maxCompactionBytes)We try to limit number of bytes in one compaction to be lower than this threshold.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)An iteration->Next() sequentially skips over keys with the same user-key unless this option is set.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMaxSuccessiveMerges(long maxSuccessiveMerges)Maximum number of successive merge operations on a key in the memtable.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMaxWriteBufferNumber(int maxWriteBufferNumber)The maximum number of write buffers that are built up in memory.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMemtableHugePageSize(long memtableHugePageSize)Page size for huge page TLB for bloom in memtable.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetMemtablePrefixBloomSizeRatio(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.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetParanoidFileChecks(boolean paranoidFileChecks)After writing every SST file, reopen it and read all the keys.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetReportBgIoStats(boolean reportBgIoStats)Measure IO stats in compactions and flushes, if true.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)All writes will be slowed down to at least delayed_write_rate if estimated bytes needed to be compaction exceed this threshold.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetTargetFileSizeBase(long targetFileSizeBase)The target file size for compaction.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetTargetFileSizeMultiplier(int targetFileSizeMultiplier)targetFileSizeMultiplier defines the size ratio between a level-L file and level-(L+1) file.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetTtl(long ttl)Non-bottom-level files older than TTL will go through the compaction process.MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuildersetWriteBufferSize(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.longsoftPendingCompactionBytesLimit()All writes will be slowed down to at least delayed_write_rate if estimated bytes needed to be compaction exceed this threshold.longtargetFileSizeBase()The target file size for compaction.inttargetFileSizeMultiplier()targetFileSizeMultiplier defines the size ratio between a level-(L+1) file and level-L file.longttl()Get the TTL for Non-bottom-level files that will go through the compaction process.longwriteBufferSize()Return size of write buffer size.-
Methods inherited from class org.rocksdb.AbstractMutableOptions.AbstractMutableOptionsBuilder
build, fromString, getBoolean, getDouble, getEnum, getInt, getIntArray, getLong, setBoolean, setDouble, setEnum, setInt, setIntArray, setLong
-
-
-
-
Method Detail
-
self
protected MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder self()
- Specified by:
selfin classAbstractMutableOptions.AbstractMutableOptionsBuilder<MutableColumnFamilyOptions,MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder,org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionKey>
-
allKeys
protected java.util.Map<java.lang.String,org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionKey> allKeys()
Description copied from class:AbstractMutableOptions.AbstractMutableOptionsBuilderGet all of the possible keys- Specified by:
allKeysin classAbstractMutableOptions.AbstractMutableOptionsBuilder<MutableColumnFamilyOptions,MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder,org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionKey>- Returns:
- A map of all keys, indexed by name.
-
build
protected MutableColumnFamilyOptions build(java.lang.String[] keys, java.lang.String[] values)
Description copied from class:AbstractMutableOptions.AbstractMutableOptionsBuilderConstruct a sub-class instance ofAbstractMutableOptions.- Specified by:
buildin classAbstractMutableOptions.AbstractMutableOptionsBuilder<MutableColumnFamilyOptions,MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder,org.rocksdb.MutableColumnFamilyOptions.MutableColumnFamilyOptionKey>- Parameters:
keys- the keysvalues- the values- Returns:
- an instance of the options.
-
setWriteBufferSize
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setWriteBufferSize(long writeBufferSize)
Description copied from interface:MutableColumnFamilyOptionsInterfaceAmount of data to build up in memory (backed by an unsorted log on disk) before converting to a sorted on-disk file. Larger values increase performance, especially during bulk loads. Up tomax_write_buffer_numberwrite buffers may be held in memory at the same time, so you may wish to adjust this parameter to control memory usage. Also, a larger write buffer will result in a longer recovery time the next time the database is opened. Default: 64MB- Specified by:
setWriteBufferSizein interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
writeBufferSize- the size of write buffer.- Returns:
- the instance of the current object.
-
writeBufferSize
public long writeBufferSize()
Description copied from interface:MutableColumnFamilyOptionsInterfaceReturn size of write buffer size.- Specified by:
writeBufferSizein interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- size of write buffer.
- See Also:
MutableColumnFamilyOptionsInterface.setWriteBufferSize(long)
-
setArenaBlockSize
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setArenaBlockSize(long arenaBlockSize)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceThe size of one block in arena memory allocation. If ≤ 0, a proper value is automatically calculated (usually 1/10 of writer_buffer_size). There are two additional restriction of the specified size: (1) size should be in the range of [4096, 2 << 30] and (2) be the multiple of the CPU word (which helps with the memory alignment). We'll automatically check and adjust the size number to make sure it conforms to the restrictions. Default: 0- Specified by:
setArenaBlockSizein interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
arenaBlockSize- the size of an arena block- Returns:
- the reference to the current options.
-
arenaBlockSize
public long arenaBlockSize()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceThe size of one block in arena memory allocation. If ≤ 0, a proper value is automatically calculated (usually 1/10 of writer_buffer_size). There are two additional restriction of the specified size: (1) size should be in the range of [4096, 2 << 30] and (2) be the multiple of the CPU word (which helps with the memory alignment). We'll automatically check and adjust the size number to make sure it conforms to the restrictions. Default: 0- Specified by:
arenaBlockSizein interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the size of an arena block
-
setMemtablePrefixBloomSizeRatio
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMemtablePrefixBloomSizeRatio(double memtablePrefixBloomSizeRatio)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceif 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. If it is larger than 0.25, it is santinized to 0.25. Default: 0 (disable)- Specified by:
setMemtablePrefixBloomSizeRatioin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
memtablePrefixBloomSizeRatio- The ratio- Returns:
- the reference to the current options.
-
memtablePrefixBloomSizeRatio
public double memtablePrefixBloomSizeRatio()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceif 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. If it is larger than 0.25, it is santinized to 0.25. Default: 0 (disable)- Specified by:
memtablePrefixBloomSizeRatioin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the ratio
-
setMemtableHugePageSize
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMemtableHugePageSize(long memtableHugePageSize)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfacePage size for huge page TLB for bloom in memtable. If ≤ 0, not allocate from huge page TLB but from malloc. Need to reserve huge pages for it to be allocated. For example: sysctl -w vm.nr_hugepages=20 See linux doc Documentation/vm/hugetlbpage.txt- Specified by:
setMemtableHugePageSizein interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
memtableHugePageSize- The page size of the huge page tlb- Returns:
- the reference to the current options.
-
memtableHugePageSize
public long memtableHugePageSize()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfacePage size for huge page TLB for bloom in memtable. If ≤ 0, not allocate from huge page TLB but from malloc. Need to reserve huge pages for it to be allocated. For example: sysctl -w vm.nr_hugepages=20 See linux doc Documentation/vm/hugetlbpage.txt- Specified by:
memtableHugePageSizein interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- The page size of the huge page tlb
-
setMaxSuccessiveMerges
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMaxSuccessiveMerges(long maxSuccessiveMerges)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceMaximum number of successive merge operations on a key in the memtable. When a merge operation is added to the memtable and the maximum number of successive merges is reached, the value of the key will be calculated and inserted into the memtable instead of the merge operation. This will ensure that there are never more than max_successive_merges merge operations in the memtable. Default: 0 (disabled)- Specified by:
setMaxSuccessiveMergesin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
maxSuccessiveMerges- the maximum number of successive merges.- Returns:
- the reference to the current options.
-
maxSuccessiveMerges
public long maxSuccessiveMerges()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceMaximum number of successive merge operations on a key in the memtable. When a merge operation is added to the memtable and the maximum number of successive merges is reached, the value of the key will be calculated and inserted into the memtable instead of the merge operation. This will ensure that there are never more than max_successive_merges merge operations in the memtable. Default: 0 (disabled)- Specified by:
maxSuccessiveMergesin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the maximum number of successive merges.
-
setMaxWriteBufferNumber
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMaxWriteBufferNumber(int maxWriteBufferNumber)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceThe maximum number of write buffers that are built up in memory. The default is 2, so that when 1 write buffer is being flushed to storage, new writes can continue to the other write buffer. Default: 2- Specified by:
setMaxWriteBufferNumberin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
maxWriteBufferNumber- maximum number of write buffers.- Returns:
- the instance of the current options.
-
maxWriteBufferNumber
public int maxWriteBufferNumber()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceReturns maximum number of write buffers.- Specified by:
maxWriteBufferNumberin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- maximum number of write buffers.
- See Also:
AdvancedMutableColumnFamilyOptionsInterface.setMaxWriteBufferNumber(int)
-
setInplaceUpdateNumLocks
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setInplaceUpdateNumLocks(long inplaceUpdateNumLocks)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceNumber of locks used for inplace update Default: 10000, if inplace_update_support = true, else 0.- Specified by:
setInplaceUpdateNumLocksin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
inplaceUpdateNumLocks- the number of locks used for inplace updates.- Returns:
- the reference to the current options.
-
inplaceUpdateNumLocks
public long inplaceUpdateNumLocks()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceNumber of locks used for inplace update Default: 10000, if inplace_update_support = true, else 0.- Specified by:
inplaceUpdateNumLocksin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the number of locks used for inplace update.
-
setDisableAutoCompactions
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setDisableAutoCompactions(boolean disableAutoCompactions)
Description copied from interface:MutableColumnFamilyOptionsInterfaceDisable automatic compactions. Manual compactions can still be issued on this column family- Specified by:
setDisableAutoCompactionsin interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
disableAutoCompactions- true if auto-compactions are disabled.- Returns:
- the reference to the current option.
-
disableAutoCompactions
public boolean disableAutoCompactions()
Description copied from interface:MutableColumnFamilyOptionsInterfaceDisable automatic compactions. Manual compactions can still be issued on this column family- Specified by:
disableAutoCompactionsin interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- true if auto-compactions are disabled.
-
setSoftPendingCompactionBytesLimit
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAll writes will be slowed down to at least delayed_write_rate if estimated bytes needed to be compaction exceed this threshold. Default: 64GB- Specified by:
setSoftPendingCompactionBytesLimitin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
softPendingCompactionBytesLimit- The soft limit to impose on compaction- Returns:
- the reference to the current options.
-
softPendingCompactionBytesLimit
public long softPendingCompactionBytesLimit()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAll writes will be slowed down to at least delayed_write_rate if estimated bytes needed to be compaction exceed this threshold. Default: 64GB- Specified by:
softPendingCompactionBytesLimitin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- The soft limit to impose on compaction
-
setHardPendingCompactionBytesLimit
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAll writes are stopped if estimated bytes needed to be compaction exceed this threshold. Default: 256GB- Specified by:
setHardPendingCompactionBytesLimitin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
hardPendingCompactionBytesLimit- The hard limit to impose on compaction- Returns:
- the reference to the current options.
-
hardPendingCompactionBytesLimit
public long hardPendingCompactionBytesLimit()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAll writes are stopped if estimated bytes needed to be compaction exceed this threshold. Default: 256GB- Specified by:
hardPendingCompactionBytesLimitin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- The hard limit to impose on compaction
-
setLevel0FileNumCompactionTrigger
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger)
Description copied from interface:MutableColumnFamilyOptionsInterfaceNumber of files to trigger level-0 compaction. A value < 0 means that level-0 compaction will not be triggered by number of files at all. Default: 4- Specified by:
setLevel0FileNumCompactionTriggerin interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
level0FileNumCompactionTrigger- The number of files to trigger level-0 compaction- Returns:
- the reference to the current option.
-
level0FileNumCompactionTrigger
public int level0FileNumCompactionTrigger()
Description copied from interface:MutableColumnFamilyOptionsInterfaceNumber of files to trigger level-0 compaction. A value < 0 means that level-0 compaction will not be triggered by number of files at all. Default: 4- Specified by:
level0FileNumCompactionTriggerin interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- The number of files to trigger
-
setLevel0SlowdownWritesTrigger
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceSoft limit on number of level-0 files. We start slowing down writes at this point. A value < 0 means that no writing slow down will be triggered by number of files in level-0.- Specified by:
setLevel0SlowdownWritesTriggerin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
level0SlowdownWritesTrigger- The soft limit on the number of level-0 files- Returns:
- the reference to the current options.
-
level0SlowdownWritesTrigger
public int level0SlowdownWritesTrigger()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceSoft limit on number of level-0 files. We start slowing down writes at this point. A value < 0 means that no writing slow down will be triggered by number of files in level-0.- Specified by:
level0SlowdownWritesTriggerin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- The soft limit on the number of level-0 files
-
setLevel0StopWritesTrigger
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setLevel0StopWritesTrigger(int level0StopWritesTrigger)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceMaximum number of level-0 files. We stop writes at this point.- Specified by:
setLevel0StopWritesTriggerin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
level0StopWritesTrigger- The maximum number of level-0 files- Returns:
- the reference to the current options.
-
level0StopWritesTrigger
public int level0StopWritesTrigger()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceMaximum number of level-0 files. We stop writes at this point.- Specified by:
level0StopWritesTriggerin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- The maximum number of level-0 files
-
setMaxCompactionBytes
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMaxCompactionBytes(long maxCompactionBytes)
Description copied from interface:MutableColumnFamilyOptionsInterfaceWe try to limit number of bytes in one compaction to be lower than this threshold. But it's not guaranteed. Value 0 will be sanitized.- Specified by:
setMaxCompactionBytesin interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
maxCompactionBytes- max bytes in a compaction- Returns:
- the reference to the current option.
- See Also:
MutableColumnFamilyOptionsInterface.maxCompactionBytes()
-
maxCompactionBytes
public long maxCompactionBytes()
Description copied from interface:MutableColumnFamilyOptionsInterfaceWe try to limit number of bytes in one compaction to be lower than this threshold. But it's not guaranteed. Value 0 will be sanitized.- Specified by:
maxCompactionBytesin interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the maximum number of bytes in for a compaction.
- See Also:
MutableColumnFamilyOptionsInterface.setMaxCompactionBytes(long)
-
setTargetFileSizeBase
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setTargetFileSizeBase(long targetFileSizeBase)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceThe target file size for compaction. This targetFileSizeBase determines a level-1 file size. Target file size for level L can be calculated by targetFileSizeBase * (targetFileSizeMultiplier ^ (L-1)) For example, if targetFileSizeBase is 2MB and target_file_size_multiplier is 10, then each file on level-1 will be 2MB, and each file on level 2 will be 20MB, and each file on level-3 will be 200MB. by default targetFileSizeBase is 64MB.- Specified by:
setTargetFileSizeBasein interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
targetFileSizeBase- the target size of a level-0 file.- Returns:
- the reference to the current options.
- See Also:
AdvancedMutableColumnFamilyOptionsInterface.setTargetFileSizeMultiplier(int)
-
targetFileSizeBase
public long targetFileSizeBase()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceThe target file size for compaction. This targetFileSizeBase determines a level-1 file size. Target file size for level L can be calculated by targetFileSizeBase * (targetFileSizeMultiplier ^ (L-1)) For example, if targetFileSizeBase is 2MB and target_file_size_multiplier is 10, then each file on level-1 will be 2MB, and each file on level 2 will be 20MB, and each file on level-3 will be 200MB. by default targetFileSizeBase is 64MB.- Specified by:
targetFileSizeBasein interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the target size of a level-0 file.
- See Also:
AdvancedMutableColumnFamilyOptionsInterface.targetFileSizeMultiplier()
-
setTargetFileSizeMultiplier
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setTargetFileSizeMultiplier(int targetFileSizeMultiplier)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfacetargetFileSizeMultiplier defines the size ratio between a level-L file and level-(L+1) file. By default target_file_size_multiplier is 1, meaning files in different levels have the same target.- Specified by:
setTargetFileSizeMultiplierin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
targetFileSizeMultiplier- the size ratio between a level-(L+1) file and level-L file.- Returns:
- the reference to the current options.
-
targetFileSizeMultiplier
public int targetFileSizeMultiplier()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfacetargetFileSizeMultiplier defines the size ratio between a level-(L+1) file and level-L file. By default targetFileSizeMultiplier is 1, meaning files in different levels have the same target.- Specified by:
targetFileSizeMultiplierin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the size ratio between a level-(L+1) file and level-L file.
-
setMaxBytesForLevelBase
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMaxBytesForLevelBase(long maxBytesForLevelBase)
Description copied from interface:MutableColumnFamilyOptionsInterfaceThe upper-bound of the total size of level-1 files in bytes. Maximum number of bytes for level L can be calculated as (maxBytesForLevelBase) * (maxBytesForLevelMultiplier ^ (L-1)) For example, if maxBytesForLevelBase is 20MB, and if max_bytes_for_level_multiplier is 10, total data size for level-1 will be 200MB, total file size for level-2 will be 2GB, and total file size for level-3 will be 20GB. by default 'maxBytesForLevelBase' is 256MB.- Specified by:
setMaxBytesForLevelBasein interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
maxBytesForLevelBase- maximum bytes for level base.- Returns:
- the reference to the current option.
See
AdvancedMutableColumnFamilyOptionsInterface.setMaxBytesForLevelMultiplier(double)
-
maxBytesForLevelBase
public long maxBytesForLevelBase()
Description copied from interface:MutableColumnFamilyOptionsInterfaceThe upper-bound of the total size of level-1 files in bytes. Maximum number of bytes for level L can be calculated as (maxBytesForLevelBase) * (maxBytesForLevelMultiplier ^ (L-1)) For example, if maxBytesForLevelBase is 20MB, and if max_bytes_for_level_multiplier is 10, total data size for level-1 will be 200MB, total file size for level-2 will be 2GB, and total file size for level-3 will be 20GB. by default 'maxBytesForLevelBase' is 256MB.- Specified by:
maxBytesForLevelBasein interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the upper-bound of the total size of level-1 files
in bytes.
See
AdvancedMutableColumnFamilyOptionsInterface.maxBytesForLevelMultiplier()
-
setMaxBytesForLevelMultiplier
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMaxBytesForLevelMultiplier(double maxBytesForLevelMultiplier)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceThe ratio between the total size of level-(L+1) files and the total size of level-L files for all L. DEFAULT: 10- Specified by:
setMaxBytesForLevelMultiplierin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
maxBytesForLevelMultiplier- the ratio between the total size of level-(L+1) files and the total size of level-L files for all L.- Returns:
- the reference to the current options.
See
MutableColumnFamilyOptionsInterface.setMaxBytesForLevelBase(long)
-
maxBytesForLevelMultiplier
public double maxBytesForLevelMultiplier()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceThe ratio between the total size of level-(L+1) files and the total size of level-L files for all L. DEFAULT: 10- Specified by:
maxBytesForLevelMultiplierin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the ratio between the total size of level-(L+1) files and
the total size of level-L files for all L.
See
MutableColumnFamilyOptionsInterface.maxBytesForLevelBase()
-
setMaxBytesForLevelMultiplierAdditional
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceDifferent max-size multipliers for different levels. These are multiplied by max_bytes_for_level_multiplier to arrive at the max-size of each level. Default: 1- Specified by:
setMaxBytesForLevelMultiplierAdditionalin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
maxBytesForLevelMultiplierAdditional- The max-size multipliers for each level- Returns:
- the reference to the current options.
-
maxBytesForLevelMultiplierAdditional
public int[] maxBytesForLevelMultiplierAdditional()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceDifferent max-size multipliers for different levels. These are multiplied by max_bytes_for_level_multiplier to arrive at the max-size of each level. Default: 1- Specified by:
maxBytesForLevelMultiplierAdditionalin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- The max-size multipliers for each level
-
setMaxSequentialSkipInIterations
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setMaxSequentialSkipInIterations(long maxSequentialSkipInIterations)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAn iteration->Next() sequentially skips over keys with the same user-key unless this option is set. This number specifies the number of keys (with the same userkey) that will be sequentially skipped before a reseek is issued. Default: 8- Specified by:
setMaxSequentialSkipInIterationsin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
maxSequentialSkipInIterations- the number of keys could be skipped in a iteration.- Returns:
- the reference to the current options.
-
maxSequentialSkipInIterations
public long maxSequentialSkipInIterations()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAn iteration->Next() sequentially skips over keys with the same user-key unless this option is set. This number specifies the number of keys (with the same userkey) that will be sequentially skipped before a reseek is issued. Default: 8- Specified by:
maxSequentialSkipInIterationsin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the number of keys could be skipped in a iteration.
-
setParanoidFileChecks
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setParanoidFileChecks(boolean paranoidFileChecks)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAfter writing every SST file, reopen it and read all the keys. Default: false- Specified by:
setParanoidFileChecksin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
paranoidFileChecks- true to enable paranoid file checks- Returns:
- the reference to the current options.
-
paranoidFileChecks
public boolean paranoidFileChecks()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceAfter writing every SST file, reopen it and read all the keys. Default: false- Specified by:
paranoidFileChecksin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- true if paranoid file checks are enabled
-
setCompressionType
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setCompressionType(CompressionType compressionType)
Description copied from interface:MutableColumnFamilyOptionsInterfaceCompress blocks using the specified compression algorithm. This parameter can be changed dynamically. Default: SNAPPY_COMPRESSION, which gives lightweight but fast compression.- Specified by:
setCompressionTypein interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
compressionType- Compression Type.- Returns:
- the reference to the current option.
-
compressionType
public CompressionType compressionType()
Description copied from interface:MutableColumnFamilyOptionsInterfaceCompress blocks using the specified compression algorithm. This parameter can be changed dynamically. Default: SNAPPY_COMPRESSION, which gives lightweight but fast compression.- Specified by:
compressionTypein interfaceMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- Compression type.
-
setReportBgIoStats
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setReportBgIoStats(boolean reportBgIoStats)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceMeasure IO stats in compactions and flushes, if true. Default: false- Specified by:
setReportBgIoStatsin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
reportBgIoStats- true to enable reporting- Returns:
- the reference to the current options.
-
reportBgIoStats
public boolean reportBgIoStats()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceDetermine whether IO stats in compactions and flushes are being measured- Specified by:
reportBgIoStatsin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- true if reporting is enabled
-
setTtl
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder setTtl(long ttl)
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceNon-bottom-level files older than TTL will go through the compaction process. This needsMutableDBOptionsInterface.maxOpenFiles()to be set to -1. Enabled only for level compaction for now. Default: 0 (disabled) Dynamically changeable throughRocksDB.setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions).- Specified by:
setTtlin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Parameters:
ttl- the time-to-live.- Returns:
- the reference to the current options.
-
ttl
public long ttl()
Description copied from interface:AdvancedMutableColumnFamilyOptionsInterfaceGet the TTL for Non-bottom-level files that will go through the compaction process. SeeAdvancedMutableColumnFamilyOptionsInterface.setTtl(long).- Specified by:
ttlin interfaceAdvancedMutableColumnFamilyOptionsInterface<MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder>- Returns:
- the time-to-live.
-
-