[ https://issues.apache.org/jira/browse/HDFS-7854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14359991#comment-14359991 ]
Li Bo commented on HDFS-7854: ----------------------------- Patch 004 includes several changes advised by Jing. Function {{queueCurrentPacket}} is moved to class DataStreamer and renamed to {{queuePacket}}. Currently {{waitAndQueueCurrentPacket}} and {{waitForAckedSeqno}} are still kept in DFSOutputStream due to the following considerations: there’re two threads, the main thread and streamer thread, the main thread will wait until the data queue has space; it’s more reasonable to keep the main thread waiting by direct calling {{ waitForAckedSeqno }} than by calling {{streamer. waitForAckedSeqno }}; {{ waitAndQueueCurrentPacket }} and {{waitForAckedSeqno}} have to check {{DFSOutputStream.closed}} which can’t be substituted by {{DataStreamer.streamClosed}}. {{dataQueue}} is still kept in DFSOutputStream currently and we can also move it to DataStreamer. We can treat the two class as producer and consumer, I think it’s reasonable to let the producer be aware of the sharing pool. > Separate class DataStreamer out of DFSOutputStream > -------------------------------------------------- > > Key: HDFS-7854 > URL: https://issues.apache.org/jira/browse/HDFS-7854 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Li Bo > Assignee: Li Bo > Attachments: HDFS-7854-001.patch, HDFS-7854-002.patch, > HDFS-7854-003.patch, HDFS-7854-004.patch > > > This sub task separate DataStreamer from DFSOutputStream. New DataStreamer > will accept packets and write them to remote datanodes. -- This message was sent by Atlassian JIRA (v6.3.4#6332)