Interface Scheduler
-
- All Known Implementing Classes:
LockBasedScheduler
public interface SchedulerASchedulerinstance transforms changes to the content tree into a queue ofcommits.An implementation is free to employ any scheduling strategy as long as it guarantees all changes are applied atomically without changing the semantics of the changes recorded in the
NodeBuilderor the semantics of theCommitHookcontained in the actualCommitpassed to theschedulemethod.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceScheduler.SchedulerOptionScheduling options for parametrizing individual commits.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringcheckpoint(long lifetime, @NotNull Map<String,String> properties)Creates a new checkpoint of the latest root of the tree.NodeStategetHeadNodeState()Returns the latest state of the tree.booleanremoveCheckpoint(String name)Releases the provided checkpoint.NodeStateschedule(@NotNull Commit commit, Scheduler.SchedulerOption... schedulingOptions)Schedule acommit.
-
-
-
Method Detail
-
schedule
NodeState schedule(@NotNull @NotNull Commit commit, Scheduler.SchedulerOption... schedulingOptions) throws CommitFailedException
Schedule acommit. This method blocks until the changes in thiscommithave been processed and persisted. That is, until a call togetHeadNodeState()would return a node state reflecting those changes.- Parameters:
commit- the commitschedulingOptions- implementation specific scheduling options- Throws:
CommitFailedException- if the commit failed and none of the changes have been applied.
-
checkpoint
String checkpoint(long lifetime, @NotNull @NotNull Map<String,String> properties)
Creates a new checkpoint of the latest root of the tree. The checkpoint remains valid for at least as long as requested and allows that state of the repository to be retrieved using the returned opaque string reference.The
propertiespassed to this methods are associated with the checkpoint and can be retrieved through theNodeStore.checkpointInfo(String)method. Its semantics is entirely application specific.- Parameters:
lifetime- time (in milliseconds, > 0) that the checkpoint should remain availableproperties- properties to associate with the checkpoint- Returns:
- string reference of this checkpoint
-
removeCheckpoint
boolean removeCheckpoint(String name)
Releases the provided checkpoint. If the provided checkpoint doesn't exist this method should returntrue.- Parameters:
name- string reference of a checkpoint- Returns:
trueif the checkpoint was successfully removed, or if it doesn't exist
-
getHeadNodeState
NodeState getHeadNodeState()
Returns the latest state of the tree.- Returns:
- the latest state.
-
-