Package org.rocksdb
Class CompressionOptions
java.lang.Object
org.rocksdb.AbstractNativeReference
org.rocksdb.AbstractImmutableNativeReference
org.rocksdb.RocksObject
org.rocksdb.CompressionOptions
- All Implemented Interfaces:
AutoCloseable
Options for Compression
-
Field Summary
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voiddisposeInternal(long handle) booleanenabled()Determine whether these compression options are used for the bottommost_compression_opts.intlevel()intMaximum size of dictionary used to prime the compression library.setEnabled(boolean enabled) When the compression options are set by the user, it will be set to "true".setLevel(int level) setMaxDictBytes(int maxDictBytes) Maximum size of dictionary used to prime the compression library.setStrategy(int strategy) setWindowBits(int windowBits) setZStdMaxTrainBytes(int zstdMaxTrainBytes) Maximum size of training data passed to zstd's dictionary trainer.intstrategy()intintMaximum size of training data passed to zstd's dictionary trainer.Methods inherited from class org.rocksdb.RocksObject
disposeInternal, getNativeHandleMethods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Constructor Details
-
CompressionOptions
public CompressionOptions()
-
-
Method Details
-
setWindowBits
-
windowBits
public int windowBits() -
setLevel
-
level
public int level() -
setStrategy
-
strategy
public int strategy() -
setMaxDictBytes
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
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 of
maxDictBytes().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
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
-