org.apache.ignite.internal.processors.cache.transactions

## Class TxCounters

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.transactions.TxCounters

    public class TxCounters
    extends Object

Values which should be tracked during transaction execution and applied on commit.

### Constructor Summary

Constructors
Constructor and Description
`TxCounters()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Map<Integer,Map<Integer,AtomicLong>>` `accumulatedUpdateCounters()`
`void` `accumulateSizeDelta(int cacheId, int part, long delta)` Accumulates size change for cache partition.
`void` `decrementUpdateCounter(int cacheId, int part)`
`Long` `generateNextCounter(int cacheId, int partId)`
`void` `incrementLockCounter()` Increments lock counter.
`void` `incrementUpdateCounter(int cacheId, int part)`
`int` `lockCounter()`
`Map<Integer,Map<Integer,AtomicLong>>` `sizeDeltas()`
`@Nullable Collection<PartitionUpdateCountersMessage>` `updateCounters()`
`void` `updateCounters(Collection<PartitionUpdateCountersMessage> updCntrs)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TxCounters

    public TxCounters()

### Method Detail

#### accumulateSizeDelta

    public void accumulateSizeDelta(int cacheId,
                                    int part,
                                    long delta)

Accumulates size change for cache partition.

Parameters:
  `cacheId` - Cache id.
  `part` - Partition id.
  `delta` - Size delta.

#### sizeDeltas

    public Map<Integer,Map<Integer,AtomicLong>> sizeDeltas()

Returns:
  Map of size changes for cache partitions made by transaction.

#### updateCounters

    public void updateCounters(Collection<PartitionUpdateCountersMessage> updCntrs)

Parameters:
  `updCntrs` - Final update counters.

#### updateCounters

    @Nullable
    public @Nullable Collection<PartitionUpdateCountersMessage> updateCounters()

Returns:
  Final update counters.

#### accumulatedUpdateCounters

    public Map<Integer,Map<Integer,AtomicLong>> accumulatedUpdateCounters()

Returns:
  Accumulated update counters.

#### incrementUpdateCounter

    public void incrementUpdateCounter(int cacheId,
                                       int part)

Parameters:
  `cacheId` - Cache id.
  `part` - Partition number.

#### decrementUpdateCounter

    public void decrementUpdateCounter(int cacheId,
                                       int part)

Parameters:
  `cacheId` - Cache id.
  `part` - Partition number.

#### incrementLockCounter

    public void incrementLockCounter()

Increments lock counter.

#### lockCounter

    public int lockCounter()

Returns:
  Current value of lock counter.

#### generateNextCounter

    public Long generateNextCounter(int cacheId,
                                    int partId)

Parameters:
  `cacheId` - Cache id.
  `partId` - Partition id.
Returns:
  Counter or `null` if cache partition has not updates.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.14.0
Release Date | : September 29 2022