]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/CompactionOptionsFIFO.java
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
9 * Options for FIFO Compaction
11 public class CompactionOptionsFIFO
extends RocksObject
{
13 public CompactionOptionsFIFO() {
14 super(newCompactionOptionsFIFO());
18 * Once the total sum of table files reaches this, we will delete the oldest
23 * @param maxTableFilesSize The maximum size of the table files
25 * @return the reference to the current options.
27 public CompactionOptionsFIFO
setMaxTableFilesSize(
28 final long maxTableFilesSize
) {
29 setMaxTableFilesSize(nativeHandle_
, maxTableFilesSize
);
34 * Once the total sum of table files reaches this, we will delete the oldest
39 * @return max table file size in bytes
41 public long maxTableFilesSize() {
42 return maxTableFilesSize(nativeHandle_
);
46 * If true, try to do compaction to compact smaller files into larger ones.
47 * Minimum files to compact follows options.level0_file_num_compaction_trigger
48 * and compaction won't trigger if average compact bytes per del file is
49 * larger than options.write_buffer_size. This is to protect large files
50 * from being compacted again.
54 * @param allowCompaction true to allow intra-L0 compaction
56 * @return the reference to the current options.
58 public CompactionOptionsFIFO
setAllowCompaction(
59 final boolean allowCompaction
) {
60 setAllowCompaction(nativeHandle_
, allowCompaction
);
66 * Check if intra-L0 compaction is enabled.
67 * When enabled, we try to compact smaller files into larger ones.
69 * See {@link #setAllowCompaction(boolean)}.
73 * @return true if intra-L0 compaction is enabled, false otherwise.
75 public boolean allowCompaction() {
76 return allowCompaction(nativeHandle_
);
80 private native static long newCompactionOptionsFIFO();
81 @Override protected final native void disposeInternal(final long handle
);
83 private native void setMaxTableFilesSize(final long handle
,
84 final long maxTableFilesSize
);
85 private native long maxTableFilesSize(final long handle
);
86 private native void setAllowCompaction(final long handle
,
87 final boolean allowCompaction
);
88 private native boolean allowCompaction(final long handle
);