ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: # ignite-341-test
Date Thu, 26 Mar 2015 11:15:37 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-341-test 58d8489c7 -> 0e2168dc8


# ignite-341-test


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

Branch: refs/heads/ignite-341-test
Commit: 0e2168dc8625ea78755c9b63185dfa066b1ca2b6
Parents: 58d8489
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Mar 26 14:14:30 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Mar 26 14:15:03 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheEvictionManager.java         | 31 ----------
 .../IgniteCacheQueryMultiThreadedSelfTest.java  | 61 +++++++-------------
 2 files changed, 20 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0e2168dc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 6314342..fd56568 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -917,36 +917,6 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
         assert !evictSyncAgr;
         assert cctx.isSwapOrOffheapEnabled();
 
-        GridCacheAdapter cache = cctx.cache();
-
-        boolean recordable = cctx.events().isRecordable(EVT_CACHE_ENTRY_EVICTED);
-
-        for (Object k : keys) {
-            KeyCacheObject cacheKey = cctx.toCacheKeyObject(k);
-
-            GridCacheEntryEx e = cache.peekEx(cacheKey);
-
-            if (e != null) {
-                if (obsoleteVer == null)
-                    obsoleteVer = cctx.versions().next();
-
-                e.evictInternal(true, obsoleteVer, null);
-
-                if (e.obsolete()) {
-                    e.onMarkedObsolete();
-
-                    cache.removeEntry(e);
-
-                    if (plcEnabled)
-                        notifyPolicy(e);
-
-                    if (recordable)
-                        cctx.events().addEvent(e.partition(), e.key(), cctx.nodeId(), (IgniteUuid)null,
null,
-                                EVT_CACHE_ENTRY_EVICTED, null, false, e.rawGet(), e.hasValue(),
null, null, null);
-                }
-            }
-        }
-        /*
         List<GridCacheEntryEx> locked = new ArrayList<>(keys.size());
 
         Collection<GridCacheBatchSwapEntry> swapped = new ArrayList<>(keys.size());
@@ -1019,7 +989,6 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
                 }
             }
         }
-        */
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0e2168dc/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
index 6060a23..e55b58b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
@@ -53,7 +53,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
     private static final boolean TEST_INFO = true;
 
     /** Number of test grids (nodes). Should not be less than 2. */
-    private static final int GRID_CNT = 3;
+    private static final int GRID_CNT = 1;
 
     /** */
     private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
@@ -87,8 +87,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
 
         CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();
 
+        cacheCfg.setNearConfiguration(null);
         cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        cacheCfg.setAtomicityMode(ATOMIC);
         cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         cacheCfg.setSwapEnabled(true);
         cacheCfg.setBackups(1);
@@ -123,7 +124,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
         }
 
         @Override public void onUnswap(@Nullable String spaceName, Object key, Object val,
byte[] valBytes)
-        throws IgniteCheckedException {
+            throws IgniteCheckedException {
             super.onUnswap(spaceName, key, val, valBytes);
 
             idxUnswapCnt.incrementAndGet();
@@ -154,7 +155,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
 
     /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {
-        assert GRID_CNT >= 2 : "Constant GRID_CNT must be greater than or equal to 2.";
+//        assert GRID_CNT >= 2 : "Constant GRID_CNT must be greater than or equal to 2.";
 
         startGridsMultiThreaded(GRID_CNT);
     }
@@ -239,26 +240,23 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
     @SuppressWarnings({"TooBroadScope"})
     public void testMultiThreadedSwapUnswapString() throws Exception {
         int threadCnt = 50;
-        final int keyCnt = 2000;
+        final int keyCnt = 10;
         final int valCnt = 10000;
 
         final Ignite g = grid(0);
 
         // Put test values into cache.
-        final IgniteCache<Integer, String> c = g.cache(null);
+        final IgniteCache<Integer, Integer> c = g.cache(null);
         final IgniteCache<Integer, Long> cl = g.cache(null);
 
         assertEquals(0, ((IgniteKernal)g).getCache(null).size());
-        assertEquals(0, c.query(new SqlQuery(String.class, "1 = 1")).getAll().size());
-        assertEquals(0, cl.query(new SqlQuery(Long.class, "1 = 1")).getAll().size());
+        //assertEquals(0, c.query(new SqlQuery(String.class, "1 = 1")).getAll().size());
+        //assertEquals(0, cl.query(new SqlQuery(Long.class, "1 = 1")).getAll().size());
 
         Random rnd = new Random();
 
         for (int i = 0; i < keyCnt; i += 1 + rnd.nextInt(3)) {
-            c.put(i, String.valueOf(rnd.nextInt(valCnt)));
-
-            if (evictsEnabled() && rnd.nextBoolean())
-                c.localEvict(Arrays.asList(i));
+            c.put(i, i);
         }
 
         final AtomicBoolean done = new AtomicBoolean();
@@ -267,31 +265,12 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
             @Override public void applyx() throws IgniteCheckedException {
                 Random rnd = new Random();
 
-                while (!done.get()) {
-                    switch (rnd.nextInt(5)) {
-                        case 0:
-                            c.put(rnd.nextInt(keyCnt), String.valueOf(rnd.nextInt(valCnt)));
+                int key = rnd.nextInt(keyCnt);
 
-                            break;
-                        case 1:
-                            if (evictsEnabled())
-                                c.localEvict(Arrays.asList(rnd.nextInt(keyCnt)));
-
-                            break;
-                        case 2:
-                            c.remove(rnd.nextInt(keyCnt));
-
-                            break;
-                        case 3:
-                            c.get(rnd.nextInt(keyCnt));
-
-                            break;
-                        case 4:
-                            int from = rnd.nextInt(valCnt);
+                while (!done.get()) {
+                    c.localEvict(Arrays.asList(key));
 
-                            c.query(new SqlQuery(String.class, "_val between ? and ?").setArgs(
-                                    String.valueOf(from), String.valueOf(from + 250))).getAll();
-                    }
+                    c.get(key);
                 }
             }
         }, threadCnt);
@@ -309,7 +288,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     @SuppressWarnings({"TooBroadScope"})
-    public void testMultiThreadedSwapUnswapLong() throws Exception {
+    public void _testMultiThreadedSwapUnswapLong() throws Exception {
         int threadCnt = 50;
         final int keyCnt = 2000;
         final int valCnt = 10000;
@@ -382,7 +361,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     @SuppressWarnings({"TooBroadScope"})
-    public void testMultiThreadedSwapUnswapLongString() throws Exception {
+    public void _testMultiThreadedSwapUnswapLongString() throws Exception {
         int threadCnt = 50;
         final int keyCnt = 2000;
         final int valCnt = 10000;
@@ -453,7 +432,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     @SuppressWarnings({"TooBroadScope"})
-    public void testMultiThreadedSwapUnswapObject() throws Exception {
+    public void _testMultiThreadedSwapUnswapObject() throws Exception {
         int threadCnt = 50;
         final int keyCnt = 4000;
         final int valCnt = 10000;
@@ -525,7 +504,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     @SuppressWarnings({"TooBroadScope"})
-    public void testMultiThreadedSameQuery() throws Exception {
+    public void _testMultiThreadedSameQuery() throws Exception {
         int threadCnt = 50;
         final int keyCnt = 10;
         final int logMod = 5000;
@@ -588,7 +567,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     @SuppressWarnings({"TooBroadScope"})
-    public void testMultiThreadedNewQueries() throws Exception {
+    public void _testMultiThreadedNewQueries() throws Exception {
         int threadCnt = 50;
         final int keyCnt = 10;
         final int logMod = 5000;
@@ -647,7 +626,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     @SuppressWarnings({"TooBroadScope"})
-    public void testMultiThreadedScanQuery() throws Exception {
+    public void _testMultiThreadedScanQuery() throws Exception {
         int threadCnt = 50;
         final int keyCnt = 500;
         final int logMod = 5000;


Mime
View raw message