Search in sources :

Example 31 with CheckpointRecord

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

the class WalScannerTest method shouldFindCorrectRecords.

/**
 * @throws Exception If failed.
 */
@Test
public void shouldFindCorrectRecords() throws Exception {
    // given: Iterator with random value and value which should be find by scanner.
    long expPageId = 984;
    int grpId = 123;
    PageSnapshot expPageSnapshot = new PageSnapshot(new FullPageId(expPageId, grpId), dummyPage(1024, expPageId), 1024);
    CheckpointRecord expCheckpoint = new CheckpointRecord(new WALPointer(5738, 0, 0));
    FixCountRecord expDeltaPage = new FixCountRecord(grpId, expPageId, 4);
    WALIterator mockedIter = mockWalIterator(new IgniteBiTuple<>(NULL_PTR, expPageSnapshot), new IgniteBiTuple<>(NULL_PTR, new PageSnapshot(new FullPageId(455, grpId), dummyPage(4096, 455), 1024)), new IgniteBiTuple<>(NULL_PTR, expCheckpoint), new IgniteBiTuple<>(NULL_PTR, new MetastoreDataRecord("key", new byte[0])), new IgniteBiTuple<>(NULL_PTR, new PartitionMetaStateRecord(grpId, 1, OWNING, 1)), new IgniteBiTuple<>(NULL_PTR, expDeltaPage), new IgniteBiTuple<>(NULL_PTR, new FixCountRecord(grpId, 98348, 4)));
    IgniteWalIteratorFactory mockedFactory = mock(IgniteWalIteratorFactory.class);
    when(mockedFactory.iterator(any(IteratorParametersBuilder.class))).thenReturn(mockedIter);
    // Test scanner handler for holding found value instead of printing its.
    List<WALRecord> holder = new ArrayList<>();
    ScannerHandler recordCaptor = (rec) -> holder.add(rec.get2());
    Set<T2<Integer, Long>> groupAndPageIds = new HashSet<>();
    groupAndPageIds.add(new T2<>(grpId, expPageId));
    // when: Scanning WAL for searching expected page.
    buildWalScanner(withIteratorParameters(), mockedFactory).findAllRecordsFor(groupAndPageIds).forEach(recordCaptor);
    // then: Should be find only expected value.
    assertEquals(holder.size(), 3);
    assertEquals(expPageSnapshot, holder.get(0));
    assertEquals(expCheckpoint, holder.get(1));
    assertEquals(expDeltaPage, holder.get(2));
}
Also used : IgniteWalIteratorFactory(org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory) WALRecord(org.apache.ignite.internal.pagemem.wal.record.WALRecord) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) WALIterator(org.apache.ignite.internal.pagemem.wal.WALIterator) Arrays(java.util.Arrays) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) IgniteWalIteratorFactory(org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory) U(org.apache.ignite.internal.util.typedef.internal.U) IgniteLogger(org.apache.ignite.IgniteLogger) FixCountRecord(org.apache.ignite.internal.pagemem.wal.record.delta.FixCountRecord) IteratorParametersBuilder.withIteratorParameters(org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory.IteratorParametersBuilder.withIteratorParameters) WALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer) ByteBuffer(java.nio.ByteBuffer) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ArgumentCaptor(org.mockito.ArgumentCaptor) ScannerHandlers.printToFile(org.apache.ignite.internal.processors.cache.persistence.wal.scanner.ScannerHandlers.printToFile) MetastoreDataRecord(org.apache.ignite.internal.pagemem.wal.record.MetastoreDataRecord) Files(java.nio.file.Files) WALRecord(org.apache.ignite.internal.pagemem.wal.record.WALRecord) Set(java.util.Set) GridUnsafe(org.apache.ignite.internal.util.GridUnsafe) Test(org.junit.Test) OWNING(org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.OWNING) Mockito.doNothing(org.mockito.Mockito.doNothing) Mockito.when(org.mockito.Mockito.when) NULL_PTR(org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointStatus.NULL_PTR) Collectors(java.util.stream.Collectors) File(java.io.File) CheckpointRecord(org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord) T2(org.apache.ignite.internal.util.typedef.T2) IgniteBiTuple(org.apache.ignite.lang.IgniteBiTuple) PartitionMetaStateRecord(org.apache.ignite.internal.pagemem.wal.record.delta.PartitionMetaStateRecord) List(java.util.List) IteratorParametersBuilder(org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory.IteratorParametersBuilder) Paths(java.nio.file.Paths) DummyPageIO(org.apache.ignite.internal.processors.cache.persistence.DummyPageIO) TestCase.assertTrue(junit.framework.TestCase.assertTrue) WalScanner.buildWalScanner(org.apache.ignite.internal.processors.cache.persistence.wal.scanner.WalScanner.buildWalScanner) ScannerHandlers.printToLog(org.apache.ignite.internal.processors.cache.persistence.wal.scanner.ScannerHandlers.printToLog) PageSnapshot(org.apache.ignite.internal.pagemem.wal.record.PageSnapshot) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) PartitionMetaStateRecord(org.apache.ignite.internal.pagemem.wal.record.delta.PartitionMetaStateRecord) IteratorParametersBuilder(org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory.IteratorParametersBuilder) ArrayList(java.util.ArrayList) CheckpointRecord(org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord) FixCountRecord(org.apache.ignite.internal.pagemem.wal.record.delta.FixCountRecord) WALIterator(org.apache.ignite.internal.pagemem.wal.WALIterator) MetastoreDataRecord(org.apache.ignite.internal.pagemem.wal.record.MetastoreDataRecord) WALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer) T2(org.apache.ignite.internal.util.typedef.T2) PageSnapshot(org.apache.ignite.internal.pagemem.wal.record.PageSnapshot) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 32 with CheckpointRecord

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

the class IgnitePdsCheckpointSimulationWithRealCpDisabledTest method testPageWalEntries.

/**
 * @throws Exception if failed.
 */
@Test
public void testPageWalEntries() throws Exception {
    IgniteEx ig = startGrid(0);
    ig.cluster().active(true);
    GridCacheSharedContext<Object, Object> sharedCtx = ig.context().cache().context();
    int cacheId = sharedCtx.cache().cache(CACHE_NAME).context().cacheId();
    GridCacheDatabaseSharedManager db = (GridCacheDatabaseSharedManager) sharedCtx.database();
    PageMemory pageMem = sharedCtx.database().dataRegion(null).pageMemory();
    IgniteWriteAheadLogManager wal = sharedCtx.wal();
    db.enableCheckpoints(false).get();
    int pageCnt = 100;
    List<FullPageId> pageIds = new ArrayList<>();
    for (int i = 0; i < pageCnt; i++) {
        db.checkpointReadLock();
        try {
            pageIds.add(new FullPageId(pageMem.allocatePage(cacheId, PageIdAllocator.INDEX_PARTITION, PageIdAllocator.FLAG_IDX), cacheId));
        } finally {
            db.checkpointReadUnlock();
        }
    }
    UUID cpId = UUID.randomUUID();
    WALPointer start = wal.log(new CheckpointRecord(cpId, null));
    wal.flush(start, false);
    ig.context().cache().context().database().checkpointReadLock();
    try {
        for (FullPageId pageId : pageIds) writePageData(pageId, pageMem);
    } finally {
        ig.context().cache().context().database().checkpointReadUnlock();
    }
    // Data will not be written to the page store.
    stopAllGrids();
    ig = startGrid(0);
    ig.cluster().active(true);
    sharedCtx = ig.context().cache().context();
    db = (GridCacheDatabaseSharedManager) sharedCtx.database();
    wal = sharedCtx.wal();
    db.enableCheckpoints(false);
    try (PartitionMetaStateRecordExcludeIterator it = new PartitionMetaStateRecordExcludeIterator(wal.replay(start))) {
        IgniteBiTuple<WALPointer, WALRecord> tup = it.next();
        assert tup.get2() instanceof CheckpointRecord : tup.get2();
        assertEquals(start, tup.get1());
        CheckpointRecord cpRec = (CheckpointRecord) tup.get2();
        assertEquals(cpId, cpRec.checkpointId());
        assertNull(cpRec.checkpointMark());
        assertFalse(cpRec.end());
        int idx = 0;
        while (idx < pageIds.size()) {
            tup = it.next();
            assert tup.get2() instanceof PageSnapshot : tup.get2().getClass();
            PageSnapshot snap = (PageSnapshot) tup.get2();
            // there are extra tracking pages, skip them
            long trackingPageFor = TrackingPageIO.VERSIONS.latest().trackingPageFor(snap.fullPageId().pageId(), pageMem.pageSize());
            if (trackingPageFor == snap.fullPageId().pageId()) {
                tup = it.next();
                assertTrue(tup.get2() instanceof PageSnapshot);
                snap = (PageSnapshot) tup.get2();
            }
            assertEquals(pageIds.get(idx), snap.fullPageId());
            idx++;
        }
    }
}
Also used : WALRecord(org.apache.ignite.internal.pagemem.wal.record.WALRecord) IgniteWriteAheadLogManager(org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager) GridCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) ArrayList(java.util.ArrayList) CheckpointRecord(org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord) IgniteEx(org.apache.ignite.internal.IgniteEx) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) UUID(java.util.UUID) WALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) PageSnapshot(org.apache.ignite.internal.pagemem.wal.record.PageSnapshot) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 33 with CheckpointRecord

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

the class IgnitePdsCheckpointSimulationWithRealCpDisabledTest method runCheckpointing.

/**
 * @param mem Memory to use.
 * @param storeMgr Store manager.
 * @param cacheId Cache ID.
 * @return Result map of random operations.
 * @throws Exception If failure occurred.
 */
private IgniteBiTuple<Map<FullPageId, Integer>, WALPointer> runCheckpointing(final IgniteEx ig, final PageMemoryImpl mem, final IgnitePageStoreManager storeMgr, final IgniteWriteAheadLogManager wal, final int cacheId) throws Exception {
    final ConcurrentMap<FullPageId, Integer> resMap = new ConcurrentHashMap<>();
    final FullPageId[] pages = new FullPageId[TOTAL_PAGES];
    Set<FullPageId> allocated = new HashSet<>();
    IgniteCacheDatabaseSharedManager db = ig.context().cache().context().database();
    PageIO pageIO = new DummyPageIO();
    for (int i = 0; i < TOTAL_PAGES; i++) {
        FullPageId fullId;
        db.checkpointReadLock();
        try {
            fullId = new FullPageId(mem.allocatePage(cacheId, 0, PageIdAllocator.FLAG_DATA), cacheId);
            initPage(mem, pageIO, fullId);
        } finally {
            db.checkpointReadUnlock();
        }
        resMap.put(fullId, -1);
        pages[i] = fullId;
        allocated.add(fullId);
    }
    final AtomicBoolean run = new AtomicBoolean(true);
    // Simulate transaction lock.
    final ReadWriteLock updLock = new ReentrantReadWriteLock();
    // Mark the start position.
    CheckpointRecord cpRec = new CheckpointRecord(null);
    WALPointer start = wal.log(cpRec);
    wal.flush(start, false);
    IgniteInternalFuture<Long> updFut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {

        @Override
        public Object call() throws Exception {
            while (true) {
                FullPageId fullId = pages[ThreadLocalRandom.current().nextInt(TOTAL_PAGES)];
                updLock.readLock().lock();
                try {
                    if (!run.get())
                        return null;
                    ig.context().cache().context().database().checkpointReadLock();
                    try {
                        long page = mem.acquirePage(fullId.groupId(), fullId.pageId());
                        try {
                            long pageAddr = mem.writeLock(fullId.groupId(), fullId.pageId(), page);
                            PageIO.setPageId(pageAddr, fullId.pageId());
                            try {
                                int state = resMap.get(fullId);
                                if (state != -1) {
                                    if (VERBOSE)
                                        info("Verify page [fullId=" + fullId + ", state=" + state + ", buf=" + pageAddr + ", bhc=" + U.hexLong(System.identityHashCode(pageAddr)) + ", page=" + U.hexLong(System.identityHashCode(page)) + ']');
                                    for (int i = PageIO.COMMON_HEADER_END; i < mem.realPageSize(fullId.groupId()); i++) {
                                        assertEquals("Verify page failed [fullId=" + fullId + ", i=" + i + ", state=" + state + ", buf=" + pageAddr + ", bhc=" + U.hexLong(System.identityHashCode(pageAddr)) + ", page=" + U.hexLong(System.identityHashCode(page)) + ']', state & 0xFF, PageUtils.getByte(pageAddr, i) & 0xFF);
                                    }
                                }
                                state = (state + 1) & 0xFF;
                                if (VERBOSE)
                                    info("Write page [fullId=" + fullId + ", state=" + state + ", buf=" + pageAddr + ", bhc=" + U.hexLong(System.identityHashCode(pageAddr)) + ", page=" + U.hexLong(System.identityHashCode(page)) + ']');
                                for (int i = PageIO.COMMON_HEADER_END; i < mem.realPageSize(fullId.groupId()); i++) PageUtils.putByte(pageAddr, i, (byte) state);
                                resMap.put(fullId, state);
                            } finally {
                                mem.writeUnlock(fullId.groupId(), fullId.pageId(), page, null, true);
                            }
                        } finally {
                            mem.releasePage(fullId.groupId(), fullId.pageId(), page);
                        }
                    } finally {
                        ig.context().cache().context().database().checkpointReadUnlock();
                    }
                } finally {
                    updLock.readLock().unlock();
                }
            }
        }
    }, 8, "update-thread");
    int checkpoints = 20;
    while (checkpoints > 0) {
        Map<FullPageId, Integer> snapshot = null;
        Collection<FullPageId> pageIds;
        updLock.writeLock().lock();
        try {
            snapshot = new HashMap<>(resMap);
            pageIds = mem.beginCheckpoint(new GridFinishedFuture());
            checkpoints--;
            if (checkpoints == 0)
                // No more writes should be done at this point.
                run.set(false);
            info("Acquired pages for checkpoint: " + pageIds.size());
        } finally {
            updLock.writeLock().unlock();
        }
        boolean ok = false;
        try {
            ByteBuffer tmpBuf = ByteBuffer.allocate(mem.pageSize());
            tmpBuf.order(ByteOrder.nativeOrder());
            long begin = System.currentTimeMillis();
            long cp = 0;
            long write = 0;
            for (FullPageId fullId : pageIds) {
                long cpStart = System.nanoTime();
                Integer tag;
                AtomicReference<Integer> tag0 = new AtomicReference<>();
                PageStoreWriter pageStoreWriter = (fullPageId, buf, tagx) -> {
                    tag0.set(tagx);
                };
                while (true) {
                    mem.checkpointWritePage(fullId, tmpBuf, pageStoreWriter, null);
                    tag = tag0.get();
                    if (tag != null && tag == PageMemoryImpl.TRY_AGAIN_TAG)
                        continue;
                    break;
                }
                if (tag == null)
                    continue;
                long cpEnd = System.nanoTime();
                cp += cpEnd - cpStart;
                Integer state = snapshot.get(fullId);
                if (allocated.contains(fullId) && state != -1) {
                    tmpBuf.rewind();
                    Integer first = null;
                    for (int i = PageIO.COMMON_HEADER_END; i < mem.realPageSize(fullId.groupId()); i++) {
                        int val = tmpBuf.get(i) & 0xFF;
                        if (first == null)
                            first = val;
                        // Avoid string concat.
                        if (first != val)
                            assertEquals("Corrupted buffer at position [pageId=" + fullId + ", pos=" + i + ']', (int) first, val);
                        // Avoid string concat.
                        if (state != val)
                            assertEquals("Invalid value at position [pageId=" + fullId + ", pos=" + i + ']', (int) state, val);
                    }
                }
                tmpBuf.rewind();
                long writeStart = System.nanoTime();
                storeMgr.write(cacheId, fullId.pageId(), tmpBuf, tag, true);
                long writeEnd = System.nanoTime();
                write += writeEnd - writeStart;
                tmpBuf.rewind();
            }
            long syncStart = System.currentTimeMillis();
            storeMgr.sync(cacheId, 0);
            long end = System.currentTimeMillis();
            info("Written pages in " + (end - begin) + "ms, copy took " + (cp / 1_000_000) + "ms, " + "write took " + (write / 1_000_000) + "ms, sync took " + (end - syncStart) + "ms");
            ok = true;
        } finally {
            info("Finishing checkpoint...");
            mem.finishCheckpoint();
            info("Finished checkpoint");
            if (!ok) {
                info("Cancelling updates...");
                run.set(false);
                updFut.get();
            }
        }
        if (checkpoints != 0)
            Thread.sleep(2_000);
    }
    info("checkpoints=" + checkpoints + ", done=" + updFut.isDone());
    updFut.get();
    assertEquals(0, mem.activePagesCount());
    for (FullPageId fullId : pages) {
        long page = mem.acquirePage(fullId.groupId(), fullId.pageId());
        try {
            assertFalse("Page has a temp heap copy after the last checkpoint: [cacheId=" + fullId.groupId() + ", pageId=" + fullId.pageId() + "]", mem.hasTempCopy(page));
            assertFalse("Page is dirty after the last checkpoint: [cacheId=" + fullId.groupId() + ", pageId=" + fullId.pageId() + "]", mem.isDirty(fullId.groupId(), fullId.pageId(), page));
        } finally {
            mem.releasePage(fullId.groupId(), fullId.pageId(), page);
        }
    }
    return F.t((Map<FullPageId, Integer>) resMap, start);
}
Also used : CacheAtomicityMode(org.apache.ignite.cache.CacheAtomicityMode) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) GridFinishedFuture(org.apache.ignite.internal.util.future.GridFinishedFuture) IgniteEx(org.apache.ignite.internal.IgniteEx) CacheRebalanceMode(org.apache.ignite.cache.CacheRebalanceMode) WALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer) ByteBuffer(java.nio.ByteBuffer) Map(java.util.Map) PageUtils(org.apache.ignite.internal.pagemem.PageUtils) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) WALMode(org.apache.ignite.configuration.WALMode) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) PageIdAllocator(org.apache.ignite.internal.pagemem.PageIdAllocator) Collection(java.util.Collection) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) WALRecord(org.apache.ignite.internal.pagemem.wal.record.WALRecord) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) UUID(java.util.UUID) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) DataRecord(org.apache.ignite.internal.pagemem.wal.record.DataRecord) DataEntry(org.apache.ignite.internal.pagemem.wal.record.DataEntry) GridCacheOperation(org.apache.ignite.internal.processors.cache.GridCacheOperation) IgniteBiTuple(org.apache.ignite.lang.IgniteBiTuple) GridTestUtils(org.apache.ignite.testframework.GridTestUtils) ByteOrder(java.nio.ByteOrder) List(java.util.List) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) IgnitePageStoreManager(org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager) IgniteWriteAheadLogManager(org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) PageSnapshot(org.apache.ignite.internal.pagemem.wal.record.PageSnapshot) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) U(org.apache.ignite.internal.util.typedef.internal.U) HashMap(java.util.HashMap) Callable(java.util.concurrent.Callable) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) ConcurrentMap(java.util.concurrent.ConcurrentMap) GridKernalContext(org.apache.ignite.internal.GridKernalContext) HashSet(java.util.HashSet) GridCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager) MvccDataRecord(org.apache.ignite.internal.pagemem.wal.record.MvccDataRecord) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) PageIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO) MvccDataEntry(org.apache.ignite.internal.pagemem.wal.record.MvccDataEntry) F(org.apache.ignite.internal.util.typedef.F) Test(org.junit.Test) CheckpointRecord(org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord) GridCloseableIterator(org.apache.ignite.internal.util.lang.GridCloseableIterator) PageMemoryImpl(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl) PartitionMetaStateRecord(org.apache.ignite.internal.pagemem.wal.record.delta.PartitionMetaStateRecord) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) DummyPageIO(org.apache.ignite.internal.processors.cache.persistence.DummyPageIO) MvccVersionImpl(org.apache.ignite.internal.processors.cache.mvcc.MvccVersionImpl) PageMemoryEx(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryEx) DataPageIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO) PageStoreWriter(org.apache.ignite.internal.processors.cache.persistence.PageStoreWriter) GridFilteredClosableIterator(org.apache.ignite.internal.util.lang.GridFilteredClosableIterator) CacheObjectContext(org.apache.ignite.internal.processors.cache.CacheObjectContext) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) TrackingPageIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.TrackingPageIO) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) GridFinishedFuture(org.apache.ignite.internal.util.future.GridFinishedFuture) PageStoreWriter(org.apache.ignite.internal.processors.cache.persistence.PageStoreWriter) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) WALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) HashSet(java.util.HashSet) PageIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO) DummyPageIO(org.apache.ignite.internal.processors.cache.persistence.DummyPageIO) DataPageIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO) TrackingPageIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.TrackingPageIO) CheckpointRecord(org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord) AtomicReference(java.util.concurrent.atomic.AtomicReference) DummyPageIO(org.apache.ignite.internal.processors.cache.persistence.DummyPageIO) ByteBuffer(java.nio.ByteBuffer) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)

Example 34 with CheckpointRecord

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

the class RecordUtils method buildCheckpointRecord.

/**
 */
public static CheckpointRecord buildCheckpointRecord() {
    CheckpointRecord record = new CheckpointRecord(new WALPointer(1, 1, 1));
    record.cacheGroupStates(new HashMap<>());
    return record;
}
Also used : CheckpointRecord(org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord) WALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer)

Aggregations

CheckpointRecord (org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord)34 WALPointer (org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer)24 PageSnapshot (org.apache.ignite.internal.pagemem.wal.record.PageSnapshot)19 FullPageId (org.apache.ignite.internal.pagemem.FullPageId)18 DataRecord (org.apache.ignite.internal.pagemem.wal.record.DataRecord)16 WALRecord (org.apache.ignite.internal.pagemem.wal.record.WALRecord)15 UUID (java.util.UUID)13 ArrayList (java.util.ArrayList)12 DataEntry (org.apache.ignite.internal.pagemem.wal.record.DataEntry)12 Test (org.junit.Test)11 ByteBuffer (java.nio.ByteBuffer)10 MetastoreDataRecord (org.apache.ignite.internal.pagemem.wal.record.MetastoreDataRecord)10 IgniteEx (org.apache.ignite.internal.IgniteEx)9 WALIterator (org.apache.ignite.internal.pagemem.wal.WALIterator)9 PartitionMetaStateRecord (org.apache.ignite.internal.pagemem.wal.record.delta.PartitionMetaStateRecord)9 HashSet (java.util.HashSet)8 HashMap (java.util.HashMap)7 Map (java.util.Map)7 CacheState (org.apache.ignite.internal.pagemem.wal.record.CacheState)7 FixCountRecord (org.apache.ignite.internal.pagemem.wal.record.delta.FixCountRecord)6