hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rushabh S Shah (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10480) Add an admin command to list currently open files
Date Mon, 22 May 2017 02:54:05 GMT

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

Rushabh S Shah commented on HDFS-10480:
---------------------------------------

Thanks for carrying forward the work [~manojg].
I just took a cursory glance over the patch. Will provide a detailed review sometime next
week.
I had couple of comments.
1. {code:title=LeaseManager.java|borderStyle=solid}
public BatchedListEntries<OpenFileEntry> getUnderConstructionFiles(
      final long prevId) throws IOException {
    SortedMap<Long, Lease> remainingLeases;
    synchronized (this) {
      remainingLeases = new TreeMap<>(leasesById).tailMap(prevId, false);
    }
...
} 
{code}
Instead of creating SortedMap<Long, Lease> we can just create SortedSet<Long>
and call {{getINodeIdWithLeases}} to populate it.

2.  {code:title=FSNamesystem.java|borderStyle=solid}
  BatchedListEntries<OpenFileEntry> listOpenFiles(long prevId)
      throws IOException {
    final String operationName = "listOpenFiles";
    boolean success = false;
    checkSuperuserPrivilege();
    checkOperation(OperationCategory.READ);
    readLock();
    try {
      checkOperation(OperationCategory.READ);
....
} 
{code}
I never understand the need to check twice for {{checkOperation(OperationCategory.READ)}}.
It is all over namenode code.
Do we need to check it twice ?

> 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.04.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