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