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/f1d35aa4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f1d35aa4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f1d35aa4 Branch: refs/heads/ignite-2788 Commit: f1d35aa47380aaaf6a97add260c73bd66305b669 Parents: 395f473 Author: iveselovskiy <[email protected]> Authored: Mon Apr 25 10:39:54 2016 +0300 Committer: shtykh_roman <[email protected]> Committed: Fri May 13 16:11:14 2016 +0900 ---------------------------------------------------------------------- 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/f1d35aa4/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/f1d35aa4/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/f1d35aa4/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/f1d35aa4/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">
