ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [04/50] [abbrv] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p3'
Date Wed, 26 Aug 2015 03:06:15 GMT
Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p3'


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d8595879
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d8595879
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d8595879

Branch: refs/heads/ignite-843
Commit: d859587948862067c2389cb5f2461e351a35ddfa
Parents: dd204de 9603b25
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Aug 21 11:00:22 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Aug 21 11:00:22 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/IgniteSystemProperties.java   |   3 +
 .../store/jdbc/CacheAbstractJdbcStore.java      |  45 +-
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |  32 +-
 .../store/jdbc/dialect/BasicJdbcDialect.java    |   3 +
 .../cache/store/jdbc/dialect/DB2Dialect.java    |   3 +
 .../cache/store/jdbc/dialect/H2Dialect.java     |   3 +
 .../cache/store/jdbc/dialect/JdbcDialect.java   |   3 +-
 .../cache/store/jdbc/dialect/MySQLDialect.java  |   3 +
 .../cache/store/jdbc/dialect/OracleDialect.java |   3 +
 .../store/jdbc/dialect/SQLServerDialect.java    |   3 +
 .../cluster/ClusterTopologyException.java       |  18 +
 .../ignite/internal/MarshallerContextImpl.java  |  24 +-
 .../ClusterTopologyCheckedException.java        |  18 +
 .../CachePartialUpdateCheckedException.java     |  11 +-
 .../processors/cache/GridCacheAdapter.java      |  81 ++-
 .../processors/cache/GridCacheIoManager.java    |   1 -
 .../cache/GridCacheSharedContext.java           |  17 +
 .../processors/cache/GridCacheUtils.java        |  23 +
 .../distributed/GridDistributedCacheEntry.java  |   7 +
 .../dht/GridClientPartitionTopology.java        |  20 +
 .../distributed/dht/GridDhtCacheAdapter.java    |  12 +-
 .../cache/distributed/dht/GridDhtGetFuture.java |  12 +-
 .../dht/GridDhtPartitionTopology.java           |   7 +
 .../dht/GridDhtPartitionTopologyImpl.java       |  20 +
 .../cache/distributed/dht/GridDhtTxLocal.java   |   4 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java | 182 ++++++-
 .../dht/GridDhtTxPrepareResponse.java           |  42 +-
 .../dht/GridPartitionedGetFuture.java           | 104 ++--
 .../dht/atomic/GridDhtAtomicCache.java          |  16 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |   3 +
 .../dht/colocated/GridDhtColocatedCache.java    |  19 +-
 .../colocated/GridDhtColocatedLockFuture.java   |   8 +-
 .../GridDhtPartitionsExchangeFuture.java        |  40 +-
 .../distributed/near/GridNearAtomicCache.java   |   6 +-
 .../distributed/near/GridNearCacheAdapter.java  |  15 +-
 .../distributed/near/GridNearCacheEntry.java    |  10 +-
 .../distributed/near/GridNearGetFuture.java     | 121 +++--
 .../distributed/near/GridNearLockFuture.java    |  12 +-
 .../near/GridNearOptimisticTxPrepareFuture.java |  13 +-
 .../GridNearPessimisticTxPrepareFuture.java     |   9 +-
 .../near/GridNearTransactionalCache.java        |   9 +-
 .../cache/distributed/near/GridNearTxLocal.java |   7 +-
 .../near/GridNearTxPrepareResponse.java         |   3 -
 .../local/atomic/GridLocalAtomicCache.java      |  17 +-
 .../cache/transactions/IgniteInternalTx.java    |   2 +-
 .../cache/transactions/IgniteTxAdapter.java     |  19 +-
 .../cache/transactions/IgniteTxEntry.java       |  18 +
 .../cache/transactions/IgniteTxHandler.java     |   5 +-
 .../ignite/internal/util/IgniteUtils.java       |  10 +-
 .../ignite/internal/util/lang/GridFunc.java     |  14 +
 .../config/store/jdbc/ignite-type-metadata.xml  |   8 +
 .../store/jdbc/CacheJdbcPojoStoreTest.java      |  33 +-
 ...eJdbcStoreAbstractMultithreadedSelfTest.java |  16 +-
 .../ignite/cache/store/jdbc/model/Person.java   |  26 +-
 .../cache/CrossCacheTxRandomOperationsTest.java | 490 +++++++++++++++++++
 ...teAtomicCacheEntryProcessorNodeJoinTest.java |  32 ++
 .../IgniteCacheEntryProcessorNodeJoinTest.java  | 225 +++++++++
 .../IgniteCacheTopologySafeGetSelfTest.java     | 215 ++++++++
 .../GridCacheTransformEventSelfTest.java        |   2 +
 .../IgniteCacheCrossCacheTxFailoverTest.java    | 433 ++++++++++++++++
 .../IgniteCachePutRetryAbstractSelfTest.java    |   1 +
 ...gniteCachePutRetryTransactionalSelfTest.java | 187 +++++++
 .../near/GridCacheNearOnlyTopologySelfTest.java |   4 +-
 .../near/GridCacheNearTxForceKeyTest.java       |  76 +++
 ...idCachePartitionedHitsAndMissesSelfTest.java |  20 +-
 .../OptimizedMarshallerNodeFailoverTest.java    |  97 +++-
 .../IgniteCacheFailoverTestSuite.java           |   2 +
 .../testsuites/IgniteCacheTestSuite2.java       |   4 +
 .../ignite/schema/model/PojoDescriptor.java     |   6 +-
 .../ignite/schema/model/SchemaDescriptor.java   |  61 +++
 .../schema/parser/DatabaseMetadataParser.java   |  54 +-
 .../parser/dialect/DB2MetadataDialect.java      |   3 +-
 .../parser/dialect/DatabaseMetadataDialect.java |  13 +-
 .../parser/dialect/JdbcMetadataDialect.java     | 129 +++--
 .../parser/dialect/MySQLMetadataDialect.java    |  57 +++
 .../parser/dialect/OracleMetadataDialect.java   | 111 +++--
 .../org/apache/ignite/schema/ui/Controls.java   |  25 +-
 .../ignite/schema/ui/SchemaImportApp.java       | 157 +++++-
 .../schema/test/AbstractSchemaImportTest.java   |  10 +-
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java |  14 +-
 80 files changed, 3186 insertions(+), 405 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index bb3673d,a85962f..6e39672
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@@ -625,30 -653,31 +653,38 @@@ public class GridPartitionedGetFuture<K
              if (log.isDebugEnabled())
                  log.debug("Remote node left grid while sending or waiting for reply (will
retry): " + this);
  
-             final AffinityTopologyVersion updTopVer =
-                 new AffinityTopologyVersion(Math.max(topVer.topologyVersion() + 1, cctx.discovery().topologyVersion()));
+             // Try getting from existing nodes.
+             if (!canRemap) {
+                 map(keys.keySet(), F.t(node, keys), topVer);
  
-             final GridFutureRemapTimeoutObject timeout = new GridFutureRemapTimeoutObject(this,
-                 cctx.kernalContext().config().getNetworkTimeout(),
-                 updTopVer,
-                 e);
- 
-             cctx.affinity().affinityReadyFuture(updTopVer).listen(
-                 new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
-                     @Override public void apply(IgniteInternalFuture<AffinityTopologyVersion>
fut) {
-                         if (timeout.finish()) {
-                             cctx.kernalContext().timeout().removeTimeoutObject(timeout);
- 
-                             try {
-                                 fut.get();
- 
-                                 // Remap.
-                                 map(keys.keySet(), F.t(node, keys), updTopVer);
- 
-                                 onDone(Collections.<K, V>emptyMap());
-                             }
-                             catch (IgniteCheckedException e) {
-                                 GridPartitionedGetFuture.this.onDone(e);
+                 onDone(Collections.<K, V>emptyMap());
+             }
+             else {
+                 final AffinityTopologyVersion updTopVer =
+                     new AffinityTopologyVersion(Math.max(topVer.topologyVersion() + 1, cctx.discovery().topologyVersion()));
+ 
+                 final GridFutureRemapTimeoutObject timeout = new GridFutureRemapTimeoutObject(this,
+                     cctx.kernalContext().config().getNetworkTimeout(),
+                     updTopVer,
+                     e);
+ 
+                 cctx.affinity().affinityReadyFuture(updTopVer).listen(
+                     new CI1<IgniteInternalFuture<AffinityTopologyVersion>>()
{
+                         @Override public void apply(IgniteInternalFuture<AffinityTopologyVersion>
fut) {
+                             if (timeout.finish()) {
+                                 cctx.kernalContext().timeout().removeTimeoutObject(timeout);
+ 
 -                                // Remap.
 -                                map(keys.keySet(), F.t(node, keys), updTopVer);
++                                try {
++                                    fut.get();
+ 
 -                                onDone(Collections.<K, V>emptyMap());
++                                    // Remap.
++                                    map(keys.keySet(), F.t(node, keys), updTopVer);
++
++                                    onDone(Collections.<K, V>emptyMap());
++                                }
++                                catch (IgniteCheckedException e) {
++                                    GridPartitionedGetFuture.this.onDone(e);
++                                }
                              }
                          }
                      }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index cbf6b40,4971ca6..1a90de9
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@@ -738,22 -761,20 +750,26 @@@ public class GridDhtPartitionsExchangeF
                          break;
                      }
                      catch (IgniteFutureTimeoutCheckedException ignored) {
-                         U.warn(log, "Failed to wait for locks release future. " +
-                             "Dumping pending objects that might be the cause: " + cctx.localNodeId());
+                         if (dumpedObjects < DUMP_PENDING_OBJECTS_THRESHOLD) {
+                             U.warn(log, "Failed to wait for locks release future. " +
+                                 "Dumping pending objects that might be the cause: " + cctx.localNodeId());
  
-                         U.warn(log, "Locked keys:");
 -                            U.warn(log, "Locked entries:");
++                            U.warn(log, "Locked keys:");
 +
-                         for (IgniteTxKey key : cctx.mvcc().lockedKeys())
-                             U.warn(log, "Locked key: " + key);
++                            for (IgniteTxKey key : cctx.mvcc().lockedKeys())
++                                U.warn(log, "Locked key: " + key);
 +
-                         for (IgniteTxKey key : cctx.mvcc().nearLockedKeys())
-                             U.warn(log, "Locked near key: " + key);
++                            for (IgniteTxKey key : cctx.mvcc().nearLockedKeys())
++                                U.warn(log, "Locked near key: " + key);
  
-                         Map<IgniteTxKey, Collection<GridCacheMvccCandidate>>
locks =
-                             cctx.mvcc().unfinishedLocks(exchId.topologyVersion());
+                             Map<IgniteTxKey, Collection<GridCacheMvccCandidate>>
locks =
+                                 cctx.mvcc().unfinishedLocks(exchId.topologyVersion());
  
-                         for (Map.Entry<IgniteTxKey, Collection<GridCacheMvccCandidate>>
e : locks.entrySet())
-                             U.warn(log, "Awaited locked entry [key=" + e.getKey() + ", mvcc="
+ e.getValue() + ']');
+                             for (Map.Entry<IgniteTxKey, Collection<GridCacheMvccCandidate>>
e : locks.entrySet())
 -                                U.warn(log, "Locked entry [key=" + e.getKey() + ", mvcc="
+ e.getValue() + ']');
 -
++                                U.warn(log, "Awaited locked entry [key=" + e.getKey() +
", mvcc=" + e.getValue() + ']');
++                            
+                             dumpedObjects++;
+                         }
                      }
                  }
  

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index 2017654,ca460c5..c4a5d70
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@@ -752,30 -781,31 +781,38 @@@ public final class GridNearGetFuture<K
              if (log.isDebugEnabled())
                  log.debug("Remote node left grid while sending or waiting for reply (will
retry): " + this);
  
-             final AffinityTopologyVersion updTopVer =
-                 new AffinityTopologyVersion(Math.max(topVer.topologyVersion() + 1, cctx.discovery().topologyVersion()));
- 
-             final GridFutureRemapTimeoutObject timeout = new GridFutureRemapTimeoutObject(this,
-                 cctx.kernalContext().config().getNetworkTimeout(),
-                 updTopVer,
-                 e);
- 
-             cctx.affinity().affinityReadyFuture(updTopVer).listen(
-                 new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
-                     @Override public void apply(IgniteInternalFuture<AffinityTopologyVersion>
fut) {
-                         if (timeout.finish()) {
-                             cctx.kernalContext().timeout().removeTimeoutObject(timeout);
- 
-                             try {
-                                 fut.get();
- 
-                                 // Remap.
-                                 map(keys.keySet(), F.t(node, keys), updTopVer);
- 
-                                 onDone(Collections.<K, V>emptyMap());
-                             }
-                             catch (IgniteCheckedException e) {
-                                 GridNearGetFuture.this.onDone(e);
+             // Try getting value from alive nodes.
+             if (!canRemap) {
+                 // Remap
+                 map(keys.keySet(), F.t(node, keys), topVer);
+ 
+                 onDone(Collections.<K, V>emptyMap());
+             } else {
+                 final AffinityTopologyVersion updTopVer =
+                     new AffinityTopologyVersion(Math.max(topVer.topologyVersion() + 1, cctx.discovery().topologyVersion()));
+ 
+                 final GridFutureRemapTimeoutObject timeout = new GridFutureRemapTimeoutObject(this,
+                     cctx.kernalContext().config().getNetworkTimeout(),
+                     updTopVer,
+                     e);
+ 
+                 cctx.affinity().affinityReadyFuture(updTopVer).listen(
+                     new CI1<IgniteInternalFuture<AffinityTopologyVersion>>()
{
+                         @Override public void apply(IgniteInternalFuture<AffinityTopologyVersion>
fut) {
+                             if (timeout.finish()) {
+                                 cctx.kernalContext().timeout().removeTimeoutObject(timeout);
+ 
 -                                // Remap.
 -                                map(keys.keySet(), F.t(node, keys), updTopVer);
++                                try {
++                                    fut.get();
+ 
 -                                onDone(Collections.<K, V>emptyMap());
++                                    // Remap.
++                                    map(keys.keySet(), F.t(node, keys), updTopVer);
++
++                                    onDone(Collections.<K, V>emptyMap());
++                                }
++                                catch (IgniteCheckedException e) {
++                                    GridNearGetFuture.this.onDone(e);
++                                }
                              }
                          }
                      }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
index 1d14dec,c2fc46c..0ab5729
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
@@@ -64,16 -76,185 +76,191 @@@ public class IgniteCachePutRetryTransac
  
          int keysCnt = keysCount();
  
 -        for (int i = 0; i < keysCnt; i++)
 -            atomic.incrementAndGet();
 +        try {
 +            for (int i = 0; i < keysCnt; i++)
 +                atomic.incrementAndGet();
  
 -        finished.set(true);
 -        fut.get();
 +            finished.set(true);
 +
 +            fut.get();
 +        }
 +        finally {
 +            finished.set(true);
 +        }
      }
+ 
+     /** {@inheritDoc} */
+     public void testExplicitTransactionRetries() throws Exception {
+         final AtomicInteger idx = new AtomicInteger();
+         int threads = 8;
+ 
+         final AtomicReferenceArray<Exception> err = new AtomicReferenceArray<>(threads);
+ 
+         IgniteInternalFuture<Long> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>()
{
+             @Override
+             public Object call() throws Exception {
+                 int th = idx.getAndIncrement();
+                 int base = th * FACTOR;
+ 
+                 Ignite ignite = ignite(0);
+                 final IgniteCache<Object, Object> cache = ignite.cache(null);
+ 
+                 try {
+                     for (int i = 0; i < FACTOR; i++) {
+                         doInTransaction(ignite, new ProcessCallable(cache, base, i));
+ 
+                         if (i > 0 && i % 500 == 0)
+                             info("Done: " + i);
+                     }
+                 }
+                 catch (Exception e) {
+                     err.set(th, e);
+                 }
+ 
+                 return null;
+             }
+         }, threads, "tx-runner");
+ 
+         while (!fut.isDone()) {
+             int stopIdx = ThreadLocalRandom.current().nextInt(2, 4); // Random in [2, 3].
+ 
+             stopGrid(stopIdx);
+ 
+             U.sleep(500);
+ 
+             startGrid(stopIdx);
+         }
+ 
+         for (int i = 0; i < threads; i++) {
+             Exception error = err.get(i);
+ 
+             if (error != null)
+                 throw error;
+         }
+ 
+         // Verify contents of the cache.
+         for (int g = 0; g < gridCount(); g++) {
+             IgniteCache<Object, Object> cache = ignite(g).cache(null);
+ 
+             for (int th = 0; th < threads; th++) {
+                 int base = th * FACTOR;
+ 
+                 String key = "key-" + base;
+ 
+                 Set<String> set = (Set<String>)cache.get(key);
+ 
+                 assertNotNull("Missing set for key: " + key, set);
+                 assertEquals(FACTOR, set.size());
+ 
+                 for (int i = 0; i < FACTOR; i++) {
+                     assertEquals("value-" + i, cache.get("key-" + base + "-" + i));
+                     assertTrue(set.contains("value-" + i));
+                 }
+             }
+         }
+     }
+ 
+     /**
+      * @param ignite Ignite instance.
+      * @param clo Closure.
+      * @return Result of closure execution.
+      * @throws Exception If failed.
+      */
+     private <T> T doInTransaction(Ignite ignite, Callable<T> clo) throws Exception
{
+         while (true) {
+             try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ))
{
+                 T res = clo.call();
+ 
+                 tx.commit();
+ 
+                 return res;
+             }
+             catch (CacheException e) {
+                 if (e.getCause() instanceof ClusterTopologyException) {
+                     ClusterTopologyException topEx = (ClusterTopologyException)e.getCause();
+ 
+                     topEx.retryReadyFuture().get();
+                 }
+                 else
+                     throw e;
+             }
+             catch (ClusterTopologyException e) {
+                 IgniteFuture<?> fut = e.retryReadyFuture();
+ 
+                 fut.get();
+             }
+             catch (TransactionRollbackException ignore) {
+                 // Safe to retry right away.
+             }
+         }
+     }
+ 
+     /**
+      * Callable to process inside transaction.
+      */
+     private static class ProcessCallable implements Callable<Void> {
+         /** */
+         private IgniteCache cache;
+ 
+         /** */
+         private int base;
+ 
+         /** */
+         private int i;
+ 
+         /**
+          * @param cache Cache.
+          * @param base Base index.
+          * @param i Iteration index.
+          */
+         private ProcessCallable(IgniteCache<Object, Object> cache, int base, int i)
{
+             this.cache = cache;
+             this.base = base;
+             this.i = i;
+         }
+ 
+         /** {@inheritDoc} */
+         @SuppressWarnings("unchecked")
+         @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;
+         }
+     }
+ 
+     /**
+      *
+      */
+     private static class AddEntryProcessor implements CacheEntryProcessor<String, Set<String>,
Void> {
+         /** */
+         private String addVal;
+ 
+         /**
+          * @param addVal Value to add.
+          */
+         private AddEntryProcessor(String addVal) {
+             this.addVal = addVal;
+         }
+ 
+         /** {@inheritDoc} */
+         @Override public Void process(MutableEntry<String, Set<String>> entry,
Object... arguments) throws EntryProcessorException {
+             Set<String> set = entry.getValue();
+ 
+             if (set == null)
+                 set = new HashSet<>();
+ 
+             set.add(addVal);
+ 
+             entry.setValue(set);
+ 
+             return null;
+         }
+     }
  }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d8595879/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 2efdb82,495719f..cb17501
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@@ -138,8 -138,12 +138,12 @@@ public class IgniteCacheTestSuite2 exte
          suite.addTest(new TestSuite(IgniteCachePartitionMapUpdateTest.class));
          suite.addTest(new TestSuite(IgniteCacheClientNodePartitionsExchangeTest.class));
          suite.addTest(new TestSuite(IgniteCacheClientNodeChangingTopologyTest.class));
 -        suite.addTest(new TestSuite(IgniteCacheClientNodeConcurrentStart.class));
 +        suite.addTest(new TestSuite(IgniteCacheServerNodeConcurrentStart.class));
  
+         suite.addTest(new TestSuite(IgniteCacheEntryProcessorNodeJoinTest.class));
+         suite.addTest(new TestSuite(IgniteAtomicCacheEntryProcessorNodeJoinTest.class));
+         suite.addTest(new TestSuite(GridCacheNearTxForceKeyTest.class));
+ 
          return suite;
      }
  }


Mime
View raw message