Merge branches 'ignite-96' and 'sprint-1' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-96
Conflicts: [9 tests conflicted w/ignite-56] Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/876ccb04 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/876ccb04 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/876ccb04 Branch: refs/heads/ignite-96 Commit: 876ccb0429f067aeb9638ace4792a5556a7d5756 Parents: ac54872 db5e5d3 Author: Yakov Zhdanov <[email protected]> Authored: Mon Feb 9 00:44:19 2015 +0300 Committer: Yakov Zhdanov <[email protected]> Committed: Mon Feb 9 00:44:19 2015 +0300 ---------------------------------------------------------------------- .../java/org/apache/ignite/IgniteCache.java | 2 - .../processors/cache/IgniteCacheProxy.java | 4 - .../GridCacheLoadOnlyStoreAdapterSelfTest.java | 2 +- .../cache/GridCacheAbstractFlagsTest.java | 5 +- ...cheAbstractFullApiMultithreadedSelfTest.java | 6 +- .../cache/GridCacheAbstractFullApiSelfTest.java | 1300 ++++++++---------- .../GridCacheAbstractIteratorsSelfTest.java | 2 +- .../cache/GridCacheAbstractMetricsSelfTest.java | 415 +++--- .../cache/GridCacheAbstractSelfTest.java | 37 +- .../cache/GridCacheAbstractTxReadTest.java | 6 +- .../GridCacheAtomicMessageCountSelfTest.java | 9 +- .../cache/GridCacheEntryMemorySizeSelfTest.java | 89 +- .../GridCacheGroupLockAbstractSelfTest.java | 14 +- .../cache/GridCacheIncrementTransformTest.java | 2 +- .../GridCacheInterceptorAbstractSelfTest.java | 70 +- .../cache/GridCacheIteratorPerformanceTest.java | 62 +- .../GridCacheOffHeapTieredAbstractSelfTest.java | 28 +- ...idCacheValueConsistencyAbstractSelfTest.java | 2 +- .../IgniteCacheEntryListenerAbstractTest.java | 6 +- .../cache/IgniteCacheInvokeAbstractTest.java | 7 +- .../processors/cache/IgniteTxAbstractTest.java | 31 +- ...dCachePartitionedQueueEntryMoveSelfTest.java | 8 +- .../GridCacheAbstractJobExecutionTest.java | 4 +- .../GridCacheEntrySetAbstractSelfTest.java | 2 +- .../distributed/GridCacheEventAbstractTest.java | 9 +- ...heExpiredEntriesPreloadAbstractSelfTest.java | 2 +- .../distributed/GridCacheLockAbstractTest.java | 4 +- .../GridCacheMultiNodeLockAbstractTest.java | 76 +- .../GridCacheNodeFailureAbstractTest.java | 50 +- ...chePartitionedReloadAllAbstractSelfTest.java | 106 +- .../IgniteTxPreloadAbstractTest.java | 4 +- .../IgniteTxTimeoutAbstractTest.java | 10 +- ...heAbstractTransformWriteThroughSelfTest.java | 9 +- .../dht/GridCacheAtomicNearCacheSelfTest.java | 2 +- .../dht/GridCacheColocatedDebugTest.java | 27 +- .../dht/GridCacheDhtEntrySelfTest.java | 14 +- .../dht/GridCacheDhtInternalEntrySelfTest.java | 2 +- .../GridCacheDhtPreloadDisabledSelfTest.java | 16 +- .../dht/GridCacheDhtPreloadSelfTest.java | 43 +- .../GridCacheDhtPreloadStartStopSelfTest.java | 30 +- .../distributed/dht/GridCacheDhtTestUtils.java | 9 - ...cheGroupLockPartitionedAbstractSelfTest.java | 6 +- ...ridCachePartitionedUnloadEventsSelfTest.java | 2 +- .../near/GridCacheNearMultiNodeSelfTest.java | 21 +- ...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 17 - .../GridCacheNearReaderPreloadSelfTest.java | 2 +- .../near/GridCacheNearReadersSelfTest.java | 40 +- .../GridCachePartitionedAffinitySelfTest.java | 2 +- ...ePartitionedBasicStoreMultiNodeSelfTest.java | 3 +- .../GridCachePartitionedEvictionSelfTest.java | 8 +- ...achePartitionedMultiNodeFullApiSelfTest.java | 4 +- .../near/GridPartitionedBackupLoadSelfTest.java | 2 +- .../GridCacheReplicatedPreloadSelfTest.java | 16 +- .../GridCacheDistributedEvictionsSelfTest.java | 8 +- .../GridCacheEvictionLockUnlockSelfTest.java | 2 +- ...cheSynchronousEvictionsFailoverSelfTest.java | 13 +- .../IgniteCacheExpiryPolicyAbstractTest.java | 20 +- .../IgniteCacheLoadAllAbstractTest.java | 2 +- ...iteCacheNoLoadPreviousValueAbstractTest.java | 6 +- .../IgniteCacheNoReadThroughAbstractTest.java | 6 +- .../IgniteCacheNoWriteThroughAbstractTest.java | 6 +- .../GridCacheSwapScanQueryAbstractSelfTest.java | 59 - ...dCacheContinuousQueryReplicatedSelfTest.java | 4 +- .../cacheget/GridBenchmarkCacheGetLoadTest.java | 13 +- .../ignite/testframework/GridTestUtils.java | 8 +- .../testframework/junits/GridAbstractTest.java | 2 +- .../junits/common/GridCommonAbstractTest.java | 175 +-- 67 files changed, 1260 insertions(+), 1713 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java index fce9696,f41f2ef..464dcec --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java @@@ -2844,8 -2884,8 +2884,8 @@@ public abstract class GridCacheAbstract // Force reload on primary node. for (int i = 0; i < gridCount(); i++) { - if (cache(i).entry(key).primary()) + if (cache(i).affinity().isPrimary(grid(i).localNode(), key)) - cache(i).reload(key); + load(jcache(i), key, true); } // Will do near get request. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java index 9df8e55,b15c2d9..91d6be3 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java @@@ -173,54 -170,52 +173,51 @@@ public class GridCacheEntryMemorySizeSe /** @throws Exception If failed. */ public void testPartitionedNearEnabled() throws Exception { - mode = PARTITIONED; - nearEnabled = true; + assert false : "ignite-96"; - // mode = PARTITIONED; - // nearEnabled = true; - // - // try { - // startGridsMultiThreaded(2); - // - // int[] keys = new int[3]; - // - // int key = 0; - // - // for (int i = 0; i < keys.length; i++) { - // while (true) { - // key++; - // - // if (grid(0).mapKeyToNode(null, key).equals(grid(0).localNode())) { - // if (i > 0) - // assertTrue(cache(0).putx(key, new Value(new byte[i * 1024]))); - // - // keys[i] = key; - // - // break; - // } - // } - // } - // - // // Create near entries. - // assertNotNull(cache(1).get(keys[1])); - // assertNotNull(cache(1).get(keys[2])); - // - // assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + - // extrasSize(cache(0).entry(keys[0])), cache(0).entry(keys[0]).memorySize()); - // assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE + - // extrasSize(cache(0).entry(keys[1])), cache(0).entry(keys[1]).memorySize()); - // assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE + - // extrasSize(cache(0).entry(keys[2])), cache(0).entry(keys[2]).memorySize()); - // - // assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD + - // extrasSize(cache(1).entry(keys[0])), cache(1).entry(keys[0]).memorySize()); - // assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD + - // extrasSize(cache(1).entry(keys[1])), cache(1).entry(keys[1]).memorySize()); - // assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD + - // extrasSize(cache(1).entry(keys[2])), cache(1).entry(keys[2]).memorySize()); - // } - // finally { - // stopAllGrids(); - // } + try { + startGridsMultiThreaded(2); + + int[] keys = new int[3]; + + int key = 0; + + for (int i = 0; i < keys.length; i++) { + while (true) { + key++; + + if (grid(0).mapKeyToNode(null, key).equals(grid(0).localNode())) { + if (i > 0) + jcache(0).put(key, new Value(new byte[i * 1024])); + + keys[i] = key; + + break; + } + } + } + + // Create near entries. + assertNotNull(jcache(1).get(keys[1])); + assertNotNull(jcache(1).get(keys[2])); + + assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + + extrasSize(cache(0).entry(keys[0])), cache(0).entry(keys[0]).memorySize()); + assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE + + extrasSize(cache(0).entry(keys[1])), cache(0).entry(keys[1]).memorySize()); + assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE + + extrasSize(cache(0).entry(keys[2])), cache(0).entry(keys[2]).memorySize()); + + assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD + + extrasSize(cache(1).entry(keys[0])), cache(1).entry(keys[0]).memorySize()); + assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD + + extrasSize(cache(1).entry(keys[1])), cache(1).entry(keys[1]).memorySize()); + assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD + + extrasSize(cache(1).entry(keys[2])), cache(1).entry(keys[2]).memorySize()); + } + finally { + stopAllGrids(); + } } /** @throws Exception If failed. */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEntrySetAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheNodeFailureAbstractTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheNodeFailureAbstractTest.java index ffbffea,c31c684..03f2057 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheNodeFailureAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheNodeFailureAbstractTest.java @@@ -31,8 -31,8 +31,9 @@@ import org.apache.ignite.spi.discovery. import org.apache.ignite.testframework.junits.common.*; import org.apache.ignite.transactions.*; +import javax.cache.*; import java.util.*; + import java.util.concurrent.locks.*; import static org.apache.ignite.IgniteState.*; import static org.apache.ignite.IgniteSystemProperties.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheGroupLockPartitionedAbstractSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheGroupLockPartitionedAbstractSelfTest.java index d4d63e3,494d5f6..79cfe1c --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheGroupLockPartitionedAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheGroupLockPartitionedAbstractSelfTest.java @@@ -84,15 -83,15 +84,15 @@@ public abstract class GridCacheGroupLoc cache.put(new CacheAffinityKey<>(i, affinityKey), i); for (int i = 0; i < 3; i++) { - try (IgniteTx tx = cache.txStartAffinity(affinityKey, concurrency, isolation, 0, 10)) { - Set<Cache.Entry<CacheAffinityKey<Integer>, Integer>> set = - cache.entrySet(cache(0).affinity().partition(affinityKey)); + try (IgniteTx tx = ignite(0).transactions().txStartAffinity(null, affinityKey, concurrency, isolation, 0, 10)) { + Set<CacheEntry<CacheAffinityKey<Integer>, Integer>> set = + cache.entrySet(ignite(0).affinity(null).partition(affinityKey)); - for (CacheEntry<CacheAffinityKey<Integer>, Integer> entry : set) { - Integer old = entry.get(); + for (Cache.Entry<CacheAffinityKey<Integer>, Integer> entry : set) { + Integer old = entry.getValue(); if (old != null) - entry.set(old + 1); + cache.putx(entry.getKey(), old + 1); else { Object key = entry.getKey(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReaderPreloadSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReaderPreloadSelfTest.java index 94344c2,080218a..131d491 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReaderPreloadSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReaderPreloadSelfTest.java @@@ -191,10 -190,10 +191,10 @@@ public class GridCacheNearReaderPreload * @param expVal Expected value. * @throws Exception If failed. */ - private void checkCache(CacheProjection<Integer, Integer> cache, int key, int expVal) throws Exception { + private void checkCache(GridCache<Integer, Integer> cache, int key, int expVal) throws Exception { - CacheEntry<Integer, Integer> entry = cache.entry(key); + Cache.Entry<Integer, Integer> entry = cache.entry(key); assert F.eq(expVal, entry.getValue()) : "Unexpected cache value [key=" + key + ", expected=" + expVal + - ", actual=" + entry.getValue() + ", primary=" + entry.primary() + ", backup=" + entry.backup() + ']'; + ", actual=" + entry.getValue() + ']'; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/876ccb04/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java ----------------------------------------------------------------------
