/** * @return Error. */ public static ClusterTopologyServerNotFoundException noCoordinatorError() { return new ClusterTopologyServerNotFoundException("Mvcc coordinator is not assigned."); }
throw new CacheServerNotFoundException(e.getMessage(), e);
/** * @param part Partition. * @param topVer Topology version. * @return Exception. */ private ClusterTopologyServerNotFoundException serverNotFoundError(int part, AffinityTopologyVersion topVer) { return new ClusterTopologyServerNotFoundException("Failed to map keys for cache " + "(all partition nodes left the grid) [topVer=" + topVer + ", part=" + part + ", cache=" + cctx.name() + ']'); }
/** * @param part Partition. * @param topVer Topology version. * @return Exception. */ protected final ClusterTopologyServerNotFoundException serverNotFoundError(int part, AffinityTopologyVersion topVer) { return new ClusterTopologyServerNotFoundException("Failed to map keys for cache " + "(all partition nodes left the grid) [topVer=" + topVer + ", part" + part + ", cache=" + cctx.name() + ", localNodeId=" + cctx.localNodeId() + ']'); }
/** * Handles case when all server nodes have left the grid. */ private void onAllServersLeft() { assert ctx.clientNode(); completeError(new ClusterTopologyServerNotFoundException("Failed to resolve coordinator to continue services " + "deployment process: [locId=" + ctx.localNodeId() + "client=" + ctx.clientNode() + "evt=" + evt + ']')); }
return new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all " + "partition nodes left the grid): " + cacheCtx.name());
/** * * @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); }
/** {@inheritDoc} */ @Override public IgniteCheckedException validateTopology( GridCacheSharedContext cctx, boolean read, GridDhtTopologyFuture topFut ) { if (cacheCtx == null) return null; Throwable err = topFut.validateCache(cacheCtx, recovery, read, null, entry); if (err != null) { return new IgniteCheckedException( "Failed to perform cache operation (cache topology is not valid): " + U.maskName(cacheCtx.name()), err); } if (CU.affinityNodes(cacheCtx, topFut.topologyVersion()).isEmpty()) { return new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all " + "partition nodes left the grid): " + cacheCtx.name()); } return null; }
throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache " + "(all partition nodes left the grid).");
/** * @param mapping Mappings. * @param key Key to map. * @param topVer Topology version. * @return Near lock mapping. * @throws IgniteCheckedException If mapping for key failed. */ private GridNearLockMapping map( KeyCacheObject key, @Nullable GridNearLockMapping mapping, AffinityTopologyVersion topVer ) throws IgniteCheckedException { assert mapping == null || mapping.node() != null; ClusterNode primary = cctx.affinity().primaryByKey(key, topVer); if (primary == null) throw new ClusterTopologyServerNotFoundException("Failed to lock keys " + "(all partition nodes left the grid)."); if (cctx.discovery().node(primary.id()) == null) // If primary node left the grid before lock acquisition, fail the whole future. throw newTopologyException(null, primary.id()); if (mapping == null || !primary.id().equals(mapping.node().id())) mapping = new GridNearLockMapping(primary, key); else mapping.addKey(key); return mapping; }
/** * @param key Key to map. * @param topVer Topology version. * @param cctx Context. * @return Nodes to send requests to. * @throws IgniteCheckedException If failed. */ private List<ClusterNode> nodes(KeyCacheObject key, AffinityTopologyVersion topVer, GridCacheContext cctx) throws IgniteCheckedException { GridAffinityProcessor aff = ctx.affinity(); List<ClusterNode> res = null; if (!allowOverwrite()) res = cctx.isLocal() ? aff.mapKeyToPrimaryAndBackups(cacheName, key, topVer) : cctx.topology().nodes(cctx.affinity().partition(key), topVer); else { ClusterNode node = aff.mapKeyToNode(cacheName, key, topVer); if (node != null) res = Collections.singletonList(node); } if (F.isEmpty(res)) throw new ClusterTopologyServerNotFoundException("Failed to find server node for cache (all affinity " + "nodes have left the grid or cache was stopped): " + cacheName); return res; }
/** * @param mapping Mappings. * @param key Key to map. * @param topVer Topology version. * @return Near lock mapping. * @throws IgniteCheckedException If mapping failed. */ private GridNearLockMapping map( KeyCacheObject key, @Nullable GridNearLockMapping mapping, AffinityTopologyVersion topVer ) throws IgniteCheckedException { assert mapping == null || mapping.node() != null; ClusterNode primary = cctx.affinity().primaryByKey(key, topVer); if (primary == null) throw new ClusterTopologyServerNotFoundException("Failed to lock keys " + "(all partition nodes left the grid)."); if (cctx.discovery().node(primary.id()) == null) // If primary node left the grid before lock acquisition, fail the whole future. throw newTopologyException(null, primary.id()); if (mapping == null || !primary.id().equals(mapping.node().id())) mapping = new GridNearLockMapping(primary, key); else mapping.addKey(key); return mapping; }
throw new ClusterTopologyServerNotFoundException("Failed to get primary node " + "[topVer=" + topVer + ", key=" + key + ']');
throw new ClusterTopologyServerNotFoundException("Failed to get primary node " + "[topVer=" + topVer + ", key=" + key + ']');
assert !cctx.affinityNode(); onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for near-only cache (all partition " + "nodes left the grid)."));
throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache " + "(all partition nodes left the grid).");
new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes left the grid)."), null);
new ClusterTopologyServerNotFoundException("All server nodes left grid."));
onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache " + "(all partition nodes left the grid): " + cctx.name()));
throw new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all partition nodes " + "left the grid).");