ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [22/50] [abbrv] ignite git commit: IGNITE-4041: Ported pool processor to 1.7.3 version.
Date Wed, 26 Oct 2016 22:55:14 GMT
IGNITE-4041: Ported pool processor to 1.7.3 version.


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

Branch: refs/heads/ignite-4110
Commit: 958f16bb0ae0ebf5307029b9fafc2cd6f0df55c5
Parents: c6c198f
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Oct 24 11:26:35 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Oct 24 11:26:35 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/GridKernalContext.java      |  8 +++++++
 .../ignite/internal/GridKernalContextImpl.java  | 12 +++++++++++
 .../apache/ignite/internal/IgniteKernal.java    |  3 +++
 .../org/apache/ignite/internal/IgnitionEx.java  | 22 +++++++++++++++++++-
 .../internal/processors/pool/PoolProcessor.java |  5 +++++
 .../junits/GridTestKernalContext.java           |  1 +
 6 files changed, 50 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/958f16bb/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index e608af2..ae29223 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -70,6 +70,7 @@ import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.plugin.PluginNotFoundException;
 import org.apache.ignite.plugin.PluginProvider;
 import org.apache.ignite.thread.IgniteStripedThreadPoolExecutor;
+import org.jetbrains.annotations.Nullable;
 
 /**
  *
@@ -548,6 +549,13 @@ public interface GridKernalContext extends Iterable<GridComponent>
{
     public ExecutorService getAffinityExecutorService();
 
     /**
+     * Get indexing executor service.
+     *
+     * @return Indexing executor service.
+     */
+    @Nullable public ExecutorService getIndexingExecutorService();
+
+    /**
      * Gets exception registry.
      *
      * @return Exception registry.

http://git-wip-us.apache.org/repos/asf/ignite/blob/958f16bb/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index ddef345..94c6448 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -320,6 +320,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** */
     @GridToStringExclude
+    protected ExecutorService idxExecSvc;
+
+    /** */
+    @GridToStringExclude
     protected IgniteStripedThreadPoolExecutor callbackExecSvc;
 
     /** */
@@ -382,6 +386,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
      * @param igfsExecSvc IGFS executor service.
      * @param restExecSvc REST executor service.
      * @param affExecSvc Affinity executor service.
+     * @param idxExecSvc Indexing executor service.
      * @param plugins Plugin providers.
      * @throws IgniteCheckedException In case of error.
      */
@@ -400,6 +405,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
         ExecutorService igfsExecSvc,
         ExecutorService restExecSvc,
         ExecutorService affExecSvc,
+        @Nullable ExecutorService idxExecSvc,
         IgniteStripedThreadPoolExecutor callbackExecSvc,
         List<PluginProvider> plugins) throws IgniteCheckedException {
         assert grid != null;
@@ -418,6 +424,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
         this.igfsExecSvc = igfsExecSvc;
         this.restExecSvc = restExecSvc;
         this.affExecSvc = affExecSvc;
+        this.idxExecSvc = idxExecSvc;
         this.callbackExecSvc = callbackExecSvc;
 
         String workDir = U.workDirectory(cfg.getWorkDirectory(), cfg.getIgniteHome());
@@ -966,6 +973,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
     }
 
     /** {@inheritDoc} */
+    @Override @Nullable public ExecutorService getIndexingExecutorService() {
+        return idxExecSvc;
+    }
+
+    /** {@inheritDoc} */
     @Override public IgniteExceptionRegistry exceptionRegistry() {
         return IgniteExceptionRegistry.get();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/958f16bb/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 02f16af..9f1f01e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -668,6 +668,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
      * @param igfsExecSvc IGFS executor service.
      * @param restExecSvc Reset executor service.
      * @param affExecSvc Affinity executor service.
+     * @param idxExecSvc Indexing executor service.
      * @param errHnd Error handler to use for notification about startup problems.
      * @throws IgniteCheckedException Thrown in case of any errors.
      */
@@ -682,6 +683,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
         ExecutorService igfsExecSvc,
         ExecutorService restExecSvc,
         ExecutorService affExecSvc,
+        @Nullable ExecutorService idxExecSvc,
         IgniteStripedThreadPoolExecutor callbackExecSvc,
         GridAbsClosure errHnd)
         throws IgniteCheckedException
@@ -788,6 +790,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 igfsExecSvc,
                 restExecSvc,
                 affExecSvc,
+                idxExecSvc,
                 callbackExecSvc,
                 plugins);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/958f16bb/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index a6860b3..5b2c3fc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1480,6 +1480,9 @@ public class IgnitionEx {
         /** Affinity executor service. */
         private ThreadPoolExecutor affExecSvc;
 
+        /** Indexing pool. */
+        private ThreadPoolExecutor idxExecSvc;
+
         /** Continuous query executor service. */
         private IgniteStripedThreadPoolExecutor callbackExecSvc;
 
@@ -1747,6 +1750,19 @@ public class IgnitionEx {
 
             affExecSvc.allowCoreThreadTimeOut(true);
 
+            if (IgniteComponentType.INDEXING.inClassPath()) {
+                int cpus = Runtime.getRuntime().availableProcessors();
+
+                idxExecSvc = new IgniteThreadPoolExecutor(
+                    "idx",
+                    cfg.getGridName(),
+                    cpus,
+                    cpus * 2,
+                    3000L,
+                    new LinkedBlockingQueue<Runnable>(1000)
+                );
+            }
+
             // Register Ignite MBean for current grid instance.
             registerFactoryMbean(myCfg.getMBeanServer());
 
@@ -1759,7 +1775,7 @@ public class IgnitionEx {
                 grid = grid0;
 
                 grid0.start(myCfg, utilityCacheExecSvc, marshCacheExecSvc, execSvc, sysExecSvc,
p2pExecSvc, mgmtExecSvc,
-                    igfsExecSvc, restExecSvc, affExecSvc, callbackExecSvc,
+                    igfsExecSvc, restExecSvc, affExecSvc, idxExecSvc, callbackExecSvc,
                     new CA() {
                         @Override public void apply() {
                             startLatch.countDown();
@@ -2398,6 +2414,10 @@ public class IgnitionEx {
 
             affExecSvc = null;
 
+            U.shutdownNow(getClass(), idxExecSvc, log);
+
+            idxExecSvc = null;
+
             U.shutdownNow(getClass(), callbackExecSvc, log);
 
             callbackExecSvc = null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/958f16bb/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
index 41e805e..59e5e7d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
@@ -108,6 +108,11 @@ public class PoolProcessor extends GridProcessorAdapter {
             case GridIoPolicy.AFFINITY_POOL:
                 return ctx.getAffinityExecutorService();
 
+            case GridIoPolicy.IDX_POOL:
+                assert ctx.getIndexingExecutorService() != null : "Indexing pool is not configured.";
+
+                return ctx.getIndexingExecutorService();
+
             case GridIoPolicy.UTILITY_CACHE_POOL:
                 assert ctx.utilityCachePool() != null : "Utility cache pool is not configured.";
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/958f16bb/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
index cba67e0..f9e2ff4 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
@@ -62,6 +62,7 @@ public class GridTestKernalContext extends GridKernalContextImpl {
                 null,
                 null,
                 null,
+                null,
                 U.allPluginProviders());
 
         GridTestUtils.setFieldValue(grid(), "cfg", config());


Mime
View raw message