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

Rakesh R commented on HDFS-9494:
--------------------------------

Thanks [~demongaorui], nice improvement. I've few comments, please see:

# To be on the safe side, please do incr {{healthyStreamerCount++;}} after 
successfully submitting {{executorCompletionService.submit()}}.
# The new logic is masking the execution exception of 
{{s.waitForAckedSeqno(toWaitFor);}}. Please catch ExecutionException. Probably 
you can use like,
{code}
try {
        Future <Void> f = executorCompletionService.take();
        f.get();
}  catch (InterruptedException ie) {
  //....
}  catch (ExecutionException e) {
  //....
} 
{code}
# For javac warning, please add {{<Void>}} as follows:
{code}
CompletionService <Void> executorCompletionService = new
        ExecutorCompletionService<>(executor);
{code}
# Nit: Please correct formatting. Give one space in between the operators like,
{code}
int healthyStreamerCount = 0;
final long toWaitFor = flushInternalWithoutWaitingAck();
//....
//....
for (int i = 0; i < healthyStreamerCount; i++)
{code}


> Parallel optimization of DFSStripedOutputStream#flushAllInternals( )
> --------------------------------------------------------------------
>
>                 Key: HDFS-9494
>                 URL: https://issues.apache.org/jira/browse/HDFS-9494
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: GAO Rui
>            Assignee: GAO Rui
>            Priority: Minor
>         Attachments: HDFS-9494-origin-trunk.00.patch, 
> HDFS-9494-origin-trunk.01.patch
>
>
> Currently, in DFSStripedOutputStream#flushAllInternals( ), we trigger and 
> wait for flushInternal( ) in sequence. So the runtime flow is like:
> {code}
> Streamer0#flushInternal( )
> Streamer0#waitForAckedSeqno( )
> Streamer1#flushInternal( )
> Streamer1#waitForAckedSeqno( )
> …
> Streamer8#flushInternal( )
> Streamer8#waitForAckedSeqno( )
> {code}
> It could be better to trigger all the streamers to flushInternal( ) and
> wait for all of them to return from waitForAckedSeqno( ),  and then 
> flushAllInternals( ) returns.



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

Reply via email to