evt.record(new WalSegmentArchivedEvent( cctx.discovery().localNode(), res.getAbsIdx(),
/** * Tests time out based WAL segment archiving. * * @throws Exception if failure occurs. */ @Test public void testArchiveIncompleteSegmentAfterInactivity() throws Exception { AtomicBoolean waitingForEvt = new AtomicBoolean(); CountDownLatch archiveSegmentForInactivity = new CountDownLatch(1); archiveIncompleteSegmentAfterInactivityMs = 1000; Ignite ignite = startGrid(); ignite.cluster().active(true); IgniteEvents evts = ignite.events(); evts.localListen(e -> { WalSegmentArchivedEvent archComplEvt = (WalSegmentArchivedEvent)e; long idx = archComplEvt.getAbsWalSegmentIdx(); log.info("Finished archive for segment [" + idx + ", " + archComplEvt.getArchiveFile() + "]: [" + e + ']'); if (waitingForEvt.get()) archiveSegmentForInactivity.countDown(); return true; }, EVT_WAL_SEGMENT_ARCHIVED); putDummyRecords(ignite, 100); waitingForEvt.set(true); // Flag for skipping regular log() and rollOver(). log.info("Wait for archiving segment for inactive grid started"); boolean recordedAfterSleep = archiveSegmentForInactivity.await( archiveIncompleteSegmentAfterInactivityMs + 1001, TimeUnit.MILLISECONDS); stopGrid(); assertTrue(recordedAfterSleep); }
WalSegmentArchivedEvent archComplEvt = (WalSegmentArchivedEvent)e; long idx = archComplEvt.getAbsWalSegmentIdx(); archComplEvt.getArchiveFile() + "]: [" + e + "]");
evt.record(new WalSegmentArchivedEvent(cctx.discovery().localNode(), res.getAbsIdx(), res.getDstArchiveFile()));
evt.record(new WalSegmentArchivedEvent( cctx.discovery().localNode(), res.getAbsIdx(),