/** {@inheritDoc} */ @Override public <S extends T> Iterable<S> save(Map<ID, S> entities) { cache.putAll(entities); return entities.values(); }
/** {@inheritDoc} */ @Override public <S extends T> Iterable<S> save(Map<ID, S> entities) { cache.putAll(entities); return entities.values(); }
@Override public Object call() throws Exception { srvCache.putAll(data2); return null; } });
@Override public Void call() throws Exception { cache.putAll(m); return null; } }, NullPointerException.class, null);
@Override public Void call() throws Exception { cache.putAll(m); return null; } }, NullPointerException.class, null);
@Override public Object call() throws Exception { Thread.currentThread().setName("put-thread"); cache.putAll(map); return null; } });
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public ClientResponse process(ClientConnectionContext ctx) { cache(ctx).putAll(map); return super.process(ctx); } }
@Override public Object call() throws Exception { Thread.currentThread().setName("put-thread"); cache.putAll(map); return null; } });
@Override public void apply(Integer key, IgniteCache<Object, Object> cache) { Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < 50; i++) map.put(i, i); map.put(key, key); cache.putAll(map); } });
@Override public void apply(Ignite ignite, IgniteCache<Integer, Integer> cache) { ThreadLocalRandom rnd = ThreadLocalRandom.current(); Map<Integer, Integer> map = new TreeMap<>(); for (int i = 0; i < 100; i++) { Integer key = rnd.nextInt(MULTITHREADED_TEST_KEYS); map.put(key, rnd.nextInt()); } cache.putAll(map); } });
@Override public Object call() throws Exception { Thread.currentThread().setName("put-thread"); if (putAll) cache.putAll(map); else cache.put(0, 0); return null; } });
@Override public Void call() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).putAll(m); return null; } }, CacheWriterException.class, null);
/** */ @Test public void testPutAll() { checkOperation(() -> cache.putAll(ImmutableMap.of(1, 1))); }
@Override public Object call() throws Exception { Thread.currentThread().setName("put-thread"); try (Transaction tx = ignite2.transactions().txStart(OPTIMISTIC, SERIALIZABLE)) { cache.putAll(map); tx.commit(); } return null; } });
/** * @throws Exception If failed. */ private void checkBatchWrites() throws Exception { prepare(); Map<Integer, String> map = new HashMap<>(); for (int i = 0; i < 100; i++) map.put(i, String.valueOf(i)); grid(0).cache(DEFAULT_CACHE_NAME).putAll(map); checkWrites(); }
@Override public void apply(Integer key, IgniteCache<Object, Object> cache) { Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < 50; i++) map.put(i, i); map.put(key, key); Ignite ignite = cache.unwrap(Ignite.class); try (Transaction tx = ignite.transactions().txStart(concurrency, isolation)) { cache.putAll(map); tx.commit(); } } });
/** */ protected void fillCache(IgniteCache<Integer, byte[]> cache) { cache.putAll(new TreeMap<Integer, byte[]>() {{ for (int i = 0; i < ENTRIES; i++) put(i, new byte[1024]); }}); //Touch entries. for (int i = 0; i < ENTRIES; i++) cache.get(i); // touch entries pringStatistics((IgniteCacheProxy)cache, "After cache puts"); }
@Override public void apply(IgniteCache<Object, Object> cache) { final IgniteTransactions txs = cache.unwrap(Ignite.class).transactions(); Map<Integer, MvccTestAccount> accounts = new HashMap<>(); for (int i = 0; i < ACCOUNTS; i++) accounts.put(i, new MvccTestAccount(ACCOUNT_START_VAL, 1)); try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) { cache.putAll(accounts); tx.commit(); } } };
/** * @throws Exception If failed. */ @Test public void testPutAll() throws Exception { Map<Object, Object> map = new HashMap<>(); for (int i = 1; i <= 3; i++) map.put(new Key(i), new Value(i)); jcache().putAll(map); checkMap(STORE.map(), 1, 2, 3); }
/** * */ @Test public void testInsertFromSelect() { Map<Integer, Account> accounts = getAccounts(100, 1, 1000); client.cache(CACHE_ACCOUNT).putAll(accounts); String text = "INSERT INTO \"trade\".Trade (_key, accountId, stockId, qty, price) " + "SELECT a._key, a._key, ?, a.depo/?, ? FROM \"acc\".Account a"; checkUpdate(client.<Integer, Trade>cache(CACHE_TRADE), null, new SqlFieldsQueryEx(text, false).setArgs(1, 10, 10)); }