ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-2115: Hadoop: Added warning when Hadoop module is not loaded due to enabled peer-class-loading. This closes #615.
Date Mon, 25 Apr 2016 07:40:06 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 2ff64c2aa -> 97cf2b31e


IGNITE-2115: Hadoop: Added warning when Hadoop module is not loaded due to enabled peer-class-loading.
This closes #615.


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

Branch: refs/heads/master
Commit: 97cf2b31ef5a818e10e1cf838016359d6a6926ca
Parents: 2ff64c2
Author: iveselovskiy <iveselovskiy@gridgain.com>
Authored: Mon Apr 25 10:39:54 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Apr 25 10:39:54 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/97cf2b31/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/97cf2b31/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 d6655d9..5094415 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
@@ -113,6 +113,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;
@@ -872,9 +873,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));
 
@@ -1105,6 +1104,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/97cf2b31/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/97cf2b31/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">


Mime
View raw message