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