Search in sources :

Example 6 with TxRecord

use of org.apache.ignite.internal.pagemem.wal.record.TxRecord in project ignite by apache.

the class WalStat method registerRecord.

/**
 * Handles WAL record.
 *
 * @param record record to handle.
 * @param walPointer pointer, used to extract segment index.
 * @param workDir true for work, false for archive folder.
 */
void registerRecord(WALRecord record, WALPointer walPointer, boolean workDir) {
    WALRecord.RecordType type = record.type();
    if (type == WALRecord.RecordType.PAGE_RECORD)
        registerPageSnapshot((PageSnapshot) record);
    else if (type == WALRecord.RecordType.DATA_RECORD)
        registerDataRecord((DataRecord) record);
    else if (type == WALRecord.RecordType.TX_RECORD)
        registerTxRecord((TxRecord) record);
    incrementStat(type.toString(), record, recTypeSizes);
    if (walPointer instanceof FileWALPointer) {
        final FileWALPointer fPtr = (FileWALPointer) walPointer;
        incrementStat(Long.toString(fPtr.index()), record, segmentsIndexes);
        incrementStat(workDir ? "work" : "archive", record, segmentsFolder);
    }
}
Also used : WALRecord(org.apache.ignite.internal.pagemem.wal.record.WALRecord) FileWALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.FileWALPointer) TxRecord(org.apache.ignite.internal.pagemem.wal.record.TxRecord) PageSnapshot(org.apache.ignite.internal.pagemem.wal.record.PageSnapshot)

Aggregations

TxRecord (org.apache.ignite.internal.pagemem.wal.record.TxRecord)6 WALRecord (org.apache.ignite.internal.pagemem.wal.record.WALRecord)4 WALPointer (org.apache.ignite.internal.pagemem.wal.WALPointer)3 DataRecord (org.apache.ignite.internal.pagemem.wal.record.DataRecord)3 GridCacheVersion (org.apache.ignite.internal.processors.cache.version.GridCacheVersion)3 Collection (java.util.Collection)2 WALIterator (org.apache.ignite.internal.pagemem.wal.WALIterator)2 DataEntry (org.apache.ignite.internal.pagemem.wal.record.DataEntry)2 TransactionState (org.apache.ignite.transactions.TransactionState)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Random (java.util.Random)1 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1 BinaryObject (org.apache.ignite.binary.BinaryObject)1 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1