/** {@inheritDoc} */ @Override public void deleteAll(Iterable<ID> ids) { if (ids instanceof Set) cache.removeAll((Set<ID>)ids); if (ids instanceof Collection) cache.removeAll(new HashSet<>((Collection<ID>)ids)); TreeSet<ID> keys = new TreeSet<>(); for (ID id : ids) keys.add(id); cache.removeAll(keys); }
@Override public Void call() throws Exception { cache.removeAll(c); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cache.removeAll(null); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cache.removeAll(c); return null; } }, NullPointerException.class, null);
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public ClientResponse process(ClientConnectionContext ctx) { cache(ctx).removeAll(keys()); return super.process(ctx); } }
/** * @throws Exception In case of error. */ @Test public void testRemoveAllDuplicates() throws Exception { jcache().removeAll(ImmutableSet.of("key1", "key1", "key1")); }
/** */ @Test public void testRemoveAll1() { checkOperation(() -> cache.removeAll(singleton(1))); }
/** * @throws Exception In case of error. */ @Test public void testRemoveAllEmpty() throws Exception { jcache().removeAll(); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { for (int i = 0; i < GRID_CNT; i++) jcache(i).removeAll(); for (GridCacheTestStore store : stores) store.reset(); }
/** * @throws Exception If failed. */ private void clearCaches() throws Exception { for (int i = 0; i < gridCount(); i++) jcache(i).removeAll(); }
@Override public void applyx(IgniteCache<String, Integer> cache) { int rnd = random(); IgniteCache<String, Integer> cacheAsync = cache.withAsync(); Set<Integer> ids = new HashSet<>(set); cacheAsync.removeAll(rangeKeys(0, rnd)); cacheAsync.future().get(); for (int i = 0; i < rnd; i++) { if (ids.contains(i)) assertNull(cache.localPeek("key" + i)); } } });
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { super.afterTest(); grid(0).getOrCreateCache(QUERY_CACHE).removeAll(); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { super.afterTest(); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).removeAll(); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { jcache().removeAll(); assert jcache().localSize() == 0; assert size(ValueObject.class) == 0; STORE_MAP.clear(); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { super.afterTest(); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).removeAll(); }
/** * @throws Exception In case of error. */ @Test public void testRemoveAllDuplicatesTx() throws Exception { if (txShouldBeUsed()) { try (Transaction tx = transactions().txStart()) { jcache().removeAll(ImmutableSet.of("key1", "key1", "key1")); tx.commit(); } } }
/** * @throws Exception If failed. */ @Test public void testCacheSize() throws Exception { jcache().removeAll(); jcache().put("getKey", "getVal"); String ret = content(DEFAULT_CACHE_NAME, GridRestCommand.CACHE_SIZE); info("Size command result: " + ret); assertCacheBulkOperation(ret, 1); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { super.afterTest(); if (GRID_CNT > 0) grid(0).cache(DEFAULT_CACHE_NAME).removeAll(); for (int i = 0; i < GRID_CNT; i++) { grid(i).cache(DEFAULT_CACHE_NAME).clear(); assert grid(i).cache(DEFAULT_CACHE_NAME).localSize() == 0; } }
@Override public boolean applyx() throws IgniteCheckedException { jcache(fi).removeAll(); if (jcache(fi).size(CachePeekMode.ALL) > 0) { for (Cache.Entry<String, ?> k : jcache(fi).localEntries()) jcache(fi).remove(k.getKey()); } return jcache(fi).localSize(CachePeekMode.ALL) == 0; } },
/** * @throws Exception If failed. */ @Test public void testRemoveAll() throws Exception { GridNearTransactionalCache cache = (GridNearTransactionalCache)((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME); for (GridDhtLocalPartition part : cache.dht().topology().localPartitions()) assertEquals(OWNING, part.state()); grid(0).cache(DEFAULT_CACHE_NAME).removeAll(); } }