/** {@inheritDoc} */ @Override public Iterable<T> findAll(Iterable<ID> ids) { if (ids instanceof Set) return cache.getAll((Set<ID>)ids).values(); if (ids instanceof Collection) return cache.getAll(new HashSet<>((Collection<ID>)ids)).values(); TreeSet<ID> keys = new TreeSet<>(); for (ID id : ids) keys.add(id); return cache.getAll(keys).values(); }
@Override public Void call() throws Exception { cacheAsync.getAll(null); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cacheAsync.getAll(null); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cache.getAll(c); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cache.getAll(c); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cache.getAll(c); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { jcache().getAll(null).isEmpty(); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cache.getAll(null).isEmpty(); return null; } }, NullPointerException.class, null);
@Override public Object call() throws Exception { latch.await(); clientCache.getAll(data1.keySet()); return null; } });
@Override public Object call() throws Exception { assertEquals(data1, clientCache.getAll(data1.keySet())); return null; } });
@Override public Object call() throws Exception { assertEquals(data2, clientCache.getAll(data2.keySet())); return null; } });
@Override public void applyx(IgniteCache<String, Integer> cache) { int rnd1 = random(); int rnd2 = random(); Map<String, Integer> map = cache.getAll(ImmutableSet.of("key" + rnd1, "key" + rnd2)); assert map.size() == (rnd1 != rnd2 ? 2 : 1); assert map.get("key" + rnd1) == rnd1; assert map.get("key" + rnd2) == rnd2; } });
/** {@inheritDoc} */ @Override public Map<K, V> call() throws Exception { return cache().getAll(keys); } }
/** {@inheritDoc} */ @Override public Integer call() throws Exception { info("Start operation."); Set<Integer> keys = F.asSet(1, 2, 3); clientCache().getAll(keys); info("Stop operation."); return null; } });
/** {@inheritDoc} */ @Override public void doRead() { Set<Integer> keys = new HashSet<>(); for (int i = 0; i < 500; i++) keys.add(random.nextInt(entriesCount())); cache().getAll(keys); } };
@Override public void applyx(IgniteCache<String, Integer> cache) { int rnd1 = random(); int rnd2 = random(); IgniteCache<String, Integer> cacheAsync = cache.withAsync(); cacheAsync.getAll(ImmutableSet.of("key" + rnd1, "key" + rnd2)); Map<String, Integer> map = cacheAsync.<Map<String, Integer>>future().get(); assert map.size() == (rnd1 != rnd2 ? 2 : 1); assert map.get("key" + rnd1) == rnd1; assert map.get("key" + rnd2) == rnd2; } });
/** */ @Test public void testGetAll() { checkOperation(() -> cache.getAll(singleton(1))); }
@Override public Void call() throws Exception { IgniteCache cache = client.cache(DEFAULT_CACHE_NAME); cache.getAll(F.asSet(1, 2, 3)); return null; } });
/** * * @throws Exception If test failed. */ @Test public void testCacheGetAll() throws Exception { Ignite ignite = grid(); assert ignite != null; ignite.cache("test-cache").getAll(Collections.singleton(1)); }
@Override public Void call() throws Exception { int node = idx.getAndIncrement(); Ignite ignite = startGrid(node); IgniteCache<Object, Object> cache = ignite.cache(DEFAULT_CACHE_NAME); for (Map.Entry<Integer, byte[]> e : dataBytes.entrySet()) { Object obj = ignite.configuration().getMarshaller().unmarshal(e.getValue(), null); cache.put(e.getKey(), obj); } ignite.cache(DEFAULT_CACHE_NAME).getAll(dataBytes.keySet()); return null; } }, 10, "test-thread");