You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Colin Patrick McCabe (JIRA)" <ji...@apache.org> on 2015/01/29 04:10:34 UTC

[jira] [Commented] (HDFS-7698) Fix locking on HDFS read statistics and add a method for clearing them.

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

Colin Patrick McCabe commented on HDFS-7698:
--------------------------------------------

* It is not necessary (or useful) to synchronized {{HdfsDataInputStream#getReadStatistics}}.  getReadStatistics is synchronized inside {{DFSInputStream}} already, and the methods modifying the statistics are not synchronized on {{HdfsDataInputStream}}.

* Add a {{ReadStatistics#clear}} method which clears the stats.

* Add {{libhdfs}} support for clearing the read statistics.

* The {{ReadStatistics}} need to be synchronized on {{infoLock}}, not on the positional lock.  {{pread}} modifies these statistics, and it shouldn't have to take the positional lock to do that.  This could have resulted in lost updates or incorrect read statistics being read when doing {{preads}} (but not when doing regular reads under the positional lock).

> Fix locking on HDFS read statistics and add a method for clearing them.
> -----------------------------------------------------------------------
>
>                 Key: HDFS-7698
>                 URL: https://issues.apache.org/jira/browse/HDFS-7698
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.7.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-7698.001.patch
>
>
> Fix locking on HDFS read statistics and add a method for clearing them.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)