You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2016/03/17 18:51:00 UTC
[1/2] ignite git commit: IGNITE-2004 Updated javadoc.
Repository: ignite
Updated Branches:
refs/heads/ignite-2004 8c13516d7 -> e2f44db8e
IGNITE-2004 Updated javadoc.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7dbf106a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7dbf106a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7dbf106a
Branch: refs/heads/ignite-2004
Commit: 7dbf106aa62c7280fb645a80e6b3d7b4bb93fc78
Parents: 8c13516
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Mar 17 15:29:26 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Mar 17 15:29:26 2016 +0300
----------------------------------------------------------------------
.../configuration/IgniteConfiguration.java | 26 ++++++++++++--------
.../continuous/CacheContinuousQueryManager.java | 6 ++---
2 files changed, 19 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7dbf106a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index f34f530..abad527 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -713,7 +713,9 @@ public class IgniteConfiguration {
}
/**
- * TODO: add javadoc
+ * Size of thread pool that is in charge of processing continuous query events.
+ * <p>
+ * If not provided, executor service will have size {@link #DFLT_PUBLIC_THREAD_CNT}.
*
* @return Thread pool size to be used
*/
@@ -722,15 +724,6 @@ public class IgniteConfiguration {
}
/**
- * TODO: add javadoc
- *
- * @param conQryPoolSize
- */
- public void setContinuousQueryPoolSize(int conQryPoolSize) {
- this.conQryPoolSize = conQryPoolSize;
- }
-
- /**
* Size of thread pool that is in charge of processing internal and Visor
* {@link ComputeJob GridJobs}.
* <p>
@@ -839,6 +832,19 @@ public class IgniteConfiguration {
}
/**
+ * Sets continuous query thread pool size to use within grid.
+ *
+ * @param poolSize Thread pool size to use within grid.
+ * @return {@code this} for chaining.
+ * @see IgniteConfiguration#getContinuousQueryPoolSize()
+ */
+ public IgniteConfiguration setContinuousQueryPoolSize(int poolSize) {
+ this.conQryPoolSize = poolSize;
+
+ return this;
+ }
+
+ /**
* Sets management thread pool size to use within grid.
*
* @param poolSize Thread pool size to use within grid.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7dbf106a/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 5c81988..1c4d1f3 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
@@ -1052,7 +1052,7 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter {
try {
switch (evt.getEventType()) {
case CREATED:
- assert impl instanceof CacheEntryCreatedListener;
+ assert impl instanceof CacheEntryCreatedListener : evt;
((CacheEntryCreatedListener<K, V>)impl).onCreated(singleton(evt));
@@ -1066,14 +1066,14 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter {
break;
case REMOVED:
- assert impl instanceof CacheEntryRemovedListener;
+ assert impl instanceof CacheEntryRemovedListener : evt;
((CacheEntryRemovedListener<K, V>)impl).onRemoved(singleton(evt));
break;
case EXPIRED:
- assert impl instanceof CacheEntryExpiredListener;
+ assert impl instanceof CacheEntryExpiredListener : evt;
((CacheEntryExpiredListener<K, V>)impl).onExpired(singleton(evt));
[2/2] ignite git commit: IGNITE-2004 Fixed javadoc.
Posted by nt...@apache.org.
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 <nt...@gridgain.com>
Authored: Thu Mar 17 20:50:58 2016 +0300
Committer: nikolay_tikhonov <nt...@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.