hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mingliang Liu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-12380) Simplify dataQueue.wait condition logical operation in DataStreamer::run()
Date Fri, 01 Sep 2017 06:21:00 GMT

     [ https://issues.apache.org/jira/browse/HDFS-12380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mingliang Liu updated HDFS-12380:
---------------------------------
       Resolution: Fixed
     Hadoop Flags: Reviewed
    Fix Version/s: 3.0.0-beta1
           Status: Resolved  (was: Patch Available)

+1

Committed to {{trunk}} branch. Thanks for your contribution [~liaoyuxiangqin]. 
Thanks for your review [~shahrs87].

> Simplify dataQueue.wait condition logical operation in DataStreamer::run()
> --------------------------------------------------------------------------
>
>                 Key: HDFS-12380
>                 URL: https://issues.apache.org/jira/browse/HDFS-12380
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs-client
>    Affects Versions: 3.0.0-beta1
>         Environment: cluster: 3 nodes
> os:(Red Hat 2.6.33.20, Red Hat 3.10.0-514.6.1.el7.x86_64, Ubuntu4.4.0-31-generic)
> hadoop version: hadoop-3.0.0-beta1
> operation: Code review
>            Reporter: liaoyuxiangqin
>            Assignee: liaoyuxiangqin
>             Fix For: 3.0.0-beta1
>
>         Attachments: HDFS-12380.001.patch, HDFS-12380.002.patch
>
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
>     When i read the run() of DataStream class in hdfs-client, i found the following condition
code could be more simplify and easy to understand.
> {code:title=DataStreamer.java|borderStyle=solid}
> // wait for a packet to be sent.
> long now = Time.monotonicNow();
> while ((!shouldStop() && dataQueue.size() == 0 &&
>      (stage != BlockConstructionStage.DATA_STREAMING ||
>       stage == BlockConstructionStage.DATA_STREAMING &&
>             now - lastPacket < halfSocketTimeout)) || doSleep ) {
> {code}
>       as described above code segmet, i find the code of stage !=DATA_STREAMING  and
stage==DATA_STREAMING appear at the same time in one  condition, so i think this condition
logical not good understanding and should simplify more.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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