]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/CompressionOptions.java
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
9 * Options for Compression
11 public class CompressionOptions
extends RocksObject
{
13 public CompressionOptions() {
14 super(newCompressionOptions());
17 public CompressionOptions
setWindowBits(final int windowBits
) {
18 setWindowBits(nativeHandle_
, windowBits
);
22 public int windowBits() {
23 return windowBits(nativeHandle_
);
26 public CompressionOptions
setLevel(final int level
) {
27 setLevel(nativeHandle_
, level
);
32 return level(nativeHandle_
);
35 public CompressionOptions
setStrategy(final int strategy
) {
36 setStrategy(nativeHandle_
, strategy
);
40 public int strategy() {
41 return strategy(nativeHandle_
);
45 * Maximum size of dictionary used to prime the compression library. Currently
46 * this dictionary will be constructed by sampling the first output file in a
47 * subcompaction when the target level is bottommost. This dictionary will be
48 * loaded into the compression library before compressing/uncompressing each
49 * data block of subsequent files in the subcompaction. Effectively, this
50 * improves compression ratios when there are repetitions across data blocks.
52 * A value of 0 indicates the feature is disabled.
56 * @param maxDictBytes Maximum bytes to use for the dictionary
58 * @return the reference to the current options
60 public CompressionOptions
setMaxDictBytes(final int maxDictBytes
) {
61 setMaxDictBytes(nativeHandle_
, maxDictBytes
);
66 * Maximum size of dictionary used to prime the compression library.
68 * @return The maximum bytes to use for the dictionary
70 public int maxDictBytes() {
71 return maxDictBytes(nativeHandle_
);
74 private native static long newCompressionOptions();
75 @Override protected final native void disposeInternal(final long handle
);
77 private native void setWindowBits(final long handle
, final int windowBits
);
78 private native int windowBits(final long handle
);
79 private native void setLevel(final long handle
, final int level
);
80 private native int level(final long handle
);
81 private native void setStrategy(final long handle
, final int strategy
);
82 private native int strategy(final long handle
);
83 private native void setMaxDictBytes(final long handle
, final int maxDictBytes
);
84 private native int maxDictBytes(final long handle
);