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

haosdent commented on HDFS-5355:
--------------------------------

In fact, I think we should change
{code:java}
((FileOutputStream)cout).getChannel().force(true);
{code}
to
{code:java}
((FileOutputStream)cout).getChannel().force(false);
{code}

Form the JavaDoc, it mentions that:
{quote}
The metaData parameter can be used to limit the number of I/O operations that 
this method is required to perform. Passing false for this parameter indicates 
that only updates to the file's content need be written to storage; passing 
true indicates that updates to both the file's content and metadata must be 
written, which generally requires at least one more I/O operation.
{quote}

I am if all the write operations are override. If it is so, set force(false) 
could reduce unnecessary IO. But if all the write operations are append, set 
force(true) couldn't bring any performance improvements.

> Hsync Metrics error
> -------------------
>
>                 Key: HDFS-5355
>                 URL: https://issues.apache.org/jira/browse/HDFS-5355
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 3.0.0, 2.2.0
>            Reporter: haosdent
>            Priority: Minor
>         Attachments: HDFS-5355.patch
>
>
> The authors before comment "Expect two syncs, one from the hsync, one on 
> close" in TestDataNodeMetrics.java. In fact there isn't call sync when close. 
> One hsync call would produce two syncs, one for checksum and the other for 
> block. I modify relate code and make it looks like the hflush metrics.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to