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