public enum StorageLevel extends Enum<StorageLevel>
Log storage level configuration values which control how logs are stored on disk or in memory.
Storage levels represent the method used to store the individual segments that make up a
Log. When configuring a Storage module, the storage can be configured to write
entries to disk, memory, or memory-mapped files using the
values provided by this enum. The StorageLevel configuration dictates the type of
Buffer to which to write entries. See the specific storage levels for more
information.
| Enum Constant and Description |
|---|
DISK
Stores logs on disk.
|
MAPPED
Stores logs in memory mapped files.
|
MEMORY
Stores logs in memory only.
|
| Modifier and Type | Method and Description |
|---|---|
static StorageLevel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static StorageLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StorageLevel MEMORY
In-memory logs will be written to segments backed by HeapBuffer.
Each MEMORY segment may only store up to 2^32-1 bytes. Entries written to in-memory logs are
not recoverable after a crash. If your use case requires strong persistence, use DISK or MAPPED
storage.
public static final StorageLevel MAPPED
Memory mapped logs will be written to segments backed by MappedBuffer.
Entries written to memory mapped files may be recovered after a crash, but the MAPPED storage level does not
guarantee that all entries written to the log will be persisted. Additionally, the use of persistent storage
levels reduces the amount of overhead required to catch the log up at startup.
public static final StorageLevel DISK
On-disk logs will be written to segments backed by FileBuffer, which
in turn is backed by RandomAccessFile. Entries written to DISK storage can be recovered in the
event of a failure or other restart. Additionally, the use of persistent storage levels reduces the amount of overhead
required to catch the log up at startup.
public static StorageLevel[] values()
for (StorageLevel c : StorageLevel.values()) System.out.println(c);
public static StorageLevel valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2013–2016. All rights reserved.