public final class SnapshotDescriptor extends Object implements AutoCloseable
Snapshot of the state machine.
Snapshot descriptors represent the header of a snapshot file which stores metadata about the snapshot contents. This API provides methods for reading and a builder for writing snapshot headers/descriptors.
| Modifier and Type | Class and Description |
|---|---|
static class |
SnapshotDescriptor.Builder
Snapshot descriptor builder.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTES |
| Constructor and Description |
|---|
SnapshotDescriptor(Buffer buffer) |
| Modifier and Type | Method and Description |
|---|---|
static SnapshotDescriptor.Builder |
builder()
Returns a descriptor builder.
|
static SnapshotDescriptor.Builder |
builder(Buffer buffer)
Returns a descriptor builder for the given descriptor buffer.
|
void |
close() |
void |
delete()
Deletes the descriptor.
|
long |
index()
Returns the snapshot index.
|
void |
lock()
Locks the segment.
|
boolean |
locked()
Returns whether the snapshot has been locked by commitment.
|
long |
timestamp()
Returns the snapshot timestamp.
|
public static final int BYTES
public SnapshotDescriptor(Buffer buffer)
NullPointerException - if buffer is nullpublic static SnapshotDescriptor.Builder builder()
The descriptor builder will write segment metadata to a 48 byte in-memory buffer.
public static SnapshotDescriptor.Builder builder(Buffer buffer)
buffer - The descriptor buffer.NullPointerException - if buffer is nullpublic long index()
public long timestamp()
public boolean locked()
A snapshot will be locked once it has been fully written.
public void lock()
public void close()
close in interface AutoCloseablepublic void delete()
Copyright © 2013–2016. All rights reserved.