]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/WalFileType.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).
8 public enum WalFileType
{
10 * Indicates that WAL file is in archive directory. WAL files are moved from
11 * the main db directory to archive directory once they are not live and stay
12 * there until cleaned up. Files are cleaned depending on archive size
13 * (Options::WAL_size_limit_MB) and time since last cleaning
14 * (Options::WAL_ttl_seconds).
16 kArchivedLogFile((byte)0x0),
19 * Indicates that WAL file is live and resides in the main db directory
21 kAliveLogFile((byte)0x1);
23 private final byte value
;
25 WalFileType(final byte value
) {
30 * Get the internal representation value.
32 * @return the internal representation value
39 * Get the WalFileType from the internal representation value.
41 * @return the wal file type.
43 * @throws IllegalArgumentException if the value is unknown.
45 static WalFileType
fromValue(final byte value
) {
46 for (final WalFileType walFileType
: WalFileType
.values()) {
47 if(walFileType
.value
== value
) {
52 throw new IllegalArgumentException(
53 "Illegal value provided for WalFileType: " + value
);