You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Eli Collins (Created) (JIRA)" <ji...@apache.org> on 2012/01/14 00:50:40 UTC

[jira] [Created] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

TestViewFsTrash incorrectly determines the user's home directory
----------------------------------------------------------------

                 Key: HADOOP-7974
                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
             Project: Hadoop Common
          Issue Type: Bug
          Components: fs
    Affects Versions: 0.23.1
            Reporter: Eli Collins


HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).

{code}
    // create a link for home directory so that trash path works
    // set up viewfs's home dir root to point to home dir root on target
    // But home dir is different on linux, mac etc.
    // Figure it out by calling home dir on target
    
   String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
   int indexOf2ndSlash = homeDir.indexOf('/', 1);
   String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
   ConfigUtil.addLink(conf, homeDirRoot,
       fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
   ConfigUtil.setHomeDirConf(conf, homeDirRoot);
   Log.info("Home dir base " + homeDirRoot);
{code}

Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.








--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186456#comment-13186456 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Hdfs-0.23-Commit #369 (See [https://builds.apache.org/job/Hadoop-Hdfs-0.23-Commit/369/])
    HADOOP-7974. svn merge -c 1231640 from trunk

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231641
Files : 
* /hadoop/common/branches/branch-0.23
* /hadoop/common/branches/branch-0.23/hadoop-common-project
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-auth
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/docs
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/core
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/native
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/.gitignore
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/bin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/conf
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/c++
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/block_forensics
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build-contrib.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/data_join
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/eclipse-plugin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/index
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/vaidya
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/fs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/FileBench.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/ipc
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/security/authorize/TestServiceLevelAuthorization.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/webapps/job
* /hadoop/common/branches/branch-0.23/hadoop-project
* /hadoop/common/branches/branch-0.23/hadoop-project/src/site

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Harsh J (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J reassigned HADOOP-7974:
-------------------------------

    Assignee: Harsh J
    
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186410#comment-13186410 ] 

Harsh J commented on HADOOP-7974:
---------------------------------

(Also fixed some diff-surrounding whitesp. and indentation issues)
                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Arun C Murthy (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arun C Murthy resolved HADOOP-7974.
-----------------------------------

    Resolution: Fixed

It's been fixed for a while.
                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186504#comment-13186504 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Mapreduce-0.23-Build #161 (See [https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Build/161/])
    HADOOP-7974. svn merge -c 1231640 from trunk

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231641
Files : 
* /hadoop/common/branches/branch-0.23
* /hadoop/common/branches/branch-0.23/hadoop-common-project
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-auth
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/docs
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/core
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/native
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/.gitignore
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/bin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/conf
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/c++
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/block_forensics
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build-contrib.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/data_join
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/eclipse-plugin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/index
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/vaidya
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/fs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/FileBench.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/ipc
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/security/authorize/TestServiceLevelAuthorization.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/webapps/job
* /hadoop/common/branches/branch-0.23/hadoop-project
* /hadoop/common/branches/branch-0.23/hadoop-project/src/site

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186490#comment-13186490 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Hdfs-trunk #926 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk/926/])
    HADOOP-7974. TestViewFsTrash incorrectly determines the user's home directory. Contributed by Harsh J

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231640
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hadoop QA (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186418#comment-13186418 ] 

Hadoop QA commented on HADOOP-7974:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12510616/HADOOP-7974.patch
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    -1 javadoc.  The javadoc tool appears to have generated 7 warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 eclipse:eclipse.  The patch built with eclipse:eclipse.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed unit tests in .

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/509//testReport/
Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/509//console

This message is automatically generated.
                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eli Collins updated HADOOP-7974:
--------------------------------

    Component/s: test
    
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, test
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186462#comment-13186462 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Mapreduce-trunk-Commit #1563 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1563/])
    HADOOP-7974. TestViewFsTrash incorrectly determines the user's home directory. Contributed by Harsh J

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231640
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Harsh J (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated HADOOP-7974:
----------------------------

    Attachment: HADOOP-7974.patch

Patch that uses a get-parent call instead of hacking with strings.
                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Harsh J (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated HADOOP-7974:
----------------------------

    Status: Patch Available  (was: Open)
    
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186508#comment-13186508 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Mapreduce-trunk #959 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/959/])
    HADOOP-7974. TestViewFsTrash incorrectly determines the user's home directory. Contributed by Harsh J

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231640
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186495#comment-13186495 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Hdfs-0.23-Build #139 (See [https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/139/])
    HADOOP-7974. svn merge -c 1231640 from trunk

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231641
Files : 
* /hadoop/common/branches/branch-0.23
* /hadoop/common/branches/branch-0.23/hadoop-common-project
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-auth
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/docs
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/core
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/native
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/.gitignore
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/bin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/conf
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/c++
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/block_forensics
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build-contrib.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/data_join
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/eclipse-plugin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/index
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/vaidya
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/fs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/FileBench.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/ipc
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/security/authorize/TestServiceLevelAuthorization.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/webapps/job
* /hadoop/common/branches/branch-0.23/hadoop-project
* /hadoop/common/branches/branch-0.23/hadoop-project/src/site

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Eli Collins (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eli Collins reopened HADOOP-7974:
---------------------------------

    
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Eli Collins (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eli Collins updated HADOOP-7974:
--------------------------------

          Resolution: Fixed
       Fix Version/s: 0.23.1
    Target Version/s:   (was: 0.23.1)
        Hadoop Flags: Reviewed
              Status: Resolved  (was: Patch Available)

I've committed this and merged to 23. Thanks Harsh!
                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186450#comment-13186450 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #1545 (See [https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1545/])
    HADOOP-7974. TestViewFsTrash incorrectly determines the user's home directory. Contributed by Harsh J

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231640
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186459#comment-13186459 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Mapreduce-0.23-Commit #392 (See [https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Commit/392/])
    HADOOP-7974. svn merge -c 1231640 from trunk

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231641
Files : 
* /hadoop/common/branches/branch-0.23
* /hadoop/common/branches/branch-0.23/hadoop-common-project
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-auth
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/docs
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/core
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/native
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/.gitignore
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/bin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/conf
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/c++
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/block_forensics
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build-contrib.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/data_join
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/eclipse-plugin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/index
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/vaidya
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/fs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/FileBench.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/ipc
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/security/authorize/TestServiceLevelAuthorization.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/webapps/job
* /hadoop/common/branches/branch-0.23/hadoop-project
* /hadoop/common/branches/branch-0.23/hadoop-project/src/site

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Eli Collins (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186447#comment-13186447 ] 

Eli Collins commented on HADOOP-7974:
-------------------------------------

+1   javadoc failures are unrelated
                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186451#comment-13186451 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Common-0.23-Commit #379 (See [https://builds.apache.org/job/Hadoop-Common-0.23-Commit/379/])
    HADOOP-7974. svn merge -c 1231640 from trunk

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231641
Files : 
* /hadoop/common/branches/branch-0.23
* /hadoop/common/branches/branch-0.23/hadoop-common-project
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-auth
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/docs
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/core
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/native
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/.gitignore
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/bin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/conf
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/c++
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/block_forensics
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build-contrib.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/build.xml
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/data_join
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/eclipse-plugin
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/index
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/contrib/vaidya
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/examples
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/fs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/hdfs
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/FileBench.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/ipc
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/security/authorize/TestServiceLevelAuthorization.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java
* /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/src/webapps/job
* /hadoop/common/branches/branch-0.23/hadoop-project
* /hadoop/common/branches/branch-0.23/hadoop-project/src/site

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186454#comment-13186454 ] 

Hudson commented on HADOOP-7974:
--------------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #1618 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1618/])
    HADOOP-7974. TestViewFsTrash incorrectly determines the user's home directory. Contributed by Harsh J

eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1231640
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java

                
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>             Fix For: 0.23.1
>
>         Attachments: HADOOP-7974.patch
>
>
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to determine the user's home directory. It only works if the user's directory is one level deep, and breaks if the home directory is more than one level deep (eg user hudson, who's home dir might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>     
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use that as the base, ie ask the home directory for its parent.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira