Hadoop Common
  1. Hadoop Common
  2. HADOOP-4917

fs -lsr does not align correctly when the username lengths are different

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: fs
    • Labels:

      Description

      For example,

      bash-3.2$ ./bin/hadoop fs -lsr /user
      drwx------   - nicholas supergroup          0 2008-12-18 15:17 /user/nicholas
      -rw-r--r--   3 nn_sze supergroup       1366 2008-12-18 15:17 /user/nicholas/a.txt
      drwx------   - tsz      supergroup          0 2008-11-25 15:55 /user/tsz
      -rw-------   3 tsz supergroup       1366 2008-11-25 15:53 /user/tsz/r.txt
      

        Activity

        Hide
        Tsz Wo Nicholas Sze added a comment -

        Edited summary: "fs -ls" => "fs -lsr"

        The problem is in lsr. It can be reproduced when files are in different directories and the usernames have different lengths as shown in the description. I think this problem also exists for group names although I have not tested it yet.

        Show
        Tsz Wo Nicholas Sze added a comment - Edited summary: "fs -ls" => "fs -lsr" The problem is in lsr. It can be reproduced when files are in different directories and the usernames have different lengths as shown in the description. I think this problem also exists for group names although I have not tested it yet.
        Hide
        Jakob Homan added a comment -

        Linux doesn't justify across directories on recursive ls either:

        ./blahblah_hdfs:
        total 8
        drwxr-xr-x   2 hdfs search 4096 Jan 16 16:30 .
        drwxrwxrwt  22 root root   4096 Jan 21 09:25 ..
        
        ./foofoo_jhoman:
        total 8
        drwxr-xr-x   2 jhoman users 4096 Jan 21 02:33 .
        drwxrwxrwt  22 root   root  4096 Jan 21 09:25 ..
        
        ./zaza_rdqbipn:
        total 8
        drwxr-xr-x   2 rdqbipn users 4096 Jan 20 09:51 .
        drwxrwxrwt  22 root    root  4096 Jan 21 09:25 ..
        
        ./zaza_tryesesb:
        total 8
        drwxr-xr-x   2 tryesesb users 4096 Jan 21 04:54 .
        drwxrwxrwt  22 root     root  4096 Jan 21 09:25 ..
        

        It could potentially be quite costly to gather the maximum spaces needed for justification across a very large namespace. Perhaps it would be better to bring lsr closer in line with Unix, separating each listed directory with a header and allowing each directory to be justified relative to itself?

        Show
        Jakob Homan added a comment - Linux doesn't justify across directories on recursive ls either: ./blahblah_hdfs: total 8 drwxr-xr-x 2 hdfs search 4096 Jan 16 16:30 . drwxrwxrwt 22 root root 4096 Jan 21 09:25 .. ./foofoo_jhoman: total 8 drwxr-xr-x 2 jhoman users 4096 Jan 21 02:33 . drwxrwxrwt 22 root root 4096 Jan 21 09:25 .. ./zaza_rdqbipn: total 8 drwxr-xr-x 2 rdqbipn users 4096 Jan 20 09:51 . drwxrwxrwt 22 root root 4096 Jan 21 09:25 .. ./zaza_tryesesb: total 8 drwxr-xr-x 2 tryesesb users 4096 Jan 21 04:54 . drwxrwxrwt 22 root root 4096 Jan 21 09:25 .. It could potentially be quite costly to gather the maximum spaces needed for justification across a very large namespace. Perhaps it would be better to bring lsr closer in line with Unix, separating each listed directory with a header and allowing each directory to be justified relative to itself?
        Hide
        Tsz Wo Nicholas Sze added a comment -

        > Perhaps it would be better to bring lsr closer in line with Unix, separating each listed directory with a header and allowing each directory to be justified relative to itself?

        +1 We probably should deprecate lsr and add a "-R" option to ls.

        Show
        Tsz Wo Nicholas Sze added a comment - > Perhaps it would be better to bring lsr closer in line with Unix, separating each listed directory with a header and allowing each directory to be justified relative to itself? +1 We probably should deprecate lsr and add a "-R" option to ls.
        Hide
        Allen Wittenauer added a comment -

        Closing this as fixed, as -R was added.

        Show
        Allen Wittenauer added a comment - Closing this as fixed, as -R was added.

          People

          • Assignee:
            Unassigned
            Reporter:
            Tsz Wo Nicholas Sze
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development