/** {@inheritDoc} */ @Override public GridDhtTopologyFuture topologyVersionFuture() { GridDhtTopologyFuture topReadyFut0 = topReadyFut; assert topReadyFut0 != null; if (!topReadyFut0.changedAffinity()) { GridDhtTopologyFuture lastFut = ctx.exchange().lastFinishedFuture(); if (lastFut != null) return lastFut; } return topReadyFut0; }
/** * Checks whether cache topology is valid for operations. * * @param read {@code True} if validating read operations, {@code false} if validating write. * @return Valid ot not. */ private boolean isValidForOperation(boolean read) { if (cctx.isLocal()) return true; try { GridDhtTopologyFuture fut = cctx.shared().exchange().lastFinishedFuture(); return (fut != null && fut.validateCache(cctx, false, read, null, null) == null); } catch (Exception ignored) { return false; } }
/** * * @param cacheNodes Cache affynity nodes. * @param topVer Topology version. */ private void validate(Collection<ClusterNode> cacheNodes, AffinityTopologyVersion topVer) { if (cacheNodes.isEmpty()) { onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache " + "(all partition nodes left the grid) [topVer=" + topVer + ", cache=" + cctx.name() + ']')); return; } GridDhtTopologyFuture topFut = cctx.shared().exchange().lastFinishedFuture(); Throwable err = topFut != null ? topFut.validateCache(cctx, recovery, true, null, keys) : null; if (err != null) onDone(err); }
/** * @param topVer Topology version. * @return True if validate success, False is not. */ private boolean validate(AffinityTopologyVersion topVer) { if (!checkRetryPermits(topVer)) return false; GridDhtTopologyFuture lastFut = cctx.shared().exchange().lastFinishedFuture(); Throwable error = lastFut.validateCache(cctx, recovery, true, key, null); if (error != null) { onDone(error); return false; } else return true; }
GridDhtTopologyFuture topFut = cctx.shared().exchange().lastFinishedFuture();
GridDhtTopologyFuture lastFinished = exch.lastFinishedFuture();
int keysSize = keys.size(); GridDhtTopologyFuture topFut = ctx.shared().exchange().lastFinishedFuture();
cctx.exchange().lastFinishedFuture(this);
GridDhtTopologyFuture topFut = cctx.exchange().lastFinishedFuture();
/** * Checks whether cache topology is valid for operations. * * @param read {@code True} if validating read operations, {@code false} if validating write. * @return Valid ot not. */ private boolean isValidForOperation(boolean read) { if (cctx.isLocal()) return true; try { GridDhtTopologyFuture fut = cctx.shared().exchange().lastFinishedFuture(); return (fut != null && fut.validateCache(cctx, false, read, null, null) == null); } catch (Exception ignored) { return false; } }
/** * */ public void init() { AffinityTopologyVersion topVer = this.topVer.topologyVersion() > 0 ? this.topVer : canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion(); GridDhtTopologyFuture topFut = cctx.shared().exchange().lastFinishedFuture(); Throwable err = topFut != null ? topFut.validateCache(cctx, recovery, true, key, null) : null; if (err != null) { onDone(err); return; } map(topVer); }
GridDhtTopologyFuture topFut = cctx.shared().exchange().lastFinishedFuture();
int keysSize = keys.size(); GridDhtTopologyFuture topFut = ctx.shared().exchange().lastFinishedFuture();
cctx.exchange().lastFinishedFuture(this);