hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yiqun Lin (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HDFS-10480) Add an admin command to list currently open files
Date Fri, 19 May 2017 02:38:05 GMT

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

Yiqun Lin edited comment on HDFS-10480 at 5/19/17 2:37 AM:
-----------------------------------------------------------

Thanks for the updated patch, [~manojg]! The latest patch almost looks good to me now. Only
one comment from me:
When the {{listOpenFiles}} command used in HA mode, the {{Tracer}} passed to {{OpenFilesIterator}}
will be null. And this will lead a NPE error. The related codes in {{OpenFilesIterator}}.
{code}
+  public BatchedEntries<OpenFileEntry> makeRequest(Long prevId)
+      throws IOException {
+    try (TraceScope ignored = tracer.newScope("listOpenFiles")) {   <== there is a chance
that tracer will be null
+      return namenode.listOpenFiles(prevId);
+    }
+  }
{code}
The codes in {{DFSAdmin#listOpenFiles}}
{code}
  public int listOpenFiles() throws IOException {
    DistributedFileSystem dfs = getDFS();
    Configuration dfsConf = dfs.getConf();
    URI dfsUri = dfs.getUri();
    boolean isHaEnabled = HAUtilClient.isLogicalUri(dfsConf, dfsUri);

    RemoteIterator<OpenFileEntry> openFilesRemoteIterator;
    if (isHaEnabled) {
      ProxyAndInfo<ClientProtocol> proxy = NameNodeProxies.createNonHAProxy(
          dfsConf, HAUtil.getAddressOfActive(getDFS()), ClientProtocol.class,
          UserGroupInformation.getCurrentUser(), false);
      openFilesRemoteIterator = new OpenFilesIterator(proxy.getProxy(), null);
    } else {
{code}


was (Author: linyiqun):
Thanks for the updated patch, [~manojg]! The latest patch almost looks good to me now. Only
one comment from me:
When the {{listOpenFiles}} command used in HA mode, the {{Tracer}} passed to {{OpenFilesIterator}}
will be null. And this will lead a NPE error. The related codes in {{OpenFilesIterator}}.
{code}
+  public BatchedEntries<OpenFileEntry> makeRequest(Long prevId)
+      throws IOException {
+    try (TraceScope ignored = tracer.newScope("listOpenFiles")) {   <== there is a chance
that tracer will be null
+      return namenode.listOpenFiles(prevId);
+    }
+  }
{code}

> Add an admin command to list currently open files
> -------------------------------------------------
>
>                 Key: HDFS-10480
>                 URL: https://issues.apache.org/jira/browse/HDFS-10480
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Kihwal Lee
>            Assignee: Manoj Govindassamy
>         Attachments: HDFS-10480.02.patch, HDFS-10480.03.patch, HDFS-10480-trunk-1.patch,
HDFS-10480-trunk.patch
>
>
> Currently there is no easy way to obtain the list of active leases or files being written.
It will be nice if we have an admin command to list open files and their lease holders.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message