Class PageTimedWriter

java.lang.Object
org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
org.apache.activemq.artemis.core.paging.impl.PageTimedWriter
All Implemented Interfaces:
Runnable, ActiveMQComponent

public class PageTimedWriter extends ActiveMQScheduledComponent
  • Field Details

    • pageEvents

      protected final List<PageTimedWriter.PageEvent> pageEvents
    • pendingTasks

      protected volatile int pendingTasks
    • syncNonTX

      protected final boolean syncNonTX
  • Constructor Details

  • Method Details

    • hasPendingIO

      public boolean hasPendingIO()
    • getMaxCredits

      public int getMaxCredits()
    • stop

      public void stop()
      Specified by:
      stop in interface ActiveMQComponent
      Overrides:
      stop in class ActiveMQScheduledComponent
    • incrementTask

      public void incrementTask()
      We increment task while holding the readLock. This is because we verify if the system is paging, and we get out of paging when no pending tasks and no pending messages. We allocate a task while holding the read Lock. We cannot call addTask within the lock as if the semaphore gets out of credits we would deadlock in certain cases.
    • addTask

      public int addTask(OperationContext context, PagedMessage message, Transaction tx, RouteContextList listCtx, boolean useFlowControl)
    • flowControl

      public void flowControl(int credits)
    • run

      public void run()
    • processMessages

      protected void processMessages()
    • performSync

      protected void performSync() throws Exception
      Throws:
      Exception
    • getAvailablePermits

      public int getAvailablePermits()