ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [20/50] [abbrv] ignite git commit: IGNITE-1849 GridCacheAdapter - made size tasks @GridInternal
Date Tue, 06 Sep 2016 14:39:42 GMT
IGNITE-1849 GridCacheAdapter - made size tasks @GridInternal


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

Branch: refs/heads/ignite-1.5.31-1
Commit: a33dd1c5d680c6a3d9dd266f135f139cacd7772f
Parents: 762c43d
Author: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Authored: Wed Jul 13 05:01:02 2016 +0300
Committer: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Committed: Wed Jul 13 05:01:02 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |  2 +
 .../IgniteCacheInternalEventsIgnoreTest.java    | 53 ++++++++++++++++++++
 .../testsuites/IgniteCacheTestSuite5.java       |  2 +
 3 files changed, 57 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a33dd1c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 55bd81d..05fd7d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -6656,6 +6656,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
     /**
      * Size task.
      */
+    @GridInternal
     private static class SizeTask extends ComputeTaskAdapter<Object, Integer> {
         /** */
         private static final long serialVersionUID = 0L;
@@ -6721,6 +6722,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
     /**
      * Size task.
      */
+    @GridInternal
     private static class SizeLongTask extends ComputeTaskAdapter<Object, Long> {
         /** */
         private static final long serialVersionUID = 0L;

http://git-wip-us.apache.org/repos/asf/ignite/blob/a33dd1c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInternalEventsIgnoreTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInternalEventsIgnoreTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInternalEventsIgnoreTest.java
new file mode 100644
index 0000000..e87206d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInternalEventsIgnoreTest.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CachePeekMode;
+import org.apache.ignite.events.Event;
+import org.apache.ignite.events.EventType;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/** */
+public class IgniteCacheInternalEventsIgnoreTest extends GridCommonAbstractTest {
+    /** */
+    private static final AtomicBoolean evtFlag = new AtomicBoolean();
+
+    /** */
+    public void testInternalEventsIgnore() throws Exception {
+        Ignite ignite = startGrid(1);
+        ignite.events().localListen(new EvtLsnr(), EventType.EVT_TASK_STARTED, EventType.EVT_TASK_REDUCED,
+            EventType.EVT_TASK_FINISHED);
+        IgniteCache cache = ignite.createCache(defaultCacheConfiguration().setName("myTestCache"));
+        cache.size(CachePeekMode.ALL);
+        cache.sizeLong(CachePeekMode.ALL);
+        assertFalse(evtFlag.get());
+    }
+
+    /** */
+    private static final class EvtLsnr implements IgnitePredicate<Event> {
+        /** {@inheritDoc} */
+        @Override public boolean apply(Event e) {
+            evtFlag.set(true);
+            return true;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a33dd1c5/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
index 98a3c44..af54f91 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
@@ -21,6 +21,7 @@ import junit.framework.TestSuite;
 import org.apache.ignite.internal.processors.cache.CacheNearReaderUpdateTest;
 import org.apache.ignite.internal.processors.cache.CacheSerializableTransactionsTest;
 import org.apache.ignite.internal.processors.cache.EntryVersionConsistencyReadThroughTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheInternalEventsIgnoreTest;
 import org.apache.ignite.internal.processors.cache.IgniteCachePutStackOverflowSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheStoreCollectionTest;
 import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheTxIteratorSelfTest;
@@ -44,6 +45,7 @@ public class IgniteCacheTestSuite5 extends TestSuite {
         suite.addTestSuite(IgniteCachePutStackOverflowSelfTest.class);
         suite.addTestSuite(EntryVersionConsistencyReadThroughTest.class);
         suite.addTestSuite(IgniteCacheTxIteratorSelfTest.class);
+        suite.addTestSuite(IgniteCacheInternalEventsIgnoreTest.class);
 
         return suite;
     }


Mime
View raw message