/** {@inheritDoc} */ @Override public void apply(StringBuilder sb, GridKernalContext ctx) { sb.append(U.nl()); List<GridDhtPartitionsExchangeFuture> futs = ctx.cache().context().exchange().exchangeFutures(); for (GridDhtPartitionsExchangeFuture fut : futs) { if (topVer.equals(fut.initialVersion())) { sb.append("Exchange future: ").append(fut); return; } } sb.append("Failed to find exchange future: ").append(topVer); }
/** * @param histSize History size. */ private void checkHistorySize(int histSize) { List<Ignite> nodes = G.allGrids(); assertTrue(!nodes.isEmpty()); for (Ignite node : nodes) { List<GridDhtPartitionsExchangeFuture> exchFuts = ((IgniteEx)node).context().cache().context().exchange().exchangeFutures(); assertTrue("Unexpected size: " + exchFuts.size(), !exchFuts.isEmpty() && exchFuts.size() <= histSize); } }
/** * Checks reverse order of exchangeFutures. * * @throws Exception If failed. */ @Test public void testExchangeFutures() throws Exception { GridCachePartitionExchangeManager mgr = ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME).context().shared().exchange(); for (int i = 1; i <= 10; i++) { startGrid(i); List<GridDhtPartitionsExchangeFuture> futs = mgr.exchangeFutures(); List<GridDhtPartitionsExchangeFuture> sortedFuts = new ArrayList<>(futs); Collections.sort(sortedFuts, Collections.reverseOrder()); for (int j = 0; j < futs.size(); j++) assertEquals(futs.get(j), sortedFuts.get(j)); } } }
for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)) { Throwable err = null;
/** * @param node Node. * @param vers Expected exchange versions. */ private void checkExchanges(Ignite node, long... vers) { IgniteKernal node0 = (IgniteKernal)node; List<AffinityTopologyVersion> expVers = new ArrayList<>(); for (long ver : vers) expVers.add(new AffinityTopologyVersion(ver)); List<AffinityTopologyVersion> doneVers = new ArrayList<>(); List<GridDhtPartitionsExchangeFuture> futs = node0.context().cache().context().exchange().exchangeFutures(); for (int i = futs.size() - 1; i >= 0; i--) { GridDhtPartitionsExchangeFuture fut = futs.get(i); if (!fut.isMerged() && fut.exchangeDone() && fut.firstEvent().type() != EVT_DISCOVERY_CUSTOM_EVT) { AffinityTopologyVersion resVer = fut.topologyVersion(); Assert.assertNotNull(resVer); doneVers.add(resVer); } } assertEquals(expVers, doneVers); for (CacheGroupContext grpCtx : node0.context().cache().cacheGroups()) { for (AffinityTopologyVersion ver : grpCtx.affinity().cachedVersions()) { if (ver.minorTopologyVersion() > 0) continue; assertTrue("Unexpected version [ver=" + ver + ", exp=" + expVers + ']', expVers.contains(ver)); } } }
for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)) { Throwable err = null;
for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)){ Throwable err = null;
for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)) { Throwable err = null;
for (IgniteInternalFuture<?> fut : exchMgr.exchangeFutures()) fut.get();
ctx.shared().exchange().exchangeFutures();
/** {@inheritDoc} */ @Override public void apply(StringBuilder sb, GridKernalContext ctx) { sb.append(U.nl()); List<GridDhtPartitionsExchangeFuture> futs = ctx.cache().context().exchange().exchangeFutures(); for (GridDhtPartitionsExchangeFuture fut : futs) { if (topVer.equals(fut.initialVersion())) { sb.append("Exchange future: ").append(fut); return; } } sb.append("Failed to find exchange future: ").append(topVer); }
/** */ private void init() { // Obtain the topology version to use. long threadId = Thread.currentThread().getId(); AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(threadId); // If there is another system transaction in progress, use it's topology version to prevent deadlock. if (topVer == null && tx.system()) topVer = cctx.tm().lockedTopologyVersion(threadId, tx); if (topVer != null) tx.topologyVersion(topVer); if (topVer == null) topVer = tx.topologyVersionSnapshot(); if (topVer != null) { for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)) { Throwable err = fut.validateCache(cctx, false, false, null, null); if (err != null) { onDone(err); return; } break; } } onDone(topVer); topLocked = true; return; } acquireTopologyVersion(); }
for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)) { Throwable err = fut.validateCache(cctx, recovery, read, null, keys);
for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)){ Throwable err = fut.validateCache(cctx, recovery, read, null, keys);
for (GridDhtTopologyFuture fut : cctx.shared().exchange().exchangeFutures()) { if (fut.exchangeDone() && fut.topologyVersion().equals(topVer)) { Throwable err = fut.validateCache(cctx, false, false, null, null);