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 20E862009E8 for ; Mon, 30 May 2016 21:29:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1FD2E160A19; Mon, 30 May 2016 19:29:20 +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 6866E160969 for ; Mon, 30 May 2016 21:29:19 +0200 (CEST) Received: (qmail 97031 invoked by uid 500); 30 May 2016 19:29:18 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 97022 invoked by uid 99); 30 May 2016 19:29:18 -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 May 2016 19:29:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3EACCDFDA9; Mon, 30 May 2016 19:29:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Message-Id: <2c0914a0628441f198e5e169beddf4af@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: WIP 3. Date: Mon, 30 May 2016 19:29:18 +0000 (UTC) archived-at: Mon, 30 May 2016 19:29:20 -0000 Repository: ignite Updated Branches: refs/heads/ignite-3202 9706668bb -> 6195303b5 WIP 3. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6195303b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6195303b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6195303b Branch: refs/heads/ignite-3202 Commit: 6195303b5b5e62fe512f86b9589e4cb694d3e394 Parents: 9706668 Author: vozerov-gridgain Authored: Mon May 30 22:29:10 2016 +0300 Committer: vozerov-gridgain Committed: Mon May 30 22:29:10 2016 +0300 ---------------------------------------------------------------------- .../hadoop/fs/BasicHadoopFileSystemFactory.java | 38 ++++++++++---------- .../fs/CachingHadoopFileSystemFactory.java | 4 ++- 2 files changed, 21 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/6195303b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java index 659cea6..6f30316 100644 --- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java +++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java @@ -71,16 +71,18 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex /** {@inheritDoc} */ @Override public final FileSystem get(String name) throws IOException { - String name0 = IgfsUtils.fixUserName(name); - - if (usrNameMapper != null) { - name0 = usrNameMapper.map(name0); - - // If mapper returned null, we will use current user, so we "fix" user name again. - name0 = IgfsUtils.fixUserName(name0); - } - - return getWithMappedName(name0); +// String name0 = IgfsUtils.fixUserName(name); +// +// if (usrNameMapper != null) { +// name0 = usrNameMapper.map(name0); +// +// // If mapper returned null, we will use current user, so we "fix" user name again. +// name0 = IgfsUtils.fixUserName(name0); +// } +// +// return getWithMappedName(name0); + + return getWithMappedName(IgfsUtils.fixUserName(name)); } /** @@ -242,16 +244,14 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex } } - // TODO -// if (usrNameMapper != null && usrNameMapper instanceof LifecycleAware) -// ((LifecycleAware)usrNameMapper).start(); + if (usrNameMapper != null && usrNameMapper instanceof LifecycleAware) + ((LifecycleAware)usrNameMapper).start(); } /** {@inheritDoc} */ @Override public void stop() throws IgniteException { - // TODO -// if (usrNameMapper != null && usrNameMapper instanceof LifecycleAware) -// ((LifecycleAware)usrNameMapper).stop(); + if (usrNameMapper != null && usrNameMapper instanceof LifecycleAware) + ((LifecycleAware)usrNameMapper).stop(); } /** {@inheritDoc} */ @@ -267,8 +267,7 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex else out.writeInt(-1); - // TODO: Return - //out.writeObject(usrNameMapper); + out.writeObject(usrNameMapper); } /** {@inheritDoc} */ @@ -284,7 +283,6 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex cfgPaths[i] = U.readString(in); } - // TODO: Return - // usrNameMapper = (UserNameMapper) in.readObject(); + usrNameMapper = (UserNameMapper) in.readObject(); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/6195303b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java index 727681d..01c51a2 100644 --- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java +++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.internal.processors.hadoop.fs.HadoopFileSystemsUtils; import org.apache.ignite.internal.processors.hadoop.fs.HadoopLazyConcurrentMap; +import org.apache.ignite.internal.processors.igfs.IgfsUtils; import java.io.IOException; import java.net.URI; @@ -60,7 +61,8 @@ public class CachingHadoopFileSystemFactory extends BasicHadoopFileSystemFactory /** {@inheritDoc} */ @Override public FileSystem getWithMappedName(String name) throws IOException { - return cache.getOrCreate(name); +// return cache.getOrCreate(name); + return cache.getOrCreate(IgfsUtils.fixUserName(name)); } /** {@inheritDoc} */