
org.rocksdb.CompactionStyle Maven / Gradle / Ivy
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
package alluxio.shaded.client.org.rocksdb;
import java.util.List;
/**
* Enum CompactionStyle
*
* RocksDB supports different styles of alluxio.shaded.client.com.action. Available
* alluxio.shaded.client.com.action styles can be chosen using this enumeration.
*
*
* - LEVEL - Level based Compaction style
* - UNIVERSAL - Universal Compaction Style is a
* alluxio.shaded.client.com.action style, targeting the use cases requiring lower write
* amplification, trading off read amplification and space
* amplification.
* - FIFO - FIFO alluxio.shaded.client.com.action style is the simplest
* alluxio.shaded.client.com.action strategy. It is suited for keeping event log data with
* very low overhead (query log for example). It periodically deletes
* the old data, so it's basically a TTL alluxio.shaded.client.com.action style.
* - NONE - Disable background alluxio.shaded.client.com.action.
* Compaction jobs are submitted
* {@link RocksDB#alluxio.shaded.client.com.actFiles(CompactionOptions, ColumnFamilyHandle, List, int, int, CompactionJobInfo)} ()}.
*
*
* @see
* Universal Compaction
* @see
* FIFO Compaction
*/
public enum CompactionStyle {
LEVEL((byte) 0x0),
UNIVERSAL((byte) 0x1),
FIFO((byte) 0x2),
NONE((byte) 0x3);
private final byte value;
CompactionStyle(final byte value) {
this.value = value;
}
/**
* Get the internal representation value.
*
* @return the internal representation value.
*/
//TODO(AR) should be made package-private
public byte getValue() {
return value;
}
/**
* Get the Compaction style from the internal representation value.
*
* @param value the internal representation value.
*
* @return the Compaction style
*
* @throws IllegalArgumentException if the value does not match a
* CompactionStyle
*/
static CompactionStyle fromValue(final byte value)
throws IllegalArgumentException {
for (final CompactionStyle alluxio.shaded.client.com.actionStyle : CompactionStyle.values()) {
if (alluxio.shaded.client.com.actionStyle.value == value) {
return alluxio.shaded.client.com.actionStyle;
}
}
throw new IllegalArgumentException("Unknown value for CompactionStyle: "
+ value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy