Tabnine Logo
GridCompoundFuture.<init>
Code IndexAdd Tabnine to your IDE (free)

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

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

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

/**
 * 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

GridCompoundFuture<String, String> fut = new GridCompoundFuture<>(new IgniteReducer<String, String>() {
  private final StringBuilder sb = new StringBuilder(msg);
origin: apache/ignite

GridCompoundFuture<String, String> fut = new GridCompoundFuture<>(new IgniteReducer<String, String>() {
  private final StringBuilder sb = new StringBuilder(msg);
origin: apache/ignite

/**
 * Resets cache state after the cache has been moved to recovery state.
 *
 * @param cacheNames Cache names.
 * @return Future that will be completed when state is changed for all caches.
 */
public IgniteInternalFuture<?> resetCacheState(Collection<String> cacheNames) {
  checkEmptyTransactions();
  if (F.isEmpty(cacheNames))
    cacheNames = cachesInfo.registeredCaches().keySet();
  Collection<DynamicCacheChangeRequest> reqs = new ArrayList<>(cacheNames.size());
  for (String cacheName : cacheNames) {
    DynamicCacheDescriptor desc = cacheDescriptor(cacheName);
    if (desc == null) {
      U.warn(log, "Failed to find cache for reset lost partition request, cache does not exist: " + cacheName);
      continue;
    }
    DynamicCacheChangeRequest req = DynamicCacheChangeRequest.resetLostPartitions(ctx, cacheName);
    reqs.add(req);
  }
  GridCompoundFuture fut = new GridCompoundFuture();
  for (DynamicCacheStartFuture f : initiateCacheChanges(reqs))
    fut.add(f);
  fut.markInitialized();
  return fut;
}
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

/**
 * @param keysMap Keys to request.
 * @return Keys request future.
 */
private IgniteInternalFuture<Object> forceRebalanceKeys(Map<Integer, Collection<KeyCacheObject>> keysMap) {
  if (F.isEmpty(keysMap))
    return null;
  GridCompoundFuture<Object, Object> compFut = null;
  IgniteInternalFuture<Object> lastForceFut = null;
  for (Map.Entry<Integer, Collection<KeyCacheObject>> entry : keysMap.entrySet()) {
    if (lastForceFut != null && compFut == null) {
      compFut = new GridCompoundFuture();
      compFut.add(lastForceFut);
    }
    int cacheId = entry.getKey();
    Collection<KeyCacheObject> keys = entry.getValue();
    GridCacheContext ctx = cctx.cacheContext(cacheId);
    lastForceFut = ctx.group().preloader().request(ctx, keys, tx.topologyVersion());
    if (compFut != null && lastForceFut != null)
      compFut.add(lastForceFut);
  }
  if (compFut != null) {
    compFut.markInitialized();
    return compFut;
  }
  else
    return lastForceFut;
}
origin: apache/ignite

/**
 * @param nearVer Near version.
 * @return Finish future for related remote transactions.
 */
@SuppressWarnings("unchecked")
public IgniteInternalFuture<?> remoteTxFinishFuture(GridCacheVersion nearVer) {
  GridCompoundFuture<Void, Void> fut = new GridCompoundFuture<>();
  for (final IgniteInternalTx tx : activeTransactions()) {
    if (!tx.local() && nearVer.equals(tx.nearXidVersion()))
      fut.add((IgniteInternalFuture) tx.finishFuture());
  }
  fut.markInitialized();
  return fut;
}
origin: apache/ignite

for (String name : servicesNames) {
  if (res == null)
    res = new GridCompoundFuture<>();
origin: apache/ignite

/**
 * @param timeMillis Loading time in milliseconds.
 */
public IgniteInternalFuture<?> loadByTime(int timeMillis) {
  GridCompoundFuture<?, ?> loadFut = new GridCompoundFuture();
  for (CacheLoader cacheLoader : cacheLoaders) {
    long endTime = U.currentTimeMillis() + timeMillis;
    cacheLoader.stopPredicate = it -> U.currentTimeMillis() >= endTime;
    loadFut.add(GridTestUtils.runAsync(cacheLoader));
  }
  loadFut.markInitialized();
  return loadFut;
}
origin: apache/ignite

GridCompoundFuture fut = new GridCompoundFuture();
origin: apache/ignite

GridCompoundFuture finishAllLatches = new GridCompoundFuture();
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testCompleteOnReducer() throws Exception {
  GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer());
  List<GridFutureAdapter<Boolean>> futs = new ArrayList<>(5);
  for (int i = 0; i < 5; i++) {
    GridFutureAdapter<Boolean> part = new GridFutureAdapter<>();
    fut.add(part);
    futs.add(part);
  }
  fut.markInitialized();
  assertFalse(fut.isDone());
  assertFalse(fut.isCancelled());
  for (int i = 0; i < 3; i++) {
    futs.get(i).onDone(true);
    assertFalse(fut.isDone());
  }
  futs.get(3).onDone(false);
  assertTrue(fut.isDone());
}
origin: apache/ignite

GridCompoundFuture<IgniteInternalTx, IgniteInternalTx> res = new GridCompoundFuture<>();
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testCompleteOnException() throws Exception {
  GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer());
  List<GridFutureAdapter<Boolean>> futs = new ArrayList<>(5);
  for (int i = 0; i < 5; i++) {
    GridFutureAdapter<Boolean> part = new GridFutureAdapter<>();
    fut.add(part);
    futs.add(part);
  }
  fut.markInitialized();
  assertFalse(fut.isDone());
  assertFalse(fut.isCancelled());
  for (int i = 0; i < 3; i++) {
    futs.get(i).onDone(true);
    assertFalse(fut.isDone());
  }
  futs.get(3).onDone(new IgniteCheckedException("Test message"));
  assertTrue(fut.isDone());
}
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testConcurrentCompletion() throws Exception {
  GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer());
  final ConcurrentLinkedDeque<GridFutureAdapter<Boolean>> futs = new ConcurrentLinkedDeque<>();
  for (int i = 0; i < 1000; i++) {
    GridFutureAdapter<Boolean> part = new GridFutureAdapter<>();
    fut.add(part);
    futs.add(part);
  }
  fut.markInitialized();
  IgniteInternalFuture<?> complete = multithreadedAsync(new Runnable() {
    @Override public void run() {
      GridFutureAdapter<Boolean> part;
      while ((part = futs.poll()) != null)
        part.onDone(true);
    }
  }, 20);
  complete.get();
  assertTrue(fut.isDone());
}
origin: apache/ignite

GridCompoundFuture<Object, Object> compound = new GridCompoundFuture<>();
origin: apache/ignite

GridCompoundFuture<Void, Object> compFut = new GridCompoundFuture<>();
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testMarkInitialized() throws Exception {
  GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>();
  for (int i = 0; i < 5; i++) {
    IgniteInternalFuture<Boolean> part = new GridFinishedFuture<>(true);
    fut.add(part);
  }
  assertFalse(fut.isDone());
  assertFalse(fut.isCancelled());
  fut.markInitialized();
  assertTrue(fut.isDone());
}
origin: apache/ignite

GridCompoundFuture<Boolean, Boolean> fut = new GridCompoundFuture<>(CU.boolReducer());
org.apache.ignite.internal.util.futureGridCompoundFuture<init>

Javadoc

Default constructor.

Popular methods of GridCompoundFuture

  • 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.
  • futuresCount
  • futures,
  • futuresCount,
  • futuresCountNoLock,
  • ignoreFailure,
  • initialized,
  • listen,
  • logDebug,
  • logError,
  • logger

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now