public class CompactionOptionsUniversal extends RocksObject
nativeHandle_
owningHandle_
Constructor and Description |
---|
CompactionOptionsUniversal() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowTrivialMove()
Option to optimize the universal multi level compaction by enabling
trivial move for non overlapping files.
|
int |
compressionSizePercent()
If this option is set to be -1 (the default value), all the output files
will follow compression type specified.
|
protected void |
disposeInternal(long handle) |
int |
maxMergeWidth()
The maximum number of files in a single compaction run.
|
int |
maxSizeAmplificationPercent()
The size amplification is defined as the amount (in percentage) of
additional storage needed to store a single byte of data in the database.
|
int |
minMergeWidth()
The minimum number of files in a single compaction run.
|
CompactionOptionsUniversal |
setAllowTrivialMove(boolean allowTrivialMove)
Option to optimize the universal multi level compaction by enabling
trivial move for non overlapping files.
|
CompactionOptionsUniversal |
setCompressionSizePercent(int compressionSizePercent)
If this option is set to be -1 (the default value), all the output files
will follow compression type specified.
|
CompactionOptionsUniversal |
setMaxMergeWidth(int maxMergeWidth)
The maximum number of files in a single compaction run.
|
CompactionOptionsUniversal |
setMaxSizeAmplificationPercent(int maxSizeAmplificationPercent)
The size amplification is defined as the amount (in percentage) of
additional storage needed to store a single byte of data in the database.
|
CompactionOptionsUniversal |
setMinMergeWidth(int minMergeWidth)
The minimum number of files in a single compaction run.
|
CompactionOptionsUniversal |
setSizeRatio(int sizeRatio)
Percentage flexibility while comparing file size.
|
CompactionOptionsUniversal |
setStopStyle(CompactionStopStyle compactionStopStyle)
The algorithm used to stop picking files into a single compaction run
|
int |
sizeRatio()
Percentage flexibility while comparing file size.
|
CompactionStopStyle |
stopStyle()
The algorithm used to stop picking files into a single compaction run
|
disposeInternal, getNativeHandle
close, disOwnNativeHandle, isOwningHandle
public CompactionOptionsUniversal setSizeRatio(int sizeRatio)
Default: 1
sizeRatio
- The size ratio to usepublic int sizeRatio()
Default: 1
public CompactionOptionsUniversal setMinMergeWidth(int minMergeWidth)
Default: 2
minMergeWidth
- minimum number of files in a single compaction runpublic int minMergeWidth()
Default: 2
public CompactionOptionsUniversal setMaxMergeWidth(int maxMergeWidth)
Default: Long.MAX_VALUE
maxMergeWidth
- maximum number of files in a single compaction runpublic int maxMergeWidth()
Default: Long.MAX_VALUE
public CompactionOptionsUniversal setMaxSizeAmplificationPercent(int maxSizeAmplificationPercent)
Default: 200, which means that a 100 byte database could require upto 300 bytes of storage.
maxSizeAmplificationPercent
- the amount of additional storage needed
(as a percentage) to store a single byte in the databasepublic int maxSizeAmplificationPercent()
Default: 200, which means that a 100 byte database could require upto 300 bytes of storage.
public CompactionOptionsUniversal setCompressionSizePercent(int compressionSizePercent)
If this option is not negative, we will try to make sure compressed size is just above this value. In normal cases, at least this percentage of data will be compressed.
When we are compacting to a new file, here is the criteria whether it needs to be compressed: assuming here are the list of files sorted by generation time: A1...An B1...Bm C1...Ct where A1 is the newest and Ct is the oldest, and we are going to compact B1...Bm, we calculate the total size of all the files as total_size, as well as the total size of C1...Ct as total_C, the compaction output file will be compressed iff total_C / total_size < this percentage
Default: -1
compressionSizePercent
- percentage of size for compressionpublic int compressionSizePercent()
If this option is not negative, we will try to make sure compressed size is just above this value. In normal cases, at least this percentage of data will be compressed.
When we are compacting to a new file, here is the criteria whether it needs to be compressed: assuming here are the list of files sorted by generation time: A1...An B1...Bm C1...Ct where A1 is the newest and Ct is the oldest, and we are going to compact B1...Bm, we calculate the total size of all the files as total_size, as well as the total size of C1...Ct as total_C, the compaction output file will be compressed iff total_C / total_size < this percentage
Default: -1
public CompactionOptionsUniversal setStopStyle(CompactionStopStyle compactionStopStyle)
compactionStopStyle
- The compaction algorithmpublic CompactionStopStyle stopStyle()
public CompactionOptionsUniversal setAllowTrivialMove(boolean allowTrivialMove)
Default: false
allowTrivialMove
- true if trivial move is allowedpublic boolean allowTrivialMove()
Default: false
protected final void disposeInternal(long handle)
disposeInternal
in class RocksObject