/** * @param backups Backup nodes. */ private void add(Iterable<GridNode> backups) { for (GridNode n : backups) this.backups.add(n.id()); } }
/** * @param primary Primary node. * @param backups Backup nodes. */ private TxMapping(GridNode primary, Iterable<GridNode> backups) { this.primary = primary.id(); this.backups = new HashSet<>(); add(backups); }
/** * @param n Node. * @return Whether node belongs to this projection. */ private boolean contains(GridNode n) { assert n != null; return ids != null ? ids.contains(n.id()) : p == null || p.apply(n); }
/** * @param leftNodeId Left node ID. */ public void onNodeLeft(UUID leftNodeId) { synchronized (this) { if (pendingNode != null && pendingNode.id().equals(leftNodeId)) { availableNodes.remove(pendingNode); pendingNode = null; } } requestFromNextNode(); }
/** {@inheritDoc} */ @Override protected Void run(String arg) throws GridException { System.out.println("<visor>: ack: " + (arg == null ? g.localNode().id() : arg)); return null; }
@Override public void onEvent(GridEvent evt) { GridDiscoveryEvent discoEvt = (GridDiscoveryEvent)evt; for (GridStreamerStageExecutionFuture fut : stageFuts.values()) fut.onNodeLeft(discoEvt.eventNode().id()); } }, EVT_NODE_LEFT, EVT_NODE_FAILED);
/** {@inheritDoc} */ @Nullable @Override protected Iterable<GridBiTuple<UUID, VisorLicense>> reduce0(List<GridComputeJobResult> results) throws GridException { Collection<GridBiTuple<UUID, VisorLicense>> licenses = new ArrayList<>(results.size()); for (GridComputeJobResult r : results) { VisorLicense license = r.getException() != null ? null : (VisorLicense) r.getData(); licenses.add(new GridBiTuple<>(r.getNode().id(), license)); } return licenses; }
/** {@inheritDoc} */ @Override public String toString() { GridNode oldestNode = this.oldestNode.get(); return S.toString(GridDhtPartitionsExchangeFuture.class, this, "oldest", oldestNode == null ? "null" : oldestNode.id(), "oldestOrder", oldestNode == null ? "null" : oldestNode.order(), "evtLatch", evtLatch == null ? "null" : evtLatch.getCount(), "remaining", remaining(), "super", super.toString()); } }
@Override public boolean apply(GridNode n) { GridCacheDistributionMode mode = U.distributionMode(n, cctx.name()); return (mode == PARTITIONED_ONLY || mode == NEAR_PARTITIONED) && (prj == null || prj.node(n.id()) != null); } });
@Override public void onEvent(GridEvent evt) { assert evt.type() == EVT_NODE_FAILED || evt.type() == EVT_NODE_LEFT; GridDiscoveryEvent discoEvt = (GridDiscoveryEvent)evt; for (EvictionFuture fut : futs.values()) fut.onNodeLeft(discoEvt.eventNode().id()); } },
/** * Short node representation. * * @param n Grid node. * @return Short string representing the node. */ public static String toShortString(GridNode n) { return "GridNode [id=" + n.id() + ", order=" + n.order() + ", addr=" + n.addresses() + ", daemon=" + n.isDaemon() + ']'; }
/** {@inheritDoc} */ @Override public boolean onNodeLeft(UUID nodeId) { for (GridFuture<?> fut : futures()) if (isMini(fut)) { MiniFuture f = (MiniFuture)fut; if (f.node().id().equals(nodeId)) { f.onResult(new GridTopologyException("Remote node left grid (will retry): " + nodeId)); return true; } } return false; }
/** * @param node Node. * @param id ID. * @throws GridException If failed. */ private void sendLocalPartitions(GridNode node, @Nullable GridDhtPartitionExchangeId id) throws GridException { GridDhtPartitionsSingleMessage<K, V> m = new GridDhtPartitionsSingleMessage<>(id, top.localPartitionMap(), cctx.versions().last()); if (log.isDebugEnabled()) log.debug("Sending local partitions [nodeId=" + node.id() + ", exchId=" + exchId + ", msg=" + m + ']'); cctx.io().send(node, m); }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridAuthorizationEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridDiscoveryEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridSecureSessionEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridCacheQueryReadEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridCacheQueryExecutedEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridCachePreloadingEvent.class, this, "discoEvtName", discoveryEventName(), "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }