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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<PageTimedWriter.PageEvent>protected intprotected final booleanFields inherited from class org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
executor, scheduledExecutorService -
Constructor Summary
ConstructorsConstructorDescriptionPageTimedWriter(int writeCredits, StorageManager storageManager, PagingStoreImpl pagingStore, ScheduledExecutorService scheduledExecutor, Executor executor, boolean syncNonTX, long timeSync) -
Method Summary
Modifier and TypeMethodDescriptionintaddTask(OperationContext context, PagedMessage message, Transaction tx, RouteContextList listCtx, boolean useFlowControl) voidflowControl(int credits) intintbooleanvoidWe increment task while holding the readLock.protected voidprotected voidvoidrun()voidstop()Methods inherited from class org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
delay, getInitialDelay, getPeriod, getThreadFactory, getTimeUnit, isStarted, setInitialDelay, setInitialDelayAndPeriod, setInitialDelayAndPeriod, setPeriod, setPeriod, setTimeUnit, startMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Field Details
-
pageEvents
-
pendingTasks
protected volatile int pendingTasks -
syncNonTX
protected final boolean syncNonTX
-
-
Constructor Details
-
PageTimedWriter
public PageTimedWriter(int writeCredits, StorageManager storageManager, PagingStoreImpl pagingStore, ScheduledExecutorService scheduledExecutor, Executor executor, boolean syncNonTX, long timeSync)
-
-
Method Details
-
hasPendingIO
public boolean hasPendingIO() -
getMaxCredits
public int getMaxCredits() -
stop
public void stop()- Specified by:
stopin interfaceActiveMQComponent- Overrides:
stopin classActiveMQScheduledComponent
-
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
- Throws:
Exception
-
getAvailablePermits
public int getAvailablePermits()
-