]>
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 | ||
8 | import java.nio.file.Paths; | |
20effc67 | 9 | import java.util.*; |
7c673cae FG |
10 | |
11 | /** | |
12 | * Options to control the behavior of a database. It will be used | |
13 | * during the creation of a {@link org.rocksdb.RocksDB} (i.e., RocksDB.open()). | |
14 | * | |
15 | * If {@link #dispose()} function is not called, then it will be GC'd | |
f67539c2 | 16 | * automatically and native resources will be released as part of the process. |
7c673cae FG |
17 | */ |
18 | public class Options extends RocksObject | |
494da23a TL |
19 | implements DBOptionsInterface<Options>, |
20 | MutableDBOptionsInterface<Options>, | |
21 | ColumnFamilyOptionsInterface<Options>, | |
7c673cae FG |
22 | MutableColumnFamilyOptionsInterface<Options> { |
23 | static { | |
24 | RocksDB.loadLibrary(); | |
25 | } | |
26 | ||
20effc67 TL |
27 | /** |
28 | * Converts the input properties into a Options-style formatted string | |
29 | * @param properties The set of properties to convert | |
30 | * @return The Options-style representation of those properties. | |
31 | */ | |
32 | public static String getOptionStringFromProps(final Properties properties) { | |
33 | if (properties == null || properties.size() == 0) { | |
34 | throw new IllegalArgumentException("Properties value must contain at least one value."); | |
35 | } | |
36 | StringBuilder stringBuilder = new StringBuilder(); | |
37 | for (final String name : properties.stringPropertyNames()) { | |
38 | stringBuilder.append(name); | |
39 | stringBuilder.append("="); | |
40 | stringBuilder.append(properties.getProperty(name)); | |
41 | stringBuilder.append(";"); | |
42 | } | |
43 | return stringBuilder.toString(); | |
44 | } | |
45 | ||
7c673cae FG |
46 | /** |
47 | * Construct options for opening a RocksDB. | |
48 | * | |
49 | * This constructor will create (by allocating a block of memory) | |
50 | * an {@code rocksdb::Options} in the c++ side. | |
51 | */ | |
52 | public Options() { | |
53 | super(newOptions()); | |
54 | env_ = Env.getDefault(); | |
55 | } | |
56 | ||
57 | /** | |
58 | * Construct options for opening a RocksDB. Reusing database options | |
59 | * and column family options. | |
60 | * | |
61 | * @param dbOptions {@link org.rocksdb.DBOptions} instance | |
62 | * @param columnFamilyOptions {@link org.rocksdb.ColumnFamilyOptions} | |
63 | * instance | |
64 | */ | |
65 | public Options(final DBOptions dbOptions, | |
66 | final ColumnFamilyOptions columnFamilyOptions) { | |
67 | super(newOptions(dbOptions.nativeHandle_, | |
68 | columnFamilyOptions.nativeHandle_)); | |
69 | env_ = Env.getDefault(); | |
70 | } | |
71 | ||
11fdf7f2 TL |
72 | /** |
73 | * Copy constructor for ColumnFamilyOptions. | |
74 | * | |
75 | * NOTE: This does a shallow copy, which means comparator, merge_operator | |
76 | * and other pointers will be cloned! | |
77 | * | |
78 | * @param other The Options to copy. | |
79 | */ | |
80 | public Options(Options other) { | |
81 | super(copyOptions(other.nativeHandle_)); | |
82 | this.env_ = other.env_; | |
83 | this.memTableConfig_ = other.memTableConfig_; | |
84 | this.tableFormatConfig_ = other.tableFormatConfig_; | |
85 | this.rateLimiter_ = other.rateLimiter_; | |
86 | this.comparator_ = other.comparator_; | |
494da23a TL |
87 | this.compactionFilter_ = other.compactionFilter_; |
88 | this.compactionFilterFactory_ = other.compactionFilterFactory_; | |
11fdf7f2 TL |
89 | this.compactionOptionsUniversal_ = other.compactionOptionsUniversal_; |
90 | this.compactionOptionsFIFO_ = other.compactionOptionsFIFO_; | |
91 | this.compressionOptions_ = other.compressionOptions_; | |
92 | this.rowCache_ = other.rowCache_; | |
494da23a | 93 | this.writeBufferManager_ = other.writeBufferManager_; |
20effc67 | 94 | this.compactionThreadLimiter_ = other.compactionThreadLimiter_; |
11fdf7f2 TL |
95 | } |
96 | ||
7c673cae FG |
97 | @Override |
98 | public Options setIncreaseParallelism(final int totalThreads) { | |
99 | assert(isOwningHandle()); | |
100 | setIncreaseParallelism(nativeHandle_, totalThreads); | |
101 | return this; | |
102 | } | |
103 | ||
104 | @Override | |
105 | public Options setCreateIfMissing(final boolean flag) { | |
106 | assert(isOwningHandle()); | |
107 | setCreateIfMissing(nativeHandle_, flag); | |
108 | return this; | |
109 | } | |
110 | ||
111 | @Override | |
112 | public Options setCreateMissingColumnFamilies(final boolean flag) { | |
113 | assert(isOwningHandle()); | |
114 | setCreateMissingColumnFamilies(nativeHandle_, flag); | |
115 | return this; | |
116 | } | |
117 | ||
118 | @Override | |
119 | public Options setEnv(final Env env) { | |
120 | assert(isOwningHandle()); | |
121 | setEnv(nativeHandle_, env.nativeHandle_); | |
122 | env_ = env; | |
123 | return this; | |
124 | } | |
125 | ||
126 | @Override | |
127 | public Env getEnv() { | |
128 | return env_; | |
129 | } | |
130 | ||
131 | /** | |
132 | * <p>Set appropriate parameters for bulk loading. | |
133 | * The reason that this is a function that returns "this" instead of a | |
134 | * constructor is to enable chaining of multiple similar calls in the future. | |
135 | * </p> | |
136 | * | |
137 | * <p>All data will be in level 0 without any automatic compaction. | |
138 | * It's recommended to manually call CompactRange(NULL, NULL) before reading | |
139 | * from the database, because otherwise the read can be very slow.</p> | |
140 | * | |
141 | * @return the instance of the current Options. | |
142 | */ | |
143 | public Options prepareForBulkLoad() { | |
144 | prepareForBulkLoad(nativeHandle_); | |
145 | return this; | |
146 | } | |
147 | ||
148 | @Override | |
149 | public boolean createIfMissing() { | |
150 | assert(isOwningHandle()); | |
151 | return createIfMissing(nativeHandle_); | |
152 | } | |
153 | ||
154 | @Override | |
155 | public boolean createMissingColumnFamilies() { | |
156 | assert(isOwningHandle()); | |
157 | return createMissingColumnFamilies(nativeHandle_); | |
158 | } | |
159 | ||
20effc67 TL |
160 | @Override |
161 | public Options oldDefaults(final int majorVersion, final int minorVersion) { | |
162 | oldDefaults(nativeHandle_, majorVersion, minorVersion); | |
163 | return this; | |
164 | } | |
165 | ||
7c673cae FG |
166 | @Override |
167 | public Options optimizeForSmallDb() { | |
168 | optimizeForSmallDb(nativeHandle_); | |
169 | return this; | |
170 | } | |
171 | ||
20effc67 TL |
172 | @Override |
173 | public Options optimizeForSmallDb(final Cache cache) { | |
174 | optimizeForSmallDb(nativeHandle_, cache.getNativeHandle()); | |
175 | return this; | |
176 | } | |
177 | ||
7c673cae FG |
178 | @Override |
179 | public Options optimizeForPointLookup( | |
180 | long blockCacheSizeMb) { | |
181 | optimizeForPointLookup(nativeHandle_, | |
182 | blockCacheSizeMb); | |
183 | return this; | |
184 | } | |
185 | ||
186 | @Override | |
187 | public Options optimizeLevelStyleCompaction() { | |
188 | optimizeLevelStyleCompaction(nativeHandle_, | |
189 | DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET); | |
190 | return this; | |
191 | } | |
192 | ||
193 | @Override | |
194 | public Options optimizeLevelStyleCompaction( | |
195 | long memtableMemoryBudget) { | |
196 | optimizeLevelStyleCompaction(nativeHandle_, | |
197 | memtableMemoryBudget); | |
198 | return this; | |
199 | } | |
200 | ||
201 | @Override | |
202 | public Options optimizeUniversalStyleCompaction() { | |
203 | optimizeUniversalStyleCompaction(nativeHandle_, | |
204 | DEFAULT_COMPACTION_MEMTABLE_MEMORY_BUDGET); | |
205 | return this; | |
206 | } | |
207 | ||
208 | @Override | |
209 | public Options optimizeUniversalStyleCompaction( | |
210 | final long memtableMemoryBudget) { | |
211 | optimizeUniversalStyleCompaction(nativeHandle_, | |
212 | memtableMemoryBudget); | |
213 | return this; | |
214 | } | |
215 | ||
216 | @Override | |
217 | public Options setComparator(final BuiltinComparator builtinComparator) { | |
218 | assert(isOwningHandle()); | |
219 | setComparatorHandle(nativeHandle_, builtinComparator.ordinal()); | |
220 | return this; | |
221 | } | |
222 | ||
223 | @Override | |
224 | public Options setComparator( | |
f67539c2 | 225 | final AbstractComparator comparator) { |
7c673cae | 226 | assert(isOwningHandle()); |
11fdf7f2 TL |
227 | setComparatorHandle(nativeHandle_, comparator.nativeHandle_, |
228 | comparator.getComparatorType().getValue()); | |
7c673cae FG |
229 | comparator_ = comparator; |
230 | return this; | |
231 | } | |
232 | ||
233 | @Override | |
234 | public Options setMergeOperatorName(final String name) { | |
235 | assert(isOwningHandle()); | |
236 | if (name == null) { | |
237 | throw new IllegalArgumentException( | |
238 | "Merge operator name must not be null."); | |
239 | } | |
240 | setMergeOperatorName(nativeHandle_, name); | |
241 | return this; | |
242 | } | |
243 | ||
244 | @Override | |
245 | public Options setMergeOperator(final MergeOperator mergeOperator) { | |
246 | setMergeOperator(nativeHandle_, mergeOperator.nativeHandle_); | |
247 | return this; | |
248 | } | |
249 | ||
494da23a TL |
250 | @Override |
251 | public Options setCompactionFilter( | |
252 | final AbstractCompactionFilter<? extends AbstractSlice<?>> | |
253 | compactionFilter) { | |
254 | setCompactionFilterHandle(nativeHandle_, compactionFilter.nativeHandle_); | |
255 | compactionFilter_ = compactionFilter; | |
256 | return this; | |
257 | } | |
258 | ||
259 | @Override | |
260 | public AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter() { | |
261 | assert (isOwningHandle()); | |
262 | return compactionFilter_; | |
263 | } | |
264 | ||
265 | @Override | |
266 | public Options setCompactionFilterFactory(final AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory) { | |
267 | assert (isOwningHandle()); | |
268 | setCompactionFilterFactoryHandle(nativeHandle_, compactionFilterFactory.nativeHandle_); | |
269 | compactionFilterFactory_ = compactionFilterFactory; | |
270 | return this; | |
271 | } | |
272 | ||
273 | @Override | |
274 | public AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> compactionFilterFactory() { | |
275 | assert (isOwningHandle()); | |
276 | return compactionFilterFactory_; | |
277 | } | |
278 | ||
7c673cae FG |
279 | @Override |
280 | public Options setWriteBufferSize(final long writeBufferSize) { | |
281 | assert(isOwningHandle()); | |
282 | setWriteBufferSize(nativeHandle_, writeBufferSize); | |
283 | return this; | |
284 | } | |
285 | ||
286 | @Override | |
287 | public long writeBufferSize() { | |
288 | assert(isOwningHandle()); | |
289 | return writeBufferSize(nativeHandle_); | |
290 | } | |
291 | ||
292 | @Override | |
293 | public Options setMaxWriteBufferNumber(final int maxWriteBufferNumber) { | |
294 | assert(isOwningHandle()); | |
295 | setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber); | |
296 | return this; | |
297 | } | |
298 | ||
299 | @Override | |
300 | public int maxWriteBufferNumber() { | |
301 | assert(isOwningHandle()); | |
302 | return maxWriteBufferNumber(nativeHandle_); | |
303 | } | |
304 | ||
305 | @Override | |
306 | public boolean errorIfExists() { | |
307 | assert(isOwningHandle()); | |
308 | return errorIfExists(nativeHandle_); | |
309 | } | |
310 | ||
311 | @Override | |
312 | public Options setErrorIfExists(final boolean errorIfExists) { | |
313 | assert(isOwningHandle()); | |
314 | setErrorIfExists(nativeHandle_, errorIfExists); | |
315 | return this; | |
316 | } | |
317 | ||
318 | @Override | |
319 | public boolean paranoidChecks() { | |
320 | assert(isOwningHandle()); | |
321 | return paranoidChecks(nativeHandle_); | |
322 | } | |
323 | ||
324 | @Override | |
325 | public Options setParanoidChecks(final boolean paranoidChecks) { | |
326 | assert(isOwningHandle()); | |
327 | setParanoidChecks(nativeHandle_, paranoidChecks); | |
328 | return this; | |
329 | } | |
330 | ||
331 | @Override | |
332 | public int maxOpenFiles() { | |
333 | assert(isOwningHandle()); | |
334 | return maxOpenFiles(nativeHandle_); | |
335 | } | |
336 | ||
337 | @Override | |
338 | public Options setMaxFileOpeningThreads(final int maxFileOpeningThreads) { | |
339 | assert(isOwningHandle()); | |
340 | setMaxFileOpeningThreads(nativeHandle_, maxFileOpeningThreads); | |
341 | return this; | |
342 | } | |
343 | ||
344 | @Override | |
345 | public int maxFileOpeningThreads() { | |
346 | assert(isOwningHandle()); | |
347 | return maxFileOpeningThreads(nativeHandle_); | |
348 | } | |
349 | ||
350 | @Override | |
351 | public Options setMaxTotalWalSize(final long maxTotalWalSize) { | |
352 | assert(isOwningHandle()); | |
353 | setMaxTotalWalSize(nativeHandle_, maxTotalWalSize); | |
354 | return this; | |
355 | } | |
356 | ||
357 | @Override | |
358 | public long maxTotalWalSize() { | |
359 | assert(isOwningHandle()); | |
360 | return maxTotalWalSize(nativeHandle_); | |
361 | } | |
362 | ||
363 | @Override | |
364 | public Options setMaxOpenFiles(final int maxOpenFiles) { | |
365 | assert(isOwningHandle()); | |
366 | setMaxOpenFiles(nativeHandle_, maxOpenFiles); | |
367 | return this; | |
368 | } | |
369 | ||
370 | @Override | |
371 | public boolean useFsync() { | |
372 | assert(isOwningHandle()); | |
373 | return useFsync(nativeHandle_); | |
374 | } | |
375 | ||
376 | @Override | |
377 | public Options setUseFsync(final boolean useFsync) { | |
378 | assert(isOwningHandle()); | |
379 | setUseFsync(nativeHandle_, useFsync); | |
380 | return this; | |
381 | } | |
382 | ||
383 | @Override | |
384 | public Options setDbPaths(final Collection<DbPath> dbPaths) { | |
385 | assert(isOwningHandle()); | |
386 | ||
387 | final int len = dbPaths.size(); | |
388 | final String paths[] = new String[len]; | |
389 | final long targetSizes[] = new long[len]; | |
390 | ||
391 | int i = 0; | |
392 | for(final DbPath dbPath : dbPaths) { | |
393 | paths[i] = dbPath.path.toString(); | |
394 | targetSizes[i] = dbPath.targetSize; | |
395 | i++; | |
396 | } | |
397 | setDbPaths(nativeHandle_, paths, targetSizes); | |
398 | return this; | |
399 | } | |
400 | ||
401 | @Override | |
402 | public List<DbPath> dbPaths() { | |
403 | final int len = (int)dbPathsLen(nativeHandle_); | |
404 | if(len == 0) { | |
405 | return Collections.emptyList(); | |
406 | } else { | |
407 | final String paths[] = new String[len]; | |
408 | final long targetSizes[] = new long[len]; | |
409 | ||
410 | dbPaths(nativeHandle_, paths, targetSizes); | |
411 | ||
412 | final List<DbPath> dbPaths = new ArrayList<>(); | |
413 | for(int i = 0; i < len; i++) { | |
414 | dbPaths.add(new DbPath(Paths.get(paths[i]), targetSizes[i])); | |
415 | } | |
416 | return dbPaths; | |
417 | } | |
418 | } | |
419 | ||
420 | @Override | |
421 | public String dbLogDir() { | |
422 | assert(isOwningHandle()); | |
423 | return dbLogDir(nativeHandle_); | |
424 | } | |
425 | ||
426 | @Override | |
427 | public Options setDbLogDir(final String dbLogDir) { | |
428 | assert(isOwningHandle()); | |
429 | setDbLogDir(nativeHandle_, dbLogDir); | |
430 | return this; | |
431 | } | |
432 | ||
433 | @Override | |
434 | public String walDir() { | |
435 | assert(isOwningHandle()); | |
436 | return walDir(nativeHandle_); | |
437 | } | |
438 | ||
439 | @Override | |
440 | public Options setWalDir(final String walDir) { | |
441 | assert(isOwningHandle()); | |
442 | setWalDir(nativeHandle_, walDir); | |
443 | return this; | |
444 | } | |
445 | ||
446 | @Override | |
447 | public long deleteObsoleteFilesPeriodMicros() { | |
448 | assert(isOwningHandle()); | |
449 | return deleteObsoleteFilesPeriodMicros(nativeHandle_); | |
450 | } | |
451 | ||
452 | @Override | |
453 | public Options setDeleteObsoleteFilesPeriodMicros( | |
454 | final long micros) { | |
455 | assert(isOwningHandle()); | |
456 | setDeleteObsoleteFilesPeriodMicros(nativeHandle_, micros); | |
457 | return this; | |
458 | } | |
459 | ||
460 | @Override | |
f67539c2 | 461 | @Deprecated |
7c673cae FG |
462 | public int maxBackgroundCompactions() { |
463 | assert(isOwningHandle()); | |
464 | return maxBackgroundCompactions(nativeHandle_); | |
465 | } | |
466 | ||
467 | @Override | |
11fdf7f2 | 468 | public Options setStatistics(final Statistics statistics) { |
7c673cae | 469 | assert(isOwningHandle()); |
11fdf7f2 | 470 | setStatistics(nativeHandle_, statistics.nativeHandle_); |
7c673cae FG |
471 | return this; |
472 | } | |
473 | ||
474 | @Override | |
11fdf7f2 | 475 | public Statistics statistics() { |
7c673cae | 476 | assert(isOwningHandle()); |
11fdf7f2 TL |
477 | final long statisticsNativeHandle = statistics(nativeHandle_); |
478 | if(statisticsNativeHandle == 0) { | |
479 | return null; | |
480 | } else { | |
481 | return new Statistics(statisticsNativeHandle); | |
7c673cae | 482 | } |
7c673cae FG |
483 | } |
484 | ||
485 | @Override | |
f67539c2 | 486 | @Deprecated |
7c673cae FG |
487 | public void setBaseBackgroundCompactions( |
488 | final int baseBackgroundCompactions) { | |
489 | assert(isOwningHandle()); | |
490 | setBaseBackgroundCompactions(nativeHandle_, baseBackgroundCompactions); | |
491 | } | |
492 | ||
493 | @Override | |
494 | public int baseBackgroundCompactions() { | |
495 | assert(isOwningHandle()); | |
496 | return baseBackgroundCompactions(nativeHandle_); | |
497 | } | |
498 | ||
499 | @Override | |
f67539c2 | 500 | @Deprecated |
7c673cae FG |
501 | public Options setMaxBackgroundCompactions( |
502 | final int maxBackgroundCompactions) { | |
503 | assert(isOwningHandle()); | |
504 | setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions); | |
505 | return this; | |
506 | } | |
507 | ||
508 | @Override | |
494da23a | 509 | public Options setMaxSubcompactions(final int maxSubcompactions) { |
7c673cae FG |
510 | assert(isOwningHandle()); |
511 | setMaxSubcompactions(nativeHandle_, maxSubcompactions); | |
494da23a | 512 | return this; |
7c673cae FG |
513 | } |
514 | ||
515 | @Override | |
516 | public int maxSubcompactions() { | |
517 | assert(isOwningHandle()); | |
518 | return maxSubcompactions(nativeHandle_); | |
519 | } | |
520 | ||
521 | @Override | |
f67539c2 | 522 | @Deprecated |
7c673cae FG |
523 | public int maxBackgroundFlushes() { |
524 | assert(isOwningHandle()); | |
525 | return maxBackgroundFlushes(nativeHandle_); | |
526 | } | |
527 | ||
528 | @Override | |
f67539c2 | 529 | @Deprecated |
7c673cae FG |
530 | public Options setMaxBackgroundFlushes( |
531 | final int maxBackgroundFlushes) { | |
532 | assert(isOwningHandle()); | |
533 | setMaxBackgroundFlushes(nativeHandle_, maxBackgroundFlushes); | |
534 | return this; | |
535 | } | |
536 | ||
11fdf7f2 TL |
537 | @Override |
538 | public int maxBackgroundJobs() { | |
539 | assert(isOwningHandle()); | |
540 | return maxBackgroundJobs(nativeHandle_); | |
541 | } | |
542 | ||
543 | @Override | |
544 | public Options setMaxBackgroundJobs(final int maxBackgroundJobs) { | |
545 | assert(isOwningHandle()); | |
546 | setMaxBackgroundJobs(nativeHandle_, maxBackgroundJobs); | |
547 | return this; | |
548 | } | |
549 | ||
7c673cae FG |
550 | @Override |
551 | public long maxLogFileSize() { | |
552 | assert(isOwningHandle()); | |
553 | return maxLogFileSize(nativeHandle_); | |
554 | } | |
555 | ||
556 | @Override | |
557 | public Options setMaxLogFileSize(final long maxLogFileSize) { | |
558 | assert(isOwningHandle()); | |
559 | setMaxLogFileSize(nativeHandle_, maxLogFileSize); | |
560 | return this; | |
561 | } | |
562 | ||
563 | @Override | |
564 | public long logFileTimeToRoll() { | |
565 | assert(isOwningHandle()); | |
566 | return logFileTimeToRoll(nativeHandle_); | |
567 | } | |
568 | ||
569 | @Override | |
570 | public Options setLogFileTimeToRoll(final long logFileTimeToRoll) { | |
571 | assert(isOwningHandle()); | |
572 | setLogFileTimeToRoll(nativeHandle_, logFileTimeToRoll); | |
573 | return this; | |
574 | } | |
575 | ||
576 | @Override | |
577 | public long keepLogFileNum() { | |
578 | assert(isOwningHandle()); | |
579 | return keepLogFileNum(nativeHandle_); | |
580 | } | |
581 | ||
582 | @Override | |
583 | public Options setKeepLogFileNum(final long keepLogFileNum) { | |
584 | assert(isOwningHandle()); | |
585 | setKeepLogFileNum(nativeHandle_, keepLogFileNum); | |
586 | return this; | |
587 | } | |
588 | ||
589 | ||
590 | @Override | |
591 | public Options setRecycleLogFileNum(final long recycleLogFileNum) { | |
592 | assert(isOwningHandle()); | |
593 | setRecycleLogFileNum(nativeHandle_, recycleLogFileNum); | |
594 | return this; | |
595 | } | |
596 | ||
597 | @Override | |
598 | public long recycleLogFileNum() { | |
599 | assert(isOwningHandle()); | |
600 | return recycleLogFileNum(nativeHandle_); | |
601 | } | |
602 | ||
603 | @Override | |
604 | public long maxManifestFileSize() { | |
605 | assert(isOwningHandle()); | |
606 | return maxManifestFileSize(nativeHandle_); | |
607 | } | |
608 | ||
609 | @Override | |
610 | public Options setMaxManifestFileSize( | |
611 | final long maxManifestFileSize) { | |
612 | assert(isOwningHandle()); | |
613 | setMaxManifestFileSize(nativeHandle_, maxManifestFileSize); | |
614 | return this; | |
615 | } | |
616 | ||
617 | @Override | |
618 | public Options setMaxTableFilesSizeFIFO( | |
619 | final long maxTableFilesSize) { | |
620 | assert(maxTableFilesSize > 0); // unsigned native type | |
621 | assert(isOwningHandle()); | |
622 | setMaxTableFilesSizeFIFO(nativeHandle_, maxTableFilesSize); | |
623 | return this; | |
624 | } | |
625 | ||
626 | @Override | |
627 | public long maxTableFilesSizeFIFO() { | |
628 | return maxTableFilesSizeFIFO(nativeHandle_); | |
629 | } | |
630 | ||
631 | @Override | |
632 | public int tableCacheNumshardbits() { | |
633 | assert(isOwningHandle()); | |
634 | return tableCacheNumshardbits(nativeHandle_); | |
635 | } | |
636 | ||
637 | @Override | |
638 | public Options setTableCacheNumshardbits( | |
639 | final int tableCacheNumshardbits) { | |
640 | assert(isOwningHandle()); | |
641 | setTableCacheNumshardbits(nativeHandle_, tableCacheNumshardbits); | |
642 | return this; | |
643 | } | |
644 | ||
645 | @Override | |
646 | public long walTtlSeconds() { | |
647 | assert(isOwningHandle()); | |
648 | return walTtlSeconds(nativeHandle_); | |
649 | } | |
650 | ||
651 | @Override | |
652 | public Options setWalTtlSeconds(final long walTtlSeconds) { | |
653 | assert(isOwningHandle()); | |
654 | setWalTtlSeconds(nativeHandle_, walTtlSeconds); | |
655 | return this; | |
656 | } | |
657 | ||
658 | @Override | |
659 | public long walSizeLimitMB() { | |
660 | assert(isOwningHandle()); | |
661 | return walSizeLimitMB(nativeHandle_); | |
662 | } | |
663 | ||
20effc67 TL |
664 | @Override |
665 | public Options setMaxWriteBatchGroupSizeBytes(long maxWriteBatchGroupSizeBytes) { | |
666 | setMaxWriteBatchGroupSizeBytes(nativeHandle_, maxWriteBatchGroupSizeBytes); | |
667 | return this; | |
668 | } | |
669 | ||
670 | @Override | |
671 | public long maxWriteBatchGroupSizeBytes() { | |
672 | assert (isOwningHandle()); | |
673 | return maxWriteBatchGroupSizeBytes(nativeHandle_); | |
674 | } | |
675 | ||
7c673cae FG |
676 | @Override |
677 | public Options setWalSizeLimitMB(final long sizeLimitMB) { | |
678 | assert(isOwningHandle()); | |
679 | setWalSizeLimitMB(nativeHandle_, sizeLimitMB); | |
680 | return this; | |
681 | } | |
682 | ||
683 | @Override | |
684 | public long manifestPreallocationSize() { | |
685 | assert(isOwningHandle()); | |
686 | return manifestPreallocationSize(nativeHandle_); | |
687 | } | |
688 | ||
689 | @Override | |
690 | public Options setManifestPreallocationSize(final long size) { | |
691 | assert(isOwningHandle()); | |
692 | setManifestPreallocationSize(nativeHandle_, size); | |
693 | return this; | |
694 | } | |
695 | ||
696 | @Override | |
697 | public Options setUseDirectReads(final boolean useDirectReads) { | |
698 | assert(isOwningHandle()); | |
699 | setUseDirectReads(nativeHandle_, useDirectReads); | |
700 | return this; | |
701 | } | |
702 | ||
703 | @Override | |
704 | public boolean useDirectReads() { | |
705 | assert(isOwningHandle()); | |
706 | return useDirectReads(nativeHandle_); | |
707 | } | |
708 | ||
709 | @Override | |
710 | public Options setUseDirectIoForFlushAndCompaction( | |
711 | final boolean useDirectIoForFlushAndCompaction) { | |
712 | assert(isOwningHandle()); | |
713 | setUseDirectIoForFlushAndCompaction(nativeHandle_, useDirectIoForFlushAndCompaction); | |
714 | return this; | |
715 | } | |
716 | ||
717 | @Override | |
718 | public boolean useDirectIoForFlushAndCompaction() { | |
719 | assert(isOwningHandle()); | |
720 | return useDirectIoForFlushAndCompaction(nativeHandle_); | |
721 | } | |
722 | ||
723 | @Override | |
724 | public Options setAllowFAllocate(final boolean allowFAllocate) { | |
725 | assert(isOwningHandle()); | |
726 | setAllowFAllocate(nativeHandle_, allowFAllocate); | |
727 | return this; | |
728 | } | |
729 | ||
730 | @Override | |
731 | public boolean allowFAllocate() { | |
732 | assert(isOwningHandle()); | |
733 | return allowFAllocate(nativeHandle_); | |
734 | } | |
735 | ||
736 | @Override | |
737 | public boolean allowMmapReads() { | |
738 | assert(isOwningHandle()); | |
739 | return allowMmapReads(nativeHandle_); | |
740 | } | |
741 | ||
742 | @Override | |
743 | public Options setAllowMmapReads(final boolean allowMmapReads) { | |
744 | assert(isOwningHandle()); | |
745 | setAllowMmapReads(nativeHandle_, allowMmapReads); | |
746 | return this; | |
747 | } | |
748 | ||
749 | @Override | |
750 | public boolean allowMmapWrites() { | |
751 | assert(isOwningHandle()); | |
752 | return allowMmapWrites(nativeHandle_); | |
753 | } | |
754 | ||
755 | @Override | |
756 | public Options setAllowMmapWrites(final boolean allowMmapWrites) { | |
757 | assert(isOwningHandle()); | |
758 | setAllowMmapWrites(nativeHandle_, allowMmapWrites); | |
759 | return this; | |
760 | } | |
761 | ||
762 | @Override | |
763 | public boolean isFdCloseOnExec() { | |
764 | assert(isOwningHandle()); | |
765 | return isFdCloseOnExec(nativeHandle_); | |
766 | } | |
767 | ||
768 | @Override | |
769 | public Options setIsFdCloseOnExec(final boolean isFdCloseOnExec) { | |
770 | assert(isOwningHandle()); | |
771 | setIsFdCloseOnExec(nativeHandle_, isFdCloseOnExec); | |
772 | return this; | |
773 | } | |
774 | ||
775 | @Override | |
776 | public int statsDumpPeriodSec() { | |
777 | assert(isOwningHandle()); | |
778 | return statsDumpPeriodSec(nativeHandle_); | |
779 | } | |
780 | ||
781 | @Override | |
782 | public Options setStatsDumpPeriodSec(final int statsDumpPeriodSec) { | |
783 | assert(isOwningHandle()); | |
784 | setStatsDumpPeriodSec(nativeHandle_, statsDumpPeriodSec); | |
785 | return this; | |
786 | } | |
787 | ||
f67539c2 TL |
788 | @Override |
789 | public Options setStatsPersistPeriodSec( | |
790 | final int statsPersistPeriodSec) { | |
791 | assert(isOwningHandle()); | |
792 | setStatsPersistPeriodSec(nativeHandle_, statsPersistPeriodSec); | |
793 | return this; | |
794 | } | |
795 | ||
796 | @Override | |
797 | public int statsPersistPeriodSec() { | |
798 | assert(isOwningHandle()); | |
799 | return statsPersistPeriodSec(nativeHandle_); | |
800 | } | |
801 | ||
802 | @Override | |
803 | public Options setStatsHistoryBufferSize( | |
804 | final long statsHistoryBufferSize) { | |
805 | assert(isOwningHandle()); | |
806 | setStatsHistoryBufferSize(nativeHandle_, statsHistoryBufferSize); | |
807 | return this; | |
808 | } | |
809 | ||
810 | @Override | |
811 | public long statsHistoryBufferSize() { | |
812 | assert(isOwningHandle()); | |
813 | return statsHistoryBufferSize(nativeHandle_); | |
814 | } | |
815 | ||
7c673cae FG |
816 | @Override |
817 | public boolean adviseRandomOnOpen() { | |
818 | return adviseRandomOnOpen(nativeHandle_); | |
819 | } | |
820 | ||
821 | @Override | |
822 | public Options setAdviseRandomOnOpen(final boolean adviseRandomOnOpen) { | |
823 | assert(isOwningHandle()); | |
824 | setAdviseRandomOnOpen(nativeHandle_, adviseRandomOnOpen); | |
825 | return this; | |
826 | } | |
827 | ||
828 | @Override | |
829 | public Options setDbWriteBufferSize(final long dbWriteBufferSize) { | |
830 | assert(isOwningHandle()); | |
831 | setDbWriteBufferSize(nativeHandle_, dbWriteBufferSize); | |
832 | return this; | |
833 | } | |
834 | ||
835 | @Override | |
494da23a TL |
836 | public Options setWriteBufferManager(final WriteBufferManager writeBufferManager) { |
837 | assert(isOwningHandle()); | |
838 | setWriteBufferManager(nativeHandle_, writeBufferManager.nativeHandle_); | |
839 | this.writeBufferManager_ = writeBufferManager; | |
840 | return this; | |
841 | } | |
842 | ||
843 | @Override | |
844 | public WriteBufferManager writeBufferManager() { | |
845 | assert(isOwningHandle()); | |
846 | return this.writeBufferManager_; | |
847 | } | |
848 | ||
849 | @Override | |
7c673cae FG |
850 | public long dbWriteBufferSize() { |
851 | assert(isOwningHandle()); | |
852 | return dbWriteBufferSize(nativeHandle_); | |
853 | } | |
854 | ||
855 | @Override | |
856 | public Options setAccessHintOnCompactionStart(final AccessHint accessHint) { | |
857 | assert(isOwningHandle()); | |
858 | setAccessHintOnCompactionStart(nativeHandle_, accessHint.getValue()); | |
859 | return this; | |
860 | } | |
861 | ||
862 | @Override | |
863 | public AccessHint accessHintOnCompactionStart() { | |
864 | assert(isOwningHandle()); | |
865 | return AccessHint.getAccessHint(accessHintOnCompactionStart(nativeHandle_)); | |
866 | } | |
867 | ||
868 | @Override | |
869 | public Options setNewTableReaderForCompactionInputs( | |
870 | final boolean newTableReaderForCompactionInputs) { | |
871 | assert(isOwningHandle()); | |
872 | setNewTableReaderForCompactionInputs(nativeHandle_, | |
873 | newTableReaderForCompactionInputs); | |
874 | return this; | |
875 | } | |
876 | ||
877 | @Override | |
878 | public boolean newTableReaderForCompactionInputs() { | |
879 | assert(isOwningHandle()); | |
880 | return newTableReaderForCompactionInputs(nativeHandle_); | |
881 | } | |
882 | ||
883 | @Override | |
884 | public Options setCompactionReadaheadSize(final long compactionReadaheadSize) { | |
885 | assert(isOwningHandle()); | |
886 | setCompactionReadaheadSize(nativeHandle_, compactionReadaheadSize); | |
887 | return this; | |
888 | } | |
889 | ||
890 | @Override | |
891 | public long compactionReadaheadSize() { | |
892 | assert(isOwningHandle()); | |
893 | return compactionReadaheadSize(nativeHandle_); | |
894 | } | |
895 | ||
896 | @Override | |
897 | public Options setRandomAccessMaxBufferSize(final long randomAccessMaxBufferSize) { | |
898 | assert(isOwningHandle()); | |
899 | setRandomAccessMaxBufferSize(nativeHandle_, randomAccessMaxBufferSize); | |
900 | return this; | |
901 | } | |
902 | ||
903 | @Override | |
904 | public long randomAccessMaxBufferSize() { | |
905 | assert(isOwningHandle()); | |
906 | return randomAccessMaxBufferSize(nativeHandle_); | |
907 | } | |
908 | ||
909 | @Override | |
910 | public Options setWritableFileMaxBufferSize(final long writableFileMaxBufferSize) { | |
911 | assert(isOwningHandle()); | |
912 | setWritableFileMaxBufferSize(nativeHandle_, writableFileMaxBufferSize); | |
913 | return this; | |
914 | } | |
915 | ||
916 | @Override | |
917 | public long writableFileMaxBufferSize() { | |
918 | assert(isOwningHandle()); | |
919 | return writableFileMaxBufferSize(nativeHandle_); | |
920 | } | |
921 | ||
922 | @Override | |
923 | public boolean useAdaptiveMutex() { | |
924 | assert(isOwningHandle()); | |
925 | return useAdaptiveMutex(nativeHandle_); | |
926 | } | |
927 | ||
928 | @Override | |
929 | public Options setUseAdaptiveMutex(final boolean useAdaptiveMutex) { | |
930 | assert(isOwningHandle()); | |
931 | setUseAdaptiveMutex(nativeHandle_, useAdaptiveMutex); | |
932 | return this; | |
933 | } | |
934 | ||
935 | @Override | |
936 | public long bytesPerSync() { | |
937 | return bytesPerSync(nativeHandle_); | |
938 | } | |
939 | ||
940 | @Override | |
941 | public Options setBytesPerSync(final long bytesPerSync) { | |
942 | assert(isOwningHandle()); | |
943 | setBytesPerSync(nativeHandle_, bytesPerSync); | |
944 | return this; | |
945 | } | |
946 | ||
947 | @Override | |
948 | public Options setWalBytesPerSync(final long walBytesPerSync) { | |
949 | assert(isOwningHandle()); | |
950 | setWalBytesPerSync(nativeHandle_, walBytesPerSync); | |
951 | return this; | |
952 | } | |
953 | ||
954 | @Override | |
955 | public long walBytesPerSync() { | |
956 | assert(isOwningHandle()); | |
957 | return walBytesPerSync(nativeHandle_); | |
958 | } | |
959 | ||
f67539c2 TL |
960 | @Override |
961 | public Options setStrictBytesPerSync(final boolean strictBytesPerSync) { | |
962 | assert(isOwningHandle()); | |
963 | setStrictBytesPerSync(nativeHandle_, strictBytesPerSync); | |
964 | return this; | |
965 | } | |
966 | ||
967 | @Override | |
968 | public boolean strictBytesPerSync() { | |
969 | assert(isOwningHandle()); | |
970 | return strictBytesPerSync(nativeHandle_); | |
971 | } | |
972 | ||
20effc67 TL |
973 | @Override |
974 | public Options setListeners(final List<AbstractEventListener> listeners) { | |
975 | assert (isOwningHandle()); | |
976 | setEventListeners(nativeHandle_, RocksCallbackObject.toNativeHandleList(listeners)); | |
977 | return this; | |
978 | } | |
979 | ||
980 | @Override | |
981 | public List<AbstractEventListener> listeners() { | |
982 | assert (isOwningHandle()); | |
983 | return Arrays.asList(eventListeners(nativeHandle_)); | |
984 | } | |
985 | ||
7c673cae FG |
986 | @Override |
987 | public Options setEnableThreadTracking(final boolean enableThreadTracking) { | |
988 | assert(isOwningHandle()); | |
989 | setEnableThreadTracking(nativeHandle_, enableThreadTracking); | |
990 | return this; | |
991 | } | |
992 | ||
993 | @Override | |
994 | public boolean enableThreadTracking() { | |
995 | assert(isOwningHandle()); | |
996 | return enableThreadTracking(nativeHandle_); | |
997 | } | |
998 | ||
999 | @Override | |
1000 | public Options setDelayedWriteRate(final long delayedWriteRate) { | |
1001 | assert(isOwningHandle()); | |
1002 | setDelayedWriteRate(nativeHandle_, delayedWriteRate); | |
1003 | return this; | |
1004 | } | |
1005 | ||
1006 | @Override | |
1007 | public long delayedWriteRate(){ | |
1008 | return delayedWriteRate(nativeHandle_); | |
1009 | } | |
1010 | ||
494da23a TL |
1011 | @Override |
1012 | public Options setEnablePipelinedWrite(final boolean enablePipelinedWrite) { | |
1013 | setEnablePipelinedWrite(nativeHandle_, enablePipelinedWrite); | |
1014 | return this; | |
1015 | } | |
1016 | ||
1017 | @Override | |
1018 | public boolean enablePipelinedWrite() { | |
1019 | return enablePipelinedWrite(nativeHandle_); | |
1020 | } | |
1021 | ||
f67539c2 TL |
1022 | @Override |
1023 | public Options setUnorderedWrite(final boolean unorderedWrite) { | |
1024 | setUnorderedWrite(nativeHandle_, unorderedWrite); | |
1025 | return this; | |
1026 | } | |
1027 | ||
1028 | @Override | |
1029 | public boolean unorderedWrite() { | |
1030 | return unorderedWrite(nativeHandle_); | |
1031 | } | |
1032 | ||
7c673cae FG |
1033 | @Override |
1034 | public Options setAllowConcurrentMemtableWrite( | |
1035 | final boolean allowConcurrentMemtableWrite) { | |
1036 | setAllowConcurrentMemtableWrite(nativeHandle_, | |
1037 | allowConcurrentMemtableWrite); | |
1038 | return this; | |
1039 | } | |
1040 | ||
1041 | @Override | |
1042 | public boolean allowConcurrentMemtableWrite() { | |
1043 | return allowConcurrentMemtableWrite(nativeHandle_); | |
1044 | } | |
1045 | ||
1046 | @Override | |
1047 | public Options setEnableWriteThreadAdaptiveYield( | |
1048 | final boolean enableWriteThreadAdaptiveYield) { | |
1049 | setEnableWriteThreadAdaptiveYield(nativeHandle_, | |
1050 | enableWriteThreadAdaptiveYield); | |
1051 | return this; | |
1052 | } | |
1053 | ||
1054 | @Override | |
1055 | public boolean enableWriteThreadAdaptiveYield() { | |
1056 | return enableWriteThreadAdaptiveYield(nativeHandle_); | |
1057 | } | |
1058 | ||
1059 | @Override | |
1060 | public Options setWriteThreadMaxYieldUsec(final long writeThreadMaxYieldUsec) { | |
1061 | setWriteThreadMaxYieldUsec(nativeHandle_, writeThreadMaxYieldUsec); | |
1062 | return this; | |
1063 | } | |
1064 | ||
1065 | @Override | |
1066 | public long writeThreadMaxYieldUsec() { | |
1067 | return writeThreadMaxYieldUsec(nativeHandle_); | |
1068 | } | |
1069 | ||
1070 | @Override | |
1071 | public Options setWriteThreadSlowYieldUsec(final long writeThreadSlowYieldUsec) { | |
1072 | setWriteThreadSlowYieldUsec(nativeHandle_, writeThreadSlowYieldUsec); | |
1073 | return this; | |
1074 | } | |
1075 | ||
1076 | @Override | |
1077 | public long writeThreadSlowYieldUsec() { | |
1078 | return writeThreadSlowYieldUsec(nativeHandle_); | |
1079 | } | |
1080 | ||
1081 | @Override | |
1082 | public Options setSkipStatsUpdateOnDbOpen(final boolean skipStatsUpdateOnDbOpen) { | |
1083 | assert(isOwningHandle()); | |
1084 | setSkipStatsUpdateOnDbOpen(nativeHandle_, skipStatsUpdateOnDbOpen); | |
1085 | return this; | |
1086 | } | |
1087 | ||
1088 | @Override | |
1089 | public boolean skipStatsUpdateOnDbOpen() { | |
1090 | assert(isOwningHandle()); | |
1091 | return skipStatsUpdateOnDbOpen(nativeHandle_); | |
1092 | } | |
1093 | ||
20effc67 TL |
1094 | @Override |
1095 | public Options setSkipCheckingSstFileSizesOnDbOpen(boolean skipCheckingSstFileSizesOnDbOpen) { | |
1096 | setSkipCheckingSstFileSizesOnDbOpen(nativeHandle_, skipCheckingSstFileSizesOnDbOpen); | |
1097 | return this; | |
1098 | } | |
1099 | ||
1100 | @Override | |
1101 | public boolean skipCheckingSstFileSizesOnDbOpen() { | |
1102 | assert (isOwningHandle()); | |
1103 | return skipCheckingSstFileSizesOnDbOpen(nativeHandle_); | |
1104 | } | |
1105 | ||
7c673cae FG |
1106 | @Override |
1107 | public Options setWalRecoveryMode(final WALRecoveryMode walRecoveryMode) { | |
1108 | assert(isOwningHandle()); | |
1109 | setWalRecoveryMode(nativeHandle_, walRecoveryMode.getValue()); | |
1110 | return this; | |
1111 | } | |
1112 | ||
1113 | @Override | |
1114 | public WALRecoveryMode walRecoveryMode() { | |
1115 | assert(isOwningHandle()); | |
1116 | return WALRecoveryMode.getWALRecoveryMode(walRecoveryMode(nativeHandle_)); | |
1117 | } | |
1118 | ||
1119 | @Override | |
1120 | public Options setAllow2pc(final boolean allow2pc) { | |
1121 | assert(isOwningHandle()); | |
1122 | setAllow2pc(nativeHandle_, allow2pc); | |
1123 | return this; | |
1124 | } | |
1125 | ||
1126 | @Override | |
1127 | public boolean allow2pc() { | |
1128 | assert(isOwningHandle()); | |
1129 | return allow2pc(nativeHandle_); | |
1130 | } | |
1131 | ||
1132 | @Override | |
1133 | public Options setRowCache(final Cache rowCache) { | |
1134 | assert(isOwningHandle()); | |
1135 | setRowCache(nativeHandle_, rowCache.nativeHandle_); | |
1136 | this.rowCache_ = rowCache; | |
1137 | return this; | |
1138 | } | |
1139 | ||
1140 | @Override | |
1141 | public Cache rowCache() { | |
1142 | assert(isOwningHandle()); | |
1143 | return this.rowCache_; | |
1144 | } | |
1145 | ||
494da23a TL |
1146 | @Override |
1147 | public Options setWalFilter(final AbstractWalFilter walFilter) { | |
1148 | assert(isOwningHandle()); | |
1149 | setWalFilter(nativeHandle_, walFilter.nativeHandle_); | |
1150 | this.walFilter_ = walFilter; | |
1151 | return this; | |
1152 | } | |
1153 | ||
1154 | @Override | |
1155 | public WalFilter walFilter() { | |
1156 | assert(isOwningHandle()); | |
1157 | return this.walFilter_; | |
1158 | } | |
1159 | ||
7c673cae FG |
1160 | @Override |
1161 | public Options setFailIfOptionsFileError(final boolean failIfOptionsFileError) { | |
1162 | assert(isOwningHandle()); | |
1163 | setFailIfOptionsFileError(nativeHandle_, failIfOptionsFileError); | |
1164 | return this; | |
1165 | } | |
1166 | ||
1167 | @Override | |
1168 | public boolean failIfOptionsFileError() { | |
1169 | assert(isOwningHandle()); | |
1170 | return failIfOptionsFileError(nativeHandle_); | |
1171 | } | |
1172 | ||
1173 | @Override | |
1174 | public Options setDumpMallocStats(final boolean dumpMallocStats) { | |
1175 | assert(isOwningHandle()); | |
1176 | setDumpMallocStats(nativeHandle_, dumpMallocStats); | |
1177 | return this; | |
1178 | } | |
1179 | ||
1180 | @Override | |
1181 | public boolean dumpMallocStats() { | |
1182 | assert(isOwningHandle()); | |
1183 | return dumpMallocStats(nativeHandle_); | |
1184 | } | |
1185 | ||
1186 | @Override | |
1187 | public Options setAvoidFlushDuringRecovery(final boolean avoidFlushDuringRecovery) { | |
1188 | assert(isOwningHandle()); | |
1189 | setAvoidFlushDuringRecovery(nativeHandle_, avoidFlushDuringRecovery); | |
1190 | return this; | |
1191 | } | |
1192 | ||
1193 | @Override | |
1194 | public boolean avoidFlushDuringRecovery() { | |
1195 | assert(isOwningHandle()); | |
1196 | return avoidFlushDuringRecovery(nativeHandle_); | |
1197 | } | |
1198 | ||
1199 | @Override | |
1200 | public Options setAvoidFlushDuringShutdown(final boolean avoidFlushDuringShutdown) { | |
1201 | assert(isOwningHandle()); | |
1202 | setAvoidFlushDuringShutdown(nativeHandle_, avoidFlushDuringShutdown); | |
1203 | return this; | |
1204 | } | |
1205 | ||
1206 | @Override | |
1207 | public boolean avoidFlushDuringShutdown() { | |
1208 | assert(isOwningHandle()); | |
1209 | return avoidFlushDuringShutdown(nativeHandle_); | |
1210 | } | |
1211 | ||
494da23a TL |
1212 | @Override |
1213 | public Options setAllowIngestBehind(final boolean allowIngestBehind) { | |
1214 | assert(isOwningHandle()); | |
1215 | setAllowIngestBehind(nativeHandle_, allowIngestBehind); | |
1216 | return this; | |
1217 | } | |
1218 | ||
1219 | @Override | |
1220 | public boolean allowIngestBehind() { | |
1221 | assert(isOwningHandle()); | |
1222 | return allowIngestBehind(nativeHandle_); | |
1223 | } | |
1224 | ||
1225 | @Override | |
1226 | public Options setPreserveDeletes(final boolean preserveDeletes) { | |
1227 | assert(isOwningHandle()); | |
1228 | setPreserveDeletes(nativeHandle_, preserveDeletes); | |
1229 | return this; | |
1230 | } | |
1231 | ||
1232 | @Override | |
1233 | public boolean preserveDeletes() { | |
1234 | assert(isOwningHandle()); | |
1235 | return preserveDeletes(nativeHandle_); | |
1236 | } | |
1237 | ||
1238 | @Override | |
1239 | public Options setTwoWriteQueues(final boolean twoWriteQueues) { | |
1240 | assert(isOwningHandle()); | |
1241 | setTwoWriteQueues(nativeHandle_, twoWriteQueues); | |
1242 | return this; | |
1243 | } | |
1244 | ||
1245 | @Override | |
1246 | public boolean twoWriteQueues() { | |
1247 | assert(isOwningHandle()); | |
1248 | return twoWriteQueues(nativeHandle_); | |
1249 | } | |
1250 | ||
1251 | @Override | |
1252 | public Options setManualWalFlush(final boolean manualWalFlush) { | |
1253 | assert(isOwningHandle()); | |
1254 | setManualWalFlush(nativeHandle_, manualWalFlush); | |
1255 | return this; | |
1256 | } | |
1257 | ||
1258 | @Override | |
1259 | public boolean manualWalFlush() { | |
1260 | assert(isOwningHandle()); | |
1261 | return manualWalFlush(nativeHandle_); | |
1262 | } | |
1263 | ||
7c673cae FG |
1264 | @Override |
1265 | public MemTableConfig memTableConfig() { | |
1266 | return this.memTableConfig_; | |
1267 | } | |
1268 | ||
1269 | @Override | |
1270 | public Options setMemTableConfig(final MemTableConfig config) { | |
1271 | memTableConfig_ = config; | |
1272 | setMemTableFactory(nativeHandle_, config.newMemTableFactoryHandle()); | |
1273 | return this; | |
1274 | } | |
1275 | ||
1276 | @Override | |
1277 | public Options setRateLimiter(final RateLimiter rateLimiter) { | |
1278 | assert(isOwningHandle()); | |
1279 | rateLimiter_ = rateLimiter; | |
1280 | setRateLimiter(nativeHandle_, rateLimiter.nativeHandle_); | |
1281 | return this; | |
1282 | } | |
1283 | ||
11fdf7f2 TL |
1284 | @Override |
1285 | public Options setSstFileManager(final SstFileManager sstFileManager) { | |
1286 | assert(isOwningHandle()); | |
1287 | setSstFileManager(nativeHandle_, sstFileManager.nativeHandle_); | |
1288 | return this; | |
1289 | } | |
1290 | ||
7c673cae FG |
1291 | @Override |
1292 | public Options setLogger(final Logger logger) { | |
1293 | assert(isOwningHandle()); | |
1294 | setLogger(nativeHandle_, logger.nativeHandle_); | |
1295 | return this; | |
1296 | } | |
1297 | ||
1298 | @Override | |
1299 | public Options setInfoLogLevel(final InfoLogLevel infoLogLevel) { | |
1300 | assert(isOwningHandle()); | |
1301 | setInfoLogLevel(nativeHandle_, infoLogLevel.getValue()); | |
1302 | return this; | |
1303 | } | |
1304 | ||
1305 | @Override | |
1306 | public InfoLogLevel infoLogLevel() { | |
1307 | assert(isOwningHandle()); | |
1308 | return InfoLogLevel.getInfoLogLevel( | |
1309 | infoLogLevel(nativeHandle_)); | |
1310 | } | |
1311 | ||
1312 | @Override | |
1313 | public String memTableFactoryName() { | |
1314 | assert(isOwningHandle()); | |
1315 | return memTableFactoryName(nativeHandle_); | |
1316 | } | |
1317 | ||
1318 | @Override | |
1319 | public TableFormatConfig tableFormatConfig() { | |
1320 | return this.tableFormatConfig_; | |
1321 | } | |
1322 | ||
1323 | @Override | |
1324 | public Options setTableFormatConfig(final TableFormatConfig config) { | |
1325 | tableFormatConfig_ = config; | |
1326 | setTableFactory(nativeHandle_, config.newTableFactoryHandle()); | |
1327 | return this; | |
1328 | } | |
1329 | ||
1330 | @Override | |
1331 | public String tableFactoryName() { | |
1332 | assert(isOwningHandle()); | |
1333 | return tableFactoryName(nativeHandle_); | |
1334 | } | |
1335 | ||
20effc67 TL |
1336 | @Override |
1337 | public Options setCfPaths(final Collection<DbPath> cfPaths) { | |
1338 | assert (isOwningHandle()); | |
1339 | ||
1340 | final int len = cfPaths.size(); | |
1341 | final String paths[] = new String[len]; | |
1342 | final long targetSizes[] = new long[len]; | |
1343 | ||
1344 | int i = 0; | |
1345 | for (final DbPath dbPath : cfPaths) { | |
1346 | paths[i] = dbPath.path.toString(); | |
1347 | targetSizes[i] = dbPath.targetSize; | |
1348 | i++; | |
1349 | } | |
1350 | setCfPaths(nativeHandle_, paths, targetSizes); | |
1351 | return this; | |
1352 | } | |
1353 | ||
1354 | @Override | |
1355 | public List<DbPath> cfPaths() { | |
1356 | final int len = (int) cfPathsLen(nativeHandle_); | |
1357 | ||
1358 | if (len == 0) { | |
1359 | return Collections.emptyList(); | |
1360 | } | |
1361 | ||
1362 | final String paths[] = new String[len]; | |
1363 | final long targetSizes[] = new long[len]; | |
1364 | ||
1365 | cfPaths(nativeHandle_, paths, targetSizes); | |
1366 | ||
1367 | final List<DbPath> cfPaths = new ArrayList<>(); | |
1368 | for (int i = 0; i < len; i++) { | |
1369 | cfPaths.add(new DbPath(Paths.get(paths[i]), targetSizes[i])); | |
1370 | } | |
1371 | ||
1372 | return cfPaths; | |
1373 | } | |
1374 | ||
7c673cae FG |
1375 | @Override |
1376 | public Options useFixedLengthPrefixExtractor(final int n) { | |
1377 | assert(isOwningHandle()); | |
1378 | useFixedLengthPrefixExtractor(nativeHandle_, n); | |
1379 | return this; | |
1380 | } | |
1381 | ||
1382 | @Override | |
1383 | public Options useCappedPrefixExtractor(final int n) { | |
1384 | assert(isOwningHandle()); | |
1385 | useCappedPrefixExtractor(nativeHandle_, n); | |
1386 | return this; | |
1387 | } | |
1388 | ||
1389 | @Override | |
1390 | public CompressionType compressionType() { | |
1391 | return CompressionType.getCompressionType(compressionType(nativeHandle_)); | |
1392 | } | |
1393 | ||
1394 | @Override | |
1395 | public Options setCompressionPerLevel( | |
1396 | final List<CompressionType> compressionLevels) { | |
1397 | final byte[] byteCompressionTypes = new byte[ | |
1398 | compressionLevels.size()]; | |
1399 | for (int i = 0; i < compressionLevels.size(); i++) { | |
1400 | byteCompressionTypes[i] = compressionLevels.get(i).getValue(); | |
1401 | } | |
1402 | setCompressionPerLevel(nativeHandle_, byteCompressionTypes); | |
1403 | return this; | |
1404 | } | |
1405 | ||
1406 | @Override | |
1407 | public List<CompressionType> compressionPerLevel() { | |
1408 | final byte[] byteCompressionTypes = | |
1409 | compressionPerLevel(nativeHandle_); | |
1410 | final List<CompressionType> compressionLevels = new ArrayList<>(); | |
1411 | for (final Byte byteCompressionType : byteCompressionTypes) { | |
1412 | compressionLevels.add(CompressionType.getCompressionType( | |
1413 | byteCompressionType)); | |
1414 | } | |
1415 | return compressionLevels; | |
1416 | } | |
1417 | ||
1418 | @Override | |
1419 | public Options setCompressionType(CompressionType compressionType) { | |
1420 | setCompressionType(nativeHandle_, compressionType.getValue()); | |
1421 | return this; | |
1422 | } | |
1423 | ||
1424 | ||
1425 | @Override | |
1426 | public Options setBottommostCompressionType( | |
1427 | final CompressionType bottommostCompressionType) { | |
1428 | setBottommostCompressionType(nativeHandle_, | |
1429 | bottommostCompressionType.getValue()); | |
1430 | return this; | |
1431 | } | |
1432 | ||
1433 | @Override | |
1434 | public CompressionType bottommostCompressionType() { | |
1435 | return CompressionType.getCompressionType( | |
1436 | bottommostCompressionType(nativeHandle_)); | |
1437 | } | |
1438 | ||
494da23a TL |
1439 | @Override |
1440 | public Options setBottommostCompressionOptions( | |
1441 | final CompressionOptions bottommostCompressionOptions) { | |
1442 | setBottommostCompressionOptions(nativeHandle_, | |
1443 | bottommostCompressionOptions.nativeHandle_); | |
1444 | this.bottommostCompressionOptions_ = bottommostCompressionOptions; | |
1445 | return this; | |
1446 | } | |
1447 | ||
1448 | @Override | |
1449 | public CompressionOptions bottommostCompressionOptions() { | |
1450 | return this.bottommostCompressionOptions_; | |
1451 | } | |
1452 | ||
7c673cae FG |
1453 | @Override |
1454 | public Options setCompressionOptions( | |
1455 | final CompressionOptions compressionOptions) { | |
1456 | setCompressionOptions(nativeHandle_, compressionOptions.nativeHandle_); | |
1457 | this.compressionOptions_ = compressionOptions; | |
1458 | return this; | |
1459 | } | |
1460 | ||
1461 | @Override | |
1462 | public CompressionOptions compressionOptions() { | |
1463 | return this.compressionOptions_; | |
1464 | } | |
1465 | ||
1466 | @Override | |
1467 | public CompactionStyle compactionStyle() { | |
494da23a | 1468 | return CompactionStyle.fromValue(compactionStyle(nativeHandle_)); |
7c673cae FG |
1469 | } |
1470 | ||
1471 | @Override | |
1472 | public Options setCompactionStyle( | |
1473 | final CompactionStyle compactionStyle) { | |
1474 | setCompactionStyle(nativeHandle_, compactionStyle.getValue()); | |
1475 | return this; | |
1476 | } | |
1477 | ||
1478 | @Override | |
1479 | public int numLevels() { | |
1480 | return numLevels(nativeHandle_); | |
1481 | } | |
1482 | ||
1483 | @Override | |
1484 | public Options setNumLevels(int numLevels) { | |
1485 | setNumLevels(nativeHandle_, numLevels); | |
1486 | return this; | |
1487 | } | |
1488 | ||
1489 | @Override | |
1490 | public int levelZeroFileNumCompactionTrigger() { | |
1491 | return levelZeroFileNumCompactionTrigger(nativeHandle_); | |
1492 | } | |
1493 | ||
1494 | @Override | |
1495 | public Options setLevelZeroFileNumCompactionTrigger( | |
1496 | final int numFiles) { | |
1497 | setLevelZeroFileNumCompactionTrigger( | |
1498 | nativeHandle_, numFiles); | |
1499 | return this; | |
1500 | } | |
1501 | ||
1502 | @Override | |
1503 | public int levelZeroSlowdownWritesTrigger() { | |
1504 | return levelZeroSlowdownWritesTrigger(nativeHandle_); | |
1505 | } | |
1506 | ||
1507 | @Override | |
1508 | public Options setLevelZeroSlowdownWritesTrigger( | |
1509 | final int numFiles) { | |
1510 | setLevelZeroSlowdownWritesTrigger(nativeHandle_, numFiles); | |
1511 | return this; | |
1512 | } | |
1513 | ||
1514 | @Override | |
1515 | public int levelZeroStopWritesTrigger() { | |
1516 | return levelZeroStopWritesTrigger(nativeHandle_); | |
1517 | } | |
1518 | ||
1519 | @Override | |
1520 | public Options setLevelZeroStopWritesTrigger( | |
1521 | final int numFiles) { | |
1522 | setLevelZeroStopWritesTrigger(nativeHandle_, numFiles); | |
1523 | return this; | |
1524 | } | |
1525 | ||
1526 | @Override | |
1527 | public long targetFileSizeBase() { | |
1528 | return targetFileSizeBase(nativeHandle_); | |
1529 | } | |
1530 | ||
1531 | @Override | |
1532 | public Options setTargetFileSizeBase(long targetFileSizeBase) { | |
1533 | setTargetFileSizeBase(nativeHandle_, targetFileSizeBase); | |
1534 | return this; | |
1535 | } | |
1536 | ||
1537 | @Override | |
1538 | public int targetFileSizeMultiplier() { | |
1539 | return targetFileSizeMultiplier(nativeHandle_); | |
1540 | } | |
1541 | ||
1542 | @Override | |
1543 | public Options setTargetFileSizeMultiplier(int multiplier) { | |
1544 | setTargetFileSizeMultiplier(nativeHandle_, multiplier); | |
1545 | return this; | |
1546 | } | |
1547 | ||
1548 | @Override | |
1549 | public Options setMaxBytesForLevelBase(final long maxBytesForLevelBase) { | |
1550 | setMaxBytesForLevelBase(nativeHandle_, maxBytesForLevelBase); | |
1551 | return this; | |
1552 | } | |
1553 | ||
1554 | @Override | |
1555 | public long maxBytesForLevelBase() { | |
1556 | return maxBytesForLevelBase(nativeHandle_); | |
1557 | } | |
1558 | ||
1559 | @Override | |
1560 | public Options setLevelCompactionDynamicLevelBytes( | |
1561 | final boolean enableLevelCompactionDynamicLevelBytes) { | |
1562 | setLevelCompactionDynamicLevelBytes(nativeHandle_, | |
1563 | enableLevelCompactionDynamicLevelBytes); | |
1564 | return this; | |
1565 | } | |
1566 | ||
1567 | @Override | |
1568 | public boolean levelCompactionDynamicLevelBytes() { | |
1569 | return levelCompactionDynamicLevelBytes(nativeHandle_); | |
1570 | } | |
1571 | ||
1572 | @Override | |
1573 | public double maxBytesForLevelMultiplier() { | |
1574 | return maxBytesForLevelMultiplier(nativeHandle_); | |
1575 | } | |
1576 | ||
1577 | @Override | |
1578 | public Options setMaxBytesForLevelMultiplier(final double multiplier) { | |
1579 | setMaxBytesForLevelMultiplier(nativeHandle_, multiplier); | |
1580 | return this; | |
1581 | } | |
1582 | ||
1583 | @Override | |
1584 | public long maxCompactionBytes() { | |
1585 | return maxCompactionBytes(nativeHandle_); | |
1586 | } | |
1587 | ||
1588 | @Override | |
1589 | public Options setMaxCompactionBytes(final long maxCompactionBytes) { | |
1590 | setMaxCompactionBytes(nativeHandle_, maxCompactionBytes); | |
1591 | return this; | |
1592 | } | |
1593 | ||
1594 | @Override | |
1595 | public long arenaBlockSize() { | |
1596 | return arenaBlockSize(nativeHandle_); | |
1597 | } | |
1598 | ||
1599 | @Override | |
1600 | public Options setArenaBlockSize(final long arenaBlockSize) { | |
1601 | setArenaBlockSize(nativeHandle_, arenaBlockSize); | |
1602 | return this; | |
1603 | } | |
1604 | ||
1605 | @Override | |
1606 | public boolean disableAutoCompactions() { | |
1607 | return disableAutoCompactions(nativeHandle_); | |
1608 | } | |
1609 | ||
1610 | @Override | |
1611 | public Options setDisableAutoCompactions( | |
1612 | final boolean disableAutoCompactions) { | |
1613 | setDisableAutoCompactions(nativeHandle_, disableAutoCompactions); | |
1614 | return this; | |
1615 | } | |
1616 | ||
1617 | @Override | |
1618 | public long maxSequentialSkipInIterations() { | |
1619 | return maxSequentialSkipInIterations(nativeHandle_); | |
1620 | } | |
1621 | ||
1622 | @Override | |
1623 | public Options setMaxSequentialSkipInIterations( | |
1624 | final long maxSequentialSkipInIterations) { | |
1625 | setMaxSequentialSkipInIterations(nativeHandle_, | |
1626 | maxSequentialSkipInIterations); | |
1627 | return this; | |
1628 | } | |
1629 | ||
1630 | @Override | |
1631 | public boolean inplaceUpdateSupport() { | |
1632 | return inplaceUpdateSupport(nativeHandle_); | |
1633 | } | |
1634 | ||
1635 | @Override | |
1636 | public Options setInplaceUpdateSupport( | |
1637 | final boolean inplaceUpdateSupport) { | |
1638 | setInplaceUpdateSupport(nativeHandle_, inplaceUpdateSupport); | |
1639 | return this; | |
1640 | } | |
1641 | ||
1642 | @Override | |
1643 | public long inplaceUpdateNumLocks() { | |
1644 | return inplaceUpdateNumLocks(nativeHandle_); | |
1645 | } | |
1646 | ||
1647 | @Override | |
1648 | public Options setInplaceUpdateNumLocks( | |
1649 | final long inplaceUpdateNumLocks) { | |
1650 | setInplaceUpdateNumLocks(nativeHandle_, inplaceUpdateNumLocks); | |
1651 | return this; | |
1652 | } | |
1653 | ||
1654 | @Override | |
1655 | public double memtablePrefixBloomSizeRatio() { | |
1656 | return memtablePrefixBloomSizeRatio(nativeHandle_); | |
1657 | } | |
1658 | ||
1659 | @Override | |
1660 | public Options setMemtablePrefixBloomSizeRatio(final double memtablePrefixBloomSizeRatio) { | |
1661 | setMemtablePrefixBloomSizeRatio(nativeHandle_, memtablePrefixBloomSizeRatio); | |
1662 | return this; | |
1663 | } | |
1664 | ||
1665 | @Override | |
1666 | public int bloomLocality() { | |
1667 | return bloomLocality(nativeHandle_); | |
1668 | } | |
1669 | ||
1670 | @Override | |
1671 | public Options setBloomLocality(final int bloomLocality) { | |
1672 | setBloomLocality(nativeHandle_, bloomLocality); | |
1673 | return this; | |
1674 | } | |
1675 | ||
1676 | @Override | |
1677 | public long maxSuccessiveMerges() { | |
1678 | return maxSuccessiveMerges(nativeHandle_); | |
1679 | } | |
1680 | ||
1681 | @Override | |
1682 | public Options setMaxSuccessiveMerges(long maxSuccessiveMerges) { | |
1683 | setMaxSuccessiveMerges(nativeHandle_, maxSuccessiveMerges); | |
1684 | return this; | |
1685 | } | |
1686 | ||
1687 | @Override | |
1688 | public int minWriteBufferNumberToMerge() { | |
1689 | return minWriteBufferNumberToMerge(nativeHandle_); | |
1690 | } | |
1691 | ||
1692 | @Override | |
1693 | public Options setMinWriteBufferNumberToMerge( | |
1694 | final int minWriteBufferNumberToMerge) { | |
1695 | setMinWriteBufferNumberToMerge(nativeHandle_, minWriteBufferNumberToMerge); | |
1696 | return this; | |
1697 | } | |
1698 | ||
1699 | @Override | |
1700 | public Options setOptimizeFiltersForHits( | |
1701 | final boolean optimizeFiltersForHits) { | |
1702 | setOptimizeFiltersForHits(nativeHandle_, optimizeFiltersForHits); | |
1703 | return this; | |
1704 | } | |
1705 | ||
1706 | @Override | |
1707 | public boolean optimizeFiltersForHits() { | |
1708 | return optimizeFiltersForHits(nativeHandle_); | |
1709 | } | |
1710 | ||
1711 | @Override | |
1712 | public Options | |
1713 | setMemtableHugePageSize( | |
1714 | long memtableHugePageSize) { | |
1715 | setMemtableHugePageSize(nativeHandle_, | |
1716 | memtableHugePageSize); | |
1717 | return this; | |
1718 | } | |
1719 | ||
1720 | @Override | |
1721 | public long memtableHugePageSize() { | |
1722 | return memtableHugePageSize(nativeHandle_); | |
1723 | } | |
1724 | ||
1725 | @Override | |
1726 | public Options setSoftPendingCompactionBytesLimit(long softPendingCompactionBytesLimit) { | |
1727 | setSoftPendingCompactionBytesLimit(nativeHandle_, | |
1728 | softPendingCompactionBytesLimit); | |
1729 | return this; | |
1730 | } | |
1731 | ||
1732 | @Override | |
1733 | public long softPendingCompactionBytesLimit() { | |
1734 | return softPendingCompactionBytesLimit(nativeHandle_); | |
1735 | } | |
1736 | ||
1737 | @Override | |
1738 | public Options setHardPendingCompactionBytesLimit(long hardPendingCompactionBytesLimit) { | |
1739 | setHardPendingCompactionBytesLimit(nativeHandle_, hardPendingCompactionBytesLimit); | |
1740 | return this; | |
1741 | } | |
1742 | ||
1743 | @Override | |
1744 | public long hardPendingCompactionBytesLimit() { | |
1745 | return hardPendingCompactionBytesLimit(nativeHandle_); | |
1746 | } | |
1747 | ||
1748 | @Override | |
1749 | public Options setLevel0FileNumCompactionTrigger(int level0FileNumCompactionTrigger) { | |
1750 | setLevel0FileNumCompactionTrigger(nativeHandle_, level0FileNumCompactionTrigger); | |
1751 | return this; | |
1752 | } | |
1753 | ||
1754 | @Override | |
1755 | public int level0FileNumCompactionTrigger() { | |
1756 | return level0FileNumCompactionTrigger(nativeHandle_); | |
1757 | } | |
1758 | ||
1759 | @Override | |
1760 | public Options setLevel0SlowdownWritesTrigger(int level0SlowdownWritesTrigger) { | |
1761 | setLevel0SlowdownWritesTrigger(nativeHandle_, level0SlowdownWritesTrigger); | |
1762 | return this; | |
1763 | } | |
1764 | ||
1765 | @Override | |
1766 | public int level0SlowdownWritesTrigger() { | |
1767 | return level0SlowdownWritesTrigger(nativeHandle_); | |
1768 | } | |
1769 | ||
1770 | @Override | |
1771 | public Options setLevel0StopWritesTrigger(int level0StopWritesTrigger) { | |
1772 | setLevel0StopWritesTrigger(nativeHandle_, level0StopWritesTrigger); | |
1773 | return this; | |
1774 | } | |
1775 | ||
1776 | @Override | |
1777 | public int level0StopWritesTrigger() { | |
1778 | return level0StopWritesTrigger(nativeHandle_); | |
1779 | } | |
1780 | ||
1781 | @Override | |
1782 | public Options setMaxBytesForLevelMultiplierAdditional(int[] maxBytesForLevelMultiplierAdditional) { | |
1783 | setMaxBytesForLevelMultiplierAdditional(nativeHandle_, maxBytesForLevelMultiplierAdditional); | |
1784 | return this; | |
1785 | } | |
1786 | ||
1787 | @Override | |
1788 | public int[] maxBytesForLevelMultiplierAdditional() { | |
1789 | return maxBytesForLevelMultiplierAdditional(nativeHandle_); | |
1790 | } | |
1791 | ||
1792 | @Override | |
1793 | public Options setParanoidFileChecks(boolean paranoidFileChecks) { | |
1794 | setParanoidFileChecks(nativeHandle_, paranoidFileChecks); | |
1795 | return this; | |
1796 | } | |
1797 | ||
1798 | @Override | |
1799 | public boolean paranoidFileChecks() { | |
1800 | return paranoidFileChecks(nativeHandle_); | |
1801 | } | |
1802 | ||
1803 | @Override | |
1804 | public Options setMaxWriteBufferNumberToMaintain( | |
1805 | final int maxWriteBufferNumberToMaintain) { | |
1806 | setMaxWriteBufferNumberToMaintain( | |
1807 | nativeHandle_, maxWriteBufferNumberToMaintain); | |
1808 | return this; | |
1809 | } | |
1810 | ||
1811 | @Override | |
1812 | public int maxWriteBufferNumberToMaintain() { | |
1813 | return maxWriteBufferNumberToMaintain(nativeHandle_); | |
1814 | } | |
1815 | ||
1816 | @Override | |
1817 | public Options setCompactionPriority( | |
1818 | final CompactionPriority compactionPriority) { | |
1819 | setCompactionPriority(nativeHandle_, compactionPriority.getValue()); | |
1820 | return this; | |
1821 | } | |
1822 | ||
1823 | @Override | |
1824 | public CompactionPriority compactionPriority() { | |
1825 | return CompactionPriority.getCompactionPriority( | |
1826 | compactionPriority(nativeHandle_)); | |
1827 | } | |
1828 | ||
1829 | @Override | |
1830 | public Options setReportBgIoStats(final boolean reportBgIoStats) { | |
1831 | setReportBgIoStats(nativeHandle_, reportBgIoStats); | |
1832 | return this; | |
1833 | } | |
1834 | ||
1835 | @Override | |
1836 | public boolean reportBgIoStats() { | |
1837 | return reportBgIoStats(nativeHandle_); | |
1838 | } | |
1839 | ||
494da23a TL |
1840 | @Override |
1841 | public Options setTtl(final long ttl) { | |
1842 | setTtl(nativeHandle_, ttl); | |
1843 | return this; | |
1844 | } | |
1845 | ||
1846 | @Override | |
1847 | public long ttl() { | |
1848 | return ttl(nativeHandle_); | |
1849 | } | |
1850 | ||
7c673cae FG |
1851 | @Override |
1852 | public Options setCompactionOptionsUniversal( | |
1853 | final CompactionOptionsUniversal compactionOptionsUniversal) { | |
1854 | setCompactionOptionsUniversal(nativeHandle_, | |
1855 | compactionOptionsUniversal.nativeHandle_); | |
1856 | this.compactionOptionsUniversal_ = compactionOptionsUniversal; | |
1857 | return this; | |
1858 | } | |
1859 | ||
1860 | @Override | |
1861 | public CompactionOptionsUniversal compactionOptionsUniversal() { | |
1862 | return this.compactionOptionsUniversal_; | |
1863 | } | |
1864 | ||
1865 | @Override | |
1866 | public Options setCompactionOptionsFIFO(final CompactionOptionsFIFO compactionOptionsFIFO) { | |
1867 | setCompactionOptionsFIFO(nativeHandle_, | |
1868 | compactionOptionsFIFO.nativeHandle_); | |
1869 | this.compactionOptionsFIFO_ = compactionOptionsFIFO; | |
1870 | return this; | |
1871 | } | |
1872 | ||
1873 | @Override | |
1874 | public CompactionOptionsFIFO compactionOptionsFIFO() { | |
1875 | return this.compactionOptionsFIFO_; | |
1876 | } | |
1877 | ||
1878 | @Override | |
1879 | public Options setForceConsistencyChecks(final boolean forceConsistencyChecks) { | |
1880 | setForceConsistencyChecks(nativeHandle_, forceConsistencyChecks); | |
1881 | return this; | |
1882 | } | |
1883 | ||
1884 | @Override | |
1885 | public boolean forceConsistencyChecks() { | |
1886 | return forceConsistencyChecks(nativeHandle_); | |
1887 | } | |
1888 | ||
494da23a TL |
1889 | @Override |
1890 | public Options setAtomicFlush(final boolean atomicFlush) { | |
1891 | setAtomicFlush(nativeHandle_, atomicFlush); | |
1892 | return this; | |
1893 | } | |
1894 | ||
1895 | @Override | |
1896 | public boolean atomicFlush() { | |
1897 | return atomicFlush(nativeHandle_); | |
1898 | } | |
1899 | ||
20effc67 TL |
1900 | @Override |
1901 | public Options setAvoidUnnecessaryBlockingIO(boolean avoidUnnecessaryBlockingIO) { | |
1902 | setAvoidUnnecessaryBlockingIO(nativeHandle_, avoidUnnecessaryBlockingIO); | |
1903 | return this; | |
1904 | } | |
1905 | ||
1906 | @Override | |
1907 | public boolean avoidUnnecessaryBlockingIO() { | |
1908 | assert (isOwningHandle()); | |
1909 | return avoidUnnecessaryBlockingIO(nativeHandle_); | |
1910 | } | |
1911 | ||
1912 | @Override | |
1913 | public Options setPersistStatsToDisk(boolean persistStatsToDisk) { | |
1914 | setPersistStatsToDisk(nativeHandle_, persistStatsToDisk); | |
1915 | return this; | |
1916 | } | |
1917 | ||
1918 | @Override | |
1919 | public boolean persistStatsToDisk() { | |
1920 | assert (isOwningHandle()); | |
1921 | return persistStatsToDisk(nativeHandle_); | |
1922 | } | |
1923 | ||
1924 | @Override | |
1925 | public Options setWriteDbidToManifest(boolean writeDbidToManifest) { | |
1926 | setWriteDbidToManifest(nativeHandle_, writeDbidToManifest); | |
1927 | return this; | |
1928 | } | |
1929 | ||
1930 | @Override | |
1931 | public boolean writeDbidToManifest() { | |
1932 | assert (isOwningHandle()); | |
1933 | return writeDbidToManifest(nativeHandle_); | |
1934 | } | |
1935 | ||
1936 | @Override | |
1937 | public Options setLogReadaheadSize(long logReadaheadSize) { | |
1938 | setLogReadaheadSize(nativeHandle_, logReadaheadSize); | |
1939 | return this; | |
1940 | } | |
1941 | ||
1942 | @Override | |
1943 | public long logReadaheadSize() { | |
1944 | assert (isOwningHandle()); | |
1945 | return logReadaheadSize(nativeHandle_); | |
1946 | } | |
1947 | ||
1948 | @Override | |
1949 | public Options setBestEffortsRecovery(boolean bestEffortsRecovery) { | |
1950 | setBestEffortsRecovery(nativeHandle_, bestEffortsRecovery); | |
1951 | return this; | |
1952 | } | |
1953 | ||
1954 | @Override | |
1955 | public boolean bestEffortsRecovery() { | |
1956 | assert (isOwningHandle()); | |
1957 | return bestEffortsRecovery(nativeHandle_); | |
1958 | } | |
1959 | ||
1960 | @Override | |
1961 | public Options setMaxBgErrorResumeCount(int maxBgerrorResumeCount) { | |
1962 | setMaxBgErrorResumeCount(nativeHandle_, maxBgerrorResumeCount); | |
1963 | return this; | |
1964 | } | |
1965 | ||
1966 | @Override | |
1967 | public int maxBgerrorResumeCount() { | |
1968 | assert (isOwningHandle()); | |
1969 | return maxBgerrorResumeCount(nativeHandle_); | |
1970 | } | |
1971 | ||
1972 | @Override | |
1973 | public Options setBgerrorResumeRetryInterval(long bgerrorResumeRetryInterval) { | |
1974 | setBgerrorResumeRetryInterval(nativeHandle_, bgerrorResumeRetryInterval); | |
1975 | return this; | |
1976 | } | |
1977 | ||
1978 | @Override | |
1979 | public long bgerrorResumeRetryInterval() { | |
1980 | assert (isOwningHandle()); | |
1981 | return bgerrorResumeRetryInterval(nativeHandle_); | |
1982 | } | |
1983 | ||
1984 | @Override | |
1985 | public Options setSstPartitionerFactory(SstPartitionerFactory sstPartitionerFactory) { | |
1986 | setSstPartitionerFactory(nativeHandle_, sstPartitionerFactory.nativeHandle_); | |
1987 | this.sstPartitionerFactory_ = sstPartitionerFactory; | |
1988 | return this; | |
1989 | } | |
1990 | ||
1991 | @Override | |
1992 | public SstPartitionerFactory sstPartitionerFactory() { | |
1993 | return sstPartitionerFactory_; | |
1994 | } | |
1995 | ||
1996 | @Override | |
1997 | public Options setCompactionThreadLimiter(final ConcurrentTaskLimiter compactionThreadLimiter) { | |
1998 | setCompactionThreadLimiter(nativeHandle_, compactionThreadLimiter.nativeHandle_); | |
1999 | this.compactionThreadLimiter_ = compactionThreadLimiter; | |
2000 | return this; | |
2001 | } | |
2002 | ||
2003 | @Override | |
2004 | public ConcurrentTaskLimiter compactionThreadLimiter() { | |
2005 | assert (isOwningHandle()); | |
2006 | return this.compactionThreadLimiter_; | |
2007 | } | |
2008 | ||
7c673cae FG |
2009 | private native static long newOptions(); |
2010 | private native static long newOptions(long dbOptHandle, | |
2011 | long cfOptHandle); | |
11fdf7f2 | 2012 | private native static long copyOptions(long handle); |
7c673cae FG |
2013 | @Override protected final native void disposeInternal(final long handle); |
2014 | private native void setEnv(long optHandle, long envHandle); | |
2015 | private native void prepareForBulkLoad(long handle); | |
2016 | ||
2017 | // DB native handles | |
2018 | private native void setIncreaseParallelism(long handle, int totalThreads); | |
2019 | private native void setCreateIfMissing(long handle, boolean flag); | |
2020 | private native boolean createIfMissing(long handle); | |
2021 | private native void setCreateMissingColumnFamilies( | |
2022 | long handle, boolean flag); | |
2023 | private native boolean createMissingColumnFamilies(long handle); | |
2024 | private native void setErrorIfExists(long handle, boolean errorIfExists); | |
2025 | private native boolean errorIfExists(long handle); | |
2026 | private native void setParanoidChecks( | |
2027 | long handle, boolean paranoidChecks); | |
2028 | private native boolean paranoidChecks(long handle); | |
2029 | private native void setRateLimiter(long handle, | |
2030 | long rateLimiterHandle); | |
11fdf7f2 TL |
2031 | private native void setSstFileManager(final long handle, |
2032 | final long sstFileManagerHandle); | |
7c673cae FG |
2033 | private native void setLogger(long handle, |
2034 | long loggerHandle); | |
2035 | private native void setInfoLogLevel(long handle, byte logLevel); | |
2036 | private native byte infoLogLevel(long handle); | |
2037 | private native void setMaxOpenFiles(long handle, int maxOpenFiles); | |
2038 | private native int maxOpenFiles(long handle); | |
2039 | private native void setMaxTotalWalSize(long handle, | |
2040 | long maxTotalWalSize); | |
2041 | private native void setMaxFileOpeningThreads(final long handle, | |
2042 | final int maxFileOpeningThreads); | |
2043 | private native int maxFileOpeningThreads(final long handle); | |
2044 | private native long maxTotalWalSize(long handle); | |
11fdf7f2 TL |
2045 | private native void setStatistics(final long handle, final long statisticsHandle); |
2046 | private native long statistics(final long handle); | |
7c673cae FG |
2047 | private native boolean useFsync(long handle); |
2048 | private native void setUseFsync(long handle, boolean useFsync); | |
2049 | private native void setDbPaths(final long handle, final String[] paths, | |
2050 | final long[] targetSizes); | |
2051 | private native long dbPathsLen(final long handle); | |
2052 | private native void dbPaths(final long handle, final String[] paths, | |
2053 | final long[] targetSizes); | |
2054 | private native void setDbLogDir(long handle, String dbLogDir); | |
2055 | private native String dbLogDir(long handle); | |
2056 | private native void setWalDir(long handle, String walDir); | |
2057 | private native String walDir(long handle); | |
2058 | private native void setDeleteObsoleteFilesPeriodMicros( | |
2059 | long handle, long micros); | |
2060 | private native long deleteObsoleteFilesPeriodMicros(long handle); | |
2061 | private native void setBaseBackgroundCompactions(long handle, | |
2062 | int baseBackgroundCompactions); | |
2063 | private native int baseBackgroundCompactions(long handle); | |
2064 | private native void setMaxBackgroundCompactions( | |
2065 | long handle, int maxBackgroundCompactions); | |
2066 | private native int maxBackgroundCompactions(long handle); | |
2067 | private native void setMaxSubcompactions(long handle, int maxSubcompactions); | |
2068 | private native int maxSubcompactions(long handle); | |
2069 | private native void setMaxBackgroundFlushes( | |
2070 | long handle, int maxBackgroundFlushes); | |
2071 | private native int maxBackgroundFlushes(long handle); | |
11fdf7f2 TL |
2072 | private native void setMaxBackgroundJobs(long handle, int maxMaxBackgroundJobs); |
2073 | private native int maxBackgroundJobs(long handle); | |
7c673cae FG |
2074 | private native void setMaxLogFileSize(long handle, long maxLogFileSize) |
2075 | throws IllegalArgumentException; | |
2076 | private native long maxLogFileSize(long handle); | |
2077 | private native void setLogFileTimeToRoll( | |
2078 | long handle, long logFileTimeToRoll) throws IllegalArgumentException; | |
2079 | private native long logFileTimeToRoll(long handle); | |
2080 | private native void setKeepLogFileNum(long handle, long keepLogFileNum) | |
2081 | throws IllegalArgumentException; | |
2082 | private native long keepLogFileNum(long handle); | |
2083 | private native void setRecycleLogFileNum(long handle, long recycleLogFileNum); | |
2084 | private native long recycleLogFileNum(long handle); | |
2085 | private native void setMaxManifestFileSize( | |
2086 | long handle, long maxManifestFileSize); | |
2087 | private native long maxManifestFileSize(long handle); | |
2088 | private native void setMaxTableFilesSizeFIFO( | |
2089 | long handle, long maxTableFilesSize); | |
2090 | private native long maxTableFilesSizeFIFO(long handle); | |
2091 | private native void setTableCacheNumshardbits( | |
2092 | long handle, int tableCacheNumshardbits); | |
2093 | private native int tableCacheNumshardbits(long handle); | |
2094 | private native void setWalTtlSeconds(long handle, long walTtlSeconds); | |
2095 | private native long walTtlSeconds(long handle); | |
2096 | private native void setWalSizeLimitMB(long handle, long sizeLimitMB); | |
2097 | private native long walSizeLimitMB(long handle); | |
20effc67 TL |
2098 | private static native void setMaxWriteBatchGroupSizeBytes( |
2099 | final long handle, final long maxWriteBatchGroupSizeBytes); | |
2100 | private static native long maxWriteBatchGroupSizeBytes(final long handle); | |
7c673cae FG |
2101 | private native void setManifestPreallocationSize( |
2102 | long handle, long size) throws IllegalArgumentException; | |
2103 | private native long manifestPreallocationSize(long handle); | |
2104 | private native void setUseDirectReads(long handle, boolean useDirectReads); | |
2105 | private native boolean useDirectReads(long handle); | |
2106 | private native void setUseDirectIoForFlushAndCompaction( | |
2107 | long handle, boolean useDirectIoForFlushAndCompaction); | |
2108 | private native boolean useDirectIoForFlushAndCompaction(long handle); | |
2109 | private native void setAllowFAllocate(final long handle, | |
2110 | final boolean allowFAllocate); | |
2111 | private native boolean allowFAllocate(final long handle); | |
2112 | private native void setAllowMmapReads( | |
2113 | long handle, boolean allowMmapReads); | |
2114 | private native boolean allowMmapReads(long handle); | |
2115 | private native void setAllowMmapWrites( | |
2116 | long handle, boolean allowMmapWrites); | |
2117 | private native boolean allowMmapWrites(long handle); | |
2118 | private native void setIsFdCloseOnExec( | |
2119 | long handle, boolean isFdCloseOnExec); | |
2120 | private native boolean isFdCloseOnExec(long handle); | |
2121 | private native void setStatsDumpPeriodSec( | |
2122 | long handle, int statsDumpPeriodSec); | |
2123 | private native int statsDumpPeriodSec(long handle); | |
f67539c2 TL |
2124 | private native void setStatsPersistPeriodSec( |
2125 | final long handle, final int statsPersistPeriodSec); | |
2126 | private native int statsPersistPeriodSec( | |
2127 | final long handle); | |
2128 | private native void setStatsHistoryBufferSize( | |
2129 | final long handle, final long statsHistoryBufferSize); | |
2130 | private native long statsHistoryBufferSize( | |
2131 | final long handle); | |
7c673cae FG |
2132 | private native void setAdviseRandomOnOpen( |
2133 | long handle, boolean adviseRandomOnOpen); | |
2134 | private native boolean adviseRandomOnOpen(long handle); | |
2135 | private native void setDbWriteBufferSize(final long handle, | |
2136 | final long dbWriteBufferSize); | |
494da23a TL |
2137 | private native void setWriteBufferManager(final long handle, |
2138 | final long writeBufferManagerHandle); | |
7c673cae FG |
2139 | private native long dbWriteBufferSize(final long handle); |
2140 | private native void setAccessHintOnCompactionStart(final long handle, | |
2141 | final byte accessHintOnCompactionStart); | |
2142 | private native byte accessHintOnCompactionStart(final long handle); | |
2143 | private native void setNewTableReaderForCompactionInputs(final long handle, | |
2144 | final boolean newTableReaderForCompactionInputs); | |
2145 | private native boolean newTableReaderForCompactionInputs(final long handle); | |
2146 | private native void setCompactionReadaheadSize(final long handle, | |
2147 | final long compactionReadaheadSize); | |
2148 | private native long compactionReadaheadSize(final long handle); | |
2149 | private native void setRandomAccessMaxBufferSize(final long handle, | |
2150 | final long randomAccessMaxBufferSize); | |
2151 | private native long randomAccessMaxBufferSize(final long handle); | |
2152 | private native void setWritableFileMaxBufferSize(final long handle, | |
2153 | final long writableFileMaxBufferSize); | |
2154 | private native long writableFileMaxBufferSize(final long handle); | |
2155 | private native void setUseAdaptiveMutex( | |
2156 | long handle, boolean useAdaptiveMutex); | |
2157 | private native boolean useAdaptiveMutex(long handle); | |
2158 | private native void setBytesPerSync( | |
2159 | long handle, long bytesPerSync); | |
2160 | private native long bytesPerSync(long handle); | |
2161 | private native void setWalBytesPerSync(long handle, long walBytesPerSync); | |
2162 | private native long walBytesPerSync(long handle); | |
f67539c2 TL |
2163 | private native void setStrictBytesPerSync( |
2164 | final long handle, final boolean strictBytesPerSync); | |
2165 | private native boolean strictBytesPerSync( | |
2166 | final long handle); | |
20effc67 TL |
2167 | private static native void setEventListeners( |
2168 | final long handle, final long[] eventListenerHandles); | |
2169 | private static native AbstractEventListener[] eventListeners(final long handle); | |
7c673cae FG |
2170 | private native void setEnableThreadTracking(long handle, |
2171 | boolean enableThreadTracking); | |
2172 | private native boolean enableThreadTracking(long handle); | |
2173 | private native void setDelayedWriteRate(long handle, long delayedWriteRate); | |
2174 | private native long delayedWriteRate(long handle); | |
494da23a TL |
2175 | private native void setEnablePipelinedWrite(final long handle, |
2176 | final boolean pipelinedWrite); | |
2177 | private native boolean enablePipelinedWrite(final long handle); | |
f67539c2 TL |
2178 | private native void setUnorderedWrite(final long handle, |
2179 | final boolean unorderedWrite); | |
2180 | private native boolean unorderedWrite(final long handle); | |
7c673cae FG |
2181 | private native void setAllowConcurrentMemtableWrite(long handle, |
2182 | boolean allowConcurrentMemtableWrite); | |
2183 | private native boolean allowConcurrentMemtableWrite(long handle); | |
2184 | private native void setEnableWriteThreadAdaptiveYield(long handle, | |
2185 | boolean enableWriteThreadAdaptiveYield); | |
2186 | private native boolean enableWriteThreadAdaptiveYield(long handle); | |
2187 | private native void setWriteThreadMaxYieldUsec(long handle, | |
2188 | long writeThreadMaxYieldUsec); | |
2189 | private native long writeThreadMaxYieldUsec(long handle); | |
2190 | private native void setWriteThreadSlowYieldUsec(long handle, | |
2191 | long writeThreadSlowYieldUsec); | |
2192 | private native long writeThreadSlowYieldUsec(long handle); | |
2193 | private native void setSkipStatsUpdateOnDbOpen(final long handle, | |
2194 | final boolean skipStatsUpdateOnDbOpen); | |
2195 | private native boolean skipStatsUpdateOnDbOpen(final long handle); | |
20effc67 TL |
2196 | private static native void setSkipCheckingSstFileSizesOnDbOpen( |
2197 | final long handle, final boolean skipChecking); | |
2198 | private static native boolean skipCheckingSstFileSizesOnDbOpen(final long handle); | |
7c673cae FG |
2199 | private native void setWalRecoveryMode(final long handle, |
2200 | final byte walRecoveryMode); | |
2201 | private native byte walRecoveryMode(final long handle); | |
2202 | private native void setAllow2pc(final long handle, | |
2203 | final boolean allow2pc); | |
2204 | private native boolean allow2pc(final long handle); | |
2205 | private native void setRowCache(final long handle, | |
494da23a TL |
2206 | final long rowCacheHandle); |
2207 | private native void setWalFilter(final long handle, | |
2208 | final long walFilterHandle); | |
7c673cae FG |
2209 | private native void setFailIfOptionsFileError(final long handle, |
2210 | final boolean failIfOptionsFileError); | |
2211 | private native boolean failIfOptionsFileError(final long handle); | |
2212 | private native void setDumpMallocStats(final long handle, | |
2213 | final boolean dumpMallocStats); | |
2214 | private native boolean dumpMallocStats(final long handle); | |
2215 | private native void setAvoidFlushDuringRecovery(final long handle, | |
2216 | final boolean avoidFlushDuringRecovery); | |
2217 | private native boolean avoidFlushDuringRecovery(final long handle); | |
2218 | private native void setAvoidFlushDuringShutdown(final long handle, | |
2219 | final boolean avoidFlushDuringShutdown); | |
2220 | private native boolean avoidFlushDuringShutdown(final long handle); | |
494da23a TL |
2221 | private native void setAllowIngestBehind(final long handle, |
2222 | final boolean allowIngestBehind); | |
2223 | private native boolean allowIngestBehind(final long handle); | |
2224 | private native void setPreserveDeletes(final long handle, | |
2225 | final boolean preserveDeletes); | |
2226 | private native boolean preserveDeletes(final long handle); | |
2227 | private native void setTwoWriteQueues(final long handle, | |
2228 | final boolean twoWriteQueues); | |
2229 | private native boolean twoWriteQueues(final long handle); | |
2230 | private native void setManualWalFlush(final long handle, | |
2231 | final boolean manualWalFlush); | |
2232 | private native boolean manualWalFlush(final long handle); | |
2233 | ||
7c673cae FG |
2234 | |
2235 | // CF native handles | |
20effc67 TL |
2236 | private static native void oldDefaults( |
2237 | final long handle, final int majorVersion, final int minorVersion); | |
7c673cae | 2238 | private native void optimizeForSmallDb(final long handle); |
20effc67 | 2239 | private static native void optimizeForSmallDb(final long handle, final long cacheHandle); |
7c673cae FG |
2240 | private native void optimizeForPointLookup(long handle, |
2241 | long blockCacheSizeMb); | |
2242 | private native void optimizeLevelStyleCompaction(long handle, | |
2243 | long memtableMemoryBudget); | |
2244 | private native void optimizeUniversalStyleCompaction(long handle, | |
2245 | long memtableMemoryBudget); | |
2246 | private native void setComparatorHandle(long handle, int builtinComparator); | |
2247 | private native void setComparatorHandle(long optHandle, | |
11fdf7f2 | 2248 | long comparatorHandle, byte comparatorType); |
7c673cae FG |
2249 | private native void setMergeOperatorName( |
2250 | long handle, String name); | |
2251 | private native void setMergeOperator( | |
2252 | long handle, long mergeOperatorHandle); | |
494da23a TL |
2253 | private native void setCompactionFilterHandle( |
2254 | long handle, long compactionFilterHandle); | |
2255 | private native void setCompactionFilterFactoryHandle( | |
2256 | long handle, long compactionFilterFactoryHandle); | |
7c673cae FG |
2257 | private native void setWriteBufferSize(long handle, long writeBufferSize) |
2258 | throws IllegalArgumentException; | |
2259 | private native long writeBufferSize(long handle); | |
2260 | private native void setMaxWriteBufferNumber( | |
2261 | long handle, int maxWriteBufferNumber); | |
2262 | private native int maxWriteBufferNumber(long handle); | |
2263 | private native void setMinWriteBufferNumberToMerge( | |
2264 | long handle, int minWriteBufferNumberToMerge); | |
2265 | private native int minWriteBufferNumberToMerge(long handle); | |
2266 | private native void setCompressionType(long handle, byte compressionType); | |
2267 | private native byte compressionType(long handle); | |
2268 | private native void setCompressionPerLevel(long handle, | |
2269 | byte[] compressionLevels); | |
2270 | private native byte[] compressionPerLevel(long handle); | |
2271 | private native void setBottommostCompressionType(long handle, | |
2272 | byte bottommostCompressionType); | |
2273 | private native byte bottommostCompressionType(long handle); | |
494da23a TL |
2274 | private native void setBottommostCompressionOptions(final long handle, |
2275 | final long bottommostCompressionOptionsHandle); | |
7c673cae FG |
2276 | private native void setCompressionOptions(long handle, |
2277 | long compressionOptionsHandle); | |
2278 | private native void useFixedLengthPrefixExtractor( | |
2279 | long handle, int prefixLength); | |
2280 | private native void useCappedPrefixExtractor( | |
2281 | long handle, int prefixLength); | |
2282 | private native void setNumLevels( | |
2283 | long handle, int numLevels); | |
2284 | private native int numLevels(long handle); | |
2285 | private native void setLevelZeroFileNumCompactionTrigger( | |
2286 | long handle, int numFiles); | |
2287 | private native int levelZeroFileNumCompactionTrigger(long handle); | |
2288 | private native void setLevelZeroSlowdownWritesTrigger( | |
2289 | long handle, int numFiles); | |
2290 | private native int levelZeroSlowdownWritesTrigger(long handle); | |
2291 | private native void setLevelZeroStopWritesTrigger( | |
2292 | long handle, int numFiles); | |
2293 | private native int levelZeroStopWritesTrigger(long handle); | |
2294 | private native void setTargetFileSizeBase( | |
2295 | long handle, long targetFileSizeBase); | |
2296 | private native long targetFileSizeBase(long handle); | |
2297 | private native void setTargetFileSizeMultiplier( | |
2298 | long handle, int multiplier); | |
2299 | private native int targetFileSizeMultiplier(long handle); | |
2300 | private native void setMaxBytesForLevelBase( | |
2301 | long handle, long maxBytesForLevelBase); | |
2302 | private native long maxBytesForLevelBase(long handle); | |
2303 | private native void setLevelCompactionDynamicLevelBytes( | |
2304 | long handle, boolean enableLevelCompactionDynamicLevelBytes); | |
2305 | private native boolean levelCompactionDynamicLevelBytes( | |
2306 | long handle); | |
2307 | private native void setMaxBytesForLevelMultiplier(long handle, double multiplier); | |
2308 | private native double maxBytesForLevelMultiplier(long handle); | |
2309 | private native void setMaxCompactionBytes(long handle, long maxCompactionBytes); | |
2310 | private native long maxCompactionBytes(long handle); | |
2311 | private native void setArenaBlockSize( | |
2312 | long handle, long arenaBlockSize) throws IllegalArgumentException; | |
2313 | private native long arenaBlockSize(long handle); | |
2314 | private native void setDisableAutoCompactions( | |
2315 | long handle, boolean disableAutoCompactions); | |
2316 | private native boolean disableAutoCompactions(long handle); | |
2317 | private native void setCompactionStyle(long handle, byte compactionStyle); | |
2318 | private native byte compactionStyle(long handle); | |
2319 | private native void setMaxSequentialSkipInIterations( | |
2320 | long handle, long maxSequentialSkipInIterations); | |
2321 | private native long maxSequentialSkipInIterations(long handle); | |
2322 | private native void setMemTableFactory(long handle, long factoryHandle); | |
2323 | private native String memTableFactoryName(long handle); | |
2324 | private native void setTableFactory(long handle, long factoryHandle); | |
2325 | private native String tableFactoryName(long handle); | |
20effc67 TL |
2326 | private static native void setCfPaths( |
2327 | final long handle, final String[] paths, final long[] targetSizes); | |
2328 | private static native long cfPathsLen(final long handle); | |
2329 | private static native void cfPaths( | |
2330 | final long handle, final String[] paths, final long[] targetSizes); | |
7c673cae FG |
2331 | private native void setInplaceUpdateSupport( |
2332 | long handle, boolean inplaceUpdateSupport); | |
2333 | private native boolean inplaceUpdateSupport(long handle); | |
2334 | private native void setInplaceUpdateNumLocks( | |
2335 | long handle, long inplaceUpdateNumLocks) | |
2336 | throws IllegalArgumentException; | |
2337 | private native long inplaceUpdateNumLocks(long handle); | |
2338 | private native void setMemtablePrefixBloomSizeRatio( | |
2339 | long handle, double memtablePrefixBloomSizeRatio); | |
2340 | private native double memtablePrefixBloomSizeRatio(long handle); | |
2341 | private native void setBloomLocality( | |
2342 | long handle, int bloomLocality); | |
2343 | private native int bloomLocality(long handle); | |
2344 | private native void setMaxSuccessiveMerges( | |
2345 | long handle, long maxSuccessiveMerges) | |
2346 | throws IllegalArgumentException; | |
2347 | private native long maxSuccessiveMerges(long handle); | |
2348 | private native void setOptimizeFiltersForHits(long handle, | |
2349 | boolean optimizeFiltersForHits); | |
2350 | private native boolean optimizeFiltersForHits(long handle); | |
2351 | private native void setMemtableHugePageSize(long handle, | |
2352 | long memtableHugePageSize); | |
2353 | private native long memtableHugePageSize(long handle); | |
2354 | private native void setSoftPendingCompactionBytesLimit(long handle, | |
2355 | long softPendingCompactionBytesLimit); | |
2356 | private native long softPendingCompactionBytesLimit(long handle); | |
2357 | private native void setHardPendingCompactionBytesLimit(long handle, | |
2358 | long hardPendingCompactionBytesLimit); | |
2359 | private native long hardPendingCompactionBytesLimit(long handle); | |
2360 | private native void setLevel0FileNumCompactionTrigger(long handle, | |
2361 | int level0FileNumCompactionTrigger); | |
2362 | private native int level0FileNumCompactionTrigger(long handle); | |
2363 | private native void setLevel0SlowdownWritesTrigger(long handle, | |
2364 | int level0SlowdownWritesTrigger); | |
2365 | private native int level0SlowdownWritesTrigger(long handle); | |
2366 | private native void setLevel0StopWritesTrigger(long handle, | |
2367 | int level0StopWritesTrigger); | |
2368 | private native int level0StopWritesTrigger(long handle); | |
2369 | private native void setMaxBytesForLevelMultiplierAdditional(long handle, | |
2370 | int[] maxBytesForLevelMultiplierAdditional); | |
2371 | private native int[] maxBytesForLevelMultiplierAdditional(long handle); | |
2372 | private native void setParanoidFileChecks(long handle, | |
2373 | boolean paranoidFileChecks); | |
2374 | private native boolean paranoidFileChecks(long handle); | |
2375 | private native void setMaxWriteBufferNumberToMaintain(final long handle, | |
2376 | final int maxWriteBufferNumberToMaintain); | |
2377 | private native int maxWriteBufferNumberToMaintain(final long handle); | |
2378 | private native void setCompactionPriority(final long handle, | |
2379 | final byte compactionPriority); | |
2380 | private native byte compactionPriority(final long handle); | |
2381 | private native void setReportBgIoStats(final long handle, | |
2382 | final boolean reportBgIoStats); | |
2383 | private native boolean reportBgIoStats(final long handle); | |
494da23a TL |
2384 | private native void setTtl(final long handle, final long ttl); |
2385 | private native long ttl(final long handle); | |
7c673cae FG |
2386 | private native void setCompactionOptionsUniversal(final long handle, |
2387 | final long compactionOptionsUniversalHandle); | |
2388 | private native void setCompactionOptionsFIFO(final long handle, | |
2389 | final long compactionOptionsFIFOHandle); | |
2390 | private native void setForceConsistencyChecks(final long handle, | |
2391 | final boolean forceConsistencyChecks); | |
2392 | private native boolean forceConsistencyChecks(final long handle); | |
494da23a TL |
2393 | private native void setAtomicFlush(final long handle, |
2394 | final boolean atomicFlush); | |
2395 | private native boolean atomicFlush(final long handle); | |
20effc67 TL |
2396 | private native void setSstPartitionerFactory(long nativeHandle_, long newFactoryHandle); |
2397 | private static native void setCompactionThreadLimiter( | |
2398 | final long nativeHandle_, final long newLimiterHandle); | |
2399 | private static native void setAvoidUnnecessaryBlockingIO( | |
2400 | final long handle, final boolean avoidBlockingIO); | |
2401 | private static native boolean avoidUnnecessaryBlockingIO(final long handle); | |
2402 | private static native void setPersistStatsToDisk( | |
2403 | final long handle, final boolean persistStatsToDisk); | |
2404 | private static native boolean persistStatsToDisk(final long handle); | |
2405 | private static native void setWriteDbidToManifest( | |
2406 | final long handle, final boolean writeDbidToManifest); | |
2407 | private static native boolean writeDbidToManifest(final long handle); | |
2408 | private static native void setLogReadaheadSize(final long handle, final long logReadaheadSize); | |
2409 | private static native long logReadaheadSize(final long handle); | |
2410 | private static native void setBestEffortsRecovery( | |
2411 | final long handle, final boolean bestEffortsRecovery); | |
2412 | private static native boolean bestEffortsRecovery(final long handle); | |
2413 | private static native void setMaxBgErrorResumeCount( | |
2414 | final long handle, final int maxBgerrorRecumeCount); | |
2415 | private static native int maxBgerrorResumeCount(final long handle); | |
2416 | private static native void setBgerrorResumeRetryInterval( | |
2417 | final long handle, final long bgerrorResumeRetryInterval); | |
2418 | private static native long bgerrorResumeRetryInterval(final long handle); | |
7c673cae FG |
2419 | |
2420 | // instance variables | |
11fdf7f2 | 2421 | // NOTE: If you add new member variables, please update the copy constructor above! |
7c673cae FG |
2422 | private Env env_; |
2423 | private MemTableConfig memTableConfig_; | |
2424 | private TableFormatConfig tableFormatConfig_; | |
2425 | private RateLimiter rateLimiter_; | |
f67539c2 | 2426 | private AbstractComparator comparator_; |
494da23a TL |
2427 | private AbstractCompactionFilter<? extends AbstractSlice<?>> compactionFilter_; |
2428 | private AbstractCompactionFilterFactory<? extends AbstractCompactionFilter<?>> | |
2429 | compactionFilterFactory_; | |
7c673cae FG |
2430 | private CompactionOptionsUniversal compactionOptionsUniversal_; |
2431 | private CompactionOptionsFIFO compactionOptionsFIFO_; | |
494da23a | 2432 | private CompressionOptions bottommostCompressionOptions_; |
7c673cae FG |
2433 | private CompressionOptions compressionOptions_; |
2434 | private Cache rowCache_; | |
494da23a TL |
2435 | private WalFilter walFilter_; |
2436 | private WriteBufferManager writeBufferManager_; | |
20effc67 TL |
2437 | private SstPartitionerFactory sstPartitionerFactory_; |
2438 | private ConcurrentTaskLimiter compactionThreadLimiter_; | |
7c673cae | 2439 | } |