/** * @param tx Transaction. * @param keys Keys to load. * @param filter Filter. * @return Future. */ GridFuture<Map<K, V>> txLoadAsync( GridNearTxLocal<K, V> tx, @Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K, V>>[] filter) { assert tx != null; GridNearGetFuture<K, V> fut = new GridNearGetFuture<K, V>(ctx, keys, false, tx, filter); // Register future for responses. ctx.mvcc().addFuture(fut); fut.init(); return fut; }
/** * @param keys Keys to load. * @param reload Reload flag. * @param filter Filter. * @return Loaded values. */ public GridFuture<Map<K, V>> loadAsync( @Nullable Collection<? extends K> keys, boolean reload, @Nullable GridPredicate<? super GridCacheEntry<K, V>>[] filter) { if (F.isEmpty(keys)) return new GridFinishedFuture<Map<K, V>>(ctx.kernalContext(), Collections.<K, V>emptyMap()); GridNearGetFuture<K, V> fut = new GridNearGetFuture<K, V>(ctx, keys, reload, null, filter); // Register future for responses. ctx.mvcc().addFuture(fut); fut.init(); return ctx.wrapCloneMap(fut); }