Modifier and Type | Class and Description |
---|---|
static class |
LockBasedScheduler.LockBasedSchedulerBuilder |
Scheduler.SchedulerOption
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.atomic.AtomicReference<SegmentNodeState> |
head |
Constructor and Description |
---|
LockBasedScheduler(LockBasedScheduler.LockBasedSchedulerBuilder builder) |
Modifier and Type | Method and Description |
---|---|
static LockBasedScheduler.LockBasedSchedulerBuilder |
builder(@NotNull Revisions revisions,
@NotNull SegmentReader reader,
@NotNull SegmentNodeStoreStats stats) |
java.lang.String |
checkpoint(long lifetime,
@NotNull java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new checkpoint of the latest root of the tree.
|
protected void |
contentChanged(NodeState root,
CommitInfo info) |
NodeState |
getHeadNodeState()
Returns the latest state of the tree.
|
boolean |
removeCheckpoint(java.lang.String name)
Releases the provided checkpoint.
|
NodeState |
schedule(@NotNull Commit commit,
Scheduler.SchedulerOption... schedulingOptions)
Schedule a
commit . |
protected final java.util.concurrent.atomic.AtomicReference<SegmentNodeState> head
public LockBasedScheduler(LockBasedScheduler.LockBasedSchedulerBuilder builder)
public static LockBasedScheduler.LockBasedSchedulerBuilder builder(@NotNull @NotNull Revisions revisions, @NotNull @NotNull SegmentReader reader, @NotNull @NotNull SegmentNodeStoreStats stats)
public NodeState getHeadNodeState()
Scheduler
getHeadNodeState
in interface Scheduler
protected void contentChanged(NodeState root, CommitInfo info)
public NodeState schedule(@NotNull @NotNull Commit commit, Scheduler.SchedulerOption... schedulingOptions) throws CommitFailedException
Scheduler
commit
. This method blocks until the changes in this
commit
have been processed and persisted. That is, until a call
to Scheduler.getHeadNodeState()
would return a node state reflecting those
changes.schedule
in interface Scheduler
commit
- the commitschedulingOptions
- implementation specific scheduling optionsCommitFailedException
- if the commit failed and none of the changes
have been applied.public java.lang.String checkpoint(long lifetime, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> properties)
Scheduler
The properties
passed to this methods are associated with the
checkpoint and can be retrieved through the
NodeStore.checkpointInfo(String)
method. Its semantics is entirely application specific.
checkpoint
in interface Scheduler
lifetime
- time (in milliseconds, > 0) that the checkpoint
should remain availableproperties
- properties to associate with the checkpointpublic boolean removeCheckpoint(java.lang.String name)
Scheduler
true
.removeCheckpoint
in interface Scheduler
name
- string reference of a checkpointtrue
if the checkpoint was successfully removed, or if it doesn't existCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.