Constructor and Description |
---|
CheckpointWriter(CorfuRuntime rt,
UUID streamId,
String author,
T map)
Constructor for Checkpoint Writer for Corfu Maps.
|
Modifier and Type | Method and Description |
---|---|
Token |
appendCheckpoint() |
void |
appendObjectState(Set<Map.Entry> entries)
Append zero or more CONTINUATION records to this
object's stream.
|
void |
finishCheckpoint()
Append a checkpoint END record to this object's stream.
|
void |
startCheckpoint(Token txnSnapshot,
long vloVersion)
Append a checkpoint START record to this object's stream.
|
public CheckpointWriter(CorfuRuntime rt, UUID streamId, String author, T map)
rt
- object's runtimestreamId
- unique identifier of stream to checkpointauthor
- checkpoint initiatormap
- local reference of the map to checkpointpublic Token appendCheckpoint()
public void startCheckpoint(Token txnSnapshot, long vloVersion)
Corfu client transaction management, if desired, is the caller's responsibility.
public void appendObjectState(Set<Map.Entry> entries)
Corfu client transaction management, if desired, is the caller's responsibility.
The Iterators class appears to preserve the laziness of Stream processing; we don't wish to use more memory than strictly necessary to generate the checkpoint. NOTE: It would be even more useful if the map had a lazy iterator: the eagerness of map.keySet().stream() is not ideal, but at least it should be much smaller than the entire map.
NOTE: The postAppendFunc lambda is executed in the current thread context, i.e., inside of a Corfu transaction, and that transaction will be *aborted* at the end of this function. Any Corfu data modifying ops will be undone by the TXAbort().
public void finishCheckpoint()
Corfu client transaction management, if desired, is the caller's responsibility.
Copyright © 2019 CorfuDB. All rights reserved.