public interface CheckpointService
Checkpoints are assumed to be atomic, single-writer, write-once, multiple-readers, ready-many type of objects.
To ensure this, any implementation of this interface must.
1) Return a CheckpointID to a client only
upon the successful commit of the checkpoint.
2) Prevent any checkpoint from being re-opened for writes.
Non-functional properties such as durability, availability, compression, garbage collection, and quotas are left to the implementation.
This API is envisioned as the basic building block for a checkpoint service, on top of which richer interfaces can be layered (e.g., frameworks providing object-serialization, checkpoint metadata and provenance, etc.)
| Modifier and Type | Interface and Description |
|---|---|
static interface |
CheckpointService.CheckpointReadChannel
A channel to read from a checkpoint.
|
static interface |
CheckpointService.CheckpointWriteChannel
A channel to write to a checkpoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(CheckpointService.CheckpointWriteChannel channel)
Aborts the current checkpoint.
|
CheckpointID |
commit(CheckpointService.CheckpointWriteChannel channel)
Closes an existing checkpoint for writes and returns the CheckpointID that can be later
used to get the read-only access to this checkpoint.
|
CheckpointService.CheckpointWriteChannel |
create()
Creates a checkpoint and provides a channel to write to it.
|
boolean |
delete(CheckpointID checkpointId)
Discards an existing checkpoint identified by its CheckpointID.
|
CheckpointService.CheckpointReadChannel |
open(CheckpointID checkpointId)
Returns a reading channel to a checkpoint identified by the CheckpointID.
|
CheckpointService.CheckpointWriteChannel create() throws IOException, InterruptedException
commit is called.
This makes enforcing atomicity of writes easy.IOExceptionInterruptedExceptionCheckpointID commit(CheckpointService.CheckpointWriteChannel channel) throws IOException, InterruptedException
channel - the CheckpointWriteChannel to commitIOExceptionInterruptedExceptionvoid abort(CheckpointService.CheckpointWriteChannel channel) throws IOException, InterruptedException
channel - the CheckpointWriteChannel to abortIOExceptionInterruptedExceptionCheckpointService.CheckpointReadChannel open(CheckpointID checkpointId) throws IOException, InterruptedException
checkpointId - CheckpointID for the checkpoint to be openedIOExceptionInterruptedExceptionboolean delete(CheckpointID checkpointId) throws IOException, InterruptedException
checkpointId - CheckpointID for the checkpoint to be deletedIOExceptionInterruptedExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.