Minors.

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

Branch: refs/heads/ignite-3914
Commit: a73878f6facfc3b74f57d37cc9c0d7c43d83effa
Parents: aa135ed
Author: vozerov-gridgain <voze...@gridgain.com>
Authored: Fri Sep 16 17:20:05 2016 +0300
Committer: vozerov-gridgain <voze...@gridgain.com>
Committed: Fri Sep 16 17:20:05 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/IgniteComponentType.java      |  3 +--
 .../org/apache/ignite/internal/IgniteKernal.java  |  2 +-
 .../processors/hadoop/HadoopHelperImpl.java       | 18 +++++++-----------
 .../external/child/HadoopChildProcessRunner.java  |  7 +------
 4 files changed, 10 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a73878f6/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
index 2e35dc6..90a77c3 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal;
 
 import java.lang.reflect.Constructor;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.hadoop.HadoopNoopHelper;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.plugin.extensions.communication.MessageFactory;
 import org.jetbrains.annotations.Nullable;
@@ -44,7 +43,7 @@ public enum IgniteComponentType {
 
     /** Hadoop Helper component. */
     HADOOP_HELPER(
-        HadoopNoopHelper.class.getName(),
+        "org.apache.ignite.internal.processors.hadoop.HadoopNoopHelper",
         "org.apache.ignite.internal.processors.hadoop.HadoopHelperImpl",
         "ignite-hadoop"
     ),

http://git-wip-us.apache.org/repos/asf/ignite/blob/a73878f6/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 49c994a..7fb8fbaf 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
@@ -822,7 +822,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 
             
addHelper(IGFS_HELPER.create(F.isEmpty(cfg.getFileSystemConfiguration())));
 
-            addHelper(HADOOP_HELPER.createIfInClassPath(ctx, false));
+            addHelper(HADOOP_HELPER.createIfInClassPath(null, false));
 
             startProcessor(new IgnitePluginProcessor(ctx, cfg, plugins));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a73878f6/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopHelperImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopHelperImpl.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopHelperImpl.java
index 0415124..59a37e9 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopHelperImpl.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopHelperImpl.java
@@ -74,9 +74,6 @@ public class HadoopHelperImpl implements HadoopHelper {
             String nameType = originalName.replace('.', '/');
 
             @Override public String map(String type) {
-                if (type == null)
-                    return null;
-
                 if (type.equals(replaceType))
                     return nameType;
 
@@ -139,7 +136,7 @@ public class HadoopHelperImpl implements HadoopHelper {
             ctx.fldVisitor = new CollectingFieldVisitor(ctx, ctx.annVisitor);
             ctx.clsVisitor = new CollectingClassVisitor(ctx, ctx.annVisitor, 
ctx.mthdVisitor, ctx.fldVisitor);
 
-            hasDeps = hasExternalDependencies(this, clsName, parentClsLdr, 
ctx);
+            hasDeps = hasExternalDependencies(clsName, parentClsLdr, ctx);
 
             dependenciesCache.put(clsName, hasDeps);
         }
@@ -155,17 +152,17 @@ public class HadoopHelperImpl implements HadoopHelper {
      * @param ctx Context.
      * @return {@code true} If the class has external dependencies.
      */
-    static boolean hasExternalDependencies(HadoopHelper h, String clsName, 
ClassLoader parentClsLdr, CollectingContext ctx) {
-        if (h.isHadoop(clsName)) // Hadoop must not be in classpath but Idea 
sucks, so filtering explicitly as external.
+    boolean hasExternalDependencies(String clsName, ClassLoader parentClsLdr, 
CollectingContext ctx) {
+        if (isHadoop(clsName)) // Hadoop must not be in classpath but Idea 
sucks, so filtering explicitly as external.
             return true;
 
         // Try to get from parent to check if the type accessible.
-        InputStream in = h.loadClassBytes(parentClsLdr, clsName);
+        InputStream in = loadClassBytes(parentClsLdr, clsName);
 
         if (in == null) // The class is external itself, it must be loaded 
from this class loader.
             return true;
 
-        if (!h.isHadoopIgfs(clsName)) // Other classes should not have 
external dependencies.
+        if (!isHadoopIgfs(clsName)) // Other classes should not have external 
dependencies.
             return false;
 
         final ClassReader rdr;
@@ -198,7 +195,7 @@ public class HadoopHelperImpl implements HadoopHelper {
         Boolean res = dependenciesCache.get(parentCls);
 
         if (res == null)
-            res = hasExternalDependencies(h, parentCls, parentClsLdr, ctx);
+            res = hasExternalDependencies(parentCls, parentClsLdr, ctx);
 
         return res;
     }
@@ -302,8 +299,7 @@ public class HadoopHelperImpl implements HadoopHelper {
 
             Boolean res = dependenciesCache.get(depCls);
 
-            if (res == Boolean.TRUE || (res == null && 
hasExternalDependencies(HadoopHelperImpl.this, depCls,
-                parentClsLdr, this)))
+            if (res == Boolean.TRUE || (res == null && 
hasExternalDependencies(depCls, parentClsLdr, this)))
                 found = true;
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a73878f6/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
index 2ca9928..35747bb 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
@@ -98,11 +98,6 @@ public class HadoopChildProcessRunner {
     /** Shuffle job. */
     private HadoopShuffleJob<HadoopProcessDescriptor> shuffleJob;
 
-    /** Hadoop helper.
-     *  NB: we consider helper to be thread-safe, so reusing the same instance 
for all the jobs.
-     */
-    private final HadoopHelper hadoopHelper = new HadoopHelperImpl();
-
     /** Concurrent mappers. */
     private int concMappers;
 
@@ -141,7 +136,7 @@ public class HadoopChildProcessRunner {
 
                 assert job == null;
 
-                job = req.jobInfo().createJob(HadoopV2Job.class, req.jobId(), 
log, null, hadoopHelper);
+                job = req.jobInfo().createJob(HadoopV2Job.class, req.jobId(), 
log, null, new HadoopHelperImpl());
 
                 job.initialize(true, nodeDesc.processId());
 

Reply via email to