Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: ui
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      Users should be able to delete files or directories using the Namenode UI.

      I'm thinking there ought to be a confirmation dialog. For directories recursive should be set to true. Initially there should be no option to skipTrash.

      1. HDFS-7986.02.patch
        5 kB
        Ravi Prakash
      2. HDFS-7986.01.patch
        4 kB
        Ravi Prakash

        Activity

        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #2340 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2340/)
        HDFS-7986. Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2340 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2340/ ) HDFS-7986 . Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32) hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #393 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/393/)
        HDFS-7986. Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #393 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/393/ ) HDFS-7986 . Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #376 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/376/)
        HDFS-7986. Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #376 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/376/ ) HDFS-7986 . Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2315 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2315/)
        HDFS-7986. Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2315 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2315/ ) HDFS-7986 . Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32) hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #399 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/399/)
        HDFS-7986. Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #399 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/399/ ) HDFS-7986 . Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32) hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #1133 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1133/)
        HDFS-7986. Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #1133 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1133/ ) HDFS-7986 . Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32) hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        Hide
        raviprak Ravi Prakash added a comment -

        Thanks a lot Haohui! I'll update the other patches.

        Show
        raviprak Ravi Prakash added a comment - Thanks a lot Haohui! I'll update the other patches.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #8461 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8461/)
        HDFS-7986. Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
        • hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8461 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8461/ ) HDFS-7986 . Allow files / directories to be deleted from the NameNode UI. Contributed by Ravi Prakash. (wheat9: rev 6c52be78a0c6d6d86444933c6b0734dfc2477c32) hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        wheat9 Haohui Mai added a comment -

        I've committed the patch to trunk and branch-2. Thanks Ravi Prakash for the contribution.

        Show
        wheat9 Haohui Mai added a comment - I've committed the patch to trunk and branch-2. Thanks Ravi Prakash for the contribution.
        Hide
        wheat9 Haohui Mai added a comment -

        +1. I'll commit it shortly.

        Show
        wheat9 Haohui Mai added a comment - +1. I'll commit it shortly.
        Hide
        hadoopqa Hadoop QA added a comment -



        +1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 0m 0s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
            0m 27s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12756055/HDFS-7986.02.patch
        Optional Tests  
        git revision trunk / 62943b8
        Java 1.7.0_55
        uname Linux asf903.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12455/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 pre-patch 0m 0s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 whitespace 0m 0s The patch has no lines that end in whitespace.     0m 27s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12756055/HDFS-7986.02.patch Optional Tests   git revision trunk / 62943b8 Java 1.7.0_55 uname Linux asf903.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12455/console This message was automatically generated.
        Hide
        raviprak Ravi Prakash added a comment -

        Thanks a lot for the review Haohui! Here's a patch incorporating all your comments!

        Show
        raviprak Ravi Prakash added a comment - Thanks a lot for the review Haohui! Here's a patch incorporating all your comments!
        Hide
        wheat9 Haohui Mai added a comment -

        Thanks for the work.

        +  <div class="modal" id="delete-modal" tabindex="-1" role="dialog" aria-hidden="true">
        +    <div class="modal-dialog">
        +      <div class="modal-content">
        +        <div class="modal-header">
        +          <button type="button" class="close" data-dismiss="modal"
        +             aria-hidden="true">&times;</button>
        +          <h4 class="modal-title" id="delete-modal-title">Delete</h4>
        +        </div>
        +        <div class="modal-body">
        +          <div class="panel-body">
        +            <div id="delete-prompt"></div>
        +          </div>
        +        </div>
        +
        +        <div class="modal-footer">
        +            <button type="button" class="btn" data-dismiss="modal">Cancel</button>
        +            <button type="button" class="btn btn-success" id="delete-button"
        +            data-complete-text="Deleting...">Delete</button>
        +        </div>
        +
        +      </div>
        +    </div>
        +  </div>
        

        Indentation is off.

        +            <td><a style="cursor:pointer" inode-type="{type}" class="explorer-browse-links">{pathSuffix}</a></td>
        +            <td><span class="glyphicon glyphicon-trash"></span></td>
        

        When adding a new column, there should be an empty td in the thead section as well.

        +          <tr inode-path="{pathSuffix}">
        -            <td><a style="cursor:pointer" inode-type="{type}" class="explorer-browse-links" inode-path="{pathSuffix}">{pathSuffix}</a></td>
        +            <td><a style="cursor:pointer" inode-type="{type}" class="explorer-browse-links">{pathSuffix}</a></td>
        +            <td><span class="glyphicon glyphicon-trash"></span></td>
        +        $('.glyphicon-trash').click(function() {
        +          var inode_name = $(this).closest('tr').attr('inode-path');
        +          var absolute_file_path = append_path(current_directory, inode_name);
        +          deletePath(inode_name, absolute_file_path);
        +        })
        

        Instead of having the styles embedded in the code, a cleaner approach is to give the tr element a class and put CSS on its children. For example:

         <tr inode-path="{pathSuffix}" class="explorer-entry">
        
        .explorer-entry .explorer-browse-links { cursor: pointer; }
        .explorer-entry .glyphicon-trash { cursor: pointer; }
        $('.explorer-entry .glyphicon-trash').click(...
        

        Nit:

        deletePath()
        

        It might make sense to use to the underscore, not the caml naming to make the styles consistent with other parts of the code.

        +
        +    $('#delete-modal').modal();
        +
        +  }
        +
        

        It'll look better to remove the empty lines.

        Show
        wheat9 Haohui Mai added a comment - Thanks for the work. + <div class= "modal" id= "delete-modal" tabindex= "-1" role= "dialog" aria-hidden= " true " > + <div class= "modal-dialog" > + <div class= "modal-content" > + <div class= "modal-header" > + <button type= "button" class= "close" data-dismiss= "modal" + aria-hidden= " true " >&times;</button> + <h4 class= "modal-title" id= "delete-modal-title" >Delete</h4> + </div> + <div class= "modal-body" > + <div class= "panel-body" > + <div id= "delete-prompt" ></div> + </div> + </div> + + <div class= "modal-footer" > + <button type= "button" class= "btn" data-dismiss= "modal" >Cancel</button> + <button type= "button" class= "btn btn-success" id= "delete-button" + data-complete-text= "Deleting..." >Delete</button> + </div> + + </div> + </div> + </div> Indentation is off. + <td><a style= "cursor:pointer" inode-type= "{type}" class= "explorer-browse-links" >{pathSuffix}</a></td> + <td><span class= "glyphicon glyphicon-trash" ></span></td> When adding a new column, there should be an empty td in the thead section as well. + <tr inode-path= "{pathSuffix}" > - <td><a style= "cursor:pointer" inode-type= "{type}" class= "explorer-browse-links" inode-path= "{pathSuffix}" >{pathSuffix}</a></td> + <td><a style= "cursor:pointer" inode-type= "{type}" class= "explorer-browse-links" >{pathSuffix}</a></td> + <td><span class= "glyphicon glyphicon-trash" ></span></td> + $('.glyphicon-trash').click(function() { + var inode_name = $( this ).closest('tr').attr('inode-path'); + var absolute_file_path = append_path(current_directory, inode_name); + deletePath(inode_name, absolute_file_path); + }) Instead of having the styles embedded in the code, a cleaner approach is to give the tr element a class and put CSS on its children. For example: <tr inode-path= "{pathSuffix}" class= "explorer-entry" > .explorer-entry .explorer-browse-links { cursor: pointer; } .explorer-entry .glyphicon-trash { cursor: pointer; } $('.explorer-entry .glyphicon-trash').click(... Nit: deletePath() It might make sense to use to the underscore, not the caml naming to make the styles consistent with other parts of the code. + + $('#delete-modal').modal(); + + } + It'll look better to remove the empty lines.
        Hide
        hadoopqa Hadoop QA added a comment -



        +1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 0m 0s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 release audit 0m 15s The applied patch does not increase the total number of release audit warnings.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
            0m 18s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12755460/HDFS-7986.01.patch
        Optional Tests  
        git revision trunk / 15a557f
        Java 1.7.0_55
        uname Linux asf902.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12401/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 pre-patch 0m 0s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 release audit 0m 15s The applied patch does not increase the total number of release audit warnings. +1 whitespace 0m 0s The patch has no lines that end in whitespace.     0m 18s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12755460/HDFS-7986.01.patch Optional Tests   git revision trunk / 15a557f Java 1.7.0_55 uname Linux asf902.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12401/console This message was automatically generated.
        Hide
        raviprak Ravi Prakash added a comment -

        Here's a patch which allows deleting of files and directories via the UI

        Show
        raviprak Ravi Prakash added a comment - Here's a patch which allows deleting of files and directories via the UI

          People

          • Assignee:
            raviprak Ravi Prakash
            Reporter:
            raviprak Ravi Prakash
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development