Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.23.0
    • Fix Version/s: None
    • Component/s: fs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Add "-h" for FSshell -ls to format the sizes of files in a human-readable format.
      For instance:
      $hdfs dfs -ls -h /user/hadoop/mylog
      rw-rr- 1 root supergroup 1.7k 2011-07-26 20:54 /user/hadoop/mylog

      1. HADOOP-7485.patch
        3 kB
        XieXianshan
      2. HADOOP-7485-v0.2.patch
        5 kB
        XieXianshan

        Issue Links

          Activity

          Hide
          XieXianshan added a comment -

          I'll add some test cases later.

          Show
          XieXianshan added a comment - I'll add some test cases later.
          Hide
          Hadoop QA added a comment -

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

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

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javadoc. The javadoc tool did not generate any warning messages.

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

          +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 failed these core unit tests:
          org.apache.hadoop.cli.TestCLI

          +1 system test framework. The patch passed system test framework compile.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/766//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/766//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/766//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12487830/HADOOP-7485.patch against trunk revision 1150987. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +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 failed these core unit tests: org.apache.hadoop.cli.TestCLI +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/766//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/766//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/766//console This message is automatically generated.
          Hide
          Suresh Srinivas added a comment -

          Along with tests, please updated the ls documentation in src/documentation/content/xdocs/file_system_shell.xml

          Show
          Suresh Srinivas added a comment - Along with tests, please updated the ls documentation in src/documentation/content/xdocs/file_system_shell.xml
          Hide
          Milind Bhandarkar added a comment -

          +1. Definitely a usability improvement.

          Show
          Milind Bhandarkar added a comment - +1. Definitely a usability improvement.
          Hide
          XieXianshan added a comment -

          Thanks for your comments,@Suresh & @Milind.
          I reuploaded the patch(updated the documentation and TestCLI).

          Show
          XieXianshan added a comment - Thanks for your comments,@Suresh & @Milind. I reuploaded the patch(updated the documentation and TestCLI).
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12487937/HADOOP-7485-v0.2.patch
          against trunk revision 1150987.

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

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

          +1 javadoc. The javadoc tool did not generate any warning messages.

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

          +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 core unit tests.

          +1 system test framework. The patch passed system test framework compile.

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/768//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/768//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/768//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12487937/HADOOP-7485-v0.2.patch against trunk revision 1150987. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +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 core unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/768//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/768//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/768//console This message is automatically generated.
          Hide
          Daryn Sharp added a comment -

          +1 Love it! Minor suggestion is to push {{formatSize()} down in the source to keep the standard methods at the top. That's just a stylistic issue, so you can decide if it's necessary.

          Show
          Daryn Sharp added a comment - +1 Love it! Minor suggestion is to push {{formatSize()} down in the source to keep the standard methods at the top. That's just a stylistic issue, so you can decide if it's necessary.
          Hide
          Suresh Srinivas added a comment -

          +1 for the patch.

          Show
          Suresh Srinivas added a comment - +1 for the patch.
          Hide
          Suresh Srinivas added a comment -

          I committed the patch. Thank you Xie Xianshan.

          Show
          Suresh Srinivas added a comment - I committed the patch. Thank you Xie Xianshan.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Common-trunk-Commit #701 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/701/)
          HADOOP-7485. Add -h option to ls to list file sizes in human readable format. Contributed by XieXianshan.

          suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151505
          Files :

          • /hadoop/common/trunk/common/src/test/core/org/apache/hadoop/cli/testConf.xml
          • /hadoop/common/trunk/common/src/docs/src/documentation/content/xdocs/file_system_shell.xml
          • /hadoop/common/trunk/common/CHANGES.txt
          • /hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/shell/Ls.java
          Show
          Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #701 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/701/ ) HADOOP-7485 . Add -h option to ls to list file sizes in human readable format. Contributed by XieXianshan. suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151505 Files : /hadoop/common/trunk/common/src/test/core/org/apache/hadoop/cli/testConf.xml /hadoop/common/trunk/common/src/docs/src/documentation/content/xdocs/file_system_shell.xml /hadoop/common/trunk/common/CHANGES.txt /hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/shell/Ls.java
          Hide
          Uma Maheswara Rao G added a comment -

          looks there are some test failures in CLI
          filed the JIRA HADOOP-7486

          Show
          Uma Maheswara Rao G added a comment - looks there are some test failures in CLI filed the JIRA HADOOP-7486
          Hide
          Milind Bhandarkar added a comment -

          I was wondering whether we should explicitly call out the NIST binary multiples (i.e. 2*n) in addition to the decimal multiples (10*n). This patch reports binary multiples as K, M, G etc. (So does unix ls, and causes confusion Ideally, one should use KiB, MiB, GiB for binary multiples. Thoughts ?

          Show
          Milind Bhandarkar added a comment - I was wondering whether we should explicitly call out the NIST binary multiples (i.e. 2* n) in addition to the decimal multiples (10 *n). This patch reports binary multiples as K, M, G etc. (So does unix ls, and causes confusion Ideally, one should use KiB, MiB, GiB for binary multiples. Thoughts ?

            People

            • Assignee:
              XieXianshan
              Reporter:
              XieXianshan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development