ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [26/50] incubator-ignite git commit: #ignite-239: small fixes.
Date Tue, 03 Mar 2015 04:40:57 GMT
#ignite-239: small fixes.


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

Branch: refs/heads/ignite-51
Commit: 4f0feeecb8c4c48ee7e7ffe4679ff0ac28ef3a0b
Parents: 5830deb
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Feb 27 16:15:17 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Feb 27 16:15:17 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 72 ++++++++++----------
 1 file changed, 37 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f0feeec/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 32a3d71..f39cd7e 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
@@ -119,9 +119,6 @@ public class IgnitionEx {
     /** */
     private static volatile boolean daemon;
 
-    /** */
-    private static final String[] EMPTY_STR_ARR = new String[0];
-
     /**
      * Checks runtime version to be 1.7.x or 1.8.x.
      * This will load pretty much first so we must do these checks here.
@@ -1138,6 +1135,9 @@ public class IgnitionEx {
         private static final Map<MBeanServer, GridMBeanServerData> mbeans =
             new HashMap<>();
 
+        /** */
+        private static final String[] EMPTY_STR_ARR = new String[0];
+
         /** Grid name. */
         private final String name;
 
@@ -1297,6 +1297,17 @@ public class IgnitionEx {
 
             IgniteConfiguration cfg = startCtx.config() != null ? startCtx.config() : new
IgniteConfiguration();
 
+            String ggHome = cfg.getIgniteHome();
+
+            // Set Ignite home.
+            if (ggHome == null)
+                ggHome = U.getIgniteHome();
+            else
+                // If user provided IGNITE_HOME - set it as a system property.
+                U.setIgniteHome(ggHome);
+
+            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
+
             // Ensure invariant.
             // It's a bit dirty - but this is a result of late refactoring
             // and I don't want to reshuffle a lot of code.
@@ -1317,20 +1328,18 @@ public class IgnitionEx {
 
             log = cfgLog.getLogger(G.class);
 
-            IgniteConfiguration myCfg = initializeDefaultConfiguration(cfg);
-
-            myCfg.setGridLogger(cfgLog);
+            // Check Ignite home folder (after log is available).
+            if (ggHome != null) {
+                File ggHomeFile = new File(ggHome);
 
-            if (myCfg.getConnectorConfiguration() != null) {
-                restExecSvc = new IgniteThreadPoolExecutor(
-                    "rest-" + cfg.getGridName(),
-                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
-                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
-                    ConnectorConfiguration.DFLT_KEEP_ALIVE_TIME,
-                    new LinkedBlockingQueue<Runnable>(ConnectorConfiguration.DFLT_THREADPOOL_QUEUE_CAP)
-                );
+                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
+                    throw new IgniteCheckedException("Invalid Ignite installation home folder:
" + ggHome);
             }
 
+            IgniteConfiguration myCfg = initializeConfiguration(cfg);
+
+            myCfg.setGridLogger(cfgLog);
+
             // Validate segmentation configuration.
             GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
 
@@ -1417,6 +1426,16 @@ public class IgnitionEx {
                 0,
                 new LinkedBlockingQueue<Runnable>());
 
+            if (myCfg.getConnectorConfiguration() != null) {
+                restExecSvc = new IgniteThreadPoolExecutor(
+                    "rest-" + myCfg.getGridName(),
+                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
+                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
+                    ConnectorConfiguration.DFLT_KEEP_ALIVE_TIME,
+                    new LinkedBlockingQueue<Runnable>(ConnectorConfiguration.DFLT_THREADPOOL_QUEUE_CAP)
+                );
+            }
+
             utilityCacheExecSvc = new IgniteThreadPoolExecutor(
                 "utility-" + cfg.getGridName(),
                 DFLT_SYSTEM_CORE_THREAD_CNT,
@@ -1499,10 +1518,12 @@ public class IgnitionEx {
          * @param cfg Ignite configuration copy to.
          * @return New ignite configuration.
          */
-        private IgniteConfiguration initializeDefaultConfiguration(IgniteConfiguration cfg)
+        private IgniteConfiguration initializeConfiguration(IgniteConfiguration cfg)
             throws IgniteCheckedException {
             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
+
             initializeDefaultConfigurationParameters(myCfg);
+
             return myCfg;
         }
 
@@ -1510,26 +1531,7 @@ public class IgnitionEx {
          * Initialize default parameters.
          */
         public void initializeDefaultConfigurationParameters(IgniteConfiguration cfg) throws
IgniteCheckedException {
-            // Set Ignite home.
-            String ggHome = cfg.getIgniteHome();
-
-            if (ggHome == null)
-                ggHome = U.getIgniteHome();
-            else
-                // If user provided IGNITE_HOME - set it as a system property.
-                U.setIgniteHome(ggHome);
-
-            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
-
-            // Check Ignite home folder (after log is available).
-            if (ggHome != null) {
-                File ggHomeFile = new File(ggHome);
-
-                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
-                    throw new IgniteCheckedException("Invalid Ignite installation home folder:
" + ggHome);
-            }
-
-            cfg.setIgniteHome(ggHome);
+            cfg.setIgniteHome(U.getIgniteHome());
 
             // Local host.
             String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);


Mime
View raw message