Return-Path: X-Original-To: apmail-spark-commits-archive@minotaur.apache.org Delivered-To: apmail-spark-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 810C4172FB for ; Mon, 30 Mar 2015 12:59:15 +0000 (UTC) Received: (qmail 23877 invoked by uid 500); 30 Mar 2015 12:59:12 -0000 Delivered-To: apmail-spark-commits-archive@spark.apache.org Received: (qmail 23849 invoked by uid 500); 30 Mar 2015 12:59:12 -0000 Mailing-List: contact commits-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@spark.apache.org Received: (qmail 23840 invoked by uid 99); 30 Mar 2015 12:59:12 -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, 30 Mar 2015 12:59:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4E8B7E0B3B; Mon, 30 Mar 2015 12:59:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: srowen@apache.org To: commits@spark.apache.org Message-Id: <5f80ecfff4174050a0e0008cf88d055d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: spark git commit: [SPARK-6558] Utils.getCurrentUserName returns the full principal name instead of login name Date: Mon, 30 Mar 2015 12:59:12 +0000 (UTC) Repository: spark Updated Branches: refs/heads/branch-1.3 1c59a4bd3 -> f8132ded0 [SPARK-6558] Utils.getCurrentUserName returns the full principal name instead of login name Utils.getCurrentUserName returns UserGroupInformation.getCurrentUser().getUserName() when SPARK_USER isn't set. It should return UserGroupInformation.getCurrentUser().getShortUserName() getUserName() returns the users full principal name (ie user1CORP.COM). getShortUserName() returns just the users login name (user1). This just happens to work on YARN because the Client code sets: env("SPARK_USER") = UserGroupInformation.getCurrentUser().getShortUserName() Author: Thomas Graves Closes #5229 from tgravescs/SPARK-6558 and squashes the following commits: 24830bf [Thomas Graves] Utils.getCurrentUserName returns the full principal name instead of login name Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/f8132ded Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/f8132ded Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/f8132ded Branch: refs/heads/branch-1.3 Commit: f8132ded0c89f682e13cb12ecd8aee32b417437e Parents: 1c59a4b Author: Thomas Graves Authored: Sun Mar 29 12:43:30 2015 +0100 Committer: Sean Owen Committed: Mon Mar 30 13:58:33 2015 +0100 ---------------------------------------------------------------------- core/src/main/scala/org/apache/spark/util/Utils.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/f8132ded/core/src/main/scala/org/apache/spark/util/Utils.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index 949bc55..c136584 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -1998,7 +1998,7 @@ private[spark] object Utils extends Logging { */ def getCurrentUserName(): String = { Option(System.getenv("SPARK_USER")) - .getOrElse(UserGroupInformation.getCurrentUser().getUserName()) + .getOrElse(UserGroupInformation.getCurrentUser().getShortUserName()) } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org For additional commands, e-mail: commits-help@spark.apache.org