/** {@inheritDoc} */ @Override public void receive(IgniteCache<K, V> cache, Collection<Map.Entry<K, V>> entries) throws IgniteException { for (Map.Entry<K, V> entry : entries) cache.invoke(entry.getKey(), this, entry.getValue()); }
@Override public Void call() throws Exception { if (getAll) cache.invokeAll(data.keySet(), new HangEntryProcessor()); else cache.invoke(1, new HangEntryProcessor()); return null; } });
@Override public Void call() throws Exception { cache.invoke("k1", errProcessor); return null; } }, EntryProcessorException.class, "Test entry processor exception.");
@Override public Object call() throws Exception { clnCache0.invoke(KEY, createEntryProcessor()); return null; } }, UnsupportedOperationException.class);
/** {@inheritDoc} */ @Override public void receive(IgniteCache<Integer, Long> cache, Collection<Map.Entry<Integer, Long>> entries) { for (Map.Entry<Integer, Long> entry : entries) cache.invoke(entry.getKey(), INC); } }
/** {@inheritDoc} */ @Override protected void updateCache(IgniteEx ignite, IgniteCache cache) { final int k = ThreadLocalRandom.current().nextInt(RANGE); String key = "key-" + k; AtomicLong nextAtomicVal = nextValMap.putIfAbsent(key, new AtomicLong(FIRST_VAL)); Long nextVal = FIRST_VAL; if (nextAtomicVal != null) nextVal = nextAtomicVal.incrementAndGet(); cache.invoke(key, new AddInSetEntryProcessor(), nextVal); }
@Override public Void call() throws Exception { grid(0).<Integer, Integer>cache(DEFAULT_CACHE_NAME).invoke(key, new EntryProcessor<Integer, Integer, Void>() { @Override public Void process(MutableEntry<Integer, Integer> e, Object... args) { e.setValue(2); return null; } }); return null; } }, CacheWriterException.class, null);
@Override public Void call() throws Exception { cache.invoke(key, new ExceptionProcessor(63)); return null; } }, EntryProcessorException.class, "Test processor exception.");
@Override public void run() { cache.invoke(k, new TestEntryProcessor()); } }, concurrency, isolation, 2);
/** {@inheritDoc} */ @Override public R call() throws Exception { return cache().invoke(key, processor, args); } }
@Override public Object call() throws Exception { cache.invoke(KEY, createEntryProcessor()); fail("Should never happened."); tx.commit(); return null; } }, UnsupportedOperationException.class);
@Override public Object call() throws Exception { cache.invoke("1", new UpdateValueProcessor()); return null; } }, CachePartialUpdateException.class, null);
@Override public Object call() { clnCache0.invoke(KEY, new NonSerialazibleEntryProcessor()); return null; } }, NotSerializableException.class);
@Override public Object call() throws Exception { cache.invoke("1", new UpdateProcessor()); return null; } }, exp, null);
@Override public Void call() throws Exception { grid(0).<Integer, Integer>cache(DEFAULT_CACHE_NAME).invoke(key, new EntryProcessor<Integer, Integer, Void>() { @Override public Void process(MutableEntry<Integer, Integer> e, Object... args) { e.setValue(2); return null; } }); return null; } }, CacheException.class, null);
/** {@inheritDoc} */ @Override public Void call() throws Exception { String key1 = "key-" + base + "-" + i; String key2 = "key-" + base; assert key1.compareTo(key2) > 0; ((IgniteCache<String, String>)cache).put(key1, "value-" + i); ((IgniteCache<String, Set<String>>)cache).invoke(key2, new AddEntryProcessor("value-" + i)); return null; } }
@Override public Object call() { cache.invoke(KEY, new NonSerialazibleEntryProcessor()); fail("Should never happened."); tx.commit(); return null; } }, NotSerializableException.class);
@Override public Void call() throws Exception { for (int i = 0; i < ITERATIONS_PER_THREAD && !failed; i++) { if (i % 500 == 0) log.info("Iteration " + i); cache.invoke(key, new IncProcessor()); } return null; } }, THREADS, "transform");
/** */ @Test public void testInvoke1() { checkOperation(() -> cache.invoke(1, testEntryProcessor)); }
/** */ @Test public void testInvoke2() { checkOperation(() -> cache.invoke(1, testEntryProcessor)); }