[ 
https://issues.apache.org/jira/browse/HDFS-5978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13946160#comment-13946160
 ] 

Haohui Mai commented on HDFS-5978:
----------------------------------

{code}
+  public void shutdown() {
+    bootstrap.shutdown();
+  }
{code}

Calling {{bootstrap.shutdown()}} only will have resource leaks. You'll need to 
add all channels into a {{ChannelGroup}} and calls {{ChannelGroup.close()}} and 
{{ChannelFactory.releaseExternalResources()}} to guarantee proper clean ups. It 
is important to clean up the resources as other tests might reuse the JVM.

Please see http://docs.jboss.org/netty/3.2/guide/html_single for code examples. 
The portmap daemon in the nfs project contains the example as well.

for {{initServerAndWait()}}, you replace it with a single line of code that 
waits on the close future of the server-side channel:

{code}
bootstrap.bind(address).getCloseFuture().await();
{code}

Other than that the patch looks good to me.

> Create a tool to take fsimage and expose read-only WebHDFS API
> --------------------------------------------------------------
>
>                 Key: HDFS-5978
>                 URL: https://issues.apache.org/jira/browse/HDFS-5978
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: tools
>            Reporter: Akira AJISAKA
>            Assignee: Akira AJISAKA
>              Labels: newbie
>         Attachments: HDFS-5978.2.patch, HDFS-5978.3.patch, HDFS-5978.4.patch, 
> HDFS-5978.5.patch, HDFS-5978.patch
>
>
> Suggested in HDFS-5975.
> Add an option to OfflineImageViewer to launch HTTP server that takes fsimage 
> and exposes the read-only version of WebHDFS API for OfflineImageViewer. The 
> server only supports {{LISTSTATUS}} operation and other operations such as 
> {{GETFILESTATUS}} will be added by other JIRAs.
> That way we can allow the operator to use the existing command-line tool, or 
> even the web UI to debug the fsimage. It also allows the operator to 
> interactively browsing the file system, figuring out what goes wrong.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to