]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/java/src/main/java/org/rocksdb/MutableColumnFamilyOptionsInterface.java
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / MutableColumnFamilyOptionsInterface.java
CommitLineData
7c673cae 1// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
11fdf7f2
TL
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).
7c673cae
FG
5
6package org.rocksdb;
7
8public interface MutableColumnFamilyOptionsInterface
9 <T extends MutableColumnFamilyOptionsInterface>
10 extends AdvancedMutableColumnFamilyOptionsInterface<T> {
11
12 /**
13 * Amount of data to build up in memory (backed by an unsorted log
14 * on disk) before converting to a sorted on-disk file.
15 *
16 * Larger values increase performance, especially during bulk loads.
17 * Up to {@code max_write_buffer_number} write buffers may be held in memory
18 * at the same time, so you may wish to adjust this parameter
19 * to control memory usage.
20 *
21 * Also, a larger write buffer will result in a longer recovery time
22 * the next time the database is opened.
23 *
24 * Default: 4MB
25 * @param writeBufferSize the size of write buffer.
26 * @return the instance of the current object.
27 * @throws java.lang.IllegalArgumentException thrown on 32-Bit platforms
28 * while overflowing the underlying platform specific value.
29 */
30 MutableColumnFamilyOptionsInterface setWriteBufferSize(long writeBufferSize);
31
32 /**
33 * Return size of write buffer size.
34 *
35 * @return size of write buffer.
36 * @see #setWriteBufferSize(long)
37 */
38 long writeBufferSize();
39
40 /**
41 * Disable automatic compactions. Manual compactions can still
42 * be issued on this column family
43 *
44 * @param disableAutoCompactions true if auto-compactions are disabled.
45 * @return the reference to the current option.
46 */
47 MutableColumnFamilyOptionsInterface setDisableAutoCompactions(
48 boolean disableAutoCompactions);
49
50 /**
51 * Disable automatic compactions. Manual compactions can still
52 * be issued on this column family
53 *
54 * @return true if auto-compactions are disabled.
55 */
56 boolean disableAutoCompactions();
57
58 /**
59 * Number of files to trigger level-0 compaction. A value &lt; 0 means that
60 * level-0 compaction will not be triggered by number of files at all.
61 *
62 * Default: 4
63 *
64 * @param level0FileNumCompactionTrigger The number of files to trigger
65 * level-0 compaction
66 * @return the reference to the current option.
67 */
68 MutableColumnFamilyOptionsInterface setLevel0FileNumCompactionTrigger(
69 int level0FileNumCompactionTrigger);
70
71 /**
72 * Number of files to trigger level-0 compaction. A value &lt; 0 means that
73 * level-0 compaction will not be triggered by number of files at all.
74 *
75 * Default: 4
76 *
77 * @return The number of files to trigger
78 */
79 int level0FileNumCompactionTrigger();
80
81 /**
82 * We try to limit number of bytes in one compaction to be lower than this
83 * threshold. But it's not guaranteed.
84 * Value 0 will be sanitized.
85 *
86 * @param maxCompactionBytes max bytes in a compaction
87 * @return the reference to the current option.
88 * @see #maxCompactionBytes()
89 */
90 MutableColumnFamilyOptionsInterface setMaxCompactionBytes(final long maxCompactionBytes);
91
92 /**
93 * We try to limit number of bytes in one compaction to be lower than this
94 * threshold. But it's not guaranteed.
95 * Value 0 will be sanitized.
96 *
97 * @return the maximum number of bytes in for a compaction.
98 * @see #setMaxCompactionBytes(long)
99 */
100 long maxCompactionBytes();
101
102 /**
103 * The upper-bound of the total size of level-1 files in bytes.
104 * Maximum number of bytes for level L can be calculated as
105 * (maxBytesForLevelBase) * (maxBytesForLevelMultiplier ^ (L-1))
106 * For example, if maxBytesForLevelBase is 20MB, and if
107 * max_bytes_for_level_multiplier is 10, total data size for level-1
108 * will be 20MB, total file size for level-2 will be 200MB,
109 * and total file size for level-3 will be 2GB.
110 * by default 'maxBytesForLevelBase' is 10MB.
111 *
112 * @param maxBytesForLevelBase maximum bytes for level base.
113 *
114 * @return the reference to the current option.
115 *
116 * See {@link AdvancedMutableColumnFamilyOptionsInterface#setMaxBytesForLevelMultiplier(double)}
117 */
118 T setMaxBytesForLevelBase(
119 long maxBytesForLevelBase);
120
121 /**
122 * The upper-bound of the total size of level-1 files in bytes.
123 * Maximum number of bytes for level L can be calculated as
124 * (maxBytesForLevelBase) * (maxBytesForLevelMultiplier ^ (L-1))
125 * For example, if maxBytesForLevelBase is 20MB, and if
126 * max_bytes_for_level_multiplier is 10, total data size for level-1
127 * will be 20MB, total file size for level-2 will be 200MB,
128 * and total file size for level-3 will be 2GB.
129 * by default 'maxBytesForLevelBase' is 10MB.
130 *
131 * @return the upper-bound of the total size of level-1 files
132 * in bytes.
133 *
134 * See {@link AdvancedMutableColumnFamilyOptionsInterface#maxBytesForLevelMultiplier()}
135 */
136 long maxBytesForLevelBase();
137
138 /**
139 * Compress blocks using the specified compression algorithm. This
140 * parameter can be changed dynamically.
141 *
142 * Default: SNAPPY_COMPRESSION, which gives lightweight but fast compression.
143 *
144 * @param compressionType Compression Type.
145 * @return the reference to the current option.
146 */
147 T setCompressionType(
148 CompressionType compressionType);
149
150 /**
151 * Compress blocks using the specified compression algorithm. This
152 * parameter can be changed dynamically.
153 *
154 * Default: SNAPPY_COMPRESSION, which gives lightweight but fast compression.
155 *
156 * @return Compression type.
157 */
158 CompressionType compressionType();
159}