public abstract class TransactionStatistics extends Object
Modifier and Type | Field and Description |
---|---|
protected long |
initTime |
protected Log |
log |
protected TimeService |
timeService |
protected boolean |
trace |
Modifier | Constructor and Description |
---|---|
protected |
TransactionStatistics(ExtendedStatisticsContainer container,
TimeService timeService) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(ExtendedStatistic stat,
double value)
Adds a value to a statistic collected for this transaction.
|
protected void |
copyValue(ExtendedStatistic from,
ExtendedStatistic to)
Copies a statistic value and adds it to another statistic.
|
void |
flushTo(ConcurrentGlobalContainer globalContainer)
Merges this statistics in the global container.
|
double |
getValue(ExtendedStatistic stat) |
void |
incrementValue(ExtendedStatistic stat)
Increments a statistic value.
|
boolean |
isCommitted() |
abstract boolean |
isLocalTransaction() |
boolean |
isReadOnly() |
void |
markAsUpdateTransaction()
Sets this transaction as a write transaction.
|
abstract void |
onPrepareCommand()
Signals the reception of the
PrepareCommand . |
void |
setOutcome(boolean commit)
Sets the transaction outcome.
|
protected abstract void |
terminate()
Signals this transaction as completed and updates the statistics to the final values ready to be merged in the
cache statistics.
|
void |
terminateTransaction()
Signals this transaction as completed and updates the statistics to the final values ready to be merged in the
cache statistics.
|
String |
toString() |
protected final long initTime
protected final Log log
protected final boolean trace
protected final TimeService timeService
protected TransactionStatistics(ExtendedStatisticsContainer container, TimeService timeService)
public final boolean isCommitted()
true
if the transaction committed successfully, false
otherwisepublic final void setOutcome(boolean commit)
isCommitted()
.commit
- true
if the transaction is committed successfully.public final boolean isReadOnly()
true
if this transaction is a read-only transaction.public final void markAsUpdateTransaction()
isReadOnly()
.public final void addValue(ExtendedStatistic stat, double value)
public final double getValue(ExtendedStatistic stat) throws ExtendedStatisticNotFoundException
ExtendedStatisticNotFoundException
- if the statistic collected was not found.public final void incrementValue(ExtendedStatistic stat)
addValue(stat, 1)
.public final void terminateTransaction()
public final void flushTo(ConcurrentGlobalContainer globalContainer)
public abstract void onPrepareCommand()
PrepareCommand
.public abstract boolean isLocalTransaction()
true
if this transaction statistics is for a local transaction.protected abstract void terminate()
protected final void copyValue(ExtendedStatistic from, ExtendedStatistic to)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.