/** * @param sb String builder. * @param ctx Context. */ static void dumpExchangeInfo(StringBuilder sb, GridKernalContext ctx) { GridCachePartitionExchangeManager exchMgr = ctx.cache().context().exchange(); GridDhtTopologyFuture fut = exchMgr.lastTopologyFuture(); sb.append("Partitions exchange info [readyVer=").append(exchMgr.readyAffinityVersion()).append(']').append(U.nl()) .append("Last initialized exchange future: ").append(fut); }
/** * @return {@code True} If there is any exchange future in progress. */ private boolean exchangeInProgress() { if (exchWorker.hasPendingServerExchange()) return true; GridDhtPartitionsExchangeFuture current = lastTopologyFuture(); if (current == null) return false; GridDhtTopologyFuture finished = lastFinishedFut.get(); if (finished == null || finished.result().compareTo(current.initialVersion()) < 0) { ClusterNode triggeredBy = current.firstEvent().eventNode(); if (current.partitionChangesInProgress() && !triggeredBy.isClient()) return true; } return false; }
/** * @param readyVer Ready topology version. * * @return {@code true} If pending distributed exchange exists because server topology is changed. */ public boolean serverTopologyChanged(AffinityTopologyVersion readyVer) { GridDhtPartitionsExchangeFuture fut = ctx.cache().context().exchange().lastTopologyFuture(); if (fut.isDone()) return false; AffinityTopologyVersion initVer = fut.initialVersion(); return initVer.compareTo(readyVer) > 0 && !fut.firstEvent().node().isClient(); }
assert req.firstClientRequest() : req; GridDhtTopologyFuture topFut = ctx.shared().exchange().lastTopologyFuture();
/** * * @param ig Ignite. */ private void awaitExchange(IgniteEx ig) throws IgniteCheckedException { ig.context().cache().context().exchange().lastTopologyFuture().get(); }
/** {@inheritDoc} */ @Override public GridDhtTopologyFuture topologyReadLock(GridCacheSharedContext cctx, GridFutureAdapter<?> fut) { if (activeCacheIds.isEmpty()) return cctx.exchange().lastTopologyFuture(); GridCacheContext<?, ?> nonLocCtx = null; for (int i = 0; i < activeCacheIds.size(); i++) { int cacheId = activeCacheIds.get(i); GridCacheContext<?, ?> cacheCtx = cctx.cacheContext(cacheId); if (!cacheCtx.isLocal()) { nonLocCtx = cacheCtx; break; } } if (nonLocCtx == null) return cctx.exchange().lastTopologyFuture(); nonLocCtx.topology().readLock(); if (nonLocCtx.topology().stopping()) { fut.onDone( cctx.cache().isCacheRestarting(nonLocCtx.name())? new IgniteCacheRestartingException(nonLocCtx.name()): new CacheStoppedException(nonLocCtx.name())); return null; } return nonLocCtx.topology().topologyVersionFuture(); }
/** {@inheritDoc} */ @Override public GridDhtTopologyFuture topologyReadLock(GridCacheSharedContext cctx, GridFutureAdapter<?> fut) { if (cacheCtx == null || cacheCtx.isLocal()) return cctx.exchange().lastTopologyFuture(); cacheCtx.topology().readLock(); if (cacheCtx.topology().stopping()) { fut.onDone( cctx.cache().isCacheRestarting(cacheCtx.name())? new IgniteCacheRestartingException(cacheCtx.name()): new CacheStoppedException(cacheCtx.name())); return null; } return cacheCtx.topology().topologyVersionFuture(); }
topVer = ctx.cache().context().exchange().lastTopologyFuture().get(); else topVer = ctx.cache().context().exchange().readyAffinityVersion();
stopThreads.get(i).start(); while (lastFinished == exch.lastTopologyFuture()) doSleep(1);
assert req.firstClientRequest() : req; GridDhtTopologyFuture topFut = ctx.exchange().lastTopologyFuture();
affFut = ctx.cache().context().exchange().lastTopologyFuture(); mapTopVer = ctx.cache().context().exchange().readyAffinityVersion(); affFut = ctx.cache().context().exchange().lastTopologyFuture();
platformCtx.kernalContext().cache().context().exchange().lastTopologyFuture().get();
AffinityTopologyVersion topVer = ctx.shared().exchange().lastTopologyFuture().initialVersion();
/** * @param cacheName Cache name. * @param node Node. * @param exp {@code True} if expect that cache is started on node. */ void checkCache(Ignite node, String cacheName, boolean exp) throws IgniteCheckedException { ((IgniteEx)node).context().cache().context().exchange().lastTopologyFuture().get(); ((IgniteEx)node).context().state().publicApiActiveState(true); GridCacheAdapter cache = ((IgniteEx)node).context().cache().internalCache(cacheName); if (exp) assertNotNull("Cache not found [cache=" + cacheName + ", node=" + node.name() + ']', cache); else assertNull("Unexpected cache found [cache=" + cacheName + ", node=" + node.name() + ']', cache); }
() -> exchangeMgr.lastTopologyFuture().initialVersion().compareTo(joinFourNodeVer) >= 0, getTestTimeout() );
AffinityTopologyVersion topVer = grid(1).context().cache().context().exchange().lastTopologyFuture().get();
AffinityTopologyVersion topVer = ctx.shared().exchange().lastTopologyFuture().initialVersion();
/** * @param sb String builder. * @param ctx Context. */ static void dumpExchangeInfo(StringBuilder sb, GridKernalContext ctx) { GridCachePartitionExchangeManager exchMgr = ctx.cache().context().exchange(); GridDhtTopologyFuture fut = exchMgr.lastTopologyFuture(); sb.append("Partitions exchange info [readyVer=").append(exchMgr.readyAffinityVersion()).append(']').append(U.nl()) .append("Last initialized exchange future: ").append(fut); }
/** * @param readyVer Ready topology version. * * @return {@code true} If pending distributed exchange exists because server topology is changed. */ public boolean serverTopologyChanged(AffinityTopologyVersion readyVer) { GridDhtPartitionsExchangeFuture fut = ctx.cache().context().exchange().lastTopologyFuture(); if (fut.isDone()) return false; AffinityTopologyVersion initVer = fut.initialVersion(); return initVer.compareTo(readyVer) > 0 && !fut.firstEvent().node().isClient(); }
/** {@inheritDoc} */ @Override public GridDhtTopologyFuture topologyReadLock(GridCacheSharedContext cctx, GridFutureAdapter<?> fut) { if (cacheCtx == null || cacheCtx.isLocal()) return cctx.exchange().lastTopologyFuture(); cacheCtx.topology().readLock(); if (cacheCtx.topology().stopping()) { fut.onDone(new CacheStoppedException(cacheCtx.name())); return null; } return cacheCtx.topology().topologyVersionFuture(); }