1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
10 public class MutableColumnFamilyOptions
{
11 private final static String KEY_VALUE_PAIR_SEPARATOR
= ";";
12 private final static char KEY_VALUE_SEPARATOR
= '=';
13 private final static String INT_ARRAY_INT_SEPARATOR
= ",";
15 private final String
[] keys
;
16 private final String
[] values
;
18 // user must use builder pattern, or parser
19 private MutableColumnFamilyOptions(final String keys
[],
20 final String values
[]) {
29 String
[] getValues() {
34 * Creates a builder which allows you
35 * to set MutableColumnFamilyOptions in a fluent
38 * @return A builder for MutableColumnFamilyOptions
40 public static MutableColumnFamilyOptionsBuilder
builder() {
41 return new MutableColumnFamilyOptionsBuilder();
45 * Parses a String representation of MutableColumnFamilyOptions
47 * The format is: key1=value1;key2=value2;key3=value3 etc
49 * For int[] values, each int should be separated by a comma, e.g.
51 * key1=value1;intArrayKey1=1,2,3
53 * @param str The string representation of the mutable column family options
55 * @return A builder for the mutable column family options
57 public static MutableColumnFamilyOptionsBuilder
parse(final String str
) {
58 Objects
.requireNonNull(str
);
60 final MutableColumnFamilyOptionsBuilder builder
=
61 new MutableColumnFamilyOptionsBuilder();
63 final String options
[] = str
.trim().split(KEY_VALUE_PAIR_SEPARATOR
);
64 for(final String option
: options
) {
65 final int equalsOffset
= option
.indexOf(KEY_VALUE_SEPARATOR
);
66 if(equalsOffset
<= 0) {
67 throw new IllegalArgumentException(
68 "options string has an invalid key=value pair");
71 final String key
= option
.substring(0, equalsOffset
);
72 if(key
== null || key
.isEmpty()) {
73 throw new IllegalArgumentException("options string is invalid");
76 final String value
= option
.substring(equalsOffset
+ 1);
77 if(value
== null || value
.isEmpty()) {
78 throw new IllegalArgumentException("options string is invalid");
81 builder
.fromString(key
, value
);
88 * Returns a string representation
89 * of MutableColumnFamilyOptions which is
90 * suitable for consumption by {@link #parse(String)}
92 * @return String representation of MutableColumnFamilyOptions
95 public String
toString() {
96 final StringBuilder buffer
= new StringBuilder();
97 for(int i
= 0; i
< keys
.length
; i
++) {
100 .append(KEY_VALUE_SEPARATOR
)
103 if(i
+ 1 < keys
.length
) {
104 buffer
.append(KEY_VALUE_PAIR_SEPARATOR
);
107 return buffer
.toString();
110 public enum ValueType
{
119 public enum MemtableOption
implements MutableColumnFamilyOptionKey
{
120 write_buffer_size(ValueType
.LONG
),
121 arena_block_size(ValueType
.LONG
),
122 memtable_prefix_bloom_size_ratio(ValueType
.DOUBLE
),
123 @Deprecated memtable_prefix_bloom_bits(ValueType
.INT
),
124 @Deprecated memtable_prefix_bloom_probes(ValueType
.INT
),
125 memtable_huge_page_size(ValueType
.LONG
),
126 max_successive_merges(ValueType
.LONG
),
127 @Deprecated filter_deletes(ValueType
.BOOLEAN
),
128 max_write_buffer_number(ValueType
.INT
),
129 inplace_update_num_locks(ValueType
.LONG
);
131 private final ValueType valueType
;
132 MemtableOption(final ValueType valueType
) {
133 this.valueType
= valueType
;
137 public ValueType
getValueType() {
142 public enum CompactionOption
implements MutableColumnFamilyOptionKey
{
143 disable_auto_compactions(ValueType
.BOOLEAN
),
144 @Deprecated soft_rate_limit(ValueType
.DOUBLE
),
145 soft_pending_compaction_bytes_limit(ValueType
.LONG
),
146 @Deprecated hard_rate_limit(ValueType
.DOUBLE
),
147 hard_pending_compaction_bytes_limit(ValueType
.LONG
),
148 level0_file_num_compaction_trigger(ValueType
.INT
),
149 level0_slowdown_writes_trigger(ValueType
.INT
),
150 level0_stop_writes_trigger(ValueType
.INT
),
151 max_compaction_bytes(ValueType
.LONG
),
152 target_file_size_base(ValueType
.LONG
),
153 target_file_size_multiplier(ValueType
.INT
),
154 max_bytes_for_level_base(ValueType
.LONG
),
155 max_bytes_for_level_multiplier(ValueType
.INT
),
156 max_bytes_for_level_multiplier_additional(ValueType
.INT_ARRAY
);
158 private final ValueType valueType
;
159 CompactionOption(final ValueType valueType
) {
160 this.valueType
= valueType
;
164 public ValueType
getValueType() {
169 public enum MiscOption
implements MutableColumnFamilyOptionKey
{
170 max_sequential_skip_in_iterations(ValueType
.LONG
),
171 paranoid_file_checks(ValueType
.BOOLEAN
),
172 report_bg_io_stats(ValueType
.BOOLEAN
),
173 compression_type(ValueType
.ENUM
);
175 private final ValueType valueType
;
176 MiscOption(final ValueType valueType
) {
177 this.valueType
= valueType
;
181 public ValueType
getValueType() {
186 private interface MutableColumnFamilyOptionKey
{
188 ValueType
getValueType();
191 private static abstract class MutableColumnFamilyOptionValue
<T
> {
192 protected final T value
;
194 MutableColumnFamilyOptionValue(final T value
) {
198 abstract double asDouble() throws NumberFormatException
;
199 abstract long asLong() throws NumberFormatException
;
200 abstract int asInt() throws NumberFormatException
;
201 abstract boolean asBoolean() throws IllegalStateException
;
202 abstract int[] asIntArray() throws IllegalStateException
;
203 abstract String
asString();
204 abstract T
asObject();
207 private static class MutableColumnFamilyOptionStringValue
208 extends MutableColumnFamilyOptionValue
<String
> {
209 MutableColumnFamilyOptionStringValue(final String value
) {
214 double asDouble() throws NumberFormatException
{
215 return Double
.parseDouble(value
);
219 long asLong() throws NumberFormatException
{
220 return Long
.parseLong(value
);
224 int asInt() throws NumberFormatException
{
225 return Integer
.parseInt(value
);
229 boolean asBoolean() throws IllegalStateException
{
230 return Boolean
.parseBoolean(value
);
234 int[] asIntArray() throws IllegalStateException
{
235 throw new IllegalStateException("String is not applicable as int[]");
249 private static class MutableColumnFamilyOptionDoubleValue
250 extends MutableColumnFamilyOptionValue
<Double
> {
251 MutableColumnFamilyOptionDoubleValue(final double value
) {
261 long asLong() throws NumberFormatException
{
262 return value
.longValue();
266 int asInt() throws NumberFormatException
{
267 if(value
> Integer
.MAX_VALUE
|| value
< Integer
.MIN_VALUE
) {
268 throw new NumberFormatException(
269 "double value lies outside the bounds of int");
271 return value
.intValue();
275 boolean asBoolean() throws IllegalStateException
{
276 throw new IllegalStateException(
277 "double is not applicable as boolean");
281 int[] asIntArray() throws IllegalStateException
{
282 if(value
> Integer
.MAX_VALUE
|| value
< Integer
.MIN_VALUE
) {
283 throw new NumberFormatException(
284 "double value lies outside the bounds of int");
286 return new int[] { value
.intValue() };
291 return Double
.toString(value
);
300 private static class MutableColumnFamilyOptionLongValue
301 extends MutableColumnFamilyOptionValue
<Long
> {
302 MutableColumnFamilyOptionLongValue(final long value
) {
308 if(value
> Double
.MAX_VALUE
|| value
< Double
.MIN_VALUE
) {
309 throw new NumberFormatException(
310 "long value lies outside the bounds of int");
312 return value
.doubleValue();
316 long asLong() throws NumberFormatException
{
321 int asInt() throws NumberFormatException
{
322 if(value
> Integer
.MAX_VALUE
|| value
< Integer
.MIN_VALUE
) {
323 throw new NumberFormatException(
324 "long value lies outside the bounds of int");
326 return value
.intValue();
330 boolean asBoolean() throws IllegalStateException
{
331 throw new IllegalStateException(
332 "long is not applicable as boolean");
336 int[] asIntArray() throws IllegalStateException
{
337 if(value
> Integer
.MAX_VALUE
|| value
< Integer
.MIN_VALUE
) {
338 throw new NumberFormatException(
339 "long value lies outside the bounds of int");
341 return new int[] { value
.intValue() };
346 return Long
.toString(value
);
355 private static class MutableColumnFamilyOptionIntValue
356 extends MutableColumnFamilyOptionValue
<Integer
> {
357 MutableColumnFamilyOptionIntValue(final int value
) {
363 if(value
> Double
.MAX_VALUE
|| value
< Double
.MIN_VALUE
) {
364 throw new NumberFormatException("int value lies outside the bounds of int");
366 return value
.doubleValue();
370 long asLong() throws NumberFormatException
{
375 int asInt() throws NumberFormatException
{
380 boolean asBoolean() throws IllegalStateException
{
381 throw new IllegalStateException("int is not applicable as boolean");
385 int[] asIntArray() throws IllegalStateException
{
386 return new int[] { value
};
391 return Integer
.toString(value
);
400 private static class MutableColumnFamilyOptionBooleanValue
401 extends MutableColumnFamilyOptionValue
<Boolean
> {
402 MutableColumnFamilyOptionBooleanValue(final boolean value
) {
408 throw new NumberFormatException("boolean is not applicable as double");
412 long asLong() throws NumberFormatException
{
413 throw new NumberFormatException("boolean is not applicable as Long");
417 int asInt() throws NumberFormatException
{
418 throw new NumberFormatException("boolean is not applicable as int");
422 boolean asBoolean() {
427 int[] asIntArray() throws IllegalStateException
{
428 throw new IllegalStateException("boolean is not applicable as int[]");
433 return Boolean
.toString(value
);
442 private static class MutableColumnFamilyOptionIntArrayValue
443 extends MutableColumnFamilyOptionValue
<int[]> {
444 MutableColumnFamilyOptionIntArrayValue(final int[] value
) {
450 throw new NumberFormatException("int[] is not applicable as double");
454 long asLong() throws NumberFormatException
{
455 throw new NumberFormatException("int[] is not applicable as Long");
459 int asInt() throws NumberFormatException
{
460 throw new NumberFormatException("int[] is not applicable as int");
464 boolean asBoolean() {
465 throw new NumberFormatException("int[] is not applicable as boolean");
469 int[] asIntArray() throws IllegalStateException
{
475 final StringBuilder builder
= new StringBuilder();
476 for(int i
= 0; i
< value
.length
; i
++) {
477 builder
.append(Integer
.toString(i
));
478 if(i
+ 1 < value
.length
) {
479 builder
.append(INT_ARRAY_INT_SEPARATOR
);
482 return builder
.toString();
491 private static class MutableColumnFamilyOptionEnumValue
<T
extends Enum
<T
>>
492 extends MutableColumnFamilyOptionValue
<T
> {
494 MutableColumnFamilyOptionEnumValue(final T value
) {
499 double asDouble() throws NumberFormatException
{
500 throw new NumberFormatException("Enum is not applicable as double");
504 long asLong() throws NumberFormatException
{
505 throw new NumberFormatException("Enum is not applicable as long");
509 int asInt() throws NumberFormatException
{
510 throw new NumberFormatException("Enum is not applicable as int");
514 boolean asBoolean() throws IllegalStateException
{
515 throw new NumberFormatException("Enum is not applicable as boolean");
519 int[] asIntArray() throws IllegalStateException
{
520 throw new NumberFormatException("Enum is not applicable as int[]");
534 public static class MutableColumnFamilyOptionsBuilder
535 implements MutableColumnFamilyOptionsInterface
{
537 private final static Map
<String
, MutableColumnFamilyOptionKey
> ALL_KEYS_LOOKUP
= new HashMap
<>();
539 for(final MutableColumnFamilyOptionKey key
: MemtableOption
.values()) {
540 ALL_KEYS_LOOKUP
.put(key
.name(), key
);
543 for(final MutableColumnFamilyOptionKey key
: CompactionOption
.values()) {
544 ALL_KEYS_LOOKUP
.put(key
.name(), key
);
547 for(final MutableColumnFamilyOptionKey key
: MiscOption
.values()) {
548 ALL_KEYS_LOOKUP
.put(key
.name(), key
);
552 private final Map
<MutableColumnFamilyOptionKey
, MutableColumnFamilyOptionValue
<?
>> options
= new LinkedHashMap
<>();
554 public MutableColumnFamilyOptions
build() {
555 final String keys
[] = new String
[options
.size()];
556 final String values
[] = new String
[options
.size()];
559 for(final Map
.Entry
<MutableColumnFamilyOptionKey
, MutableColumnFamilyOptionValue
<?
>> option
: options
.entrySet()) {
560 keys
[i
] = option
.getKey().name();
561 values
[i
] = option
.getValue().asString();
565 return new MutableColumnFamilyOptions(keys
, values
);
568 private MutableColumnFamilyOptionsBuilder
setDouble(
569 final MutableColumnFamilyOptionKey key
, final double value
) {
570 if(key
.getValueType() != ValueType
.DOUBLE
) {
571 throw new IllegalArgumentException(
572 key
+ " does not accept a double value");
574 options
.put(key
, new MutableColumnFamilyOptionDoubleValue(value
));
578 private double getDouble(final MutableColumnFamilyOptionKey key
)
579 throws NoSuchElementException
, NumberFormatException
{
580 final MutableColumnFamilyOptionValue
<?
> value
= options
.get(key
);
582 throw new NoSuchElementException(key
.name() + " has not been set");
584 return value
.asDouble();
587 private MutableColumnFamilyOptionsBuilder
setLong(
588 final MutableColumnFamilyOptionKey key
, final long value
) {
589 if(key
.getValueType() != ValueType
.LONG
) {
590 throw new IllegalArgumentException(
591 key
+ " does not accept a long value");
593 options
.put(key
, new MutableColumnFamilyOptionLongValue(value
));
597 private long getLong(final MutableColumnFamilyOptionKey key
)
598 throws NoSuchElementException
, NumberFormatException
{
599 final MutableColumnFamilyOptionValue
<?
> value
= options
.get(key
);
601 throw new NoSuchElementException(key
.name() + " has not been set");
603 return value
.asLong();
606 private MutableColumnFamilyOptionsBuilder
setInt(
607 final MutableColumnFamilyOptionKey key
, final int value
) {
608 if(key
.getValueType() != ValueType
.INT
) {
609 throw new IllegalArgumentException(
610 key
+ " does not accept an integer value");
612 options
.put(key
, new MutableColumnFamilyOptionIntValue(value
));
616 private int getInt(final MutableColumnFamilyOptionKey key
)
617 throws NoSuchElementException
, NumberFormatException
{
618 final MutableColumnFamilyOptionValue
<?
> value
= options
.get(key
);
620 throw new NoSuchElementException(key
.name() + " has not been set");
622 return value
.asInt();
625 private MutableColumnFamilyOptionsBuilder
setBoolean(
626 final MutableColumnFamilyOptionKey key
, final boolean value
) {
627 if(key
.getValueType() != ValueType
.BOOLEAN
) {
628 throw new IllegalArgumentException(
629 key
+ " does not accept a boolean value");
631 options
.put(key
, new MutableColumnFamilyOptionBooleanValue(value
));
635 private boolean getBoolean(final MutableColumnFamilyOptionKey key
)
636 throws NoSuchElementException
, NumberFormatException
{
637 final MutableColumnFamilyOptionValue
<?
> value
= options
.get(key
);
639 throw new NoSuchElementException(key
.name() + " has not been set");
641 return value
.asBoolean();
644 private MutableColumnFamilyOptionsBuilder
setIntArray(
645 final MutableColumnFamilyOptionKey key
, final int[] value
) {
646 if(key
.getValueType() != ValueType
.INT_ARRAY
) {
647 throw new IllegalArgumentException(
648 key
+ " does not accept an int array value");
650 options
.put(key
, new MutableColumnFamilyOptionIntArrayValue(value
));
654 private int[] getIntArray(final MutableColumnFamilyOptionKey key
)
655 throws NoSuchElementException
, NumberFormatException
{
656 final MutableColumnFamilyOptionValue
<?
> value
= options
.get(key
);
658 throw new NoSuchElementException(key
.name() + " has not been set");
660 return value
.asIntArray();
663 private <T
extends Enum
<T
>> MutableColumnFamilyOptionsBuilder
setEnum(
664 final MutableColumnFamilyOptionKey key
, final T value
) {
665 if(key
.getValueType() != ValueType
.ENUM
) {
666 throw new IllegalArgumentException(
667 key
+ " does not accept a Enum value");
669 options
.put(key
, new MutableColumnFamilyOptionEnumValue
<T
>(value
));
674 private <T
extends Enum
<T
>> T
getEnum(final MutableColumnFamilyOptionKey key
)
675 throws NoSuchElementException
, NumberFormatException
{
676 final MutableColumnFamilyOptionValue
<?
> value
= options
.get(key
);
678 throw new NoSuchElementException(key
.name() + " has not been set");
681 if(!(value
instanceof MutableColumnFamilyOptionEnumValue
)) {
682 throw new NoSuchElementException(key
.name() + " is not of Enum type");
685 return ((MutableColumnFamilyOptionEnumValue
<T
>)value
).asObject();
688 public MutableColumnFamilyOptionsBuilder
fromString(final String keyStr
,
689 final String valueStr
) throws IllegalArgumentException
{
690 Objects
.requireNonNull(keyStr
);
691 Objects
.requireNonNull(valueStr
);
693 final MutableColumnFamilyOptionKey key
= ALL_KEYS_LOOKUP
.get(keyStr
);
694 switch(key
.getValueType()) {
696 return setDouble(key
, Double
.parseDouble(valueStr
));
699 return setLong(key
, Long
.parseLong(valueStr
));
702 return setInt(key
, Integer
.parseInt(valueStr
));
705 return setBoolean(key
, Boolean
.parseBoolean(valueStr
));
708 final String
[] strInts
= valueStr
709 .trim().split(INT_ARRAY_INT_SEPARATOR
);
710 if(strInts
== null || strInts
.length
== 0) {
711 throw new IllegalArgumentException(
712 "int array value is not correctly formatted");
715 final int value
[] = new int[strInts
.length
];
717 for(final String strInt
: strInts
) {
718 value
[i
++] = Integer
.parseInt(strInt
);
720 return setIntArray(key
, value
);
723 throw new IllegalStateException(
724 key
+ " has unknown value type: " + key
.getValueType());
728 public MutableColumnFamilyOptionsBuilder
setWriteBufferSize(
729 final long writeBufferSize
) {
730 return setLong(MemtableOption
.write_buffer_size
, writeBufferSize
);
734 public long writeBufferSize() {
735 return getLong(MemtableOption
.write_buffer_size
);
739 public MutableColumnFamilyOptionsBuilder
setArenaBlockSize(
740 final long arenaBlockSize
) {
741 return setLong(MemtableOption
.arena_block_size
, arenaBlockSize
);
745 public long arenaBlockSize() {
746 return getLong(MemtableOption
.arena_block_size
);
750 public MutableColumnFamilyOptionsBuilder
setMemtablePrefixBloomSizeRatio(
751 final double memtablePrefixBloomSizeRatio
) {
752 return setDouble(MemtableOption
.memtable_prefix_bloom_size_ratio
,
753 memtablePrefixBloomSizeRatio
);
757 public double memtablePrefixBloomSizeRatio() {
758 return getDouble(MemtableOption
.memtable_prefix_bloom_size_ratio
);
762 public MutableColumnFamilyOptionsBuilder
setMemtableHugePageSize(
763 final long memtableHugePageSize
) {
764 return setLong(MemtableOption
.memtable_huge_page_size
,
765 memtableHugePageSize
);
769 public long memtableHugePageSize() {
770 return getLong(MemtableOption
.memtable_huge_page_size
);
774 public MutableColumnFamilyOptionsBuilder
setMaxSuccessiveMerges(
775 final long maxSuccessiveMerges
) {
776 return setLong(MemtableOption
.max_successive_merges
, maxSuccessiveMerges
);
780 public long maxSuccessiveMerges() {
781 return getLong(MemtableOption
.max_successive_merges
);
785 public MutableColumnFamilyOptionsBuilder
setMaxWriteBufferNumber(
786 final int maxWriteBufferNumber
) {
787 return setInt(MemtableOption
.max_write_buffer_number
,
788 maxWriteBufferNumber
);
792 public int maxWriteBufferNumber() {
793 return getInt(MemtableOption
.max_write_buffer_number
);
797 public MutableColumnFamilyOptionsBuilder
setInplaceUpdateNumLocks(
798 final long inplaceUpdateNumLocks
) {
799 return setLong(MemtableOption
.inplace_update_num_locks
,
800 inplaceUpdateNumLocks
);
804 public long inplaceUpdateNumLocks() {
805 return getLong(MemtableOption
.inplace_update_num_locks
);
809 public MutableColumnFamilyOptionsBuilder
setDisableAutoCompactions(
810 final boolean disableAutoCompactions
) {
811 return setBoolean(CompactionOption
.disable_auto_compactions
,
812 disableAutoCompactions
);
816 public boolean disableAutoCompactions() {
817 return getBoolean(CompactionOption
.disable_auto_compactions
);
821 public MutableColumnFamilyOptionsBuilder
setSoftPendingCompactionBytesLimit(
822 final long softPendingCompactionBytesLimit
) {
823 return setLong(CompactionOption
.soft_pending_compaction_bytes_limit
,
824 softPendingCompactionBytesLimit
);
828 public long softPendingCompactionBytesLimit() {
829 return getLong(CompactionOption
.soft_pending_compaction_bytes_limit
);
833 public MutableColumnFamilyOptionsBuilder
setHardPendingCompactionBytesLimit(
834 final long hardPendingCompactionBytesLimit
) {
835 return setLong(CompactionOption
.hard_pending_compaction_bytes_limit
,
836 hardPendingCompactionBytesLimit
);
840 public long hardPendingCompactionBytesLimit() {
841 return getLong(CompactionOption
.hard_pending_compaction_bytes_limit
);
845 public MutableColumnFamilyOptionsBuilder
setLevel0FileNumCompactionTrigger(
846 final int level0FileNumCompactionTrigger
) {
847 return setInt(CompactionOption
.level0_file_num_compaction_trigger
,
848 level0FileNumCompactionTrigger
);
852 public int level0FileNumCompactionTrigger() {
853 return getInt(CompactionOption
.level0_file_num_compaction_trigger
);
857 public MutableColumnFamilyOptionsBuilder
setLevel0SlowdownWritesTrigger(
858 final int level0SlowdownWritesTrigger
) {
859 return setInt(CompactionOption
.level0_slowdown_writes_trigger
,
860 level0SlowdownWritesTrigger
);
864 public int level0SlowdownWritesTrigger() {
865 return getInt(CompactionOption
.level0_slowdown_writes_trigger
);
869 public MutableColumnFamilyOptionsBuilder
setLevel0StopWritesTrigger(
870 final int level0StopWritesTrigger
) {
871 return setInt(CompactionOption
.level0_stop_writes_trigger
,
872 level0StopWritesTrigger
);
876 public int level0StopWritesTrigger() {
877 return getInt(CompactionOption
.level0_stop_writes_trigger
);
881 public MutableColumnFamilyOptionsBuilder
setMaxCompactionBytes(final long maxCompactionBytes
) {
882 return setLong(CompactionOption
.max_compaction_bytes
, maxCompactionBytes
);
886 public long maxCompactionBytes() {
887 return getLong(CompactionOption
.max_compaction_bytes
);
892 public MutableColumnFamilyOptionsBuilder
setTargetFileSizeBase(
893 final long targetFileSizeBase
) {
894 return setLong(CompactionOption
.target_file_size_base
,
899 public long targetFileSizeBase() {
900 return getLong(CompactionOption
.target_file_size_base
);
904 public MutableColumnFamilyOptionsBuilder
setTargetFileSizeMultiplier(
905 final int targetFileSizeMultiplier
) {
906 return setInt(CompactionOption
.target_file_size_multiplier
,
907 targetFileSizeMultiplier
);
911 public int targetFileSizeMultiplier() {
912 return getInt(CompactionOption
.target_file_size_multiplier
);
916 public MutableColumnFamilyOptionsBuilder
setMaxBytesForLevelBase(
917 final long maxBytesForLevelBase
) {
918 return setLong(CompactionOption
.max_bytes_for_level_base
,
919 maxBytesForLevelBase
);
923 public long maxBytesForLevelBase() {
924 return getLong(CompactionOption
.max_bytes_for_level_base
);
928 public MutableColumnFamilyOptionsBuilder
setMaxBytesForLevelMultiplier(
929 final double maxBytesForLevelMultiplier
) {
930 return setDouble(CompactionOption
.max_bytes_for_level_multiplier
, maxBytesForLevelMultiplier
);
934 public double maxBytesForLevelMultiplier() {
935 return getDouble(CompactionOption
.max_bytes_for_level_multiplier
);
939 public MutableColumnFamilyOptionsBuilder
setMaxBytesForLevelMultiplierAdditional(
940 final int[] maxBytesForLevelMultiplierAdditional
) {
942 CompactionOption
.max_bytes_for_level_multiplier_additional
,
943 maxBytesForLevelMultiplierAdditional
);
947 public int[] maxBytesForLevelMultiplierAdditional() {
949 CompactionOption
.max_bytes_for_level_multiplier_additional
);
953 public MutableColumnFamilyOptionsBuilder
setMaxSequentialSkipInIterations(
954 final long maxSequentialSkipInIterations
) {
955 return setLong(MiscOption
.max_sequential_skip_in_iterations
,
956 maxSequentialSkipInIterations
);
960 public long maxSequentialSkipInIterations() {
961 return getLong(MiscOption
.max_sequential_skip_in_iterations
);
965 public MutableColumnFamilyOptionsBuilder
setParanoidFileChecks(
966 final boolean paranoidFileChecks
) {
967 return setBoolean(MiscOption
.paranoid_file_checks
, paranoidFileChecks
);
971 public boolean paranoidFileChecks() {
972 return getBoolean(MiscOption
.paranoid_file_checks
);
976 public MutableColumnFamilyOptionsBuilder
setCompressionType(
977 final CompressionType compressionType
) {
978 return setEnum(MiscOption
.compression_type
, compressionType
);
982 public CompressionType
compressionType() {
983 return (CompressionType
)getEnum(MiscOption
.compression_type
);
987 public MutableColumnFamilyOptionsBuilder
setReportBgIoStats(
988 final boolean reportBgIoStats
) {
989 return setBoolean(MiscOption
.report_bg_io_stats
, reportBgIoStats
);
993 public boolean reportBgIoStats() {
994 return getBoolean(MiscOption
.report_bg_io_stats
);