Search in sources :

Example 1 with MutableEntry

use of javax.cache.processor.MutableEntry in project ignite by apache.

the class CacheContinuousQueryAsyncFilterListenerTest method testNonDeadLockInFilter.

/**
 * @param ccfg Cache configuration.
 * @param asyncFilter Async filter.
 * @param asyncLsnr Async listener.
 * @param jcacheApi Use JCache api for start update listener.
 * @throws Exception If failed.
 */
private void testNonDeadLockInFilter(CacheConfiguration ccfg, final boolean asyncFilter, final boolean asyncLsnr, boolean jcacheApi) throws Exception {
    ignite(0).createCache(ccfg);
    ThreadLocalRandom rnd = ThreadLocalRandom.current();
    try {
        for (int i = 0; i < ITERATION_CNT; i++) {
            log.info("Start iteration: " + i);
            int nodeIdx = i % NODES;
            final String cacheName = ccfg.getName();
            final IgniteCache cache = grid(nodeIdx).cache(cacheName);
            final QueryTestKey key = NODES - 1 != nodeIdx ? affinityKey(cache) : new QueryTestKey(1);
            final QueryTestValue val0 = new QueryTestValue(1);
            final QueryTestValue newVal = new QueryTestValue(2);
            final CountDownLatch latch = new CountDownLatch(1);
            final CountDownLatch evtFromLsnrLatch = new CountDownLatch(1);
            IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> fltrClsr = new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {

                @Override
                public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) {
                    if (asyncFilter) {
                        assertFalse("Failed: " + Thread.currentThread().getName(), Thread.currentThread().getName().contains("sys-"));
                        assertTrue("Failed: " + Thread.currentThread().getName(), Thread.currentThread().getName().contains("callback-"));
                    }
                    IgniteCache<Object, Object> cache0 = ignite.cache(cacheName);
                    QueryTestValue val = e.getValue();
                    if (val == null)
                        return;
                    else if (val.equals(newVal)) {
                        evtFromLsnrLatch.countDown();
                        return;
                    } else if (!val.equals(val0))
                        return;
                    try {
                        assertEquals(val, val0);
                        if (atomicityMode(cache0) != ATOMIC) {
                            boolean committed = false;
                            while (!committed && !Thread.currentThread().isInterrupted()) {
                                try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                                    cache0.put(key, newVal);
                                    tx.commit();
                                    committed = true;
                                } catch (Exception ex) {
                                    assertTrue(ex.toString(), X.hasCause(ex, TransactionSerializationException.class));
                                    assertEquals(atomicityMode(cache0), TRANSACTIONAL_SNAPSHOT);
                                }
                            }
                        } else
                            cache0.put(key, newVal);
                        latch.countDown();
                    } catch (Exception exp) {
                        log.error("Failed: ", exp);
                        throw new IgniteException(exp);
                    }
                }
            };
            IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> lsnrClsr = new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {

                @Override
                public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) {
                    if (asyncLsnr) {
                        assertFalse("Failed: " + Thread.currentThread().getName(), Thread.currentThread().getName().contains("sys-"));
                        assertTrue("Failed: " + Thread.currentThread().getName(), Thread.currentThread().getName().contains("callback-"));
                    }
                    QueryTestValue val = e.getValue();
                    if (val == null || !val.equals(new QueryTestValue(1)))
                        return;
                    assertEquals(val, val0);
                    latch.countDown();
                }
            };
            QueryCursor qry = null;
            MutableCacheEntryListenerConfiguration<QueryTestKey, QueryTestValue> lsnrCfg = null;
            CacheInvokeListener locLsnr = asyncLsnr ? new CacheInvokeListenerAsync(lsnrClsr) : new CacheInvokeListener(lsnrClsr);
            CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue> rmtFltr = asyncFilter ? new CacheTestRemoteFilterAsync(fltrClsr) : new CacheTestRemoteFilter(fltrClsr);
            if (jcacheApi) {
                lsnrCfg = new MutableCacheEntryListenerConfiguration<>(FactoryBuilder.factoryOf(locLsnr), FactoryBuilder.factoryOf(rmtFltr), true, false);
                cache.registerCacheEntryListener(lsnrCfg);
            } else {
                ContinuousQuery<QueryTestKey, QueryTestValue> conQry = new ContinuousQuery<>();
                conQry.setLocalListener(locLsnr);
                conQry.setRemoteFilterFactory(FactoryBuilder.factoryOf(rmtFltr));
                qry = cache.query(conQry);
            }
            try {
                if (rnd.nextBoolean())
                    cache.put(key, val0);
                else
                    cache.invoke(key, new CacheEntryProcessor() {

                        @Override
                        public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
                            entry.setValue(val0);
                            return null;
                        }
                    });
                assert U.await(latch, 3, SECONDS) : "Failed to waiting event.";
                assertEquals(cache.get(key), new QueryTestValue(2));
                assertTrue("Failed to waiting event from filter.", U.await(latch, 3, SECONDS));
            } finally {
                if (qry != null)
                    qry.close();
                if (lsnrCfg != null)
                    cache.deregisterCacheEntryListener(lsnrCfg);
            }
            log.info("Iteration finished: " + i);
        }
    } finally {
        ignite(0).destroyCache(ccfg.getName());
    }
}
Also used : IgniteBiInClosure(org.apache.ignite.lang.IgniteBiInClosure) CacheEntryEvent(javax.cache.event.CacheEntryEvent) ContinuousQuery(org.apache.ignite.cache.query.ContinuousQuery) IgniteException(org.apache.ignite.IgniteException) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Ignite(org.apache.ignite.Ignite) MutableEntry(javax.cache.processor.MutableEntry) QueryCursor(org.apache.ignite.cache.query.QueryCursor) IgniteCache(org.apache.ignite.IgniteCache) CountDownLatch(java.util.concurrent.CountDownLatch) EntryProcessorException(javax.cache.processor.EntryProcessorException) TransactionSerializationException(org.apache.ignite.transactions.TransactionSerializationException) IgniteException(org.apache.ignite.IgniteException) CacheEntryListenerException(javax.cache.event.CacheEntryListenerException) Transaction(org.apache.ignite.transactions.Transaction) CacheEntryProcessor(org.apache.ignite.cache.CacheEntryProcessor)

Example 2 with MutableEntry

use of javax.cache.processor.MutableEntry in project ignite by apache.

the class CacheContinuousQueryAsyncFilterListenerTest method testNonDeadLockInListener.

/**
 * @param ccfg Cache configuration.
 * @param asyncFltr Async filter.
 * @param asyncLsnr Async listener.
 * @param jcacheApi Use JCache api for registration entry update listener.
 * @throws Exception If failed.
 */
private void testNonDeadLockInListener(CacheConfiguration ccfg, final boolean asyncFltr, boolean asyncLsnr, boolean jcacheApi) throws Exception {
    ignite(0).createCache(ccfg);
    ThreadLocalRandom rnd = ThreadLocalRandom.current();
    try {
        for (int i = 0; i < ITERATION_CNT; i++) {
            log.info("Start iteration: " + i);
            int nodeIdx = i % NODES;
            final String cacheName = ccfg.getName();
            final IgniteCache cache = grid(nodeIdx).cache(cacheName);
            final QueryTestKey key = NODES - 1 != nodeIdx ? affinityKey(cache) : new QueryTestKey(1);
            final QueryTestValue val0 = new QueryTestValue(1);
            final QueryTestValue newVal = new QueryTestValue(2);
            final CountDownLatch latch = new CountDownLatch(1);
            final CountDownLatch evtFromLsnrLatch = new CountDownLatch(1);
            IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> fltrClsr = new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {

                @Override
                public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) {
                    if (asyncFltr) {
                        assertFalse("Failed: " + Thread.currentThread().getName(), Thread.currentThread().getName().contains("sys-"));
                        assertTrue("Failed: " + Thread.currentThread().getName(), Thread.currentThread().getName().contains("callback-"));
                    }
                }
            };
            IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> lsnrClsr = new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {

                @Override
                public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) {
                    IgniteCache<Object, Object> cache0 = ignite.cache(cacheName);
                    QueryTestValue val = e.getValue();
                    if (val == null)
                        return;
                    else if (val.equals(newVal)) {
                        evtFromLsnrLatch.countDown();
                        return;
                    } else if (!val.equals(val0))
                        return;
                    // several ms to wait - mvcc coordinator need some time to register tx as finished.
                    if (ccfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT) {
                        Object v = null;
                        while (v == null && !Thread.currentThread().isInterrupted()) {
                            v = cache0.get(key);
                            if (v == null)
                                doSleep(50);
                        }
                    }
                    try {
                        assertEquals(val, val0);
                        if (atomicityMode(cache0) != ATOMIC) {
                            boolean committed = false;
                            while (!committed && !Thread.currentThread().isInterrupted()) {
                                try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                                    cache0.put(key, newVal);
                                    tx.commit();
                                    committed = true;
                                } catch (Exception ex) {
                                    assertTrue(ex.getCause() instanceof TransactionSerializationException);
                                    assertEquals(atomicityMode(cache0), TRANSACTIONAL_SNAPSHOT);
                                }
                            }
                        } else
                            cache0.put(key, newVal);
                        latch.countDown();
                    } catch (Exception exp) {
                        log.error("Failed: ", exp);
                        throw new IgniteException(exp);
                    }
                }
            };
            QueryCursor qry = null;
            MutableCacheEntryListenerConfiguration<QueryTestKey, QueryTestValue> lsnrCfg = null;
            CacheInvokeListener locLsnr = asyncLsnr ? new CacheInvokeListenerAsync(lsnrClsr) : new CacheInvokeListener(lsnrClsr);
            CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue> rmtFltr = asyncFltr ? new CacheTestRemoteFilterAsync(fltrClsr) : new CacheTestRemoteFilter(fltrClsr);
            if (jcacheApi) {
                lsnrCfg = new MutableCacheEntryListenerConfiguration<>(FactoryBuilder.factoryOf(locLsnr), FactoryBuilder.factoryOf(rmtFltr), true, false);
                cache.registerCacheEntryListener(lsnrCfg);
            } else {
                ContinuousQuery<QueryTestKey, QueryTestValue> conQry = new ContinuousQuery<>();
                conQry.setLocalListener(locLsnr);
                conQry.setRemoteFilterFactory(FactoryBuilder.factoryOf(rmtFltr));
                qry = cache.query(conQry);
            }
            try {
                if (rnd.nextBoolean())
                    cache.put(key, val0);
                else {
                    cache.invoke(key, new CacheEntryProcessor() {

                        @Override
                        public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
                            entry.setValue(val0);
                            return null;
                        }
                    });
                }
                assertTrue("Failed to waiting event.", U.await(latch, 3, SECONDS));
                assertEquals(cache.get(key), new QueryTestValue(2));
                assertTrue("Failed to waiting event from listener.", U.await(latch, 3, SECONDS));
            } finally {
                if (qry != null)
                    qry.close();
                if (lsnrCfg != null)
                    cache.deregisterCacheEntryListener(lsnrCfg);
            }
            log.info("Iteration finished: " + i);
        }
    } finally {
        ignite(0).destroyCache(ccfg.getName());
    }
}
Also used : TransactionSerializationException(org.apache.ignite.transactions.TransactionSerializationException) IgniteBiInClosure(org.apache.ignite.lang.IgniteBiInClosure) CacheEntryEvent(javax.cache.event.CacheEntryEvent) ContinuousQuery(org.apache.ignite.cache.query.ContinuousQuery) EntryProcessorException(javax.cache.processor.EntryProcessorException) IgniteException(org.apache.ignite.IgniteException) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Ignite(org.apache.ignite.Ignite) MutableEntry(javax.cache.processor.MutableEntry) QueryCursor(org.apache.ignite.cache.query.QueryCursor) IgniteCache(org.apache.ignite.IgniteCache) CountDownLatch(java.util.concurrent.CountDownLatch) EntryProcessorException(javax.cache.processor.EntryProcessorException) TransactionSerializationException(org.apache.ignite.transactions.TransactionSerializationException) IgniteException(org.apache.ignite.IgniteException) CacheEntryListenerException(javax.cache.event.CacheEntryListenerException) Transaction(org.apache.ignite.transactions.Transaction) CacheEntryProcessor(org.apache.ignite.cache.CacheEntryProcessor)

Example 3 with MutableEntry

use of javax.cache.processor.MutableEntry in project ignite by apache.

the class BinaryMetadataRegistrationInsideEntryProcessorTest method testContinuousQueryAndBinaryObjectBuilder.

/**
 * Continuously execute multiple EntryProcessors with having continuous queries in parallel.
 * This used to lead to several deadlocks.
 *
 * @throws Exception If failed.
 */
@Test
public void testContinuousQueryAndBinaryObjectBuilder() throws Exception {
    startGrids(3).cluster().active(true);
    grid(0).createCache(new CacheConfiguration<>().setName(CACHE_NAME).setAtomicityMode(ATOMIC).setBackups(2).setCacheMode(PARTITIONED).setWriteSynchronizationMode(FULL_SYNC).setPartitionLossPolicy(READ_WRITE_SAFE));
    IgniteEx client1 = startClientGrid(getConfiguration().setIgniteInstanceName("client1"));
    IgniteEx client2 = startClientGrid(getConfiguration().setIgniteInstanceName("client2"));
    AtomicBoolean stop = new AtomicBoolean();
    AtomicInteger keyCntr = new AtomicInteger();
    AtomicInteger binaryTypeCntr = new AtomicInteger();
    /**
     */
    class MyEntryProcessor implements CacheEntryProcessor<Object, Object, Object> {

        /**
         * Cached int value retrieved from {@code binaryTypeCntr} variable.
         */
        private int i;

        /**
         */
        public MyEntryProcessor(int i) {
            this.i = i;
        }

        /**
         */
        @IgniteInstanceResource
        Ignite ignite;

        /**
         * {@inheritDoc}
         */
        @Override
        public Object process(MutableEntry<Object, Object> entry, Object... arguments) throws EntryProcessorException {
            BinaryObjectBuilder builder = ignite.binary().builder("my_type");
            builder.setField("new_field" + i, i);
            entry.setValue(builder.build());
            return null;
        }
    }
    IgniteInternalFuture fut1 = GridTestUtils.runMultiThreadedAsync(() -> {
        IgniteCache<Object, Object> cache = client1.cache(CACHE_NAME).withKeepBinary();
        while (!stop.get()) {
            Integer key = keyCntr.getAndIncrement();
            cache.put(key, key);
            cache.invoke(key, new MyEntryProcessor(binaryTypeCntr.get()));
            binaryTypeCntr.incrementAndGet();
        }
    }, 8, "writer-thread");
    IgniteInternalFuture fut2 = GridTestUtils.runAsync(() -> {
        IgniteCache<Object, Object> cache = client2.cache(CACHE_NAME).withKeepBinary();
        while (!stop.get()) {
            ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
            qry.setInitialQuery(new ScanQuery<>((key, val) -> true));
            qry.setLocalListener(evts -> {
            });
            // noinspection EmptyTryBlock
            try (QueryCursor<Cache.Entry<Object, Object>> cursor = cache.query(qry)) {
            // No-op.
            }
        }
    });
    doSleep(10_000);
    stop.set(true);
    fut1.get(10, TimeUnit.SECONDS);
    fut2.get(10, TimeUnit.SECONDS);
}
Also used : IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) READ_WRITE_SAFE(org.apache.ignite.cache.PartitionLossPolicy.READ_WRITE_SAFE) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) IgniteEx(org.apache.ignite.internal.IgniteEx) EntryProcessorException(javax.cache.processor.EntryProcessorException) EntryProcessor(javax.cache.processor.EntryProcessor) MutableEntry(javax.cache.processor.MutableEntry) BinaryObjectBuilder(org.apache.ignite.binary.BinaryObjectBuilder) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) After(org.junit.After) Cache(javax.cache.Cache) PARTITIONED(org.apache.ignite.cache.CacheMode.PARTITIONED) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) IgniteInstanceResource(org.apache.ignite.resources.IgniteInstanceResource) Test(org.junit.Test) Ignite(org.apache.ignite.Ignite) ContinuousQuery(org.apache.ignite.cache.query.ContinuousQuery) FULL_SYNC(org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC) IgniteCache(org.apache.ignite.IgniteCache) GridTestUtils(org.apache.ignite.testframework.GridTestUtils) TimeUnit(java.util.concurrent.TimeUnit) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheEntryProcessor(org.apache.ignite.cache.CacheEntryProcessor) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) QueryCursor(org.apache.ignite.cache.query.QueryCursor) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) ATOMIC(org.apache.ignite.cache.CacheAtomicityMode.ATOMIC) Collections(java.util.Collections) ScanQuery(org.apache.ignite.cache.query.ScanQuery) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) MutableEntry(javax.cache.processor.MutableEntry) ContinuousQuery(org.apache.ignite.cache.query.ContinuousQuery) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) CacheEntryProcessor(org.apache.ignite.cache.CacheEntryProcessor) IgniteEx(org.apache.ignite.internal.IgniteEx) Ignite(org.apache.ignite.Ignite) MutableEntry(javax.cache.processor.MutableEntry) BinaryObjectBuilder(org.apache.ignite.binary.BinaryObjectBuilder) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 4 with MutableEntry

use of javax.cache.processor.MutableEntry in project ignite by apache.

the class GridCacheHashMapPutAllWarningsTest method testHashMapInvokeAllLocal.

/**
 * @throws Exception If failed.
 */
@Test
public void testHashMapInvokeAllLocal() throws Exception {
    Assume.assumeFalse("Local transactional caches not supported by MVCC", IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_FORCE_MVCC_MODE_IN_TESTS, false));
    List<String> messages = Collections.synchronizedList(new ArrayList<>());
    testLog = new ListeningTestLogger(false, log());
    testLog.registerListener((s) -> {
        if (s.contains("deadlock"))
            messages.add(s);
    });
    Ignite ignite = startGrid(0);
    IgniteCache<Integer, String> c = ignite.getOrCreateCache(new CacheConfiguration<Integer, String>("invoke").setCacheMode(CacheMode.LOCAL).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));
    c.put(1, "foo");
    c.put(2, "bar");
    Map<Integer, EntryProcessorResult<String>> result = c.invokeAll(new HashSet<>(Arrays.asList(1, 2)), new EntryProcessor<Integer, String, String>() {

        @Override
        public String process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
            String newVal = entry.getValue() + "2";
            entry.setValue(newVal);
            return newVal;
        }
    });
    assertEquals(2, result.size());
    assertEquals("bar2", c.get(2));
    int found = 0;
    for (String message : messages) {
        if (message.contains("Unordered collection java.util.HashSet is used for invokeAll operation on cache invoke. "))
            found++;
    }
    assertEquals(1, found);
}
Also used : ListeningTestLogger(org.apache.ignite.testframework.ListeningTestLogger) EntryProcessorResult(javax.cache.processor.EntryProcessorResult) EntryProcessorException(javax.cache.processor.EntryProcessorException) Ignite(org.apache.ignite.Ignite) MutableEntry(javax.cache.processor.MutableEntry) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 5 with MutableEntry

use of javax.cache.processor.MutableEntry in project ignite by apache.

the class IgniteCacheGroupsTest method cacheInvokeAllAsync.

/**
 * @param cache Cache.
 */
private void cacheInvokeAllAsync(IgniteCache cache) {
    int keys = 100;
    Map<Integer, Integer> data = generateDataMap(keys);
    cache.putAll(data);
    Random rnd = ThreadLocalRandom.current();
    int one = rnd.nextInt();
    int two = rnd.nextInt();
    Object res0 = cache.invokeAllAsync(data.keySet(), new CacheEntryProcessor<Integer, Integer, Integer>() {

        @Override
        public Integer process(MutableEntry<Integer, Integer> entry, Object... arguments) throws EntryProcessorException {
            Object expected = ((Map) arguments[0]).get(entry.getKey());
            assertEquals(expected, entry.getValue());
            // Some calculation.
            return (Integer) arguments[1] + (Integer) arguments[2];
        }
    }, data, one, two).get(ASYNC_TIMEOUT);
    Map<Integer, CacheInvokeResult<Integer>> res = (Map<Integer, CacheInvokeResult<Integer>>) res0;
    assertEquals(keys, res.size());
    assertEquals(one + two, (Object) res.get(0).get());
    tearDown(cache);
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Random(java.util.Random) CacheEntryProcessor(org.apache.ignite.cache.CacheEntryProcessor) BinaryObject(org.apache.ignite.binary.BinaryObject) MutableEntry(javax.cache.processor.MutableEntry) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap) TreeMap(java.util.TreeMap) IntMap(org.apache.ignite.internal.util.collection.IntMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Aggregations

MutableEntry (javax.cache.processor.MutableEntry)17 Ignite (org.apache.ignite.Ignite)9 CacheEntryProcessor (org.apache.ignite.cache.CacheEntryProcessor)9 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)7 EntryProcessorException (javax.cache.processor.EntryProcessorException)7 IgniteCache (org.apache.ignite.IgniteCache)7 EntryProcessor (javax.cache.processor.EntryProcessor)6 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)5 Test (org.junit.Test)5 HashMap (java.util.HashMap)4 ContinuousQuery (org.apache.ignite.cache.query.ContinuousQuery)4 QueryCursor (org.apache.ignite.cache.query.QueryCursor)4 Transaction (org.apache.ignite.transactions.Transaction)4 Map (java.util.Map)3 CacheEntryEvent (javax.cache.event.CacheEntryEvent)3 IgniteException (org.apache.ignite.IgniteException)3 BinaryObject (org.apache.ignite.binary.BinaryObject)3 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)3 ArrayList (java.util.ArrayList)2 Random (java.util.Random)2