/** * @param fut Internal future. * @return Public API future. */ private <R> IgniteFuture<R> createFuture(IgniteInternalFuture<R> fut) { return new IgniteFutureImpl<>(fut); }
/** * @param fut Future. */ protected <V> IgniteFutureImpl<V> createFuture(IgniteInternalFuture<V> fut) { return new IgniteFutureImpl<>(fut); }
/** * @return Error. */ private IllegalStateException suspendedError() { throw new IgniteCacheRestartingException(new IgniteFutureImpl<>(suspendFut), ctx.name()); }
/** {@inheritDoc} */ @Override public IgniteFuture<Collection<ClusterStartNodeResult>> startNodesAsync( Collection<Map<String, Object>> hosts, @Nullable Map<String, Object> dflts, boolean restart, int timeout, int maxConn) throws IgniteException { return new IgniteFutureImpl<>(startNodesAsync0(hosts, dflts, restart, timeout, maxConn)); }
/** {@inheritDoc} */ @Override public <T extends Event> IgniteFuture<T> waitForLocalAsync(@Nullable IgnitePredicate<T> filter, @Nullable int... types) throws IgniteException { guard(); try { return new IgniteFutureImpl<>(ctx.event().waitForEvent(filter, types)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public <T> IgniteFuture<T> chainAsync(final IgniteClosure<? super IgniteFuture<V>, T> doneCb, Executor exec) { A.notNull(doneCb, "doneCb"); A.notNull(exec, "exec"); return new IgniteFutureImpl<>(chainInternal(doneCb, exec)); }
/** {@inheritDoc} */ @Override public IgniteFuture<Boolean> rebalance() { GridCacheContext<K, V> ctx = getContextSafe(); return new IgniteFutureImpl<>(ctx.preloader().forceRebalance()); }
/** {@inheritDoc} */ @Override public IgniteFuture<Void> cancelAllAsync(Collection<String> names) { guard(); try { return (IgniteFuture<Void>)new IgniteFutureImpl<>(ctx.service().cancelAll(names)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public IgniteFuture<?> closeAsync() { GridCacheContext<K, V> ctx = getContextSafe(); return new IgniteFutureImpl<>(ctx.kernalContext().cache().dynamicCloseCache(cacheName)); }
/** {@inheritDoc} */ @Override public <T extends Event> IgniteFuture<List<T>> remoteQueryAsync(IgnitePredicate<T> p, long timeout, @Nullable int... types) throws IgniteException { guard(); try { return new IgniteFutureImpl<>(ctx.event().remoteEventsAsync(compoundPredicate(p, types), prj.nodes(), timeout)); } finally { unguard(); } }
@Override public IgniteException apply(IgniteCheckedException e) { ClusterTopologyException topEx = new ClusterTopologyException(e.getMessage(), e); ClusterTopologyCheckedException checked = (ClusterTopologyCheckedException)e; if (checked.retryReadyFuture() != null) topEx.retryReadyFuture(new IgniteFutureImpl<>(checked.retryReadyFuture())); return topEx; } });
/** {@inheritDoc} */ @Override public IgniteFuture<Void> deployAllAsync(Collection<ServiceConfiguration> cfgs) { A.notNull(cfgs, "cfgs"); guard(); try { return (IgniteFuture<Void>)new IgniteFutureImpl<>(ctx.service().deployAll(prj, cfgs)); } finally { unguard(); } }
/** {@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 IgniteFuture<Void> cancelAsync(String name) { A.notNull(name, "name"); guard(); try { return (IgniteFuture<Void>)new IgniteFutureImpl<>(ctx.service().cancel(name)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public IgniteFuture<Void> stopRemoteListenAsync(UUID opId) throws IgniteException { A.notNull(opId, "opId"); guard(); try { return (IgniteFuture<Void>)new IgniteFutureImpl<>(ctx.continuous().stopRoutine(opId)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public IgniteFuture<Void> stopRemoteListenAsync(UUID opId) throws IgniteException { A.notNull(opId, "consumeId"); guard(); try { return (IgniteFuture<Void>)new IgniteFutureImpl<>(ctx.continuous().stopRoutine(opId)); } 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 IgniteFuture<Void> deployNodeSingletonAsync(String name, Service svc) { A.notNull(name, "name"); A.notNull(svc, "svc"); guard(); try { return (IgniteFuture<Void>)new IgniteFutureImpl<>(ctx.service().deployNodeSingleton(prj, name, svc)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public IgniteFuture<Void> deployClusterSingletonAsync(String name, Service svc) { A.notNull(name, "name"); A.notNull(svc, "svc"); guard(); try { return (IgniteFuture<Void>)new IgniteFutureImpl<>(ctx.service().deployClusterSingleton(prj, name, svc)); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public IgniteFuture<?> indexReadyFuture() { GridCacheContext<K, V> ctx = getContextSafe(); IgniteInternalFuture fut = ctx.shared().database().indexRebuildFuture(ctx.cacheId()); if (fut == null) return new IgniteFinishedFutureImpl<>(); return new IgniteFutureImpl<>(fut); }