public class TxnReservedCapacityCounterImpl extends Object implements TxnReservedCapacityCounter
MapStoreConfig.writeCoalescing
is off.
Every record-store has its own counter instance.TxnReservedCapacityCounter
EMPTY_COUNTER
Constructor and Description |
---|
TxnReservedCapacityCounterImpl(NodeWideUsedCapacityCounter nodeWideUsedCapacityCounter) |
Modifier and Type | Method and Description |
---|---|
void |
decrement(UUID txnId)
Decrements 2 counters for supplied txnId.
|
void |
decrementOnlyReserved(UUID txnId)
Decrements capacity count for a transaction.
|
Map<UUID,Long> |
getReservedCapacityCountPerTxnId()
Returns reserved capacity counts of all
transactions which happened on this record store.
|
boolean |
hasReservedCapacity(UUID txnId) |
void |
increment(UUID txnId,
boolean backup)
Increments 2 counters for supplied txnId.
|
void |
putAll(Map<UUID,Long> reservedCapacityPerTxnId)
Increments 2 counters with supplied txn reserved capacity counts.
|
void |
releaseAllReservations()
Releases all reserved capacity info on this counter.
|
public TxnReservedCapacityCounterImpl(NodeWideUsedCapacityCounter nodeWideUsedCapacityCounter)
public void increment(@Nonnull UUID txnId, boolean backup)
ReachedMaxSizeException
increment
in interface TxnReservedCapacityCounter
txnId
- id of transactionbackup
- set true
if counter increment
operation is on a backup partition,
otherwise set false
ReachedMaxSizeException
- (only when backup is false)public void putAll(@Nonnull Map<UUID,Long> reservedCapacityPerTxnId)
putAll
in interface TxnReservedCapacityCounter
reservedCapacityPerTxnId
- reserved capacities per txnIdpublic boolean hasReservedCapacity(@Nonnull UUID txnId)
hasReservedCapacity
in interface TxnReservedCapacityCounter
txnId
- id of transactiontrue
if txnId has reserved
capacity, otherwise return false
public void decrement(@Nonnull UUID txnId)
decrement
in interface TxnReservedCapacityCounter
txnId
- id of transactionpublic void decrementOnlyReserved(@Nonnull UUID txnId)
TxnReservedCapacityCounter
decrementOnlyReserved
in interface TxnReservedCapacityCounter
txnId
- id of transactionpublic void releaseAllReservations()
TxnReservedCapacityCounter
releaseAllReservations
in interface TxnReservedCapacityCounter
public Map<UUID,Long> getReservedCapacityCountPerTxnId()
TxnReservedCapacityCounter
getReservedCapacityCountPerTxnId
in interface TxnReservedCapacityCounter
Copyright © 2019 Hazelcast, Inc.. All rights reserved.