Package org.rocksdb
Class CompressionOptions
- java.lang.Object
-
- org.rocksdb.AbstractNativeReference
-
- org.rocksdb.AbstractImmutableNativeReference
-
- org.rocksdb.RocksObject
-
- org.rocksdb.CompressionOptions
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class CompressionOptions extends RocksObject
Options for Compression
-
-
Field Summary
-
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_
-
Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_
-
-
Constructor Summary
Constructors Constructor Description CompressionOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisposeInternal(long handle)booleanenabled()Determine whether these compression options are used for the bottommost_compression_opts.intlevel()intmaxDictBytes()Maximum size of dictionary used to prime the compression library.CompressionOptionssetEnabled(boolean enabled)When the compression options are set by the user, it will be set to "true".CompressionOptionssetLevel(int level)CompressionOptionssetMaxDictBytes(int maxDictBytes)Maximum size of dictionary used to prime the compression library.CompressionOptionssetStrategy(int strategy)CompressionOptionssetWindowBits(int windowBits)CompressionOptionssetZStdMaxTrainBytes(int zstdMaxTrainBytes)Maximum size of training data passed to zstd's dictionary trainer.intstrategy()intwindowBits()intzstdMaxTrainBytes()Maximum size of training data passed to zstd's dictionary trainer.-
Methods inherited from class org.rocksdb.RocksObject
disposeInternal, getNativeHandle
-
Methods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Methods inherited from class org.rocksdb.AbstractNativeReference
dispose, finalize
-
-
-
-
Method Detail
-
setWindowBits
public CompressionOptions setWindowBits(int windowBits)
-
windowBits
public int windowBits()
-
setLevel
public CompressionOptions setLevel(int level)
-
level
public int level()
-
setStrategy
public CompressionOptions setStrategy(int strategy)
-
strategy
public int strategy()
-
setMaxDictBytes
public CompressionOptions setMaxDictBytes(int maxDictBytes)
Maximum size of dictionary used to prime the compression library. Currently this dictionary will be constructed by sampling the first output file in a subcompaction when the target level is bottommost. This dictionary will be loaded into the compression library before compressing/uncompressing each data block of subsequent files in the subcompaction. Effectively, this improves compression ratios when there are repetitions across data blocks. A value of 0 indicates the feature is disabled. Default: 0.- Parameters:
maxDictBytes- Maximum bytes to use for the dictionary- Returns:
- the reference to the current options
-
maxDictBytes
public int maxDictBytes()
Maximum size of dictionary used to prime the compression library.- Returns:
- The maximum bytes to use for the dictionary
-
setZStdMaxTrainBytes
public CompressionOptions setZStdMaxTrainBytes(int zstdMaxTrainBytes)
Maximum size of training data passed to zstd's dictionary trainer. Using zstd's dictionary trainer can achieve even better compression ratio improvements than usingsetMaxDictBytes(int)alone. The training data will be used to generate a dictionary ofmaxDictBytes(). Default: 0.- Parameters:
zstdMaxTrainBytes- Maximum bytes to use for training ZStd.- Returns:
- the reference to the current options
-
zstdMaxTrainBytes
public int zstdMaxTrainBytes()
Maximum size of training data passed to zstd's dictionary trainer.- Returns:
- Maximum bytes to use for training ZStd
-
setEnabled
public CompressionOptions setEnabled(boolean enabled)
When the compression options are set by the user, it will be set to "true". For bottommost_compression_opts, to enable it, user must set enabled=true. Otherwise, bottommost compression will use compression_opts as default compression options. For compression_opts, if compression_opts.enabled=false, it is still used as compression options for compression process. Default: false.- Parameters:
enabled- true to use these compression options for the bottommost_compression_opts, false otherwise- Returns:
- the reference to the current options
-
enabled
public boolean enabled()
Determine whether these compression options are used for the bottommost_compression_opts.- Returns:
- true if these compression options are used for the bottommost_compression_opts, false otherwise
-
disposeInternal
protected final void disposeInternal(long handle)
- Specified by:
disposeInternalin classRocksObject
-
-