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).
11 public enum OperationStage
{
12 STAGE_UNKNOWN((byte)0x0),
13 STAGE_FLUSH_RUN((byte)0x1),
14 STAGE_FLUSH_WRITE_L0((byte)0x2),
15 STAGE_COMPACTION_PREPARE((byte)0x3),
16 STAGE_COMPACTION_RUN((byte)0x4),
17 STAGE_COMPACTION_PROCESS_KV((byte)0x5),
18 STAGE_COMPACTION_INSTALL((byte)0x6),
19 STAGE_COMPACTION_SYNC_FILE((byte)0x7),
20 STAGE_PICK_MEMTABLES_TO_FLUSH((byte)0x8),
21 STAGE_MEMTABLE_ROLLBACK((byte)0x9),
22 STAGE_MEMTABLE_INSTALL_FLUSH_RESULTS((byte)0xA);
24 private final byte value
;
26 OperationStage(final byte value
) {
31 * Get the internal representation value.
33 * @return the internal representation value.
40 * Get the Operation stage from the internal representation value.
42 * @param value the internal representation value.
44 * @return the operation stage
46 * @throws IllegalArgumentException if the value does not match
49 static OperationStage
fromValue(final byte value
)
50 throws IllegalArgumentException
{
51 for (final OperationStage threadType
: OperationStage
.values()) {
52 if (threadType
.value
== value
) {
56 throw new IllegalArgumentException(
57 "Unknown value for OperationStage: " + value
);