hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shweta (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HDFS-14260) Synchronized Method in BlockReceiver Can Be Replaced with Atomic Value
Date Fri, 08 Feb 2019 23:30:00 GMT

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

Shweta edited comment on HDFS-14260 at 2/8/19 11:29 PM:
--------------------------------------------------------

Thanks for the patch [~belugabehr]. Looks good to me.
Just curious, does this change improve performance that you noticed?


was (Author: shwetayakkali):
Thanks for the [~belugabehr]. Looks good to me.
Just curious, does this change improve performance that you noticed?

> Synchronized Method in BlockReceiver Can Be Replaced with Atomic Value
> ----------------------------------------------------------------------
>
>                 Key: HDFS-14260
>                 URL: https://issues.apache.org/jira/browse/HDFS-14260
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>    Affects Versions: 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: HDFS-14260.1.patch, HDFS-14260.2.patch
>
>
> This synchronized block is protecting {{lastSentTime}} which is a native long.  Can use
AtomicLong and remove this synchronization.
> {code}
>   synchronized boolean packetSentInTime() {
>     long diff = Time.monotonicNow() - lastSentTime;
>     if (diff > maxSendIdleTime) {
>       LOG.info("A packet was last sent " + diff + " milliseconds ago.");
>       return false;
>     }
>     return true;
>   }
> {code}
> https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java#L392-L399



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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