Codota Logo
GridCompoundFuture
Code IndexAdd Codota to your IDE (free)

How to use
GridCompoundFuture
in
org.apache.ignite.internal.util.future

Best Java code snippets using org.apache.ignite.internal.util.future.GridCompoundFuture (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: apache/ignite

/** {@inheritDoc} */
@Override public void visit(SchemaIndexCacheVisitorClosure clo) throws IgniteCheckedException {
  assert clo != null;
  List<GridDhtLocalPartition> parts = cctx.topology().localPartitions();
  if (parts.isEmpty())
    return;
  GridCompoundFuture<Void, Void> fut = null;
  if (parallelism > 1) {
    fut = new GridCompoundFuture<>();
    for (int i = 1; i < parallelism; i++)
      fut.add(processPartitionsAsync(parts, clo, i));
    fut.markInitialized();
  }
  processPartitions(parts, clo, 0);
  if (fut != null)
    fut.get();
}
origin: apache/ignite

  /** {@inheritDoc} */
  @Override public String toString() {
    return S.toString(GridCompoundFuture.class, this,
      "done", isDone(),
      "cancelled", isCancelled(),
      "err", error(),
      "futs",
      F.viewReadOnly(futures(), new C1<IgniteInternalFuture<T>, String>() {
        @Override public String apply(IgniteInternalFuture<T> f) {
          return Boolean.toString(f.isDone());
        }
      })
    );
  }
}
origin: apache/ignite

/**
 * Check completeness of the future.
 */
private void checkComplete() {
  if (initialized() && !isDone() && lsnrCalls == futuresCount()) {
    try {
      onDone(rdc != null ? rdc.reduce() : null);
    }
    catch (RuntimeException e) {
      logError(logger(), "Failed to execute compound future reducer: " + this, e);
      onDone(e);
    }
    catch (AssertionError e) {
      logError(logger(), "Failed to execute compound future reducer: " + this, e);
      onDone(e);
      throw e;
    }
  }
}
origin: apache/ignite

/**
 * Starts cache stop request as cache change batch.
 *
 * @param reqs cache stop requests.
 * @return compound future.
 */
@NotNull public IgniteInternalFuture<?> dynamicChangeCaches(List<DynamicCacheChangeRequest> reqs) {
  GridCompoundFuture<?, ?> compoundFut = new GridCompoundFuture<>();
  for (DynamicCacheStartFuture fut : initiateCacheChanges(reqs))
    compoundFut.add((IgniteInternalFuture)fut);
  compoundFut.markInitialized();
  return compoundFut;
}
origin: apache/ignite

/**
 *
 * @return Finish update future.
 */
public IgniteInternalFuture<?> finishDataStreamerUpdates(AffinityTopologyVersion topVer) {
  GridCompoundFuture<Void, Object> res = new CacheObjectsReleaseFuture<>("DataStreamer", topVer);
  for (DataStreamerFuture fut : dataStreamerFuts) {
    if (fut.topVer.compareTo(topVer) < 0)
      res.add(fut);
  }
  res.markInitialized();
  return res;
}
origin: apache/ignite

  new HashSet<Object>(ctx.cache().publicCacheNames()) : new HashSet<>(map.keySet());
GridCompoundFuture compFut = new GridCompoundFuture();
  compFut.add(executeCommand(req.destinationId(), req.clientId(), (String)cName, cacheFlags, key,
    new RemoveAllCommand(null)));
compFut.markInitialized();
fut = compFut.chain(new CX1<GridCompoundFuture<GridCacheRestResponse, ?>, GridRestResponse>() {
  @Override public GridRestResponse applyx(
    GridCompoundFuture<GridCacheRestResponse, ?> cf) throws IgniteCheckedException {
origin: apache/ignite

  return new GridFinishedFuture<>();
GridCompoundFuture res = new GridCompoundFuture<>();
      res.add(new GridFinishedFuture<>(err));
      res.add(old);
    res.add(fut);
  res.onDone(e);
res.markInitialized();
origin: apache/ignite

/**
 * @param fut Child future.
 * @param own If {@code true}, then corresponding service will be cancelled on failure.
 */
public void add(GridServiceDeploymentFuture<T> fut, boolean own) {
  super.add(fut);
  if (own) {
    if (svcsToRollback == null)
      svcsToRollback = new ArrayList<>();
    svcsToRollback.add(fut.serviceId());
  }
}
origin: apache/ignite

if (asyncRunFut != null && !asyncRunFut.isDone()) {
  stop.set(true);
    asyncRunFut.cancel();
    asyncRunFut.get(60000);
origin: apache/ignite

opFut.listen(lsnr);
  futs = buf.update(entriesForNode, topVer, assignments, opFut, remap);
  opFut.markInitialized();
origin: apache/ignite

new GridCompoundFuture<>(CU.<ClusterStartNodeResult>objectsReducer());
origin: apache/ignite

/**
 *
 */
void waitPreviousReconnect() {
  if (curReconnectFut != null && !curReconnectFut.isDone()) {
    assert reconnectDone != null;
    curReconnectFut.onDone(STOP_RECONNECT);
    try {
      reconnectDone.get();
    }
    catch (IgniteCheckedException ignote) {
      // No-op.
    }
  }
}
origin: apache/ignite

/**
 * Adds a future to this compound future.
 *
 * @param fut Future to add.
 */
public final void add(IgniteInternalFuture<T> fut) {
  assert fut != null;
  synchronized (this) {
    if (futs == null)
      futs = fut;
    else if (futs instanceof IgniteInternalFuture) {
      Collection<IgniteInternalFuture> futs0 = new ArrayList<>(4);
      futs0.add((IgniteInternalFuture)futs);
      futs0.add(fut);
      futs = futs0;
    }
    else
      ((Collection<IgniteInternalFuture>)futs).add(fut);
  }
  fut.listen(this);
  if (isCancelled()) {
    try {
      fut.cancel();
    }
    catch (IgniteCheckedException e) {
      onDone(e);
    }
  }
}
origin: apache/ignite

/**
 * Creates multi update finish future. Will return {@code null} if no multi-update locks are found.
 *
 * @param topVer Topology version.
 * @return Finish future.
 */
@Nullable public IgniteInternalFuture<?> multiUpdateFinishFuture(AffinityTopologyVersion topVer) {
  GridCompoundFuture<IgniteUuid, Object> fut = null;
  for (MultiUpdateFuture multiFut : multiTxFuts.values()) {
    if (multiFut.topologyVersion().compareTo(topVer) <= 0) {
      if (fut == null)
        fut = new GridCompoundFuture<>();
      fut.add(multiFut);
    }
  }
  if (fut != null)
    fut.markInitialized();
  return fut;
}
origin: apache/ignite

/**
 * @param topVer Topology version to finish.
 *
 * @return Finish update future.
 */
@SuppressWarnings("unchecked")
public IgniteInternalFuture<?> finishAtomicUpdates(AffinityTopologyVersion topVer) {
  GridCompoundFuture<Object, Object> res = new FinishAtomicUpdateFuture("AtomicUpdate", topVer);
  for (GridCacheAtomicFuture<?> fut : atomicFuts.values()) {
    IgniteInternalFuture<Void> complete = fut.completeFuture(topVer);
    if (complete != null)
      res.add((IgniteInternalFuture)complete);
  }
  res.markInitialized();
  return res;
}
origin: org.apache.ignite/ignite-core

  new HashSet<Object>(ctx.cache().publicCacheNames()) : new HashSet<>(map.keySet());
GridCompoundFuture compFut = new GridCompoundFuture();
  compFut.add(executeCommand(req.destinationId(), req.clientId(), (String)cName, cacheFlags, key,
    new RemoveAllCommand(null)));
compFut.markInitialized();
fut = compFut.chain(new CX1<GridCompoundFuture<GridCacheRestResponse, ?>, GridRestResponse>() {
  @Override public GridRestResponse applyx(
    GridCompoundFuture<GridCacheRestResponse, ?> cf) throws IgniteCheckedException {
origin: apache/ignite

forcedRebFut.add(fut);
origin: org.apache.ignite/ignite-core

/**
 * Check completeness of the future.
 */
private void checkComplete() {
  if (initialized() && !isDone() && lsnrCalls == futuresCount()) {
    try {
      onDone(rdc != null ? rdc.reduce() : null);
    }
    catch (RuntimeException e) {
      logError(logger(), "Failed to execute compound future reducer: " + this, e);
      onDone(e);
    }
    catch (AssertionError e) {
      logError(logger(), "Failed to execute compound future reducer: " + this, e);
      onDone(e);
      throw e;
    }
  }
}
origin: org.apache.ignite/ignite-core

opFut.listen(lsnr);
  futs = buf.update(entriesForNode, topVer, assignments, opFut, remap);
  opFut.markInitialized();
origin: org.apache.ignite/ignite-core

new GridCompoundFuture<>(CU.<ClusterStartNodeResult>objectsReducer());
org.apache.ignite.internal.util.futureGridCompoundFuture

Javadoc

Future composed of multiple inner futures.

Most used methods

  • <init>
  • add
    Adds a future to this compound future.
  • markInitialized
    Mark this future as initialized.
  • get
  • isCancelled
  • isDone
  • cancel
  • chain
  • checkComplete
    Check completeness of the future.
  • error
  • future
    Returns future at the specified position in this list.
  • futures
    Gets collection of futures.
  • future,
  • futures,
  • futuresCount,
  • futuresCountNoLock,
  • ignoreFailure,
  • initialized,
  • listen,
  • logDebug,
  • logError,
  • logger

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • startActivity (Activity)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ImageIO (javax.imageio)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now