You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/06/28 12:12:26 UTC

[5/6] ignite git commit: IGNITE-2115: Backported from master to 7.5.28.

IGNITE-2115: Backported from master to 7.5.28.


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

Branch: refs/heads/ignite-3383
Commit: a77e6901a4e9e9f1116698fc65e6a2ffbe68f08f
Parents: 62c7143
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Jun 28 14:42:12 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Jun 28 14:42:12 2016 +0300

----------------------------------------------------------------------
 examples/config/filesystem/example-igfs.xml     |  3 --
 .../apache/ignite/internal/IgniteKernal.java    | 31 ++++++++++++++++++--
 modules/core/src/test/config/igfs-loopback.xml  |  7 -----
 modules/core/src/test/config/igfs-shmem.xml     |  7 -----
 4 files changed, 28 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a77e6901/examples/config/filesystem/example-igfs.xml
----------------------------------------------------------------------
diff --git a/examples/config/filesystem/example-igfs.xml b/examples/config/filesystem/example-igfs.xml
index 0a0b1b4..a72ddce 100644
--- a/examples/config/filesystem/example-igfs.xml
+++ b/examples/config/filesystem/example-igfs.xml
@@ -50,9 +50,6 @@
         Configuration below demonstrates how to setup a IgniteFs node with file data.
     -->
     <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <!-- Set to true to enable cluster-aware class loading for examples, default is false. -->
-        <property name="peerClassLoadingEnabled" value="true"/>
-
         <property name="marshaller">
             <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
                 <!-- Set to false to allow non-serializable objects in examples, default is true. -->

http://git-wip-us.apache.org/repos/asf/ignite/blob/a77e6901/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 d1f3ef5..3572293 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
@@ -114,6 +114,7 @@ import org.apache.ignite.internal.processors.continuous.GridContinuousProcessor;
 import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor;
 import org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor;
 import org.apache.ignite.internal.processors.hadoop.Hadoop;
+import org.apache.ignite.internal.processors.hadoop.HadoopNoopProcessor;
 import org.apache.ignite.internal.processors.job.GridJobProcessor;
 import org.apache.ignite.internal.processors.jobmetrics.GridJobMetricsProcessor;
 import org.apache.ignite.internal.processors.nodevalidation.DiscoveryNodeValidationProcessor;
@@ -862,9 +863,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
             startProcessor(new DataStreamProcessor(ctx));
             startProcessor((GridProcessor)IGFS.create(ctx, F.isEmpty(cfg.getFileSystemConfiguration())));
             startProcessor(new GridContinuousProcessor(ctx));
-            startProcessor((GridProcessor)(cfg.isPeerClassLoadingEnabled() ?
-                IgniteComponentType.HADOOP.create(ctx, true): // No-op when peer class loading is enabled.
-                IgniteComponentType.HADOOP.createIfInClassPath(ctx, cfg.getHadoopConfiguration() != null)));
+            startProcessor((GridProcessor)createHadoopComponent());
             startProcessor(new DataStructuresProcessor(ctx));
             startProcessor(createComponent(PlatformProcessor.class, ctx));
 
@@ -1085,6 +1084,32 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
     }
 
     /**
+     * Create Hadoop component.
+     *
+     * @return Non-null Hadoop component: workable or no-op.
+     * @throws IgniteCheckedException if the component is mandatory and cannot be initialized.
+     */
+    private GridComponent createHadoopComponent() throws IgniteCheckedException {
+        GridComponent cmp;
+
+        if (cfg.isPeerClassLoadingEnabled()) {
+            cmp = IgniteComponentType.HADOOP.createIfInClassPath(ctx, false);
+
+            if (!(cmp instanceof HadoopNoopProcessor)) {
+                U.warn(log, "Hadoop module is found in classpath, but it will not be started because peer class " +
+                    "loading is enabled (set IgniteConfiguration.peerClassLoadingEnabled to \"false\" to start " +
+                    "Hadoop module).");
+
+                cmp = IgniteComponentType.HADOOP.create(ctx, true/*no-op*/);
+            }
+        }
+        else
+            cmp = IgniteComponentType.HADOOP.createIfInClassPath(ctx, cfg.getHadoopConfiguration() != null);
+
+        return cmp;
+    }
+
+    /**
      * Validates common configuration parameters.
      *
      * @param cfg Configuration.

http://git-wip-us.apache.org/repos/asf/ignite/blob/a77e6901/modules/core/src/test/config/igfs-loopback.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/igfs-loopback.xml b/modules/core/src/test/config/igfs-loopback.xml
index c01fb98..dbbfb4e 100644
--- a/modules/core/src/test/config/igfs-loopback.xml
+++ b/modules/core/src/test/config/igfs-loopback.xml
@@ -54,13 +54,6 @@
     -->
     <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
         <!--
-            For better performance set this property to false in case
-            peer deployment is not used.
-            Default value is false.
-        -->
-        <property name="peerClassLoadingEnabled" value="true"/>
-
-        <!--
             Configure optimized marshaller.
         -->
         <property name="marshaller">

http://git-wip-us.apache.org/repos/asf/ignite/blob/a77e6901/modules/core/src/test/config/igfs-shmem.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/igfs-shmem.xml b/modules/core/src/test/config/igfs-shmem.xml
index b38544f..c4c8704 100644
--- a/modules/core/src/test/config/igfs-shmem.xml
+++ b/modules/core/src/test/config/igfs-shmem.xml
@@ -54,13 +54,6 @@
     -->
     <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
         <!--
-            For better performance set this property to false in case
-            peer deployment is not used.
-            Default value is false.
-        -->
-        <property name="peerClassLoadingEnabled" value="true"/>
-
-        <!--
             Configure optimized marshaller.
         -->
         <property name="marshaller">