]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/OperationType.java
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
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).
9 * The type used to refer to a thread operation.
11 * A thread operation describes high-level action of a thread,
12 * examples include compaction and flush.
14 public enum OperationType
{
15 OP_UNKNOWN((byte)0x0),
16 OP_COMPACTION((byte)0x1),
19 private final byte value
;
21 OperationType(final byte value
) {
26 * Get the internal representation value.
28 * @return the internal representation value.
35 * Get the Operation type from the internal representation value.
37 * @param value the internal representation value.
39 * @return the operation type
41 * @throws IllegalArgumentException if the value does not match
44 static OperationType
fromValue(final byte value
)
45 throws IllegalArgumentException
{
46 for (final OperationType threadType
: OperationType
.values()) {
47 if (threadType
.value
== value
) {
51 throw new IllegalArgumentException(
52 "Unknown value for OperationType: " + value
);