Methods Summary |
---|
public static void | freezeAll()freezeAll
Freeze all transactional activity.
Part of freezing functions that will be used to achive a
transactional quiet period before taking any action or collecting
any statistics. This call returns when all the activities are frozen.
All the states would be allowed to complete before freezing on. For
example a transaction in preparing state would be allowed to transition
to next state - the prepared state.
TransactionState.freezeLock.acquireWriteLock();
|
public static long | getAbortedTransactionCount()Return the count of rolledback transactions.
return iAborts;
|
public static long | getActiveTransactionCount()Return the number of transactions that are active currently.
return RecoveryManager.getCoordsByGlobalTID().size()
- getPendingTransactionCount();
|
public static java.util.Enumeration | getAllTIDs()Returned enumeration of globaltids of existing transactions.
return RecoveryManager.getCoordsByGlobalTID().keys();
|
public static java.util.Collection | getAllTransactions()Returns the collection of existing coordinators.
return RecoveryManager.getCoordsByGlobalTID().values();
|
public static long | getCommitedTransactionCount()Return the committed transactions count.
return iCommits;
|
public static long | getPendingTransactionCount()Return the count of transactions that are prepared - but not completed.
This includes the total transactions that ever entered into prepared state
minus ones which got committed, rolledback, taking care of ones that were
rolledback without entering prepared state.
return iPending-iAborts-iCommits+iUAborts;
|
public static long | getRecoveryAbortedTransactionCount()Return the number of transactions that were rolled back as part of the
recovery process.
return iRecAborts;
|
public static long | getRecoveryCommitedTransactionCount()Return the count of transactions that were commited as part of the
recovery process.
return iRecCommits;
|
public static long | getSamplingDuration()Returns the duration for which the last sampling window was open, in milliseconds.
If the sampling window is still open, then the running duration is returned.
return ( lSampleEndTime == 0 && lSampleStartTime != 0 )
? System.currentTimeMillis() - lSampleStartTime
: lSampleEndTime - lSampleStartTime;
|
public static long | getSamplingEndTime()Returns the time in millisecond , since the begining of time, when the
sampling window was closed.
return lSampleEndTime;
|
public static long | getSamplingStartTime()Returns the time in milliseconds, since the begining of time, when the
sampling window was started.
return lSampleStartTime;
|
static void | incrementAbortedTransactionCount()Increment the count of transactions that were rolled back.
try
{
statisticsLock.acquireReadLock();
synchronized ( lkAborts )
{
iAborts++;
}
}
finally
{
statisticsLock.releaseReadLock();
}
|
static void | incrementCommitedTransactionCount()Increment the count of committed transactions.
try
{
statisticsLock.acquireReadLock();
synchronized ( lkCommits )
{
iCommits++;
}
}
finally
{
statisticsLock.releaseReadLock();
}
|
static void | incrementPendingTransactionCount()Increment the count of pending transactions
- i.e. the transactions entering the prepared state.
try
{
statisticsLock.acquireReadLock();
synchronized ( lkPending )
{
iPending++;
}
}
finally
{
statisticsLock.releaseReadLock();
}
|
public static void | incrementRecoveryAbortedTransactionCount()Increments the number of transactions that were rolled back as part
of the recovery process.
try
{
statisticsLock.acquireReadLock();
synchronized ( lkRecAborts )
{
iRecAborts++;
}
}
finally
{
statisticsLock.releaseReadLock();
}
|
public static void | incrementRecoveryCommitedTransactionCount()Increments the number of transactions that were commited as part of
the recovery process.
try
{
statisticsLock.acquireReadLock();
synchronized ( lkRecCommits )
{
iRecCommits++;
}
}
finally
{
statisticsLock.releaseReadLock();
}
|
static void | incrementUnpreparedAbortedTransactionCount()Increment the count of transactions that were rolled back and ne'er went through prepare phase.
try
{
statisticsLock.acquireReadLock();
synchronized ( lkUAborts )
{
iUAborts++;
}
}
finally
{
statisticsLock.releaseReadLock();
}
|
public static boolean | isFrozenAll()isFrozenAll
Get the current state.
Part of freezing functions that will be used to achive a
transactional quiet period before taking any action or collecting
any statistics. This call returns almost immediately.
return TransactionState.freezeLock.isWriteLocked();
|
public static void | startSampling()startSampling
Start the sampling window. The sample window determines the duration
in which the data is collected. Start and stop calls demarcate the
the window. The sampling data could be number of transactions committed
,rolledback etc and transient data like pending etc. It also resets
various counters.
if(!bSampling){
try
{
statisticsLock.acquireWriteLock();
lSampleEndTime = 0 ;
lSampleStartTime = System.currentTimeMillis();
iCommits = 0;
iAborts = 0;
iPending = 0;
iRecCommits = 0;
iRecAborts = 0;
//iImmigerent = 0;
//iEmmigerent = 0;
Iterator iter = getAllTransactions().iterator();
while ( iter.hasNext() )
{
CoordinatorImpl coord = (CoordinatorImpl)iter.next();
if ( coord.get_status() ==
org.omg.CosTransactions.Status.StatusPrepared )
iPending++;
}
bSampling = true;
}
finally
{
statisticsLock.releaseWriteLock();
}
}
|
public static void | stopSampling()stopSampling
Stop sampling the statitics values. This is used to indicate end of
sampling window.
try
{
statisticsLock.acquireWriteLock();
lSampleEndTime = System.currentTimeMillis();
bSampling = false;
}
finally
{
statisticsLock.releaseWriteLock();
}
|
public static void | unfreezeAll()unfreezeAll
Unfreeze all transactional activity frozen by a freezeAll call.
Part of freezing functions that will be used to achive a
transactional quiet period before taking any action or collecting
any statistics. This call returns almost immediately.
TransactionState.freezeLock.releaseWriteLock();
|