Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 798CB18EB6 for ; Mon, 1 Jun 2015 18:16:09 +0000 (UTC) Received: (qmail 93605 invoked by uid 500); 1 Jun 2015 18:16:09 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 93576 invoked by uid 500); 1 Jun 2015 18:16:09 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 93567 invoked by uid 99); 1 Jun 2015 18:16:09 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 18:16:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E385EC129C for ; Mon, 1 Jun 2015 18:16:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id REnV6ZfyaHND for ; Mon, 1 Jun 2015 18:16:00 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id EB37223142 for ; Mon, 1 Jun 2015 18:15:58 +0000 (UTC) Received: (qmail 93488 invoked by uid 99); 1 Jun 2015 18:15:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 18:15:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 61311E05D3; Mon, 1 Jun 2015 18:15:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-ignite git commit: # changed signature: runAs -> runAsJobOwner Date: Mon, 1 Jun 2015 18:15:57 +0000 (UTC) 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 Authored: Mon Jun 1 21:15:35 2015 +0300 Committer: iveselovskiy 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 The return type of the Callable. * @return The result of the callable. * @throws IgniteCheckedException On any error in callable. */ - public abstract T runAs(String user, Callable c) throws IgniteCheckedException; + public abstract T runAsJobOwner(Callable 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 { /** {@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() { + return ctx.runAsJobOwner(new Callable() { @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 runAs(final String user, final Callable c) throws IgniteCheckedException { + @Override public T runAsJobOwner(final Callable 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 runAs(String user, Callable callable) throws IgniteCheckedException { + /** {@inheritDoc} */ + @Override public T runAsJobOwner(Callable c) throws IgniteCheckedException { try { - return callable.call(); + return c.call(); } catch (Exception e) { throw new IgniteCheckedException(e);