/** * Constructor. * * @param creatorNodeId Creator node ID. */ protected GridTcpDiscoveryAbstractMessage(UUID creatorNodeId) { id = GridUuid.fromUuid(creatorNodeId); }
/** * @param taskName Task name. * @param arg Optional execution argument. * @return Task future. * @param <T> Task argument type. * @param <R> Task return value type. */ public <T, R> GridComputeTaskFuture<R> execute(String taskName, @Nullable T arg) { assert taskName != null; lock.readLock(); try { if (stopping) throw new IllegalStateException("Failed to execute task due to grid shutdown: " + taskName); return startTask(taskName, null, null, GridUuid.fromUuid(ctx.localNodeId()), arg, false); } finally { lock.readUnlock(); } }
/** * @param task Actual task. * @param arg Optional task argument. * @param sys If {@code true}, then system pool will be used. * @return Task future. * @param <T> Task argument type. * @param <R> Task return value type. */ public <T, R> GridComputeTaskFuture<R> execute(GridComputeTask<T, R> task, @Nullable T arg, boolean sys) { lock.readLock(); try { if (stopping) throw new IllegalStateException("Failed to execute task due to grid shutdown: " + task); return startTask(null, null, task, GridUuid.fromUuid(ctx.localNodeId()), arg, sys); } finally { lock.readUnlock(); } }
/** * @param taskCls Task class. * @param arg Optional execution argument. * @return Task future. * @param <T> Task argument type. * @param <R> Task return value type. */ public <T, R> GridComputeTaskFuture<R> execute(Class<? extends GridComputeTask<T, R>> taskCls, @Nullable T arg) { assert taskCls != null; lock.readLock(); try { if (stopping) throw new IllegalStateException("Failed to execute task due to grid shutdown: " + taskCls); return startTask(null, taskCls, null, GridUuid.fromUuid(ctx.localNodeId()), arg, false); } finally { lock.readUnlock(); } }
@Override public void onEvent(GridEvent evt) { int evtType = evt.type(); assert evtType == EVT_NODE_FAILED || evtType == EVT_NODE_LEFT || evtType == EVT_NODE_JOINED; if (affMap.isEmpty()) return; // Skip empty affinity map. final GridDiscoveryEvent discoEvt = (GridDiscoveryEvent)evt; // Clean up affinity functions if such cache no more exists. if (evtType == EVT_NODE_FAILED || evtType == EVT_NODE_LEFT) { final Collection<String> caches = new HashSet<>(); for (GridNode gridNode : ctx.discovery().allNodes()) caches.addAll(U.cacheNames(gridNode)); final Collection<AffinityAssignmentKey> rmv = new GridLeanSet<>(); for (AffinityAssignmentKey key : affMap.keySet()) { if (!caches.contains(key.cacheName) || key.topVer < discoEvt.topologyVersion() - 1) rmv.add(key); } ctx.timeout().addTimeoutObject(new GridTimeoutObjectAdapter( GridUuid.fromUuid(ctx.localNodeId()), AFFINITY_MAP_CLEAN_UP_DELAY) { @Override public void onTimeout() { affMap.keySet().removeAll(rmv); } }); } } };
GridUuid ldrId = GridUuid.fromUuid(ctx.localNodeId());
/** * Starts multi-update lock. Will wait for topology future is ready. * * @return Topology version. * @throws GridException If failed. */ public long beginMultiUpdate() throws GridException { GridBiTuple<GridUuid, GridDhtTopologyFuture> tup = multiTxHolder.get(); if (tup != null) throw new GridException("Nested multi-update locks are not supported"); top.readLock(); GridDhtTopologyFuture topFut; long topVer; try { // While we are holding read lock, register lock future for partition release future. GridUuid lockId = GridUuid.fromUuid(ctx.localNodeId()); topVer = top.topologyVersion(); MultiUpdateFuture fut = new MultiUpdateFuture(ctx.kernalContext(), topVer); MultiUpdateFuture old = multiTxFuts.putIfAbsent(lockId, fut); assert old == null; topFut = top.topologyVersionFuture(); multiTxHolder.set(F.t(lockId, topFut)); } finally { top.readUnlock(); } topFut.get(); return topVer; }
Object resTopic = TOPIC_EVENT.topic(GridUuid.fromUuid(ctx.localNodeId()));
futId = GridUuid.fromUuid(streamer.kernalContext().localNodeId()); this.parentFutId = parentFutId;
throw new GridException("Node can not be null [mappedJob=" + mappedJob + ", ses=" + ses + ']'); GridUuid jobId = GridUuid.fromUuid(node.id());
/** * @param ctx Grid kernal context. */ public GridDeploymentManager(GridKernalContext ctx) { super(ctx, ctx.config().getDeploymentSpi()); if (!ctx.config().isPeerClassLoadingEnabled()) { GridDeploymentSpi spi = ctx.config().getDeploymentSpi(); GridIgnoreIfPeerClassLoadingDisabled ann = U.getAnnotation(spi.getClass(), GridIgnoreIfPeerClassLoadingDisabled.class); locDep = ann != null ? new LocalDeployment( ctx.config().getDeploymentMode(), U.gridClassLoader(), GridUuid.fromUuid(ctx.localNodeId()), ctx.userVersion(U.gridClassLoader()), String.class.getName()) : null; } else locDep = null; }
GridUuid.fromUuid(ctx.localNodeId()), meta.userVersion(), meta.deploymentMode(),
topic = TOPIC_DATALOAD.topic(GridUuid.fromUuid(ctx.localNodeId()));
GridUuid ldrId = GridUuid.fromUuid(ctx.localNodeId());
Object resTopic = TOPIC_CLASSLOAD.topic(GridUuid.fromUuid(ctx.localNodeId()));