ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [2/2] ignite git commit: IGNITE-2004 Fixed javadoc.
Date Thu, 17 Mar 2016 17:51:01 GMT
IGNITE-2004 Fixed javadoc.


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

Branch: refs/heads/ignite-2004
Commit: e2f44db8eb78188479d56ce395399c44630f81ca
Parents: 7dbf106
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Thu Mar 17 20:50:58 2016 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Thu Mar 17 20:50:58 2016 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/query/AsyncInvoke.java  | 25 --------------
 .../ignite/cache/query/CacheAsyncCallback.java  | 36 ++++++++++++++++++++
 .../ignite/cache/query/ContinuousQuery.java     |  6 ++++
 .../continuous/CacheContinuousQueryHandler.java |  6 ++--
 .../continuous/CacheContinuousQueryManager.java |  4 +--
 ...eContinuousQueryAsyncFilterListenerTest.java |  7 ++--
 ...ryFactoryAsyncFilterRandomOperationTest.java |  4 +--
 7 files changed, 52 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e2f44db8/modules/core/src/main/java/org/apache/ignite/cache/query/AsyncInvoke.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/AsyncInvoke.java b/modules/core/src/main/java/org/apache/ignite/cache/query/AsyncInvoke.java
deleted file mode 100644
index 4af61c1..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/AsyncInvoke.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.cache.query;
-
-/**
- * Marker interface.
- *
- */
-public interface AsyncInvoke {
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2f44db8/modules/core/src/main/java/org/apache/ignite/cache/query/CacheAsyncCallback.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheAsyncCallback.java
b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheAsyncCallback.java
new file mode 100644
index 0000000..a67b369
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheAsyncCallback.java
@@ -0,0 +1,36 @@
+/*
+ * 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.cache.query;
+
+import javax.cache.configuration.Factory;
+import javax.cache.event.CacheEntryEventFilter;
+import javax.cache.event.CacheEntryListener;
+import org.apache.ignite.configuration.IgniteConfiguration;
+
+/**
+ * Marker interface. If {@link CacheEntryEventFilter filter} or {@link CacheEntryListener}
+ * implementations extend this interface then they will be executing on a separate thread
pool. It allows
+ * to use cache API in a callbacks.
+ * <p>
+ * Thread pool which will be used for it can be configured by
+ * {@link IgniteConfiguration#setContinuousQueryPoolSize(int)}
+ *
+ * @see ContinuousQuery#setRemoteFilterFactory(Factory)
+ */
+public interface CacheAsyncCallback {
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2f44db8/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
b/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
index 3ea8f93..1b6c16e 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
@@ -173,6 +173,9 @@ public final class ContinuousQuery<K, V> extends Query<Cache.Entry<K,
V>> {
      * <b>WARNING:</b> all operations that involve any kind of JVM-local or distributed
locking (e.g.,
      * synchronization or transactional cache operations), should be executed asynchronously
without
      * blocking the thread that called the callback. Otherwise, you can get deadlocks.
+     * * <p>
+     * If listener implements {@link CacheAsyncCallback} marker interface then cache operations
are allowed.
+     * see {@link CacheAsyncCallback}.
      *
      * @param locLsnr Local callback.
      * @return {@code this} for chaining.
@@ -227,6 +230,9 @@ public final class ContinuousQuery<K, V> extends Query<Cache.Entry<K,
V>> {
      * <b>WARNING:</b> all operations that involve any kind of JVM-local or distributed
locking
      * (e.g., synchronization or transactional cache operations), should be executed asynchronously
      * without blocking the thread that called the filter. Otherwise, you can get deadlocks.
+     * <p>
+     * If filter implements {@link CacheAsyncCallback} marker interface then cache operations
are allowed.
+     * see {@link CacheAsyncCallback}.
      *
      * @param rmtFilterFactory Key-value filter factory.
      * @return {@code this} for chaining.

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2f44db8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index 2da1b5c..46229fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -43,7 +43,7 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
-import org.apache.ignite.cache.query.AsyncInvoke;
+import org.apache.ignite.cache.query.CacheAsyncCallback;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.events.CacheQueryExecutedEvent;
 import org.apache.ignite.events.CacheQueryReadEvent;
@@ -292,12 +292,12 @@ public class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler
 
         final CacheEntryEventFilter filter = getEventFilter();
 
-        asyncLsnr = locLsnr instanceof AsyncInvoke;
+        asyncLsnr = locLsnr instanceof CacheAsyncCallback;
 
         if (filter != null) {
             ctx.resource().injectGeneric(filter);
 
-            asyncFilter = filter instanceof AsyncInvoke
+            asyncFilter = filter instanceof CacheAsyncCallback
                 || (filter instanceof JCacheQueryRemoteFilter && ((JCacheQueryRemoteFilter)filter).async());
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2f44db8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index 1c4d1f3..089b766 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -47,7 +47,7 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
 import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.query.AsyncInvoke;
+import org.apache.ignite.cache.query.CacheAsyncCallback;
 import org.apache.ignite.cache.query.ContinuousQuery;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.internal.GridKernalContext;
@@ -1170,7 +1170,7 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter
{
          * @return {@code True} if filter should be executed in non-system thread.
          */
         protected boolean async() {
-            return impl != null && impl instanceof AsyncInvoke;
+            return impl != null && impl instanceof CacheAsyncCallback;
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2f44db8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryAsyncFilterListenerTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryAsyncFilterListenerTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryAsyncFilterListenerTest.java
index 4a4ecd5..677845f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryAsyncFilterListenerTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryAsyncFilterListenerTest.java
@@ -21,7 +21,6 @@ import java.io.Serializable;
 import java.util.concurrent.CountDownLatch;
 import javax.cache.configuration.FactoryBuilder;
 import javax.cache.event.CacheEntryEvent;
-import javax.cache.event.CacheEntryEventFilter;
 import javax.cache.event.CacheEntryListenerException;
 import javax.cache.event.CacheEntryUpdatedListener;
 import org.apache.ignite.Ignite;
@@ -32,7 +31,7 @@ import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
 import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.affinity.Affinity;
-import org.apache.ignite.cache.query.AsyncInvoke;
+import org.apache.ignite.cache.query.CacheAsyncCallback;
 import org.apache.ignite.cache.query.ContinuousQuery;
 import org.apache.ignite.cache.query.QueryCursor;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -443,7 +442,7 @@ public class CacheContinuousQueryAsyncFilterListenerTest extends GridCommonAbstr
      *
      */
     private static class CacheTestRemoteFilter implements
-        CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue>, AsyncInvoke
{
+        CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue>, CacheAsyncCallback
{
         /** */
         @IgniteInstanceResource
         private Ignite ignite;
@@ -472,7 +471,7 @@ public class CacheContinuousQueryAsyncFilterListenerTest extends GridCommonAbstr
      *
      */
     private static class CacheInvokeListener implements CacheEntryUpdatedListener<QueryTestKey,
QueryTestValue>,
-        AsyncInvoke {
+        CacheAsyncCallback {
         @IgniteInstanceResource
         private Ignite ignite;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e2f44db8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryAsyncFilterRandomOperationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryAsyncFilterRandomOperationTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryAsyncFilterRandomOperationTest.java
index 30340cb..6efa3c4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryAsyncFilterRandomOperationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryAsyncFilterRandomOperationTest.java
@@ -26,7 +26,7 @@ import javax.cache.event.CacheEntryEvent;
 import javax.cache.event.CacheEntryEventFilter;
 import javax.cache.event.CacheEntryListenerException;
 import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
-import org.apache.ignite.cache.query.AsyncInvoke;
+import org.apache.ignite.cache.query.CacheAsyncCallback;
 import org.jetbrains.annotations.NotNull;
 
 /**
@@ -44,7 +44,7 @@ public class CacheContinuousQueryFactoryAsyncFilterRandomOperationTest
      *
      */
     protected static class NonSerializableAsyncFilter implements
-        CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue>, AsyncInvoke,
Externalizable {
+        CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue>, CacheAsyncCallback,
Externalizable {
         /** */
         public NonSerializableAsyncFilter() {
             // No-op.


Mime
View raw message