ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: # changed signature: runAs -> runAsJobOwner
Date Mon, 01 Jun 2015 18:15:57 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-218 0b6db07fb -> 95895ce6d


# changed signature: runAs -> runAsJobOwner


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

Branch: refs/heads/ignite-218
Commit: 95895ce6d8b820d95325fd819af568bdca069188
Parents: 0b6db07
Author: iveselovskiy <iveselovskiy@gridgain.com>
Authored: Mon Jun 1 21:15:35 2015 +0300
Committer: iveselovskiy <iveselovskiy@gridgain.com>
Committed: Mon Jun 1 21:15:35 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/hadoop/HadoopTaskContext.java   |  7 +++----
 .../hadoop/taskexecutor/HadoopRunnableTask.java         | 10 +---------
 .../processors/hadoop/v2/HadoopV2TaskContext.java       |  9 ++++++++-
 .../shuffle/collections/HadoopAbstractMapTest.java      | 12 ++++--------
 4 files changed, 16 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95895ce6/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
index d0fafc5..3d2ee17 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
@@ -28,7 +28,7 @@ import java.util.concurrent.*;
  */
 public abstract class HadoopTaskContext {
     /** */
-    private final HadoopJob job;
+    protected final HadoopJob job;
 
     /** */
     private HadoopTaskInput input;
@@ -190,14 +190,13 @@ public abstract class HadoopTaskContext {
     public abstract void cleanupTaskEnvironment() throws IgniteCheckedException;
 
     /**
-     * Executes a callable on behalf of the specified user.
+     * Executes a callable on behalf of the job owner.
      * In case of embedded task execution the implementation of this method
      * will use classes loaded by the ClassLoader this HadoopTaskContext loaded with.
-     * @param user The user name.
      * @param c The callable.
      * @param <T> The return type of the Callable.
      * @return The result of the callable.
      * @throws IgniteCheckedException On any error in callable.
      */
-    public abstract <T> T runAs(String user, Callable<T> c) throws IgniteCheckedException;
+    public abstract <T> T runAsJobOwner(Callable<T> c) throws IgniteCheckedException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95895ce6/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
index f091e8f..b170125 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.internal.processors.hadoop.*;
 import org.apache.ignite.internal.processors.hadoop.counter.*;
 import org.apache.ignite.internal.processors.hadoop.shuffle.collections.*;
-import org.apache.ignite.internal.processors.igfs.*;
 import org.apache.ignite.internal.util.offheap.unsafe.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 
@@ -100,16 +99,9 @@ public abstract class HadoopRunnableTask implements Callable<Void>
{
 
     /** {@inheritDoc} */
     @Override public Void call() throws IgniteCheckedException {
-        String user = job.info().user();
-
-        user = IgfsUtils.fixUserName(user);
-
-        assert user != null;
-
-        // TODO: Inclapsulate user name into HadoopTaskContext.
         ctx = job.getTaskContext(info);
 
-        return ctx.runAs(user, new Callable<Void>() {
+        return ctx.runAsJobOwner(new Callable<Void>() {
             @Override public Void call() throws Exception {
                 call0();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95895ce6/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
index ee10b01..e838df3 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
@@ -34,6 +34,7 @@ import org.apache.ignite.internal.processors.hadoop.*;
 import org.apache.ignite.internal.processors.hadoop.counter.*;
 import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters;
 import org.apache.ignite.internal.processors.hadoop.v1.*;
+import org.apache.ignite.internal.processors.igfs.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
@@ -453,7 +454,13 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
     }
 
     /** {@inheritDoc} */
-    @Override public <T> T runAs(final String user, final Callable<T> c) throws
IgniteCheckedException {
+    @Override public <T> T runAsJobOwner(final Callable<T> c) throws IgniteCheckedException
{
+        String user = job.info().user();
+
+        user = IgfsUtils.fixUserName(user);
+
+        assert user != null;
+
         String ugiUser;
         try {
             UserGroupInformation currUser = UserGroupInformation.getCurrentUser();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95895ce6/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopAbstractMapTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopAbstractMapTest.java
b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopAbstractMapTest.java
index c894b76..9395c5e 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopAbstractMapTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopAbstractMapTest.java
@@ -96,19 +96,15 @@ public abstract class HadoopAbstractMapTest extends GridCommonAbstractTest
{
             assert false;
         }
 
+        /** {@inheritDoc} */
         @Override public void cleanupTaskEnvironment() throws IgniteCheckedException {
             assert false;
         }
 
-        /**
-         * @param user
-         * @param callable
-         * @return
-         * @throws IgniteCheckedException
-         */
-        @Override public <T> T runAs(String user, Callable<T> callable) throws
IgniteCheckedException {
+        /** {@inheritDoc} */
+        @Override public <T> T runAsJobOwner(Callable<T> c) throws IgniteCheckedException
{
             try {
-                return callable.call();
+                return c.call();
             }
             catch (Exception e) {
                 throw new IgniteCheckedException(e);


Mime
View raw message