@Override public Map<K, V> applyx(GridFuture<Map<K, V>> f) throws GridException { return interceptGet(keys, f.get()); } });
@Override public GridCacheReturn<V> applyx(GridFuture<Set<K>> f) throws GridException { f.get(); return ret; } }));
@Override public V applyx(GridFuture<Map<K, V>> e) throws GridException { return e.get().get(key); } });
/** * Synchronously waits for all futures in the collection. * * @param futs Futures to wait for. * @throws GridException If any of the futures threw exception. */ public static void waitAll(@Nullable Iterable<GridFuture<?>> futs) throws GridException { if (F.isEmpty(futs)) return; for (GridFuture fut : futs) fut.get(); }
/** {@inheritDoc} */ @Override public boolean putxIfAbsent(K key, V val) throws GridException { return putxIfAbsentAsync(key, val).get(); }
/** {@inheritDoc} */ @Override public GridCacheReturn<V> removex(K key, V val) throws GridException { return removexAsync(key, val).get(); }
/** {@inheritDoc} */ @Override public void putAllDr(Map<? extends K, GridCacheDrInfo<V>> drMap) throws GridException { putAllDrAsync(drMap).get(); }
/** {@inheritDoc} */ @Override public void transformAll(@Nullable Map<? extends K, ? extends GridClosure<V, V>> m) throws GridException { transformAllAsync(m).get(); }
/** {@inheritDoc} */ @Override public void putAll(Map<? extends K, ? extends V> m, @Nullable GridPredicate<GridCacheEntry<K, V>>[] filter) throws GridException { putAllAsync(m, filter).get(); }
/** {@inheritDoc} */ @Override public boolean removex(K key, @Nullable GridCacheEntryEx<K, V> entry, @Nullable GridPredicate<GridCacheEntry<K, V>>... filter) throws GridException { return removexAsync(key, entry, filter).get(); }
/** {@inheritDoc} */ @Override public GridCacheReturn<V> putAll(Map<? extends K, ? extends V> map, GridPredicate<GridCacheEntry<K, V>>[] filter) throws GridException { return putAllAsync0(map, null, null, false, null, -1, filter).get(); }
/** {@inheritDoc} */ @Override public boolean removex(K key, @Nullable GridCacheEntryEx<K, V> cached, GridPredicate<GridCacheEntry<K, V>>[] filter) throws GridException { return removeAllAsync(Collections.singletonList(key), cached, implicit, false, filter).get().success(); }
/** {@inheritDoc} */ @Override public void transformAll(@Nullable Map<? extends K, ? extends GridClosure<V, V>> map) throws GridException { putAllAsync0(null, map, null, false, null, -1, CU.<K, V>empty()).get(); }
/** {@inheritDoc} */ @Override protected V readThrough(GridCacheTxEx<K, V> tx, K key, boolean reload, GridPredicate<GridCacheEntry<K, V>>[] filter, UUID subjId, String taskName) throws GridException { return cctx.near().loadAsync(tx, F.asList(key), reload, /*force primary*/false, filter, subjId, taskName, true). get().get(key); }
/** {@inheritDoc} */ @Override public boolean putx(K key, V val, @Nullable GridCacheEntryEx<K, V> cached, long ttl, GridPredicate<GridCacheEntry<K, V>>[] filter) throws GridException { return putAllAsync0(F.t(key, val), null, null, false, cached, ttl, filter).get().success(); }
/** {@inheritDoc} */ @Override protected Void run(String ggfsName) throws GridException { try { g.ggfs(ggfsName).format().get(); } catch (IllegalArgumentException iae) { throw new GridException("Failed to format GGFS: " + ggfsName, iae); } return null; }
@Override public void apply(GridFuture<GridCacheTxEx<K, V>> f) { try { f.get(); // Check for errors of a parent future. } catch (GridException e) { log.debug("Failed to prepare transaction during rollback (will ignore) [tx=" + this + ", msg=" + e.getMessage() + ']'); } fut.finish(); } });
@Override public void apply(GridFuture<?> f) { try { f.get(); } catch (GridException e) { if (!F.isEmpty(excl)) for (Class cls : excl) if (e.hasCause(cls)) return; U.error(log, "Future execution resulted in error: " + f, e); } }
/** {@inheritDoc} */ @Override public boolean putx(K key, V val, GridPredicate<GridCacheEntry<K, V>>[] filter) throws GridException { return putAllAsync0(F.t(key, val), null, null, false, null, -1, filter).get().success(); }
/** {@inheritDoc} */ @Override public <R> R transformCompute(K key, GridClosure<V, GridBiTuple<V, R>> transformer) throws GridException { GridFuture<GridCacheReturn<V>> fut = putAllAsync0(null, Collections.singletonMap(key, new GridCacheTransformComputeClosure<>(transformer)), null, true, null, -1, CU.<K, V>empty()); GridCacheReturn<V> ret = fut.get(); return transformer.apply(ret.value()).get2(); }