/** * @return Grid discovery manager. */ public GridDiscoveryManager discovery() { return ctx.discovery(); }
/** * @return Local node. */ public GridNode localNode() { if (locNode == null) locNode = ctx.discovery().localNode(); return locNode; }
/** {@inheritDoc} */ @Override public Collection<GridNode> nodes() { if (ctx.discovery().topologyVersion() != lastTopVer) reset(); GridNode node = this.node; return node == null ? Collections.<GridNode>emptyList() : Collections.singletonList(node); } }
/** {@inheritDoc} */ @Override public boolean isTaskNode() { return taskNodeId.equals(ctx.discovery().localNode().id()); }
/** * @param cacheName Cache name. * @param keys Keys. * @return Affinity map. * @throws GridException If failed. */ private <K> Map<GridNode, Collection<K>> keysToNodes(@Nullable final String cacheName, Collection<? extends K> keys) throws GridException { return keysToNodes(cacheName, keys, ctx.discovery().topologyVersion()); }
@Override public boolean pingNode(UUID nodeId) { A.notNull(nodeId, "nodeId"); return ctx.discovery().pingNode(nodeId); }
/** * @return Local node. */ private GridNode localNode() { if (locNode == null) locNode = ggfsCtx.kernalContext().discovery().localNode(); return locNode; }
/** {@inheritDoc} */ @Override public GridNode node() { if (ctx.discovery().topologyVersion() != lastTopVer) reset(); return node; }
/** {@inheritDoc} */ @Override public long topologyVersion() { guard(); try { return ctx.discovery().topologyVersion(); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public Collection<GridNode> topology(long topVer) { guard(); try { return ctx.discovery().topology(topVer); } finally { unguard(); } }
/** * @return Next version based on current topology. */ public GridCacheVersion next() { return next(cctx.kernalContext().discovery().topologyVersion(), true, false); }
/** {@inheritDoc} */ @Override public GridNode localNode() { guard(); try { GridNode node = ctx.discovery().localNode(); assert node != null; return node; } finally { unguard(); } }
/** {@inheritDoc} */ @Override public void onKernalStart() throws GridException { if (ctx.config().isDaemon()) return; if (!Boolean.getBoolean(GridSystemProperties.GG_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) { for (GridNode n : ctx.discovery().remoteNodes()) checkGgfsOnRemoteNode(n); } for (GridGgfsContext ggfsCtx : ggfsCache.values()) for (GridGgfsManager mgr : ggfsCtx.managers()) mgr.onKernalStart(); }
/** Initializes future. */ private void init() { ctx.event().addLocalEventListener(this, EVT_NODE_JOINED, EVT_NODE_LEFT, EVT_NODE_FAILED); // Close potential window. long topVer = ctx.discovery().topologyVersion(); if (topVer >= awaitVer) onDone(topVer); }
/** {@inheritDoc} */ @Override protected void onKernalStart0() throws GridException { locNode = ggfsCtx.kernalContext().discovery().localNode(); // Start background delete worker. delWorker = new GridGgfsDeleteWorker(ggfsCtx); delWorker.start(); }
/** {@inheritDoc} */ @Override protected void onKernalStart0() throws GridException { locNode = ggfsCtx.kernalContext().discovery().localNode(); // Start background delete worker. delWorker = new GridGgfsDeleteWorker(ggfsCtx); delWorker.start(); }
/** {@inheritDoc} */ @Override public boolean pingNodeByAddress(String host) { guard(); try { for (GridNode n : nodes()) if (n.addresses().contains(host)) return ctx.discovery().pingNode(n.id()); return false; } finally { unguard(); } }
/** {@inheritDoc} */ @Override protected void onKernalStart0() throws GridException { if (ggfsCtx.configuration().isFragmentizerEnabled()) { // Check at startup if this node is a fragmentizer coordinator. GridDiscoveryEvent locJoinEvt = ggfsCtx.kernalContext().discovery().localJoinEvent(); checkLaunchCoordinator(locJoinEvt); } }
/** {@inheritDoc} */ @Override protected void onKernalStart0() throws GridException { if (ggfsCtx.configuration().isFragmentizerEnabled()) { // Check at startup if this node is a fragmentizer coordinator. GridDiscoveryEvent locJoinEvt = ggfsCtx.kernalContext().discovery().localJoinEvent(); checkLaunchCoordinator(locJoinEvt); } }