public interface TxnReservedCapacityCounter
NodeWideUsedCapacityCounter
and it is incremented by all record-stores of all maps on a
node. The reason that we have this extra counter is to map
used-capacity increments to record-stores. With the implementation
of TxnReservedCapacityCounter
we can know which
record-store is incremented NodeWideUsedCapacityCounter
.
Thus, we can transfer reserved capacity info with migrations.
Note that this txn-reserved-capacity-counter is
only used with transactional-maps which have
non-coalescing write-behind store configuration.
Each record-store has its own reserved capacity counter instance.Modifier and Type | Field and Description |
---|---|
static TxnReservedCapacityCounter |
EMPTY_COUNTER
Used when
MapStoreConfig.writeCoalescing is enabled. |
Modifier and Type | Method and Description |
---|---|
void |
decrement(UUID txnId)
Decrements capacity count for a transaction.
|
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 capacity count for a transaction.
|
void |
putAll(Map<UUID,Long> reservedCapacityPerTxnId)
Puts all supplied transactions capacity counts into this counter.
|
void |
releaseAllReservations()
Releases all reserved capacity info on this counter.
|
static final TxnReservedCapacityCounter EMPTY_COUNTER
MapStoreConfig.writeCoalescing
is enabled.void increment(@Nonnull UUID txnId, boolean backup)
txnId
- id of transactionbackup
- set true
if counter increment
operation is on a backup partition,
otherwise set false
void decrement(@Nonnull UUID txnId)
txnId
- id of transactionvoid decrementOnlyReserved(@Nonnull UUID txnId)
txnId
- id of transactionvoid putAll(@Nonnull Map<UUID,Long> reservedCapacityPerTxnId)
reservedCapacityPerTxnId
- reserved capacity counts per txnIdboolean hasReservedCapacity(@Nonnull UUID txnId)
txnId
- id of transactiontrue
if txnId has reserved
capacity, otherwise return false
void releaseAllReservations()
Copyright © 2019 Hazelcast, Inc.. All rights reserved.