Class SimpleProcedureScheduler

java.lang.Object
org.apache.iotdb.confignode.procedure.scheduler.AbstractProcedureScheduler
org.apache.iotdb.confignode.procedure.scheduler.SimpleProcedureScheduler
All Implemented Interfaces:
ProcedureScheduler

public class SimpleProcedureScheduler extends AbstractProcedureScheduler
Simple scheduler for procedures
  • Constructor Details

    • SimpleProcedureScheduler

      public SimpleProcedureScheduler()
  • Method Details

    • enqueue

      protected void enqueue(Procedure procedure, boolean addFront)
      Description copied from class: AbstractProcedureScheduler
      Add the procedure to the queue. NOTE: this method is called with the sched lock held.
      Specified by:
      enqueue in class AbstractProcedureScheduler
      Parameters:
      procedure - the Procedure to add
      addFront - true if the item should be added to the front of the queue
    • dequeue

      protected Procedure dequeue()
      Description copied from class: AbstractProcedureScheduler
      Fetch one Procedure from the queue NOTE: this method is called with the sched lock held.
      Specified by:
      dequeue in class AbstractProcedureScheduler
      Returns:
      the Procedure to execute, or null if nothing is available.
    • clear

      public void clear()
      Description copied from interface: ProcedureScheduler
      Clear current state of scheduler such that it is equivalent to newly created scheduler. Used for testing failure and recovery.
    • yield

      public void yield(Procedure proc)
      Description copied from interface: ProcedureScheduler
      The procedure can't run at the moment. add it back to the queue, giving priority to someone else.
      Parameters:
      proc - the Procedure to add back to the list
    • queueHasRunnables

      public boolean queueHasRunnables()
      Description copied from class: AbstractProcedureScheduler
      Returns true if there are procedures available to process. NOTE: this method is called with the sched lock held.
      Specified by:
      queueHasRunnables in class AbstractProcedureScheduler
      Returns:
      true if there are procedures available to process, otherwise false.
    • queueSize

      public int queueSize()
      Description copied from class: AbstractProcedureScheduler
      Returns the number of elements in this queue. NOTE: this method is called with the sched lock held.
      Specified by:
      queueSize in class AbstractProcedureScheduler
      Returns:
      the number of elements in this queue.
    • addWaiting

      public void addWaiting(Procedure proc)
    • releaseWaiting

      public void releaseWaiting()