/** * @return Closures processor. */ public GridClosureProcessor closures() { return ctx.closure(); }
/** * @param ctx Kernal context. */ public GridMarshallerMappingProcessor(GridKernalContext ctx) { super(ctx); marshallerCtx = ctx.marshallerContext(); closProc = ctx.closure(); }
@Override public void apply(IgniteInternalFuture<?> fut0) { ctx.closure().runLocalSafe(new Runnable() { @Override public void run() { onResponse(failoverRes); } }, false); } });
@Override public void apply(IgniteInternalFuture<?> t) { ctx.closure().runLocalSafe(new Runnable() { @Override public void run() { processRequest(nodeId, req); } }, plc); } });
/** {@inheritDoc} */ @Override public void onTimeout() { // Should not block timeout thread. cctx.kernalContext().closure().runLocalSafe(new Runnable() { @Override public void run() { onTimeout0(); } }); } }
@Override public void apply(IgniteInternalFuture<?> syncFut) { ctx.kernalContext().closure().runLocalSafe( new GridPlainRunnable() { @Override public void run() { fut.init(); } }); } });
@Override public void apply(IgniteInternalFuture<?> t) { ((IgniteEx)ignite).context().closure().runLocalSafe(new Runnable() { @Override public void run() { jobCtx.callcc(); } }, false); } });
@Override public void apply(final IgniteInternalFuture<AffinityTopologyVersion> fut) { cctx.kernalContext().closure().runLocalSafe(new Runnable() { @Override public void run() { mapOnTopology(); } }); } });
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> t) { cctx.kernalContext().closure().runLocalSafe(new Runnable() { @Override public void run() { mapOnTopology(); } }); } });
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> t) { cctx.kernalContext().closure().runLocalSafe(new Runnable() { @Override public void run() { mapOnTopology(); } }); } });
/** * Executes query runnable. */ void execute() { fut = cctx.kernalContext().closure().runLocalSafe(run, GridIoPolicy.QUERY_POOL); }
@Override public void apply(final IgniteInternalFuture<AffinityTopologyVersion> fut) { cctx.kernalContext().closure().runLocalSafe(new Runnable() { @Override public void run() { mapOnTopology(); } }); } });
/** */ private void completeMini(UUID nodeId) { for (IgniteInternalFuture<?> fut : futures()) { assert fut instanceof MiniFuture; MiniFuture mini = (MiniFuture)fut; if (mini.nodeId.equals(nodeId)) { cctx.kernalContext().closure().runLocalSafe(mini::onDone); break; } } }
/** * Initializes a new coordinator. */ private void initialize(MvccCoordinator curCrd0) { readyVer = curCrd0.topologyVersion(); curCrd0.initialized(true); // Complete init future if local node is a new coordinator. All previous txs have been already completed here. if (curCrd0.local()) ctx.closure().runLocalSafe(initFut::onDone); }
/** {@inheritDoc} */ @Override public Map<UUID, Integer> serviceTopology(String name, long timeout) throws IgniteCheckedException { IgniteInternalCache<Object, Object> cache = serviceCache(); ClusterNode node = cache.affinity().mapKeyToNode(name); final ServiceTopologyCallable call = new ServiceTopologyCallable(name); return ctx.closure().callAsyncNoFailover( GridClosureCallMode.BROADCAST, call, Collections.singletonList(node), false, timeout, true).get(); }
/** {@inheritDoc} */ @Override public IgniteFuture<?> runLocal(Runnable r) { A.notNull(r, "r"); guard(); try { return new IgniteFutureImpl<>(ctx.closure().runLocalSafe(r, false)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public <R> IgniteFuture<R> callLocal(Callable<R> c) { A.notNull(c, "c"); guard(); try { return new IgniteFutureImpl<>(ctx.closure().callLocalSafe(c, false)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public <T> Future<T> submit(Callable<T> task) { A.notNull(task, "task != null"); checkShutdown(); ctx.gateway().readLock(); try { return addFuture(ctx.closure().callAsync(BALANCE, task, prj.nodes())); } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public Future<?> submit(Runnable task) { A.notNull(task, "task != null"); checkShutdown(); ctx.gateway().readLock(); try { return addFuture(ctx.closure().runAsync(BALANCE, task, prj.nodes())); } finally { ctx.gateway().readUnlock(); } }
/** {@inheritDoc} */ @Override public void execute(Runnable cmd) { A.notNull(cmd, "cmd != null"); checkShutdown(); ctx.gateway().readLock(); try { addFuture(ctx.closure().runAsync(BALANCE, cmd, prj.nodes())); } finally { ctx.gateway().readUnlock(); } }