hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rakesh R (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-4185) Add a metric for number of active leases
Date Mon, 11 May 2015 18:39:01 GMT

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

Rakesh R commented on HDFS-4185:

Oh, HDFS-6757 has completely re-factored the {{LeaseManager}} and removed the datastructure
{{Collection<String> paths}}. Now I need to change the logic as follows:

# IMO following functions can be used to count the {{NumActiveClients}}

  /** @return the number of leases currently in the system */
  public synchronized int countLease() {return sortedLeases.size();}
# Secondly, we need to introduce new API to count the {{NumActiveLeases}}
  /** @return the number of paths contained in all leases */
  synchronized int countPath() {
    int count = 0;
    for (Lease lease : sortedLeases) {
      count += lease.getFiles().size();
    return count;

[~raviprak] Does this sounds good to you ?

> Add a metric for number of active leases
> ----------------------------------------
>                 Key: HDFS-4185
>                 URL: https://issues.apache.org/jira/browse/HDFS-4185
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>    Affects Versions: 0.23.4, 2.0.2-alpha
>            Reporter: Kihwal Lee
>            Assignee: Rakesh R
>              Labels: BB2015-05-TBR
>         Attachments: HDFS-4185-001.patch, HDFS-4185-002.patch, HDFS-4185-003.patch, HDFS-4185-004.patch,
> We have seen cases of systematic open file leaks, which could have been detected if we
have a metric that shows number of active leases.

This message was sent by Atlassian JIRA

View raw message