Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A7F55200C41 for ; Fri, 10 Mar 2017 01:42:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A688D160B87; Fri, 10 Mar 2017 00:42:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 05291160B75 for ; Fri, 10 Mar 2017 01:42:35 +0100 (CET) Received: (qmail 97250 invoked by uid 500); 10 Mar 2017 00:42:30 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 96512 invoked by uid 99); 10 Mar 2017 00:42:29 -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; Fri, 10 Mar 2017 00:42:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B716FF4B5C; Fri, 10 Mar 2017 00:42:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jhung@apache.org To: common-commits@hadoop.apache.org Date: Fri, 10 Mar 2017 00:42:44 -0000 Message-Id: <8458a22a5e7c47639b8947c63611e1fc@git.apache.org> In-Reply-To: <6dac5dbdc4514021bb6affec72e6d376@git.apache.org> References: <6dac5dbdc4514021bb6affec72e6d376@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [16/33] hadoop git commit: HADOOP-14150. Implement getHomeDirectory() method in NativeAzureFileSystem. Contributed by Santhosh G Nayak archived-at: Fri, 10 Mar 2017 00:42:36 -0000 HADOOP-14150. Implement getHomeDirectory() method in NativeAzureFileSystem. Contributed by Santhosh G Nayak Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/28daaf0e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/28daaf0e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/28daaf0e Branch: refs/heads/YARN-5734 Commit: 28daaf0eb206d723d2baf0f9d91e43d98bb2fd26 Parents: 1598fd3 Author: Mingliang Liu Authored: Tue Mar 7 14:55:52 2017 -0800 Committer: Mingliang Liu Committed: Tue Mar 7 14:55:52 2017 -0800 ---------------------------------------------------------------------- .../org/apache/hadoop/fs/azure/NativeAzureFileSystem.java | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/28daaf0e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java index 6de0a28..9aebbb5 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java @@ -84,6 +84,7 @@ import com.microsoft.azure.storage.StorageException; @InterfaceStability.Stable public class NativeAzureFileSystem extends FileSystem { private static final int USER_WX_PERMISION = 0300; + private static final String USER_HOME_DIR_PREFIX_DEFAULT = "/user"; /** * A description of a folder rename operation, including the source and * destination keys, and descriptions of the files in the source folder. @@ -1129,6 +1130,8 @@ public class NativeAzureFileSystem extends FileSystem { */ private WasbAuthorizerInterface authorizer = null; + private UserGroupInformation ugi; + private String delegationToken = null; public NativeAzureFileSystem() { @@ -1247,6 +1250,7 @@ public class NativeAzureFileSystem extends FileSystem { store.initialize(uri, conf, instrumentation); setConf(conf); + this.ugi = UserGroupInformation.getCurrentUser(); this.uri = URI.create(uri.getScheme() + "://" + uri.getAuthority()); this.workingDir = new Path("/user", UserGroupInformation.getCurrentUser() .getShortUserName()).makeQualified(getUri(), getWorkingDirectory()); @@ -1276,6 +1280,12 @@ public class NativeAzureFileSystem extends FileSystem { } } + @Override + public Path getHomeDirectory() { + return makeQualified(new Path( + USER_HOME_DIR_PREFIX_DEFAULT + "/" + this.ugi.getShortUserName())); + } + @VisibleForTesting public void updateWasbAuthorizer(WasbAuthorizerInterface authorizer) { this.authorizer = authorizer; --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org