IGNITE-160 TEMP
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/015745ad Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/015745ad Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/015745ad Branch: refs/heads/ignite-160 Commit: 015745ad314ad63e260607c5b7644afa74972213 Parents: 1244764 Author: nikolay_tikhonov <[email protected]> Authored: Fri Feb 6 14:05:08 2015 +0300 Committer: nikolay_tikhonov <[email protected]> Committed: Fri Feb 6 16:00:26 2015 +0300 ---------------------------------------------------------------------- .../HibernateL2CacheExampleNodeStartup.java | 1 - .../singlesplit/SingleSplitsLoadTest.java | 2 - .../gridify/GridifySingleSplitLoadTest.java | 2 - .../ClientAbstractMultiNodeSelfTest.java | 26 +- .../internal/TaskEventSubjectIdSelfTest.java | 2 +- .../rest/RestProcessorMultiStartSelfTest.java | 2 +- .../ignite/jdbc/JdbcComplexQuerySelfTest.java | 2 +- .../ignite/jdbc/JdbcEmptyCacheSelfTest.java | 2 +- .../ignite/jdbc/JdbcLocalCachesSelfTest.java | 2 +- .../ignite/jdbc/JdbcMetadataSelfTest.java | 2 +- .../jdbc/JdbcPreparedStatementSelfTest.java | 2 +- .../ignite/jdbc/JdbcResultSetSelfTest.java | 2 +- .../ignite/jdbc/JdbcStatementSelfTest.java | 2 +- .../ClientConnectionConfiguration.java | 53 +-- .../configuration/IgniteConfiguration.java | 345 +++---------------- .../ignite/internal/GridJobContextImpl.java | 2 +- .../ignite/internal/GridKernalContext.java | 44 +++ .../ignite/internal/GridKernalContextImpl.java | 87 ++++- .../apache/ignite/internal/IgniteKernal.java | 58 ++-- .../org/apache/ignite/internal/IgnitionEx.java | 304 ++++++---------- .../managers/communication/GridIoManager.java | 8 +- .../closure/GridClosureProcessor.java | 6 +- .../processors/fs/GridGgfsDataManager.java | 2 +- .../processors/job/GridJobProcessor.java | 2 +- .../processors/query/GridQueryProcessor.java | 2 +- .../processors/rest/GridRestProcessor.java | 2 +- .../processors/task/GridTaskProcessor.java | 4 +- .../visor/node/VisorBasicConfiguration.java | 2 +- .../node/VisorExecutorServiceConfiguration.java | 144 ++------ .../org/apache/ignite/spi/IgniteSpiAdapter.java | 2 +- .../internal/GridCancelUnusedJobSelfTest.java | 9 +- .../internal/GridDiscoveryEventSelfTest.java | 2 - .../ignite/internal/GridHomePathSelfTest.java | 4 +- .../internal/GridManagementJobSelfTest.java | 167 --------- .../ignite/internal/GridStartStopSelfTest.java | 6 - .../GridCacheDaemonNodeAbstractSelfTest.java | 2 - .../cache/GridCacheDeploymentSelfTest.java | 2 - .../cache/GridCacheLuceneQueryIndexTest.java | 1 - ...GridCacheQueueMultiNodeAbstractSelfTest.java | 20 +- ...dCacheMultithreadedFailoverAbstractTest.java | 1 - .../GridCachePreloadLifecycleAbstractTest.java | 7 +- .../GridCacheNearReaderPreloadSelfTest.java | 1 - .../dataload/GridDataLoaderPerformanceTest.java | 2 - ...heGgfsPerBlockLruEvictionPolicySelfTest.java | 2 - .../processors/fs/GridGgfsAbstractSelfTest.java | 1 - .../processors/fs/GridGgfsModesSelfTest.java | 2 - .../cache/GridCacheCommandHandlerSelfTest.java | 1 - ...tartupWithUndefinedGridGainHomeSelfTest.java | 1 - .../util/future/GridFutureAdapterSelfTest.java | 8 +- .../cache/GridCacheSingleNodeLoadTest.java | 5 +- .../multisplit/GridMultiSplitsLoadTest.java | 2 - .../GridMultiSplitsRedeployLoadTest.java | 2 - ...ridSingleSplitsNewNodesAbstractLoadTest.java | 7 +- .../GridSingleSplitsRedeployLoadTest.java | 2 - ...SessionCancelSiblingsFromFutureSelfTest.java | 9 +- ...ridSessionCancelSiblingsFromJobSelfTest.java | 9 +- ...idSessionCancelSiblingsFromTaskSelfTest.java | 9 +- ...GridSessionJobWaitTaskAttributeSelfTest.java | 9 +- .../GridSessionSetFutureAttributeSelfTest.java | 9 +- ...nSetFutureAttributeWaitListenerSelfTest.java | 9 +- .../GridSessionSetJobAttributeSelfTest.java | 9 +- ...sionSetJobAttributeWaitListenerSelfTest.java | 9 +- .../GridSessionWaitAttributeSelfTest.java | 9 +- .../spi/GridTcpSpiForwardingSelfTest.java | 1 - .../discovery/tcp/GridTcpDiscoverySelfTest.java | 2 - .../GridTcpDiscoverySnapshotHistoryTest.java | 1 - .../testframework/junits/GridAbstractTest.java | 4 +- .../junits/GridTestKernalContext.java | 21 ++ .../ignite/testframework/junits/IgniteMock.java | 2 +- .../testsuites/IgniteComputeGridTestSuite.java | 1 - .../GridHadoopExternalTaskExecutor.java | 2 +- .../fs/GridGgfsHadoopDualAbstractSelfTest.java | 1 - ...idGgfsHadoopFileSystemHandshakeSelfTest.java | 1 - ...GgfsHadoopFileSystemLoggerStateSelfTest.java | 1 - .../hadoop/GridHadoopAbstractSelfTest.java | 7 +- .../log4j/GridLog4jCorrectFileNameTest.java | 1 - .../ignite/internal/GridFactorySelfTest.java | 9 - .../GridSpringBeanSerializationSelfTest.java | 2 - .../resource/GridResourceProcessorSelfTest.java | 2 +- .../config/VisorConfigurationCommand.scala | 4 - .../scala/org/apache/ignite/visor/visor.scala | 8 +- 81 files changed, 437 insertions(+), 1087 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java index 8ebba72..9201eb1 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java @@ -54,7 +54,6 @@ public class HibernateL2CacheExampleNodeStartup { cfg.setGridName("hibernate-grid"); cfg.setLocalHost("127.0.0.1"); - cfg.setRestEnabled(false); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitsLoadTest.java ---------------------------------------------------------------------- diff --git a/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitsLoadTest.java b/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitsLoadTest.java index a2b207e..30cf64e 100644 --- a/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitsLoadTest.java +++ b/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitsLoadTest.java @@ -54,8 +54,6 @@ public class SingleSplitsLoadTest extends GridCommonAbstractTest { log.setLevel(Level.INFO); - ((ThreadPoolExecutor)cfg.getExecutorService()).prestartAllCoreThreads(); - return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/aop/src/test/java/org/apache/loadtests/gridify/GridifySingleSplitLoadTest.java ---------------------------------------------------------------------- diff --git a/modules/aop/src/test/java/org/apache/loadtests/gridify/GridifySingleSplitLoadTest.java b/modules/aop/src/test/java/org/apache/loadtests/gridify/GridifySingleSplitLoadTest.java index 5413932..cc0dc63 100644 --- a/modules/aop/src/test/java/org/apache/loadtests/gridify/GridifySingleSplitLoadTest.java +++ b/modules/aop/src/test/java/org/apache/loadtests/gridify/GridifySingleSplitLoadTest.java @@ -73,8 +73,6 @@ public class GridifySingleSplitLoadTest extends GridCommonAbstractTest { log.getLogger("org.gridgain.grid").setLevel(Level.INFO); - ((ThreadPoolExecutor)cfg.getExecutorService()).prestartAllCoreThreads(); - return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java index cfa0cc6..7fca374 100644 --- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java @@ -163,31 +163,9 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract c.setCacheConfiguration(cacheConfiguration(null), cacheConfiguration(PARTITIONED_CACHE_NAME), cacheConfiguration(REPLICATED_CACHE_NAME), cacheConfiguration(REPLICATED_ASYNC_CACHE_NAME)); - ThreadPoolExecutor exec = new ThreadPoolExecutor( - 40, - 40, - 0, - MILLISECONDS, - new LinkedBlockingQueue<Runnable>()); + c.setExecutorService(40); - exec.prestartAllCoreThreads(); - - c.setExecutorService(exec); - - c.setExecutorServiceShutdown(true); - - ThreadPoolExecutor sysExec = new ThreadPoolExecutor( - 40, - 40, - 0, - MILLISECONDS, - new LinkedBlockingQueue<Runnable>()); - - sysExec.prestartAllCoreThreads(); - - c.setSystemExecutorService(sysExec); - - c.setSystemExecutorServiceShutdown(true); + c.setSystemExecutorService(40); return c; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java index baf100b..3edccc6 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java @@ -53,7 +53,7 @@ public class TaskEventSubjectIdSelfTest extends GridCommonAbstractTest { @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java index 92d625d..aaa61c5 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java @@ -31,7 +31,7 @@ public class RestProcessorMultiStartSelfTest extends GridCommonAbstractTest { @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java index e01143e..035044d 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java @@ -68,7 +68,7 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java index daac5f8..f0d1ddb 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java @@ -64,7 +64,7 @@ public class JdbcEmptyCacheSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java index 244133f..2e26752 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java @@ -69,7 +69,7 @@ public class JdbcLocalCachesSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java index 82a5a54..9b15dc3 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java @@ -63,7 +63,7 @@ public class JdbcMetadataSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java index 5850f5a..3ea72fe 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java @@ -69,7 +69,7 @@ public class JdbcPreparedStatementSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java index 9155742..aed9bfd 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java @@ -76,7 +76,7 @@ public class JdbcResultSetSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java index 082f980..32e665a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java @@ -69,7 +69,7 @@ public class JdbcStatementSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setRestEnabled(true); + cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java index d85b036..c0ac3c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java @@ -102,11 +102,8 @@ public class ClientConnectionConfiguration { /** Folders accessible by REST. */ private String[] restAccessibleFolders; - /** REST requests executor service. */ - private ExecutorService restExecSvc; - - /** REST executor service shutdown flag. */ - private boolean restSvcShutdown = true; + /** REST requests thread pool size. */ + private int restSvcPoolSz = DFLT_REST_CORE_THREAD_CNT; /** Client message interceptor. */ private ClientMessageInterceptor clientMsgInterceptor; @@ -129,8 +126,7 @@ public class ClientConnectionConfiguration { clientMsgInterceptor = cfg.getClientMessageInterceptor(); restAccessibleFolders = cfg.getRestAccessibleFolders(); - restExecSvc = cfg.getRestExecutorService(); - restSvcShutdown = cfg.isRestExecutorServiceShutdown(); + restSvcPoolSz = cfg.getRestExecutorService(); restIdleTimeout = cfg.getRestIdleTimeout(); jettyPath = cfg.getRestJettyPath(); restPortRange = cfg.getRestPortRange(); @@ -492,55 +488,24 @@ public class ClientConnectionConfiguration { } /** - * Should return an instance of fully configured thread pool to be used for + * Should return an thread pool size to be used for * processing of client messages (REST requests). - * <p> - * If not provided, new executor service will be created using the following - * configuration: - * <ul> - * <li>Core pool size - {@link #DFLT_REST_CORE_THREAD_CNT}</li> - * <li>Max pool size - {@link #DFLT_REST_MAX_THREAD_CNT}</li> - * <li>Queue capacity - {@link #DFLT_REST_THREADPOOL_QUEUE_CAP}</li> - * </ul> * * @return Thread pool implementation to be used for processing of client * messages. */ - public ExecutorService getRestExecutorService() { - return restExecSvc; + public int getRestExecutorService() { + return restSvcPoolSz; } /** * Sets thread pool to use for processing of client messages (REST requests). * * @param restExecSvc Thread pool to use for processing of client messages. - * @see IgniteConfiguration#getRestExecutorService() - */ - public void setRestExecutorService(ExecutorService restExecSvc) { - this.restExecSvc = restExecSvc; - } - - /** - * Sets REST executor service shutdown flag. - * - * @param restSvcShutdown REST executor service shutdown flag. - * @see IgniteConfiguration#getRestExecutorService() - */ - public void setRestExecutorServiceShutdown(boolean restSvcShutdown) { - this.restSvcShutdown = restSvcShutdown; - } - - /** - * Shutdown flag for REST executor service. - * <p> - * If not provided, default value {@code true} will be used which will shutdown - * executor service when GridGain stops regardless whether it was started before GridGain - * or by GridGain. - * - * @return REST executor service shutdown flag. + * @see #getRestExecutorService() */ - public boolean isRestExecutorServiceShutdown() { - return restSvcShutdown; + public void setRestExecutorService(int restExecSvc) { + this.restSvcPoolSz = restExecSvc; } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/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 a38cba8..5be5da0 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 @@ -34,12 +34,8 @@ import org.apache.ignite.portables.*; import org.apache.ignite.spi.authentication.*; import org.apache.ignite.spi.indexing.*; import org.apache.ignite.streamer.*; -import org.apache.ignite.client.ssl.*; -import org.apache.ignite.internal.managers.eventstorage.*; import org.apache.ignite.plugin.security.*; import org.apache.ignite.plugin.segmentation.*; -import org.apache.ignite.portables.*; -import org.apache.ignite.spi.authentication.*; import org.apache.ignite.spi.checkpoint.*; import org.apache.ignite.spi.collision.*; import org.apache.ignite.spi.communication.*; @@ -47,12 +43,9 @@ import org.apache.ignite.spi.deployment.*; import org.apache.ignite.spi.discovery.*; import org.apache.ignite.spi.eventstorage.*; import org.apache.ignite.spi.failover.*; -import org.apache.ignite.spi.indexing.*; import org.apache.ignite.spi.loadbalancing.*; import org.apache.ignite.spi.securesession.*; import org.apache.ignite.spi.swapspace.*; -import org.apache.ignite.internal.util.typedef.internal.*; -import org.apache.ignite.streamer.*; import javax.management.*; import java.lang.management.*; @@ -140,7 +133,10 @@ public class IgniteConfiguration { public static final int DFLT_TIME_SERVER_PORT_RANGE = 100; /** Default core size of public thread pool. */ - public static final int DFLT_PUBLIC_CORE_THREAD_CNT = Math.max(8, Runtime.getRuntime().availableProcessors()) * 2; + public static final int AVAILABLE_PROC_CNT = Runtime.getRuntime().availableProcessors(); + + /** Default core size of public thread pool. */ + public static final int DFLT_PUBLIC_CORE_THREAD_CNT = Math.max(8, AVAILABLE_PROC_CNT) * 2; /** Default max size of public thread pool. */ public static final int DFLT_PUBLIC_MAX_THREAD_CNT = DFLT_PUBLIC_CORE_THREAD_CNT; @@ -229,44 +225,23 @@ public class IgniteConfiguration { /** Logger. */ private IgniteLogger log; - /** Executor service. */ - private ExecutorService execSvc; - - /** Executor service. */ - private ExecutorService sysSvc; - - /** Management executor service. */ - private ExecutorService mgmtSvc; - - /** GGFS executor service. */ - private ExecutorService ggfsSvc; - - /** REST requests executor service. */ - private ExecutorService restExecSvc; - - /** Peer class loading executor service shutdown flag. */ - private boolean p2pSvcShutdown = true; - - /** Executor service shutdown flag. */ - private boolean execSvcShutdown = true; + /** Public pool size. */ + private int pubPoolSz = DFLT_PUBLIC_CORE_THREAD_CNT; - /** System executor service shutdown flag. */ - private boolean sysSvcShutdown = true; + /** System pool size. */ + private int sysPoolSz = DFLT_SYSTEM_CORE_THREAD_CNT; - /** Management executor service shutdown flag. */ - private boolean mgmtSvcShutdown = true; + /** Management pool size. */ + private int mgmtPoolSz = DFLT_MGMT_THREAD_CNT; - /** GGFS executor service shutdown flag. */ - private boolean ggfsSvcShutdown = true; - - /** REST executor service shutdown flag. */ - private boolean restSvcShutdown = true; + /** GGFS pool size. */ + private int ggfsPoolSz = AVAILABLE_PROC_CNT; /** Lifecycle email notification. */ private boolean lifeCycleEmailNtf = true; - /** Executor service. */ - private ExecutorService p2pSvc; + /** P2P pool size. */ + private int p2pPoolSz = DFLT_P2P_THREAD_CNT; /** Gridgain installation folder. */ private String ggHome; @@ -292,9 +267,6 @@ public class IgniteConfiguration { /** Jetty XML configuration path. */ private String jettyPath; - /** {@code REST} flag. */ - private boolean restEnabled = true; - /** Whether or not peer class loading is enabled. */ private boolean p2pEnabled = DFLT_P2P_ENABLED; @@ -580,14 +552,12 @@ public class IgniteConfiguration { clockSyncSamples = cfg.getClockSyncSamples(); deployMode = cfg.getDeploymentMode(); discoStartupDelay = cfg.getDiscoveryStartupDelay(); - execSvc = cfg.getExecutorService(); - execSvcShutdown = cfg.getExecutorServiceShutdown(); - ggHome = cfg.getGridGainHome(); + pubPoolSz = cfg.getExecutorService(); + ggHome = cfg.getIgniteHome(); ggWork = cfg.getWorkDirectory(); gridName = cfg.getGridName(); ggfsCfg = cfg.getGgfsConfiguration(); - ggfsSvc = cfg.getGgfsExecutorService(); - ggfsSvcShutdown = cfg.getGgfsExecutorServiceShutdown(); + ggfsPoolSz = cfg.getGgfsExecutorService(); hadoopCfg = cfg.getHadoopConfiguration(); inclEvtTypes = cfg.getIncludeEventTypes(); includeProps = cfg.getIncludeProperties(); @@ -605,20 +575,17 @@ public class IgniteConfiguration { metricsExpTime = cfg.getMetricsExpireTime(); metricsLogFreq = cfg.getMetricsLogFrequency(); metricsUpdateFreq = cfg.getMetricsUpdateFrequency(); - mgmtSvc = cfg.getManagementExecutorService(); - mgmtSvcShutdown = cfg.getManagementExecutorServiceShutdown(); + mgmtPoolSz = cfg.getManagementExecutorService(); netTimeout = cfg.getNetworkTimeout(); nodeId = cfg.getNodeId(); p2pEnabled = cfg.isPeerClassLoadingEnabled(); p2pLocClsPathExcl = cfg.getPeerClassLoadingLocalClassPathExclude(); p2pMissedCacheSize = cfg.getPeerClassLoadingMissedResourcesCacheSize(); - p2pSvc = cfg.getPeerClassLoadingExecutorService(); - p2pSvcShutdown = cfg.getPeerClassLoadingExecutorServiceShutdown(); + p2pPoolSz = cfg.getPeerClassLoadingExecutorService(); pluginCfgs = cfg.getPluginConfigurations(); portableCfg = cfg.getPortableConfiguration(); qryCfg = cfg.getQueryConfiguration(); restAccessibleFolders = cfg.getRestAccessibleFolders(); - restEnabled = cfg.isRestEnabled(); restIdleTimeout = cfg.getRestIdleTimeout(); restPortRange = cfg.getRestPortRange(); restSecretKey = cfg.getRestSecretKey(); @@ -633,8 +600,6 @@ public class IgniteConfiguration { restTcpSslCtxFactory = cfg.getRestTcpSslContextFactory(); restTcpSslEnabled = cfg.isRestTcpSslEnabled(); restTcpSslClientAuth = cfg.isRestTcpSslClientAuth(); - restExecSvc = cfg.getRestExecutorService(); - restSvcShutdown = cfg.getRestExecutorServiceShutdown(); securityCred = cfg.getSecurityCredentialsProvider(); segChkFreq = cfg.getSegmentCheckFrequency(); segPlc = cfg.getSegmentationPolicy(); @@ -650,8 +615,7 @@ public class IgniteConfiguration { smtpSsl = cfg.isSmtpSsl(); smtpStartTls = cfg.isSmtpStartTls(); streamerCfg = cfg.getStreamerConfiguration(); - sysSvc = cfg.getSystemExecutorService(); - sysSvcShutdown = cfg.getSystemExecutorServiceShutdown(); + sysPoolSz = cfg.getSystemExecutorService(); timeSrvPortBase = cfg.getTimeServerPortBase(); timeSrvPortRange = cfg.getTimeServerPortRange(); txCfg = cfg.getTransactionsConfiguration(); @@ -1112,8 +1076,8 @@ public class IgniteConfiguration { * @return Thread pool implementation to be used in grid to process job execution * requests and user messages sent to the node. */ - public ExecutorService getExecutorService() { - return execSvc; + public int getExecutorService() { + return pubPoolSz; } /** @@ -1128,8 +1092,8 @@ public class IgniteConfiguration { * * @return Thread pool implementation to be used in grid for internal system messages. */ - public ExecutorService getSystemExecutorService() { - return sysSvc; + public int getSystemExecutorService() { + return sysPoolSz; } /** @@ -1146,8 +1110,8 @@ public class IgniteConfiguration { * @return Thread pool implementation to be used in grid for internal and Visor * jobs processing. */ - public ExecutorService getManagementExecutorService() { - return mgmtSvc; + public int getManagementExecutorService() { + return mgmtPoolSz; } /** @@ -1166,8 +1130,8 @@ public class IgniteConfiguration { * @return Thread pool implementation to be used for peer class loading * requests handling. */ - public ExecutorService getPeerClassLoadingExecutorService() { - return p2pSvc; + public int getPeerClassLoadingExecutorService() { + return p2pPoolSz; } /** @@ -1183,172 +1147,58 @@ public class IgniteConfiguration { * * @return Thread pool implementation to be used for GGFS outgoing message sending. */ - public ExecutorService getGgfsExecutorService() { - return ggfsSvc; - } - - /** - * Shutdown flag for executor service. - * <p> - * If not provided, default value {@code true} will be used which will shutdown - * executor service when GridGain stops regardless of whether it was started before - * GridGain or by GridGain. - * - * @return Executor service shutdown flag. - */ - public boolean getExecutorServiceShutdown() { - return execSvcShutdown; - } - - /** - * Shutdown flag for system executor service. - * <p> - * If not provided, default value {@code true} will be used which will shutdown - * executor service when GridGain stops regardless of whether it was started before - * GridGain or by GridGain. - * - * @return System executor service shutdown flag. - */ - public boolean getSystemExecutorServiceShutdown() { - return sysSvcShutdown; + public int getGgfsExecutorService() { + return ggfsPoolSz; } /** - * Shutdown flag for management executor service. - * <p> - * If not provided, default value {@code true} will be used which will shutdown - * executor service when GridGain stops regardless of whether it was started before - * GridGain or by GridGain. - * - * @return Management executor service shutdown flag. - */ - public boolean getManagementExecutorServiceShutdown() { - return mgmtSvcShutdown; - } - - /** - * Should return flag of peer class loading executor service shutdown when the grid stops. - * <p> - * If not provided, default value {@code true} will be used which means - * that when grid will be stopped it will shut down peer class loading executor service. + * Sets thread pool size to use within grid. * - * @return Peer class loading executor service shutdown flag. - */ - public boolean getPeerClassLoadingExecutorServiceShutdown() { - return p2pSvcShutdown; - } - - /** - * Shutdown flag for GGFS executor service. - * <p> - * If not provided, default value {@code true} will be used which will shutdown - * executor service when GridGain stops regardless whether it was started before GridGain - * or by GridGain. - * - * @return GGFS executor service shutdown flag. - */ - public boolean getGgfsExecutorServiceShutdown() { - return ggfsSvcShutdown; - } - - /** - * Sets thread pool to use within grid. - * - * @param execSvc Thread pool to use within grid. + * @param poolSz Thread pool size to use within grid. * @see IgniteConfiguration#getExecutorService() */ - public void setExecutorService(ExecutorService execSvc) { - this.execSvc = execSvc; - } - - /** - * Sets executor service shutdown flag. - * - * @param execSvcShutdown Executor service shutdown flag. - * @see IgniteConfiguration#getExecutorServiceShutdown() - */ - public void setExecutorServiceShutdown(boolean execSvcShutdown) { - this.execSvcShutdown = execSvcShutdown; + public void setExecutorService(int poolSz) { + this.pubPoolSz = poolSz; } /** - * Sets system thread pool to use within grid. + * Sets system thread pool size to use within grid. * - * @param sysSvc Thread pool to use within grid. + * @param poolSz Thread pool size to use within grid. * @see IgniteConfiguration#getSystemExecutorService() */ - public void setSystemExecutorService(ExecutorService sysSvc) { - this.sysSvc = sysSvc; + public void setSystemExecutorService(int poolSz) { + this.sysPoolSz = poolSz; } /** - * Sets system executor service shutdown flag. + * Sets management thread pool size to use within grid. * - * @param sysSvcShutdown System executor service shutdown flag. - * @see IgniteConfiguration#getSystemExecutorServiceShutdown() - */ - public void setSystemExecutorServiceShutdown(boolean sysSvcShutdown) { - this.sysSvcShutdown = sysSvcShutdown; - } - - /** - * Sets management thread pool to use within grid. - * - * @param mgmtSvc Thread pool to use within grid. + * @param poolSz Thread pool size to use within grid. * @see IgniteConfiguration#getManagementExecutorService() */ - public void setManagementExecutorService(ExecutorService mgmtSvc) { - this.mgmtSvc = mgmtSvc; + public void setManagementExecutorService(int poolSz) { + this.mgmtPoolSz = poolSz; } /** - * Sets management executor service shutdown flag. + * Sets thread pool size to use for peer class loading. * - * @param mgmtSvcShutdown Management executor service shutdown flag. - * @see IgniteConfiguration#getManagementExecutorServiceShutdown() - */ - public void setManagementExecutorServiceShutdown(boolean mgmtSvcShutdown) { - this.mgmtSvcShutdown = mgmtSvcShutdown; - } - - /** - * Sets thread pool to use for peer class loading. - * - * @param p2pSvc Thread pool to use within grid. + * @param poolSz Thread pool size to use within grid. * @see IgniteConfiguration#getPeerClassLoadingExecutorService() */ - public void setPeerClassLoadingExecutorService(ExecutorService p2pSvc) { - this.p2pSvc = p2pSvc; - } - - /** - * Sets peer class loading executor service shutdown flag. - * - * @param p2pSvcShutdown Peer class loading executor service shutdown flag. - * @see IgniteConfiguration#getPeerClassLoadingExecutorServiceShutdown() - */ - public void setPeerClassLoadingExecutorServiceShutdown(boolean p2pSvcShutdown) { - this.p2pSvcShutdown = p2pSvcShutdown; - } - - /** - * Set executor service that will be used to process outgoing GGFS messages. - * - * @param ggfsSvc Executor service to use for outgoing GGFS messages. - * @see IgniteConfiguration#getGgfsExecutorService() - */ - public void setGgfsExecutorService(ExecutorService ggfsSvc) { - this.ggfsSvc = ggfsSvc; + public void setPeerClassLoadingExecutorService(int poolSz) { + this.p2pPoolSz = poolSz; } /** - * Sets GGFS executor service shutdown flag. + * Set thread pool size that will be used to process outgoing GGFS messages. * - * @param ggfsSvcShutdown GGFS executor service shutdown flag. + * @param poolSz Executor service to use for outgoing GGFS messages. * @see IgniteConfiguration#getGgfsExecutorService() */ - public void setGgfsExecutorServiceShutdown(boolean ggfsSvcShutdown) { - this.ggfsSvcShutdown = ggfsSvcShutdown; + public void setGgfsExecutorService(int poolSz) { + this.ggfsPoolSz = poolSz; } /** @@ -1361,7 +1211,7 @@ public class IgniteConfiguration { * infer it automatically. * @see org.apache.ignite.IgniteSystemProperties#IGNITE_HOME */ - public String getGridGainHome() { + public String getIgniteHome() { return ggHome; } @@ -1369,22 +1219,22 @@ public class IgniteConfiguration { * Sets GridGain installation folder. * * @param ggHome {@code GridGain} installation folder. - * @see IgniteConfiguration#getGridGainHome() + * @see IgniteConfiguration#getIgniteHome() * @see org.apache.ignite.IgniteSystemProperties#IGNITE_HOME */ - public void setGridGainHome(String ggHome) { + public void setIgniteHome(String ggHome) { this.ggHome = ggHome; } /** * Gets GridGain work folder. If not provided, the method will use work folder under - * {@code IGNITE_HOME} specified by {@link IgniteConfiguration#setGridGainHome(String)} or + * {@code IGNITE_HOME} specified by {@link IgniteConfiguration#setIgniteHome(String)} or * {@code IGNITE_HOME} environment variable or system property. * <p> * If {@code IGNITE_HOME} is not provided, then system temp folder is used. * * @return GridGain work folder or {@code null} to make the system attempt to infer it automatically. - * @see IgniteConfiguration#getGridGainHome() + * @see IgniteConfiguration#getIgniteHome() * @see org.apache.ignite.IgniteSystemProperties#IGNITE_HOME */ public String getWorkDirectory() { @@ -2352,31 +2202,6 @@ public class IgniteConfiguration { } /** - * Sets flag indicating whether external {@code REST} access is enabled or not. - * - * @param restEnabled Flag indicating whether external {@code REST} access is enabled or not. - * @deprecated Use {@link ClientConnectionConfiguration}. - */ - @Deprecated - public void setRestEnabled(boolean restEnabled) { - this.restEnabled = restEnabled; - } - - /** - * Gets flag indicating whether external {@code REST} access is enabled or not. By default, - * external {@code REST} access is turned on. - * - * @return Flag indicating whether external {@code REST} access is enabled or not. - * @see org.apache.ignite.IgniteSystemProperties#IGNITE_JETTY_HOST - * @see org.apache.ignite.IgniteSystemProperties#IGNITE_JETTY_PORT - * @deprecated Use {@link ClientConnectionConfiguration}. - */ - @Deprecated - public boolean isRestEnabled() { - return restEnabled; - } - - /** * Gets host for TCP binary protocol server. This can be either an * IP address or a domain name. * <p> @@ -2728,66 +2553,6 @@ public class IgniteConfiguration { } /** - * Should return an instance of fully configured thread pool to be used for - * processing of client messages (REST requests). - * <p> - * If not provided, new executor service will be created using the following - * configuration: - * <ul> - * <li>Core pool size - {@link #DFLT_REST_CORE_THREAD_CNT}</li> - * <li>Max pool size - {@link #DFLT_REST_MAX_THREAD_CNT}</li> - * <li>Queue capacity - {@link #DFLT_REST_THREADPOOL_QUEUE_CAP}</li> - * </ul> - * - * @return Thread pool implementation to be used for processing of client - * messages. - * @deprecated Use {@link ClientConnectionConfiguration#getRestExecutorService()}. - */ - @Deprecated - public ExecutorService getRestExecutorService() { - return restExecSvc; - } - - /** - * Sets thread pool to use for processing of client messages (REST requests). - * - * @param restExecSvc Thread pool to use for processing of client messages. - * @see IgniteConfiguration#getRestExecutorService() - * @deprecated Use {@link ClientConnectionConfiguration#setRestExecutorService(ExecutorService)}. - */ - @Deprecated - public void setRestExecutorService(ExecutorService restExecSvc) { - this.restExecSvc = restExecSvc; - } - - /** - * Sets REST executor service shutdown flag. - * - * @param restSvcShutdown REST executor service shutdown flag. - * @see IgniteConfiguration#getRestExecutorService() - * @deprecated Use {@link ClientConnectionConfiguration#setRestExecutorServiceShutdown(boolean)}. - */ - @Deprecated - public void setRestExecutorServiceShutdown(boolean restSvcShutdown) { - this.restSvcShutdown = restSvcShutdown; - } - - /** - * Shutdown flag for REST executor service. - * <p> - * If not provided, default value {@code true} will be used which will shutdown - * executor service when GridGain stops regardless whether it was started before GridGain - * or by GridGain. - * - * @return REST executor service shutdown flag. - * @deprecated Use {@link ClientConnectionConfiguration#isRestExecutorServiceShutdown()}. - */ - @Deprecated - public boolean getRestExecutorServiceShutdown() { - return restSvcShutdown; - } - - /** * Sets system-wide local address or host for all GridGain components to bind to. If provided it will * override all default local bind settings within GridGain or any of its SPIs. * http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java index 433364e..3dbc2e9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java @@ -192,7 +192,7 @@ public class GridJobContextImpl implements ComputeJobContext, Externalizable { @Override public void onTimeout() { try { ExecutorService execSvc = job.isInternal() ? - ctx.config().getManagementExecutorService() : ctx.config().getExecutorService(); + ctx.getManagementExecutorService() : ctx.getExecutorService(); assert execSvc != null; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/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 aba6f75..e2c93b1 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 @@ -512,4 +512,48 @@ public interface GridKernalContext extends Iterable<GridComponent> { * @return Message type code. */ public byte registerMessageProducer(GridTcpCommunicationMessageProducer producer); + + /** + * @return Thread pool implementation to be used in grid to process job execution + * requests and user messages sent to the node. + */ + public ExecutorService getExecutorService(); + + /** + * Executor service that is in charge of processing internal system messages. + * + * @return Thread pool implementation to be used in grid for internal system messages. + */ + public ExecutorService getSystemExecutorService(); + + /** + * Executor service that is in charge of processing internal and Visor + * {@link org.apache.ignite.compute.ComputeJob GridJobs}. + * + * @return Thread pool implementation to be used in grid for internal and Visor + * jobs processing. + */ + public ExecutorService getManagementExecutorService(); + + /** + * @return Thread pool implementation to be used for peer class loading + * requests handling. + */ + public ExecutorService getPeerClassLoadingExecutorService(); + + /** + * Executor service that is in charge of processing outgoing GGFS messages. + * + * @return Thread pool implementation to be used for GGFS outgoing message sending. + */ + public ExecutorService getGgfsExecutorService(); + + /** + * Should return an instance of fully configured thread pool to be used for + * processing of client messages (REST requests). + * + * @return Thread pool implementation to be used for processing of client + * messages. + */ + public ExecutorService getRestExecutorService(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/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 7e32d92..b6bb7d2 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 @@ -266,6 +266,31 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable private List<GridComponent> comps = new LinkedList<>(); /** */ + @GridToStringExclude + protected ExecutorService execSvc; + + /** */ + @GridToStringExclude + protected ExecutorService sysExecSvc; + + /** */ + @GridToStringExclude + private ExecutorService p2pExecSvc; + + /** */ + @GridToStringExclude + private ExecutorService mgmtExecSvc; + + /** */ + @GridToStringExclude + private ExecutorService ggfsExecSvc; + + /** */ + @GridToStringExclude + protected ExecutorService restExecSvc; + + + /** */ private IgniteEx grid; /** */ @@ -311,19 +336,32 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable /** * Creates new kernal context. * - * @param log Logger. - * @param grid Grid instance managed by kernal. - * @param cfg Grid configuration. - * @param gw Kernal gateway. - * @param utilityCachePool Utility cache pool. - * @param ent Release enterprise flag. + * @param log Logger. + * @param grid Grid instance managed by kernal. + * @param cfg Grid configuration. + * @param gw Kernal gateway. + * @param utilityCachePool Utility cache pool. + * @param execSvc Public executor service. + * @param sysExecSvc System executor service. + * @param p2pExecSvc P2P executor service. + * @param mgmtExecSvc Management executor service. + * @param ggfsExecSvc GGFS executor service. + * @param restExecSvc REST executor service. + * @param ent Release enterprise flag. */ @SuppressWarnings("TypeMayBeWeakened") - protected GridKernalContextImpl(GridLoggerProxy log, + protected GridKernalContextImpl( + GridLoggerProxy log, IgniteEx grid, IgniteConfiguration cfg, GridKernalGateway gw, ExecutorService utilityCachePool, + ExecutorService execSvc, + ExecutorService sysExecSvc, + ExecutorService p2pExecSvc, + ExecutorService mgmtExecSvc, + ExecutorService ggfsExecSvc, + ExecutorService restExecSvc, boolean ent) { assert grid != null; assert cfg != null; @@ -334,6 +372,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable this.gw = gw; this.ent = ent; this.utilityCachePool = utilityCachePool; + this.execSvc = execSvc; + this.sysExecSvc = sysExecSvc; + this.p2pExecSvc = p2pExecSvc; + this.mgmtExecSvc = mgmtExecSvc; + this.ggfsExecSvc = ggfsExecSvc; try { spring = SPRING.create(false); @@ -899,6 +942,36 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable } /** {@inheritDoc} */ + @Override public ExecutorService getExecutorService() { + return execSvc; + } + + /** {@inheritDoc} */ + @Override public ExecutorService getSystemExecutorService() { + return sysExecSvc; + } + + /** {@inheritDoc} */ + @Override public ExecutorService getManagementExecutorService() { + return mgmtExecSvc; + } + + /** {@inheritDoc} */ + @Override public ExecutorService getPeerClassLoadingExecutorService() { + return p2pExecSvc; + } + + /** {@inheritDoc} */ + @Override public ExecutorService getGgfsExecutorService() { + return ggfsExecSvc; + } + + /** {@inheritDoc} */ + @Override public ExecutorService getRestExecutorService() { + return restExecSvc; + } + + /** {@inheritDoc} */ @Override public String toString() { return S.toString(GridKernalContextImpl.class, this); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/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 2b0d014..2df65d6 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 @@ -433,14 +433,14 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit @Override public String getExecutorServiceFormatted() { assert cfg != null; - return cfg.getExecutorService().toString(); + return String.valueOf(cfg.getExecutorService()); } /** {@inheritDoc} */ @Override public String getGridGainHome() { assert cfg != null; - return cfg.getGridGainHome(); + return cfg.getIgniteHome(); } /** {@inheritDoc} */ @@ -553,11 +553,17 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit /** * @param cfg Grid configuration to use. * @param utilityCachePool Utility cache pool. - * @param errHnd Error handler to use for notification about startup problems. - * @throws IgniteCheckedException Thrown in case of any errors. + * @param execSvc + *@param sysExecSvc + * @param p2pExecSvc + * @param mgmtExecSvc + * @param ggfsExecSvc + * @param errHnd Error handler to use for notification about startup problems. @throws IgniteCheckedException Thrown in case of any errors. */ @SuppressWarnings({"CatchGenericClass", "unchecked"}) - public void start(final IgniteConfiguration cfg, ExecutorService utilityCachePool, GridAbsClosure errHnd) + public void start(final IgniteConfiguration cfg, ExecutorService utilityCachePool, final ExecutorService execSvc, + final ExecutorService sysExecSvc, ExecutorService p2pExecSvc, ExecutorService mgmtExecSvc, + ExecutorService ggfsExecSvc, ExecutorService restExecSvc, GridAbsClosure errHnd) throws IgniteCheckedException { gw.compareAndSet(null, new GridKernalGatewayImpl(cfg.getGridName())); @@ -624,7 +630,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit ackP2pConfiguration(); // Run background network diagnostics. - GridDiagnostic.runBackgroundCheck(gridName, cfg.getExecutorService(), log); + GridDiagnostic.runBackgroundCheck(gridName, execSvc, log); boolean notifyEnabled = IgniteSystemProperties.getBoolean(IGNITE_UPDATE_NOTIFIER, true); @@ -634,7 +640,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit try { verChecker0 = new GridUpdateNotifier(gridName, VER, SITE, gw, false); - verChecker0.checkForNewVersion(cfg.getExecutorService(), log); + verChecker0.checkForNewVersion(execSvc, log); } catch (IgniteCheckedException e) { if (log.isDebugEnabled()) @@ -645,8 +651,8 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit final GridUpdateNotifier verChecker = verChecker0; // Ack 3-rd party licenses location. - if (log.isInfoEnabled() && cfg.getGridGainHome() != null) - log.info("3-rd party licenses can be found at: " + cfg.getGridGainHome() + File.separatorChar + "libs" + + if (log.isInfoEnabled() && cfg.getIgniteHome() != null) + log.info("3-rd party licenses can be found at: " + cfg.getIgniteHome() + File.separatorChar + "libs" + File.separatorChar + "licenses"); // Check that user attributes are not conflicting @@ -667,7 +673,8 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit // Spin out SPIs & managers. try { GridKernalContextImpl ctx = - new GridKernalContextImpl(log, this, cfg, gw, utilityCachePool, ENT); + new GridKernalContextImpl(log, this, cfg, gw, utilityCachePool, execSvc, sysExecSvc, p2pExecSvc, + mgmtExecSvc, ggfsExecSvc, restExecSvc, ENT); nodeLoc = new ClusterNodeLocalMapImpl(ctx); @@ -821,7 +828,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit // Register MBeans. registerKernalMBean(); registerLocalNodeMBean(); - registerExecutorMBeans(); + registerExecutorMBeans(execSvc, sysExecSvc, p2pExecSvc, mgmtExecSvc, restExecSvc); // Lifecycle bean notifications. notifyLifecycleBeans(AFTER_GRID_START); @@ -866,7 +873,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit @Override public void safeRun() throws InterruptedException { verChecker.topologySize(nodes().size()); - verChecker.checkForNewVersion(cfg.getExecutorService(), log); + verChecker.checkForNewVersion(execSvc, log); // Just wait for 10 secs. Thread.sleep(PERIODIC_VER_CHECK_CONN_TIMEOUT); @@ -893,7 +900,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit private long lastCompletedCnt; @Override protected void safeRun() { - ExecutorService e = cfg.getExecutorService(); + ExecutorService e = execSvc; if (!(e instanceof ThreadPoolExecutor)) return; @@ -1003,7 +1010,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit int pubPoolIdleThreads = 0; int pubPoolQSize = 0; - ExecutorService pubExec = cfg.getExecutorService(); + ExecutorService pubExec = execSvc; if (pubExec instanceof ThreadPoolExecutor) { ThreadPoolExecutor exec = (ThreadPoolExecutor)pubExec; @@ -1019,7 +1026,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit int sysPoolIdleThreads = 0; int sysPoolQSize = 0; - ExecutorService sysExec = cfg.getSystemExecutorService(); + ExecutorService sysExec = sysExecSvc; if (sysExec instanceof ThreadPoolExecutor) { ThreadPoolExecutor exec = (ThreadPoolExecutor)sysExec; @@ -1479,18 +1486,15 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit } /** @throws IgniteCheckedException If registration failed. */ - private void registerExecutorMBeans() throws IgniteCheckedException { - pubExecSvcMBean = registerExecutorMBean(cfg.getExecutorService(), "GridExecutionExecutor"); - sysExecSvcMBean = registerExecutorMBean(cfg.getSystemExecutorService(), "GridSystemExecutor"); - mgmtExecSvcMBean = registerExecutorMBean(cfg.getManagementExecutorService(), "GridManagementExecutor"); - p2PExecSvcMBean = registerExecutorMBean(cfg.getPeerClassLoadingExecutorService(), "GridClassLoadingExecutor"); + private void registerExecutorMBeans(ExecutorService execSvc, ExecutorService sysExecSvc, ExecutorService p2pExecSvc, + ExecutorService mgmtExecSvc, ExecutorService restExecSvc) throws IgniteCheckedException { + pubExecSvcMBean = registerExecutorMBean(execSvc, "GridExecutionExecutor"); + sysExecSvcMBean = registerExecutorMBean(sysExecSvc, "GridSystemExecutor"); + mgmtExecSvcMBean = registerExecutorMBean(mgmtExecSvc, "GridManagementExecutor"); + p2PExecSvcMBean = registerExecutorMBean(p2pExecSvc, "GridClassLoadingExecutor"); - ClientConnectionConfiguration clientCfg = cfg.getClientConnectionConfiguration(); - - if (clientCfg != null) { - restExecSvcMBean = clientCfg.getRestExecutorService() != null ? - registerExecutorMBean(clientCfg.getRestExecutorService(), "GridRestExecutor") : null; - } + if (restExecSvc != null) + registerExecutorMBean(restExecSvc, "GridRestExecutor"); } /** @@ -2401,7 +2405,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx, Ignit // Ack IGNITE_HOME and VM arguments. if (log.isInfoEnabled()) { - log.info("IGNITE_HOME=" + cfg.getGridGainHome()); + log.info("IGNITE_HOME=" + cfg.getIgniteHome()); log.info("VM arguments: " + rtBean.getInputArguments()); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/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 3efb2aa..c0a228f 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 @@ -1160,57 +1160,21 @@ public class IgnitionEx { /** Executor service. */ private ExecutorService execSvc; - /** Auto executor service flag. */ - private boolean isAutoExecSvc; - - /** Executor service shutdown flag. */ - private boolean execSvcShutdown; - /** System executor service. */ private ExecutorService sysExecSvc; - /** Auto system service flag. */ - private boolean isAutoSysSvc; - - /** System executor service shutdown flag. */ - private boolean sysSvcShutdown; - /** Management executor service. */ private ExecutorService mgmtExecSvc; - /** Auto management service flag. */ - private boolean isAutoMgmtSvc; - - /** Management executor service shutdown flag. */ - private boolean mgmtSvcShutdown; - /** P2P executor service. */ private ExecutorService p2pExecSvc; - /** Auto P2P service flag. */ - private boolean isAutoP2PSvc; - - /** P2P executor service shutdown flag. */ - private boolean p2pSvcShutdown; - /** GGFS executor service. */ private ExecutorService ggfsExecSvc; - /** Auto GGFS service flag. */ - private boolean isAutoGgfsSvc; - - /** GGFS executor service shutdown flag. */ - private boolean ggfsSvcShutdown; - /** REST requests executor service. */ private ExecutorService restExecSvc; - /** Auto REST service flag. */ - private boolean isAutoRestSvc; - - /** REST executor service shutdown flag. */ - private boolean restSvcShutdown; - /** Utility cache executor service. */ private ExecutorService utilityCacheExecSvc; @@ -1351,7 +1315,7 @@ public class IgnitionEx { IgniteConfiguration myCfg = new IgniteConfiguration(); - String ggHome = cfg.getGridGainHome(); + String ggHome = cfg.getIgniteHome(); // Set GridGain home. if (ggHome == null) @@ -1399,7 +1363,7 @@ public class IgnitionEx { throw new IgniteCheckedException("Invalid GridGain installation home folder: " + ggHome); } - myCfg.setGridGainHome(ggHome); + myCfg.setIgniteHome(ggHome); // Copy values that don't need extra processing. myCfg.setLicenseUrl(cfg.getLicenseUrl()); @@ -1430,38 +1394,6 @@ public class IgnitionEx { myCfg.setQueryConfiguration(cfg.getQueryConfiguration()); myCfg.setAtomicConfiguration(cfg.getAtomicConfiguration()); - ClientConnectionConfiguration clientCfg = cfg.getClientConnectionConfiguration(); - - if (clientCfg == null) { - // If client config is not provided then create config copying values from GridConfiguration. - if (cfg.isRestEnabled()) { - clientCfg = new ClientConnectionConfiguration(); - - clientCfg.setClientMessageInterceptor(cfg.getClientMessageInterceptor()); - clientCfg.setRestAccessibleFolders(cfg.getRestAccessibleFolders()); - clientCfg.setRestExecutorService(cfg.getRestExecutorService()); - clientCfg.setRestExecutorServiceShutdown(cfg.getRestExecutorServiceShutdown()); - clientCfg.setRestIdleTimeout(cfg.getRestIdleTimeout()); - clientCfg.setRestJettyPath(cfg.getRestJettyPath()); - clientCfg.setRestPortRange(cfg.getRestPortRange()); - clientCfg.setRestSecretKey(cfg.getRestSecretKey()); - clientCfg.setRestTcpDirectBuffer(cfg.isRestTcpDirectBuffer()); - clientCfg.setRestTcpHost(cfg.getRestTcpHost()); - clientCfg.setRestTcpNoDelay(cfg.isRestTcpNoDelay()); - clientCfg.setRestTcpPort(cfg.getRestTcpPort()); - clientCfg.setRestTcpReceiveBufferSize(cfg.getRestTcpReceiveBufferSize()); - clientCfg.setRestTcpSelectorCount(cfg.getRestTcpSelectorCount()); - clientCfg.setRestTcpSendBufferSize(cfg.getRestTcpSendBufferSize()); - clientCfg.setRestTcpSendQueueLimit(cfg.getRestTcpSendQueueLimit()); - clientCfg.setRestTcpSslClientAuth(cfg.isRestTcpSslClientAuth()); - clientCfg.setRestTcpSslContextFactory(cfg.getRestTcpSslContextFactory()); - clientCfg.setRestTcpSslEnabled(cfg.isRestTcpSslEnabled()); - } - } - else - clientCfg = new ClientConnectionConfiguration(clientCfg); - - String ntfStr = IgniteSystemProperties.getString(IGNITE_LIFECYCLE_EMAIL_NOTIFY); if (ntfStr != null) @@ -1523,104 +1455,69 @@ public class IgnitionEx { SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi(); GridIndexingSpi indexingSpi = cfg.getIndexingSpi(); - execSvc = cfg.getExecutorService(); - sysExecSvc = cfg.getSystemExecutorService(); - p2pExecSvc = cfg.getPeerClassLoadingExecutorService(); - mgmtExecSvc = cfg.getManagementExecutorService(); - ggfsExecSvc = cfg.getGgfsExecutorService(); - - if (execSvc == null) { - isAutoExecSvc = true; - - execSvc = new IgniteThreadPoolExecutor( - "pub-" + cfg.getGridName(), - DFLT_PUBLIC_CORE_THREAD_CNT, - DFLT_PUBLIC_MAX_THREAD_CNT, - DFLT_PUBLIC_KEEP_ALIVE_TIME, - new LinkedBlockingQueue<Runnable>(DFLT_PUBLIC_THREADPOOL_QUEUE_CAP)); - - // Pre-start all threads as they are guaranteed to be needed. - ((ThreadPoolExecutor)execSvc).prestartAllCoreThreads(); - } - - if (sysExecSvc == null) { - isAutoSysSvc = true; - - // Note that since we use 'LinkedBlockingQueue', number of - // maximum threads has no effect. - sysExecSvc = new IgniteThreadPoolExecutor( - "sys-" + cfg.getGridName(), - DFLT_SYSTEM_CORE_THREAD_CNT, - DFLT_SYSTEM_MAX_THREAD_CNT, - DFLT_SYSTEM_KEEP_ALIVE_TIME, - new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP)); - - // Pre-start all threads as they are guaranteed to be needed. - ((ThreadPoolExecutor)sysExecSvc).prestartAllCoreThreads(); - } - - if (mgmtExecSvc == null) { - isAutoMgmtSvc = true; - - // Note that since we use 'LinkedBlockingQueue', number of - // maximum threads has no effect. - // Note, that we do not pre-start threads here as management pool may - // not be needed. - mgmtExecSvc = new IgniteThreadPoolExecutor( - "mgmt-" + cfg.getGridName(), - DFLT_MGMT_THREAD_CNT, - DFLT_MGMT_THREAD_CNT, - 0, - new LinkedBlockingQueue<Runnable>()); - } - - if (p2pExecSvc == null) { - isAutoP2PSvc = true; - - // Note that since we use 'LinkedBlockingQueue', number of - // maximum threads has no effect. - // Note, that we do not pre-start threads here as class loading pool may - // not be needed. - p2pExecSvc = new IgniteThreadPoolExecutor( - "p2p-" + cfg.getGridName(), - DFLT_P2P_THREAD_CNT, - DFLT_P2P_THREAD_CNT, - 0, - new LinkedBlockingQueue<Runnable>()); - } - - if (ggfsExecSvc == null) { - isAutoGgfsSvc = true; - - int procCnt = Runtime.getRuntime().availableProcessors(); + execSvc = new IgniteThreadPoolExecutor( + "pub-" + cfg.getGridName(), + cfg.getExecutorService(), + cfg.getExecutorService(), + DFLT_PUBLIC_KEEP_ALIVE_TIME, + new LinkedBlockingQueue<Runnable>(DFLT_PUBLIC_THREADPOOL_QUEUE_CAP)); + + // Pre-start all threads as they are guaranteed to be needed. + ((ThreadPoolExecutor) execSvc).prestartAllCoreThreads(); + + // Note that since we use 'LinkedBlockingQueue', number of + // maximum threads has no effect. + sysExecSvc = new IgniteThreadPoolExecutor( + "sys-" + cfg.getGridName(), + cfg.getSystemExecutorService(), + cfg.getSystemExecutorService(), + DFLT_SYSTEM_KEEP_ALIVE_TIME, + new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP)); - // Note that we do not pre-start threads here as ggfs pool may not be needed. - ggfsExecSvc = new IgniteThreadPoolExecutor( - "ggfs-" + cfg.getGridName(), - procCnt, - procCnt, - 0, - new LinkedBlockingQueue<Runnable>()); - } + // Pre-start all threads as they are guaranteed to be needed. + ((ThreadPoolExecutor) sysExecSvc).prestartAllCoreThreads(); + + // Note that since we use 'LinkedBlockingQueue', number of + // maximum threads has no effect. + // Note, that we do not pre-start threads here as management pool may + // not be needed. + mgmtExecSvc = new IgniteThreadPoolExecutor( + "mgmt-" + cfg.getGridName(), + cfg.getManagementExecutorService(), + cfg.getManagementExecutorService(), + 0, + new LinkedBlockingQueue<Runnable>()); + + // Note that since we use 'LinkedBlockingQueue', number of + // maximum threads has no effect. + // Note, that we do not pre-start threads here as class loading pool may + // not be needed. + p2pExecSvc = new IgniteThreadPoolExecutor( + "p2p-" + cfg.getGridName(), + cfg.getPeerClassLoadingExecutorService(), + cfg.getPeerClassLoadingExecutorService(), + 0, + new LinkedBlockingQueue<Runnable>()); + + // Note that we do not pre-start threads here as ggfs pool may not be needed. + ggfsExecSvc = new IgniteThreadPoolExecutor( + "ggfs-" + cfg.getGridName(), + cfg.getGgfsExecutorService(), + cfg.getGgfsExecutorService(), + 0, + new LinkedBlockingQueue<Runnable>()); - restExecSvc = clientCfg != null ? clientCfg.getRestExecutorService() : null; - if (restExecSvc != null && !cfg.isRestEnabled()) { - U.warn(log, "REST executor service is configured, but REST is disabled in configuration " + - "(safely ignoring)."); - } - else if (restExecSvc == null && clientCfg != null) { - isAutoRestSvc = true; + ClientConnectionConfiguration clientCfg = cfg.getClientConnectionConfiguration(); + if (clientCfg != null) { restExecSvc = new IgniteThreadPoolExecutor( "rest-" + cfg.getGridName(), - DFLT_REST_CORE_THREAD_CNT, - DFLT_REST_MAX_THREAD_CNT, + clientCfg.getRestExecutorService(), + clientCfg.getRestExecutorService(), DFLT_REST_KEEP_ALIVE_TIME, new LinkedBlockingQueue<Runnable>(DFLT_REST_THREADPOOL_QUEUE_CAP) ); - - clientCfg.setRestExecutorService(restExecSvc); } utilityCacheExecSvc = new IgniteThreadPoolExecutor( @@ -1630,13 +1527,6 @@ public class IgnitionEx { DFLT_SYSTEM_KEEP_ALIVE_TIME, new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP)); - execSvcShutdown = cfg.getExecutorServiceShutdown(); - sysSvcShutdown = cfg.getSystemExecutorServiceShutdown(); - mgmtSvcShutdown = cfg.getManagementExecutorServiceShutdown(); - p2pSvcShutdown = cfg.getPeerClassLoadingExecutorServiceShutdown(); - ggfsSvcShutdown = cfg.getGgfsExecutorServiceShutdown(); - restSvcShutdown = clientCfg != null && clientCfg.isRestExecutorServiceShutdown(); - if (marsh == null) { if (!U.isHotSpot()) { U.warn(log, "GridOptimizedMarshaller is not supported on this JVM " + @@ -1670,16 +1560,6 @@ public class IgnitionEx { myCfg.setGridLogger(cfgLog); myCfg.setMarshaller(marsh); myCfg.setMarshalLocalJobs(cfg.isMarshalLocalJobs()); - myCfg.setExecutorService(execSvc); - myCfg.setSystemExecutorService(sysExecSvc); - myCfg.setManagementExecutorService(mgmtExecSvc); - myCfg.setPeerClassLoadingExecutorService(p2pExecSvc); - myCfg.setGgfsExecutorService(ggfsExecSvc); - myCfg.setExecutorServiceShutdown(execSvcShutdown); - myCfg.setSystemExecutorServiceShutdown(sysSvcShutdown); - myCfg.setManagementExecutorServiceShutdown(mgmtSvcShutdown); - myCfg.setPeerClassLoadingExecutorServiceShutdown(p2pSvcShutdown); - myCfg.setGgfsExecutorServiceShutdown(ggfsSvcShutdown); myCfg.setNodeId(nodeId); IgniteFsConfiguration[] ggfsCfgs = cfg.getGgfsConfiguration(); @@ -1795,6 +1675,31 @@ public class IgnitionEx { myCfg.setSmtpPassword(cfg.getSmtpPassword()); myCfg.setAdminEmails(cfg.getAdminEmails()); + if (clientCfg == null) { + // If client config is not provided then create config copying values from GridConfiguration. + clientCfg = new ClientConnectionConfiguration(); + + clientCfg.setClientMessageInterceptor(cfg.getClientMessageInterceptor()); + clientCfg.setRestAccessibleFolders(cfg.getRestAccessibleFolders()); + clientCfg.setRestIdleTimeout(cfg.getRestIdleTimeout()); + clientCfg.setRestJettyPath(cfg.getRestJettyPath()); + clientCfg.setRestPortRange(cfg.getRestPortRange()); + clientCfg.setRestSecretKey(cfg.getRestSecretKey()); + clientCfg.setRestTcpDirectBuffer(cfg.isRestTcpDirectBuffer()); + clientCfg.setRestTcpHost(cfg.getRestTcpHost()); + clientCfg.setRestTcpNoDelay(cfg.isRestTcpNoDelay()); + clientCfg.setRestTcpPort(cfg.getRestTcpPort()); + clientCfg.setRestTcpReceiveBufferSize(cfg.getRestTcpReceiveBufferSize()); + clientCfg.setRestTcpSelectorCount(cfg.getRestTcpSelectorCount()); + clientCfg.setRestTcpSendBufferSize(cfg.getRestTcpSendBufferSize()); + clientCfg.setRestTcpSendQueueLimit(cfg.getRestTcpSendQueueLimit()); + clientCfg.setRestTcpSslClientAuth(cfg.isRestTcpSslClientAuth()); + clientCfg.setRestTcpSslContextFactory(cfg.getRestTcpSslContextFactory()); + clientCfg.setRestTcpSslEnabled(cfg.isRestTcpSslEnabled()); + } + else + clientCfg = new ClientConnectionConfiguration(clientCfg); + // REST configuration. myCfg.setClientConnectionConfiguration(clientCfg); @@ -1969,8 +1874,10 @@ public class IgnitionEx { // Init here to make grid available to lifecycle listeners. grid = grid0; - grid0.start(myCfg, utilityCacheExecSvc, new CA() { - @Override public void apply() { + grid0.start(myCfg, utilityCacheExecSvc, execSvc, sysExecSvc, p2pExecSvc, mgmtExecSvc, ggfsExecSvc, + restExecSvc, + new CA() { + @Override public void apply() { startLatch.countDown(); } }); @@ -2251,46 +2158,29 @@ public class IgnitionEx { private void stopExecutors0(IgniteLogger log) { assert log != null; - /* - * If it was us who started the executor services than we - * stop it. Otherwise, we do no-op since executor service - * was started before us. - */ - if (isAutoExecSvc || execSvcShutdown) { - U.shutdownNow(getClass(), execSvc, log); + U.shutdownNow(getClass(), execSvc, log); - execSvc = null; - } + execSvc = null; - if (isAutoSysSvc || sysSvcShutdown) { - U.shutdownNow(getClass(), sysExecSvc, log); + U.shutdownNow(getClass(), sysExecSvc, log); - sysExecSvc = null; - } + sysExecSvc = null; - if (isAutoMgmtSvc || mgmtSvcShutdown) { - U.shutdownNow(getClass(), mgmtExecSvc, log); + U.shutdownNow(getClass(), mgmtExecSvc, log); - mgmtExecSvc = null; - } + mgmtExecSvc = null; - if (isAutoP2PSvc || p2pSvcShutdown) { - U.shutdownNow(getClass(), p2pExecSvc, log); + U.shutdownNow(getClass(), p2pExecSvc, log); - p2pExecSvc = null; - } + p2pExecSvc = null; - if (isAutoGgfsSvc || ggfsSvcShutdown) { - U.shutdownNow(getClass(), ggfsExecSvc, log); + U.shutdownNow(getClass(), ggfsExecSvc, log); - ggfsExecSvc = null; - } + ggfsExecSvc = null; - if (isAutoRestSvc || restSvcShutdown) { - U.shutdownNow(getClass(), restExecSvc, log); + U.shutdownNow(getClass(), restExecSvc, log); - restExecSvc = null; - } + restExecSvc = null; U.shutdownNow(getClass(), utilityCacheExecSvc, log); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java index 4ccd7e9..c52f765 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java @@ -158,10 +158,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa startSpi(); - pubPool = ctx.config().getExecutorService(); - p2pPool = ctx.config().getPeerClassLoadingExecutorService(); - sysPool = ctx.config().getSystemExecutorService(); - mgmtPool = ctx.config().getManagementExecutorService(); + pubPool = ctx.getExecutorService(); + p2pPool = ctx.getPeerClassLoadingExecutorService(); + sysPool = ctx.getSystemExecutorService(); + mgmtPool = ctx.getManagementExecutorService(); utilityCachePool = ctx.utilityCachePool(); affPool = Executors.newFixedThreadPool(1); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java index c6fda07..8ca5b7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java @@ -69,9 +69,9 @@ public class GridClosureProcessor extends GridProcessorAdapter { public GridClosureProcessor(GridKernalContext ctx) { super(ctx); - sysPool = ctx.config().getSystemExecutorService(); - pubPool = ctx.config().getExecutorService(); - ggfsPool = ctx.config().getGgfsExecutorService(); + sysPool = ctx.getSystemExecutorService(); + pubPool = ctx.getExecutorService(); + ggfsPool = ctx.getGgfsExecutorService(); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsDataManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsDataManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsDataManager.java index 9853f3b..f20603a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsDataManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsDataManager.java @@ -200,7 +200,7 @@ public class GridGgfsDataManager extends GridGgfsManager { } }, EVT_NODE_LEFT, EVT_NODE_FAILED); - ggfsSvc = ggfsCtx.kernalContext().config().getGgfsExecutorService(); + ggfsSvc = ggfsCtx.kernalContext().getGgfsExecutorService(); trashPurgeTimeout = ggfsCtx.configuration().getTrashPurgeTimeout(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java index 349324a..ab5f235 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java @@ -1211,7 +1211,7 @@ public class GridJobProcessor extends GridProcessorAdapter { */ private boolean executeAsync(GridJobWorker jobWorker) { try { - ctx.config().getExecutorService().execute(jobWorker); + ctx.getExecutorService().execute(jobWorker); if (metricsUpdateFreq > -1L) startedJobsCnt.increment(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java index 9845ffa..4b32018 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java @@ -115,7 +115,7 @@ public class GridQueryProcessor extends GridProcessorAdapter { } } - execSvc = ctx.config().getExecutorService(); + execSvc = ctx.getExecutorService(); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java index 44b07c0..6859013 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java @@ -130,7 +130,7 @@ public class GridRestProcessor extends GridProcessorAdapter { fut.setWorker(w); try { - config().getRestExecutorService().execute(w); + ctx.getRestExecutorService().execute(w); } catch (RejectedExecutionException e) { U.error(log, "Failed to execute worker due to execution rejection " + http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java index 02c34c3..77e0b41 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java @@ -587,9 +587,9 @@ public class GridTaskProcessor extends GridProcessorAdapter { try { // Start task execution in another thread. if (sys) - ctx.config().getSystemExecutorService().execute(taskWorker); + ctx.getSystemExecutorService().execute(taskWorker); else - ctx.config().getExecutorService().execute(taskWorker); + ctx.getExecutorService().execute(taskWorker); } catch (RejectedExecutionException e) { tasks.remove(sesId); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/015745ad/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBasicConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBasicConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBasicConfiguration.java index 260dd39..d91f2a1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBasicConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBasicConfiguration.java @@ -111,7 +111,7 @@ public class VisorBasicConfiguration implements Serializable { VisorBasicConfiguration cfg = new VisorBasicConfiguration(); cfg.gridName(c.getGridName()); - cfg.ggHome(getProperty(IGNITE_HOME, c.getGridGainHome())); + cfg.ggHome(getProperty(IGNITE_HOME, c.getIgniteHome())); cfg.localHost(getProperty(IGNITE_LOCAL_HOST, c.getLocalHost())); cfg.nodeId(g.localNode().id()); cfg.marshaller(compactClass(c.getMarshaller()));
