Class PageSubscriptionCounterImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.paging.cursor.impl.PageSubscriptionCounterImpl
-
- All Implemented Interfaces:
PageSubscriptionCounter
public class PageSubscriptionCounterImpl extends Object implements PageSubscriptionCounter
This class will encapsulate the persistent counters for the PagingSubscription
-
-
Constructor Summary
Constructors Constructor Description PageSubscriptionCounterImpl(StorageManager storage, PageSubscription subscription, boolean persistent, long subscriptionID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyIncrementOnTX(Transaction tx, long recordID1, int add, long size)This method will install the TXsprotected voidcleanup()This method should always be called from a single threaded executorvoidcleanupNonTXCounters(long pageID)Cleanup temporary page counters on non transactional paged messagesvoiddelete()voiddelete(Transaction tx)longgetPersistentSize()longgetPersistentSizeAdded()longgetValue()longgetValueAdded()voidincrement(Transaction tx, int add, long size)voidloadInc(long id, int add, long size)voidloadValue(long recordID1, long value1, long size)voidpendingCounter(Page page, int increment, long size)This is used only on non transactional pagingvoidprocessReload()This will process the reloadvoidsetPersistent(boolean persistent)used on testing only
-
-
-
Constructor Detail
-
PageSubscriptionCounterImpl
public PageSubscriptionCounterImpl(StorageManager storage, PageSubscription subscription, boolean persistent, long subscriptionID)
-
-
Method Detail
-
getValueAdded
public long getValueAdded()
- Specified by:
getValueAddedin interfacePageSubscriptionCounter
-
getValue
public long getValue()
- Specified by:
getValuein interfacePageSubscriptionCounter
-
getPersistentSizeAdded
public long getPersistentSizeAdded()
- Specified by:
getPersistentSizeAddedin interfacePageSubscriptionCounter
-
getPersistentSize
public long getPersistentSize()
- Specified by:
getPersistentSizein interfacePageSubscriptionCounter
-
pendingCounter
public void pendingCounter(Page page, int increment, long size) throws Exception
This is used only on non transactional paging- Specified by:
pendingCounterin interfacePageSubscriptionCounter- Parameters:
page-increment-- Throws:
Exception
-
cleanupNonTXCounters
public void cleanupNonTXCounters(long pageID) throws ExceptionCleanup temporary page counters on non transactional paged messages- Specified by:
cleanupNonTXCountersin interfacePageSubscriptionCounter- Parameters:
pageID-- Throws:
Exception
-
increment
public void increment(Transaction tx, int add, long size) throws Exception
- Specified by:
incrementin interfacePageSubscriptionCounter- Throws:
Exception
-
applyIncrementOnTX
public void applyIncrementOnTX(Transaction tx, long recordID1, int add, long size)
This method will install the TXs- Specified by:
applyIncrementOnTXin interfacePageSubscriptionCounter- Parameters:
tx-recordID1-add-
-
loadValue
public void loadValue(long recordID1, long value1, long size)- Specified by:
loadValuein interfacePageSubscriptionCounter
-
delete
public void delete() throws Exception- Specified by:
deletein interfacePageSubscriptionCounter- Throws:
Exception
-
delete
public void delete(Transaction tx) throws Exception
- Specified by:
deletein interfacePageSubscriptionCounter- Throws:
Exception
-
loadInc
public void loadInc(long id, int add, long size)- Specified by:
loadIncin interfacePageSubscriptionCounter
-
processReload
public void processReload()
Description copied from interface:PageSubscriptionCounterThis will process the reload- Specified by:
processReloadin interfacePageSubscriptionCounter
-
setPersistent
public void setPersistent(boolean persistent)
used on testing only
-
cleanup
protected void cleanup()
This method should always be called from a single threaded executor
-
-