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

## Class TransactionMetricsAdapter.TransactionMetricsSnapshot

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

All Implemented Interfaces:
  Externalizable, Serializable, TransactionMetrics

Enclosing class:
  TransactionMetricsAdapter

    public static class TransactionMetricsAdapter.TransactionMetricsSnapshot
    extends Object
    implements TransactionMetrics, Externalizable

Transaction metrics snapshot.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`TransactionMetricsSnapshot()` Required by `Externalizable`.
`TransactionMetricsSnapshot(TransactionMetricsAdapter adapter)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `commitTime()` Gets last time transaction was committed.
`Map<String,String>` `getAllOwnerTransactions()` Gets a map of all transactions for which the local node is the originating node.
`long` `getLockedKeysNumber()` The number of keys locked on the node.
`Map<String,String>` `getLongRunningOwnerTransactions(int duration)` Gets a map of all transactions for which the local node is the originating node and which duration exceeds the given duration.
`long` `getOwnerTransactionsNumber()` The number of active transactions for which this node is the initiator.
`long` `getTransactionsCommittedNumber()` The number of transactions which were committed on the local node.
`long` `getTransactionsHoldingLockNumber()` The number of active transactions on the local node holding at least one key lock.
`long` `getTransactionsRolledBackNumber()` The number of transactions which were rolled back on the local node.
`void` `readExternal(ObjectInput in)`
`long` `rollbackTime()` Gets last time transaction was rollback.
`int` `txCommits()` Gets total number of transaction commits.
`int` `txRollbacks()` Gets total number of transaction rollbacks.
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### TransactionMetricsSnapshot

    public TransactionMetricsSnapshot()

Required by `Externalizable`.

#### TransactionMetricsSnapshot

    public TransactionMetricsSnapshot(TransactionMetricsAdapter adapter)

Parameters:
  `adapter` - Transaction metrics adapter.

### Method Detail

#### commitTime

    public long commitTime()

Gets last time transaction was committed.

Specified by:
  `commitTime` in interface `TransactionMetrics`
Returns:
  Last commit time.

#### rollbackTime

    public long rollbackTime()

Gets last time transaction was rollback.

Specified by:
  `rollbackTime` in interface `TransactionMetrics`
Returns:
  Last rollback time.

#### txCommits

    public int txCommits()

Gets total number of transaction commits.

Specified by:
  `txCommits` in interface `TransactionMetrics`
Returns:
  Number of transaction commits.

#### txRollbacks

    public int txRollbacks()

Gets total number of transaction rollbacks.

Specified by:
  `txRollbacks` in interface `TransactionMetrics`
Returns:
  Number of transaction rollbacks.

#### getAllOwnerTransactions

    public Map<String,String> getAllOwnerTransactions()

Gets a map of all transactions for which the local node is the originating node.

Specified by:
  `getAllOwnerTransactions` in interface `TransactionMetrics`
Returns:
  Map of local node owning transactions.

#### getLongRunningOwnerTransactions

    public Map<String,String> getLongRunningOwnerTransactions(int duration)

Gets a map of all transactions for which the local node is the originating node and which duration exceeds the given duration.

Specified by:
  `getLongRunningOwnerTransactions` in interface `TransactionMetrics`
Returns:
  Map of local node owning transactions which duration is longer than `duration`.

#### getTransactionsCommittedNumber

    public long getTransactionsCommittedNumber()

The number of transactions which were committed on the local node.

Specified by:
  `getTransactionsCommittedNumber` in interface `TransactionMetrics`
Returns:
  The number of transactions which were committed on the local node.

#### getTransactionsRolledBackNumber

    public long getTransactionsRolledBackNumber()

The number of transactions which were rolled back on the local node.

Specified by:
  `getTransactionsRolledBackNumber` in interface `TransactionMetrics`
Returns:
  The number of transactions which were rolled back on the local node.

#### getTransactionsHoldingLockNumber

    public long getTransactionsHoldingLockNumber()

The number of active transactions on the local node holding at least one key lock.

Specified by:
  `getTransactionsHoldingLockNumber` in interface `TransactionMetrics`
Returns:
  The number of active transactions holding at least one key lock.

#### getLockedKeysNumber

    public long getLockedKeysNumber()

The number of keys locked on the node.

Specified by:
  `getLockedKeysNumber` in interface `TransactionMetrics`
Returns:
  The number of keys locked on the node.

#### getOwnerTransactionsNumber

    public long getOwnerTransactionsNumber()

The number of active transactions for which this node is the initiator. Effectively, this method is semantically equivalent to `getAllOwnerTransactions.size()`.

Specified by:
  `getOwnerTransactionsNumber` in interface `TransactionMetrics`
Returns:
  The number of active transactions for which this node is the initiator.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020