Repository: ignite
Updated Branches:
  refs/heads/ignite-3949 7e740e07a -> 4325a8844


Fixed counter writer bug.


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

Branch: refs/heads/ignite-3949
Commit: 4325a8844b7253ada3a53816181a30d20ee57087
Parents: 7e740e0
Author: vozerov-gridgain <voze...@gridgain.com>
Authored: Wed Sep 21 18:59:38 2016 +0300
Committer: vozerov-gridgain <voze...@gridgain.com>
Committed: Wed Sep 21 18:59:38 2016 +0300

----------------------------------------------------------------------
 .../ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java | 7 ++++---
 .../processors/hadoop/delegate/HadoopDelegateUtils.java       | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4325a884/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
index d11944e..f1c1b16 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
@@ -43,15 +43,16 @@ public class IgniteHadoopFileSystemCounterWriter implements 
HadoopCounterWriter
     /** {@inheritDoc} */
     @Override public void write(HadoopJob job, HadoopCounters cntrs)
         throws IgniteCheckedException {
-        delegate().write(job, cntrs);
+        delegate(job).write(job, cntrs);
     }
 
     /**
      * Get delegate creating it if needed.
      *
+     * @param job Job.
      * @return Delegate.
      */
-    private HadoopFileSystemCounterWriterDelegate delegate() {
+    private HadoopFileSystemCounterWriterDelegate delegate(HadoopJob job) {
         HadoopFileSystemCounterWriterDelegate delegate0 = delegate;
 
         if (delegate0 == null) {
@@ -59,7 +60,7 @@ public class IgniteHadoopFileSystemCounterWriter implements 
HadoopCounterWriter
                 delegate0 = delegate;
 
                 if (delegate0 == null) {
-                    delegate0 = 
HadoopDelegateUtils.counterWriterDelegate(this);
+                    delegate0 = 
HadoopDelegateUtils.counterWriterDelegate(job.getClass().getClassLoader(), 
this);
 
                     delegate = delegate0;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/4325a884/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopDelegateUtils.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopDelegateUtils.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopDelegateUtils.java
index 8250a66..76d9bff 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopDelegateUtils.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopDelegateUtils.java
@@ -93,12 +93,13 @@ public class HadoopDelegateUtils {
     /**
      * Create delegate for Hadoop counter writer.
      *
+     * @param ldr Class loader.
      * @param proxy Proxy.
      * @return Delegate.
      */
-    public static HadoopFileSystemCounterWriterDelegate counterWriterDelegate(
+    public static HadoopFileSystemCounterWriterDelegate 
counterWriterDelegate(ClassLoader ldr,
         IgniteHadoopFileSystemCounterWriter proxy) {
-        return newInstance(COUNTER_WRITER_DELEGATE_CLS, null, proxy);
+        return newInstance(COUNTER_WRITER_DELEGATE_CLS, ldr, proxy);
     }
 
     /**

Reply via email to