Class LockBasedScheduler

  • All Implemented Interfaces:
    Scheduler

    public class LockBasedScheduler
    extends java.lang.Object
    implements Scheduler
    • Field Detail

      • head

        protected final java.util.concurrent.atomic.AtomicReference<SegmentNodeState> head
    • Method Detail

      • getHeadNodeState

        public NodeState getHeadNodeState()
        Description copied from interface: Scheduler
        Returns the latest state of the tree.
        Specified by:
        getHeadNodeState in interface Scheduler
        Returns:
        the latest state.
      • checkpoint

        public java.lang.String checkpoint​(long lifetime,
                                           @NotNull
                                           @NotNull java.util.Map<java.lang.String,​java.lang.String> properties)
        Description copied from interface: Scheduler
        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 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.

        Specified by:
        checkpoint in interface Scheduler
        Parameters:
        lifetime - time (in milliseconds, > 0) that the checkpoint should remain available
        properties - properties to associate with the checkpoint
        Returns:
        string reference of this checkpoint
      • removeCheckpoint

        public boolean removeCheckpoint​(java.lang.String name)
        Description copied from interface: Scheduler
        Releases the provided checkpoint. If the provided checkpoint doesn't exist this method should return true.
        Specified by:
        removeCheckpoint in interface Scheduler
        Parameters:
        name - string reference of a checkpoint
        Returns:
        true if the checkpoint was successfully removed, or if it doesn't exist