Repository navigation
Expand file tree
/
Copy pathDBOptions.java
More file actions
1466 lines (1282 loc) · 45.5 KB
/
Copy pathDBOptions.java
File metadata and controls
1466 lines (1282 loc) · 45.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
package org.rocksdb;
import java.nio.file.Paths;
import java.util.*;
/**
* DBOptions to control the behavior of a database. It will be used
* during the creation of a {@link org.rocksdb.RocksDB} (i.e., RocksDB.open()).
* <p>
* As a descendent of {@link AbstractNativeReference}, this class is {@link AutoCloseable}
* and will be automatically released if opened in the preamble of a try with resources block.
*/
public class DBOptions extends RocksObject
implements DBOptionsInterface<DBOptions>, MutableDBOptionsInterface<DBOptions> {
/**
* Construct DBOptions.
* <p>
* This constructor will create (by allocating a block of memory)
* an {@code rocksdb::DBOptions} in the c++ side.
*/
public DBOptions() {
super(newDBOptionsInstance());
numShardBits_ = DEFAULT_NUM_SHARD_BITS;
env_ = Env.getDefault();
}
/**
* Copy constructor for DBOptions.
* <p>
* NOTE: This does a shallow copy, which means env, rate_limiter, sst_file_manager,
* info_log and other pointers will be cloned!
*
* @param other The DBOptions to copy.
*/
public DBOptions(final DBOptions other) {
super(copyDBOptions(other.nativeHandle_));
this.env_ = other.env_;
this.numShardBits_ = other.numShardBits_;
this.rateLimiter_ = other.rateLimiter_;
this.rowCache_ = other.rowCache_;
this.walFilter_ = other.walFilter_;
this.writeBufferManager_ = other.writeBufferManager_;
}
/**
* Constructor from Options
*
* @param options The options.
*/
public DBOptions(final Options options) {
super(newDBOptionsFromOptions(options.nativeHandle_));
}
/**
* <p>Method to get a options instance by using pre-configured
* property values. If one or many values are undefined in
* the context of RocksDB the method will return a null
* value.</p>
*
* <p><strong>Note</strong>: Property keys can be derived from
* getter methods within the options class. Example: the method
* {@code allowMmapReads()} has a property key:
* {@code allow_mmap_reads}.</p>
*
* @param cfgOpts The ConfigOptions to control how the string is processed.
* @param properties {@link java.util.Properties} instance.
*
* @return {@link org.rocksdb.DBOptions instance}
* or null.
*
* @throws java.lang.IllegalArgumentException if null or empty
* {@link java.util.Properties} instance is passed to the method call.
*/
public static DBOptions getDBOptionsFromProps(
final ConfigOptions cfgOpts, final Properties properties) {
DBOptions dbOptions = null;
final String optionsString = Options.getOptionStringFromProps(properties);
final long handle = getDBOptionsFromProps(cfgOpts.nativeHandle_, optionsString);
if (handle != 0) {
dbOptions = new DBOptions(handle);
}
return dbOptions;
}
/**
* <p>Method to get a options instance by using pre-configured
* property values. If one or many values are undefined in
* the context of RocksDB the method will return a null
* value.</p>
*
* <p><strong>Note</strong>: Property keys can be derived from
* getter methods within the options class. Example: the method
* {@code allowMmapReads()} has a property key:
* {@code allow_mmap_reads}.</p>
*
* @param properties {@link java.util.Properties} instance.
*
* @return {@link org.rocksdb.DBOptions instance}
* or null.
*
* @throws java.lang.IllegalArgumentException if null or empty
* {@link java.util.Properties} instance is passed to the method call.
*/
public static DBOptions getDBOptionsFromProps(final Properties properties) {
DBOptions dbOptions = null;
final String optionsString = Options.getOptionStringFromProps(properties);
final long handle = getDBOptionsFromProps(optionsString);
if (handle != 0) {
dbOptions = new DBOptions(handle);
}
return dbOptions;
}
@Override
public DBOptions optimizeForSmallDb() {
optimizeForSmallDb(nativeHandle_);
return this;
}
@Override
public DBOptions setIncreaseParallelism(
final int totalThreads) {
assert(isOwningHandle());
setIncreaseParallelism(nativeHandle_, totalThreads);
return this;
}
@Override
public DBOptions setCreateIfMissing(final boolean flag) {
assert(isOwningHandle());
setCreateIfMissing(nativeHandle_, flag);
return this;
}
@Override
public boolean createIfMissing() {
assert(isOwningHandle());
return createIfMissing(nativeHandle_);
}
@Override
public DBOptions setCreateMissingColumnFamilies(
final boolean flag) {
assert(isOwningHandle());
setCreateMissingColumnFamilies(nativeHandle_, flag);
return this;
}
@Override
public boolean createMissingColumnFamilies() {
assert(isOwningHandle());
return createMissingColumnFamilies(nativeHandle_);
}
@Override
public DBOptions setErrorIfExists(
final boolean errorIfExists) {
assert(isOwningHandle());
setErrorIfExists(nativeHandle_, errorIfExists);
return this;
}
@Override
public boolean errorIfExists() {
assert(isOwningHandle());
return errorIfExists(nativeHandle_);
}
@Override
public DBOptions setParanoidChecks(
final boolean paranoidChecks) {
assert(isOwningHandle());
setParanoidChecks(nativeHandle_, paranoidChecks);
return this;
}
@Override
public boolean paranoidChecks() {
assert(isOwningHandle());
return paranoidChecks(nativeHandle_);
}
@Override
public DBOptions setOpenFilesAsync(final boolean openFilesAsync) {
assert (isOwningHandle());
setOpenFilesAsync(nativeHandle_, openFilesAsync);
return this;
}
@Override
public boolean openFilesAsync() {
assert (isOwningHandle());
return openFilesAsync(nativeHandle_);
}
@Override
public DBOptions setEnv(final Env env) {
setEnv(nativeHandle_, env.nativeHandle_);
this.env_ = env;
return this;
}
@Override
public Env getEnv() {
return env_;
}
@Override
public DBOptions setRateLimiter(final RateLimiter rateLimiter) {
assert(isOwningHandle());
rateLimiter_ = rateLimiter;
setRateLimiter(nativeHandle_, rateLimiter.nativeHandle_);
return this;
}
@Override
public DBOptions setSstFileManager(final SstFileManager sstFileManager) {
assert(isOwningHandle());
setSstFileManager(nativeHandle_, sstFileManager.nativeHandle_);
return this;
}
@Override
public DBOptions setLogger(final LoggerInterface logger) {
assert(isOwningHandle());
setLogger(nativeHandle_, logger.getNativeHandle(), logger.getLoggerType().getValue());
return this;
}
@Override
public DBOptions setInfoLogLevel(
final InfoLogLevel infoLogLevel) {
assert(isOwningHandle());
setInfoLogLevel(nativeHandle_, infoLogLevel.getValue());
return this;
}
@Override
public InfoLogLevel infoLogLevel() {
assert(isOwningHandle());
return InfoLogLevel.getInfoLogLevel(
infoLogLevel(nativeHandle_));
}
@Override
public DBOptions setMaxOpenFiles(
final int maxOpenFiles) {
assert(isOwningHandle());
setMaxOpenFiles(nativeHandle_, maxOpenFiles);
return this;
}
@Override
public int maxOpenFiles() {
assert(isOwningHandle());
return maxOpenFiles(nativeHandle_);
}
@Override
public DBOptions setMaxFileOpeningThreads(final int maxFileOpeningThreads) {
assert(isOwningHandle());
setMaxFileOpeningThreads(nativeHandle_, maxFileOpeningThreads);
return this;
}
@Override
public int maxFileOpeningThreads() {
assert(isOwningHandle());
return maxFileOpeningThreads(nativeHandle_);
}
@Override
public DBOptions setMaxTotalWalSize(
final long maxTotalWalSize) {
assert(isOwningHandle());
setMaxTotalWalSize(nativeHandle_, maxTotalWalSize);
return this;
}
@Override
public long maxTotalWalSize() {
assert(isOwningHandle());
return maxTotalWalSize(nativeHandle_);
}
@Override
public DBOptions setStatistics(final Statistics statistics) {
assert(isOwningHandle());
setStatistics(nativeHandle_, statistics.nativeHandle_);
return this;
}
@Override
public Statistics statistics() {
assert(isOwningHandle());
final long statisticsNativeHandle = statistics(nativeHandle_);
if(statisticsNativeHandle == 0) {
return null;
} else {
return new Statistics(statisticsNativeHandle);
}
}
@Override
public DBOptions setUseFsync(
final boolean useFsync) {
assert(isOwningHandle());
setUseFsync(nativeHandle_, useFsync);
return this;
}
@Override
public boolean useFsync() {
assert(isOwningHandle());
return useFsync(nativeHandle_);
}
@Override
public DBOptions setDbPaths(final Collection<DbPath> dbPaths) {
assert(isOwningHandle());
final int len = dbPaths.size();
final String[] paths = new String[len];
final long[] targetSizes = new long[len];
int i = 0;
for(final DbPath dbPath : dbPaths) {
paths[i] = dbPath.path.toString();
targetSizes[i] = dbPath.targetSize;
i++;
}
setDbPaths(nativeHandle_, paths, targetSizes);
return this;
}
@Override
public List<DbPath> dbPaths() {
final int len = (int)dbPathsLen(nativeHandle_);
if(len == 0) {
return Collections.emptyList();
} else {
final String[] paths = new String[len];
final long[] targetSizes = new long[len];
dbPaths(nativeHandle_, paths, targetSizes);
final List<DbPath> dbPaths = new ArrayList<>();
for(int i = 0; i < len; i++) {
dbPaths.add(new DbPath(Paths.get(paths[i]), targetSizes[i]));
}
return dbPaths;
}
}
@Override
public DBOptions setDbLogDir(
final String dbLogDir) {
assert(isOwningHandle());
setDbLogDir(nativeHandle_, dbLogDir);
return this;
}
@Override
public String dbLogDir() {
assert(isOwningHandle());
return dbLogDir(nativeHandle_);
}
@Override
public DBOptions setWalDir(
final String walDir) {
assert(isOwningHandle());
setWalDir(nativeHandle_, walDir);
return this;
}
@Override
public String walDir() {
assert(isOwningHandle());
return walDir(nativeHandle_);
}
@Override
public DBOptions setDeleteObsoleteFilesPeriodMicros(
final long micros) {
assert(isOwningHandle());
setDeleteObsoleteFilesPeriodMicros(nativeHandle_, micros);
return this;
}
@Override
public long deleteObsoleteFilesPeriodMicros() {
assert(isOwningHandle());
return deleteObsoleteFilesPeriodMicros(nativeHandle_);
}
@Override
public DBOptions setMaxBackgroundJobs(final int maxBackgroundJobs) {
assert(isOwningHandle());
setMaxBackgroundJobs(nativeHandle_, maxBackgroundJobs);
return this;
}
@Override
public int maxBackgroundJobs() {
assert(isOwningHandle());
return maxBackgroundJobs(nativeHandle_);
}
@Override
@Deprecated
public DBOptions setMaxBackgroundCompactions(
final int maxBackgroundCompactions) {
assert(isOwningHandle());
setMaxBackgroundCompactions(nativeHandle_, maxBackgroundCompactions);
return this;
}
@Override
@Deprecated
public int maxBackgroundCompactions() {
assert(isOwningHandle());
return maxBackgroundCompactions(nativeHandle_);
}
@Override
public DBOptions setMaxSubcompactions(final int maxSubcompactions) {
assert(isOwningHandle());
setMaxSubcompactions(nativeHandle_, maxSubcompactions);
return this;
}
@Override
public int maxSubcompactions() {
assert(isOwningHandle());
return maxSubcompactions(nativeHandle_);
}
@Override
@Deprecated
public DBOptions setMaxBackgroundFlushes(
final int maxBackgroundFlushes) {
assert(isOwningHandle());
setMaxBackgroundFlushes(nativeHandle_, maxBackgroundFlushes);
return this;
}
@Override
@Deprecated
public int maxBackgroundFlushes() {
assert(isOwningHandle());
return maxBackgroundFlushes(nativeHandle_);
}
@Override
public DBOptions setMaxLogFileSize(final long maxLogFileSize) {
assert(isOwningHandle());
setMaxLogFileSize(nativeHandle_, maxLogFileSize);
return this;
}
@Override
public long maxLogFileSize() {
assert(isOwningHandle());
return maxLogFileSize(nativeHandle_);
}
@Override
public DBOptions setLogFileTimeToRoll(
final long logFileTimeToRoll) {
assert(isOwningHandle());
setLogFileTimeToRoll(nativeHandle_, logFileTimeToRoll);
return this;
}
@Override
public long logFileTimeToRoll() {
assert(isOwningHandle());
return logFileTimeToRoll(nativeHandle_);
}
@Override
public DBOptions setKeepLogFileNum(
final long keepLogFileNum) {
assert(isOwningHandle());
setKeepLogFileNum(nativeHandle_, keepLogFileNum);
return this;
}
@Override
public long keepLogFileNum() {
assert(isOwningHandle());
return keepLogFileNum(nativeHandle_);
}
@Override
public DBOptions setRecycleLogFileNum(final long recycleLogFileNum) {
assert(isOwningHandle());
setRecycleLogFileNum(nativeHandle_, recycleLogFileNum);
return this;
}
@Override
public long recycleLogFileNum() {
assert(isOwningHandle());
return recycleLogFileNum(nativeHandle_);
}
@Override
public DBOptions setMaxManifestFileSize(
final long maxManifestFileSize) {
assert(isOwningHandle());
setMaxManifestFileSize(nativeHandle_, maxManifestFileSize);
return this;
}
@Override
public long maxManifestFileSize() {
assert(isOwningHandle());
return maxManifestFileSize(nativeHandle_);
}
@Override
public DBOptions setTableCacheNumshardbits(
final int tableCacheNumshardbits) {
assert(isOwningHandle());
setTableCacheNumshardbits(nativeHandle_, tableCacheNumshardbits);
return this;
}
@Override
public int tableCacheNumshardbits() {
assert(isOwningHandle());
return tableCacheNumshardbits(nativeHandle_);
}
@Override
public DBOptions setWalTtlSeconds(
final long walTtlSeconds) {
assert(isOwningHandle());
setWalTtlSeconds(nativeHandle_, walTtlSeconds);
return this;
}
@Override
public long walTtlSeconds() {
assert(isOwningHandle());
return walTtlSeconds(nativeHandle_);
}
@Override
public DBOptions setWalSizeLimitMB(
final long sizeLimitMB) {
assert(isOwningHandle());
setWalSizeLimitMB(nativeHandle_, sizeLimitMB);
return this;
}
@Override
public long walSizeLimitMB() {
assert(isOwningHandle());
return walSizeLimitMB(nativeHandle_);
}
@Override
public DBOptions setMaxWriteBatchGroupSizeBytes(final long maxWriteBatchGroupSizeBytes) {
setMaxWriteBatchGroupSizeBytes(nativeHandle_, maxWriteBatchGroupSizeBytes);
return this;
}
@Override
public long maxWriteBatchGroupSizeBytes() {
assert (isOwningHandle());
return maxWriteBatchGroupSizeBytes(nativeHandle_);
}
@Override
public DBOptions setManifestPreallocationSize(
final long size) {
assert(isOwningHandle());
setManifestPreallocationSize(nativeHandle_, size);
return this;
}
@Override
public long manifestPreallocationSize() {
assert(isOwningHandle());
return manifestPreallocationSize(nativeHandle_);
}
@Override
public DBOptions setAllowMmapReads(
final boolean allowMmapReads) {
assert(isOwningHandle());
setAllowMmapReads(nativeHandle_, allowMmapReads);
return this;
}
@Override
public boolean allowMmapReads() {
assert(isOwningHandle());
return allowMmapReads(nativeHandle_);
}
@Override
public DBOptions setAllowMmapWrites(
final boolean allowMmapWrites) {
assert(isOwningHandle());
setAllowMmapWrites(nativeHandle_, allowMmapWrites);
return this;
}
@Override
public boolean allowMmapWrites() {
assert(isOwningHandle());
return allowMmapWrites(nativeHandle_);
}
@Override
public DBOptions setUseDirectReads(
final boolean useDirectReads) {
assert(isOwningHandle());
setUseDirectReads(nativeHandle_, useDirectReads);
return this;
}
@Override
public boolean useDirectReads() {
assert(isOwningHandle());
return useDirectReads(nativeHandle_);
}
@Override
public DBOptions setUseDirectIoForFlushAndCompaction(
final boolean useDirectIoForFlushAndCompaction) {
assert(isOwningHandle());
setUseDirectIoForFlushAndCompaction(nativeHandle_,
useDirectIoForFlushAndCompaction);
return this;
}
@Override
public boolean useDirectIoForFlushAndCompaction() {
assert(isOwningHandle());
return useDirectIoForFlushAndCompaction(nativeHandle_);
}
@Override
public DBOptions setAllowFAllocate(final boolean allowFAllocate) {
assert(isOwningHandle());
setAllowFAllocate(nativeHandle_, allowFAllocate);
return this;
}
@Override
public boolean allowFAllocate() {
assert(isOwningHandle());
return allowFAllocate(nativeHandle_);
}
@Override
public DBOptions setIsFdCloseOnExec(
final boolean isFdCloseOnExec) {
assert(isOwningHandle());
setIsFdCloseOnExec(nativeHandle_, isFdCloseOnExec);
return this;
}
@Override
public boolean isFdCloseOnExec() {
assert(isOwningHandle());
return isFdCloseOnExec(nativeHandle_);
}
@Override
public DBOptions setStatsDumpPeriodSec(
final int statsDumpPeriodSec) {
assert(isOwningHandle());
setStatsDumpPeriodSec(nativeHandle_, statsDumpPeriodSec);
return this;
}
@Override
public int statsDumpPeriodSec() {
assert(isOwningHandle());
return statsDumpPeriodSec(nativeHandle_);
}
@Override
public DBOptions setMaxCompactionTriggerWakeupSeconds(
final long maxCompactionTriggerWakeupSeconds) {
assert (isOwningHandle());
setMaxCompactionTriggerWakeupSeconds(nativeHandle_, maxCompactionTriggerWakeupSeconds);
return this;
}
@Override
public long maxCompactionTriggerWakeupSeconds() {
assert (isOwningHandle());
return maxCompactionTriggerWakeupSeconds(nativeHandle_);
}
@Override
public DBOptions setStatsPersistPeriodSec(
final int statsPersistPeriodSec) {
assert(isOwningHandle());
setStatsPersistPeriodSec(nativeHandle_, statsPersistPeriodSec);
return this;
}
@Override
public int statsPersistPeriodSec() {
assert(isOwningHandle());
return statsPersistPeriodSec(nativeHandle_);
}
@Override
public DBOptions setStatsHistoryBufferSize(
final long statsHistoryBufferSize) {
assert(isOwningHandle());
setStatsHistoryBufferSize(nativeHandle_, statsHistoryBufferSize);
return this;
}
@Override
public long statsHistoryBufferSize() {
assert(isOwningHandle());
return statsHistoryBufferSize(nativeHandle_);
}
@Override
public DBOptions setAdviseRandomOnOpen(
final boolean adviseRandomOnOpen) {
assert(isOwningHandle());
setAdviseRandomOnOpen(nativeHandle_, adviseRandomOnOpen);
return this;
}
@Override
public boolean adviseRandomOnOpen() {
return adviseRandomOnOpen(nativeHandle_);
}
@Override
public DBOptions setDbWriteBufferSize(final long dbWriteBufferSize) {
assert(isOwningHandle());
setDbWriteBufferSize(nativeHandle_, dbWriteBufferSize);
return this;
}
@Override
public DBOptions setWriteBufferManager(final WriteBufferManager writeBufferManager) {
assert(isOwningHandle());
setWriteBufferManager(nativeHandle_, writeBufferManager.nativeHandle_);
this.writeBufferManager_ = writeBufferManager;
return this;
}
@Override
public WriteBufferManager writeBufferManager() {
assert(isOwningHandle());
return this.writeBufferManager_;
}
@Override
public long dbWriteBufferSize() {
assert(isOwningHandle());
return dbWriteBufferSize(nativeHandle_);
}
@Override
public DBOptions setCompactionReadaheadSize(final long compactionReadaheadSize) {
assert(isOwningHandle());
setCompactionReadaheadSize(nativeHandle_, compactionReadaheadSize);
return this;
}
@Override
public long compactionReadaheadSize() {
assert(isOwningHandle());
return compactionReadaheadSize(nativeHandle_);
}
@Override
public DBOptions setDailyOffpeakTimeUTC(String offpeakTimeUTC) {
assert (isOwningHandle());
setDailyOffpeakTimeUTC(nativeHandle_, offpeakTimeUTC);
return this;
}
@Override
public String dailyOffpeakTimeUTC() {
assert (isOwningHandle());
return dailyOffpeakTimeUTC(nativeHandle_);
}
@Override
public DBOptions setWritableFileMaxBufferSize(final long writableFileMaxBufferSize) {
assert(isOwningHandle());
setWritableFileMaxBufferSize(nativeHandle_, writableFileMaxBufferSize);
return this;
}
@Override
public long writableFileMaxBufferSize() {
assert(isOwningHandle());
return writableFileMaxBufferSize(nativeHandle_);
}
@Override
public DBOptions setUseAdaptiveMutex(
final boolean useAdaptiveMutex) {
assert(isOwningHandle());
setUseAdaptiveMutex(nativeHandle_, useAdaptiveMutex);
return this;
}
@Override
public boolean useAdaptiveMutex() {
assert(isOwningHandle());
return useAdaptiveMutex(nativeHandle_);
}
@Override
public DBOptions setBytesPerSync(
final long bytesPerSync) {
assert(isOwningHandle());
setBytesPerSync(nativeHandle_, bytesPerSync);
return this;
}
@Override
public long bytesPerSync() {
return bytesPerSync(nativeHandle_);
}
@Override
public DBOptions setWalBytesPerSync(final long walBytesPerSync) {
assert(isOwningHandle());
setWalBytesPerSync(nativeHandle_, walBytesPerSync);
return this;
}
@Override
public long walBytesPerSync() {
assert(isOwningHandle());
return walBytesPerSync(nativeHandle_);
}
@Override
public DBOptions setStrictBytesPerSync(final boolean strictBytesPerSync) {
assert(isOwningHandle());
setStrictBytesPerSync(nativeHandle_, strictBytesPerSync);
return this;
}
@Override
public boolean strictBytesPerSync() {
assert(isOwningHandle());
return strictBytesPerSync(nativeHandle_);
}
@Override
public DBOptions setListeners(final List<AbstractEventListener> listeners) {
assert (isOwningHandle());
setEventListeners(nativeHandle_, RocksCallbackObject.toNativeHandleList(listeners));
return this;
}
@Override
public List<AbstractEventListener> listeners() {
assert (isOwningHandle());
return Arrays.asList(eventListeners(nativeHandle_));
}
@Override
public DBOptions setEnableThreadTracking(final boolean enableThreadTracking) {
assert(isOwningHandle());
setEnableThreadTracking(nativeHandle_, enableThreadTracking);
return this;
}
@Override
public boolean enableThreadTracking() {
assert(isOwningHandle());
return enableThreadTracking(nativeHandle_);
}
@Override
public DBOptions setDelayedWriteRate(final long delayedWriteRate) {
assert(isOwningHandle());
setDelayedWriteRate(nativeHandle_, delayedWriteRate);
return this;
}
@Override
public long delayedWriteRate(){
return delayedWriteRate(nativeHandle_);
}
@Override
public DBOptions setEnablePipelinedWrite(final boolean enablePipelinedWrite) {
assert(isOwningHandle());
setEnablePipelinedWrite(nativeHandle_, enablePipelinedWrite);
return this;
}
@Override
public boolean enablePipelinedWrite() {
assert(isOwningHandle());
return enablePipelinedWrite(nativeHandle_);
}
@Override
public DBOptions setUnorderedWrite(final boolean unorderedWrite) {
setUnorderedWrite(nativeHandle_, unorderedWrite);
return this;
}
@Override
public boolean unorderedWrite() {
return unorderedWrite(nativeHandle_);
}
@Override
public DBOptions setAllowConcurrentMemtableWrite(
final boolean allowConcurrentMemtableWrite) {
setAllowConcurrentMemtableWrite(nativeHandle_,
allowConcurrentMemtableWrite);
return this;
}
@Override
public boolean allowConcurrentMemtableWrite() {
return allowConcurrentMemtableWrite(nativeHandle_);
}
@Override
public DBOptions setEnableWriteThreadAdaptiveYield(
final boolean enableWriteThreadAdaptiveYield) {
setEnableWriteThreadAdaptiveYield(nativeHandle_,
enableWriteThreadAdaptiveYield);
return this;
}
@Override
public boolean enableWriteThreadAdaptiveYield() {
return enableWriteThreadAdaptiveYield(nativeHandle_);
}
@Override
public DBOptions setWriteThreadMaxYieldUsec(final long writeThreadMaxYieldUsec) {
setWriteThreadMaxYieldUsec(nativeHandle_, writeThreadMaxYieldUsec);
return this;
}
@Override
public long writeThreadMaxYieldUsec() {
return writeThreadMaxYieldUsec(nativeHandle_);
}
@Override
public DBOptions setWriteThreadSlowYieldUsec(final long writeThreadSlowYieldUsec) {
setWriteThreadSlowYieldUsec(nativeHandle_, writeThreadSlowYieldUsec);
return this;
}
@Override
public long writeThreadSlowYieldUsec() {
return writeThreadSlowYieldUsec(nativeHandle_);
}
@Override
public DBOptions setSkipStatsUpdateOnDbOpen(final boolean skipStatsUpdateOnDbOpen) {
assert(isOwningHandle());
setSkipStatsUpdateOnDbOpen(nativeHandle_, skipStatsUpdateOnDbOpen);
return this;
}
@Override
public boolean skipStatsUpdateOnDbOpen() {
assert(isOwningHandle());
return skipStatsUpdateOnDbOpen(nativeHandle_);
}
@Override
public DBOptions setWalRecoveryMode(final WALRecoveryMode walRecoveryMode) {
assert(isOwningHandle());
setWalRecoveryMode(nativeHandle_, walRecoveryMode.getValue());
return this;
}
@Override
public WALRecoveryMode walRecoveryMode() {