]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/CompactionStopStyle.java
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / CompactionStopStyle.java
1 package org.rocksdb;
2
3 /**
4 * Algorithm used to make a compaction request stop picking new files
5 * into a single compaction run
6 */
7 public enum CompactionStopStyle {
8
9 /**
10 * Pick files of similar size
11 */
12 CompactionStopStyleSimilarSize((byte)0x0),
13
14 /**
15 * Total size of picked files > next file
16 */
17 CompactionStopStyleTotalSize((byte)0x1);
18
19
20 private final byte value;
21
22 CompactionStopStyle(final byte value) {
23 this.value = value;
24 }
25
26 /**
27 * Returns the byte value of the enumerations value
28 *
29 * @return byte representation
30 */
31 public byte getValue() {
32 return value;
33 }
34
35 /**
36 * Get CompactionStopStyle by byte value.
37 *
38 * @param value byte representation of CompactionStopStyle.
39 *
40 * @return {@link org.rocksdb.CompactionStopStyle} instance or null.
41 * @throws java.lang.IllegalArgumentException if an invalid
42 * value is provided.
43 */
44 public static CompactionStopStyle getCompactionStopStyle(final byte value) {
45 for (final CompactionStopStyle compactionStopStyle :
46 CompactionStopStyle.values()) {
47 if (compactionStopStyle.getValue() == value){
48 return compactionStopStyle;
49 }
50 }
51 throw new IllegalArgumentException(
52 "Illegal value provided for CompactionStopStyle.");
53 }
54 }