/** {@inheritDoc} */ @Override public void printMemoryStats() { X.println(">>> "); X.println(">>> Cache IO manager memory stats [igniteInstanceName=" + cctx.igniteInstanceName() + ']'); X.println(">>> cacheClsHandlersSize: " + cacheHandlers.clsHandlers.size()); X.println(">>> cacheOrderedHandlersSize: " + cacheHandlers.orderedHandlers.size()); X.println(">>> cacheGrpClsHandlersSize: " + grpHandlers.clsHandlers.size()); X.println(">>> cacheGrpOrderedHandlersSize: " + grpHandlers.orderedHandlers.size()); }
@Override public boolean apply(Event evt) { X.println("Job event: " + evt); return true; } }, EVTS_JOB_EXECUTION);
/** * */ private static void testSystemCurrentTimeMillis() { n = 0; long start = System.currentTimeMillis(); long l = 0L; for (int i = 0; i < MAX; i++) l = System.currentTimeMillis(); long time = l - start; X.println("Current time millis time: " + time); }
/** * @throws InterruptedException If interrupted. */ private static void waitGc() throws InterruptedException { System.gc(); System.gc(); X.println(">>> Waiting for GC to complete..."); Thread.sleep(1000); }
/** * */ private static void testAtomicIntegerLoop() { a.set(0); long start = System.currentTimeMillis(); for (long i = 0; i < MAX; i++) a.incrementAndGet(); long time = System.currentTimeMillis() - start; X.println("Loop atomic integer time: " + time); }
/** * */ private static void testAtomicIntegerGetLoop() { a.set(0); long start = System.currentTimeMillis(); for (long i = 0; i < MAX; i++) a.get(); long time = System.currentTimeMillis() - start; X.println("Loop atomic integer get time: " + time); }
@Nullable @Override public Object call() throws Exception { boolean res = lock.writeLock().tryLock(); X.println("Attempting to try write lock: " + res); try { return null; } finally { if (res) lock.writeLock().unlock(); } } },
/** */ @ComputeJobAfterSend private void afterSend() { X.println("AfterSend start TestJob [this=" + this + ", identity=" + System.identityHashCode(this) + ", flag=" + flag + "]"); afterSendCnt.incrementAndGet(); flag = false; X.println("AfterSend end TestJob [this=" + this + ", identity=" + System.identityHashCode(this) + ", flag=" + flag + "]"); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { startGridsMultiThreaded(3); X.println("--> seed: " + SEED); }
/** {@inheritDoc} */ @Override public boolean apply(UUID uuid, Object msg) { X.println(">>> Received [node=" + ignite.name() + ", msg=" + msg + ']'); msgLatch.countDown(); return true; } }
/** {@inheritDoc} */ @Override public void onBeforeWriteLock(int cacheId, long pageId, long page) { if (PRINT_LOCKS) X.println(" onBeforeWriteLock: " + U.hexLong(pageId)); assertNull(beforeWriteLock.put(threadId(), pageId)); }
/** {@inheritDoc} */ @Override protected void receive(UUID nodeId, Object msg) throws Throwable { assertNotNull(ignite()); UUID locNodeId = ignite().cluster().localNode().id(); X.println("Received message [nodeId=" + nodeId + ", locNodeId=" + locNodeId + ']'); assertEquals(sourceNodeId, nodeId); assertEquals(MSG, msg); nodes.add(locNodeId); cnt.incrementAndGet(); latch.countDown(); } }
/** {@inheritDoc} */ @Override public void onReadLock(int cacheId, long pageId, long page, long pageAddr) { if (PRINT_LOCKS) X.println(" onReadLock: " + U.hexLong(pageId)); if (pageAddr != 0L) { long actual = PageIO.getPageId(pageAddr); checkPageId(pageId, pageAddr); assertNull(locks(true).put(pageId, actual)); } assertEquals(Long.valueOf(pageId), beforeReadLock.remove(threadId())); }