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

Zsolt Venczel commented on HDFS-13573:
--------------------------------------

Hi [~linyiqun]!
 Thanks for the suggestions!

One question about the sentence you mentioned:
{code:java}
* The replica placement strategy is that if the writer is on a datanode,
* the 1st replica is placed on the local machine otherwise a random datanode
* (By passing the {@link org.apache.hadoop.fs.CreateFlag}#NO_LOCAL_WRITE flag
* the client can request not to put a block replica on the local datanode.
{code}
If I understand you correctly you're suggesting the above to be changed to the 
following:
{code:java}
* The replica placement strategy is that if the writer is on a datanode,
* the 1st replica is placed on the local machine by default.
* (By passing the {@link org.apache.hadoop.fs.CreateFlag}#NO_LOCAL_WRITE flag
* the client can request not to put a block replica on the local datanode.
{code}
I would suggest not to leave out the scenario when the writer is not on a 
datanode and have the following:
{code:java}
* The replica placement strategy is that if the writer is on a datanode,
* the 1st replica is placed on the local machine by default
* (By passing the {@link org.apache.hadoop.fs.CreateFlag#NO_LOCAL_WRITE} flag
* the client can request not to put a block replica on the local datanode.
* Subsequent replicas will still follow default block placement policy.).
* If the writer is not on a datanode, the 1st replica is placed on a random 
node.{code}
What do you think?

Best regards,
Zsolt

> Javadoc for BlockPlacementPolicyDefault is inaccurate
> -----------------------------------------------------
>
>                 Key: HDFS-13573
>                 URL: https://issues.apache.org/jira/browse/HDFS-13573
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 3.1.0
>            Reporter: Yiqun Lin
>            Assignee: Zsolt Venczel
>            Priority: Trivial
>         Attachments: HDFS-13573.01.patch
>
>
> Current rule of default block placement policy:
> {quote}The replica placement strategy is that if the writer is on a datanode,
>  the 1st replica is placed on the local machine,
>  otherwise a random datanode. The 2nd replica is placed on a datanode
>  that is on a different rack. The 3rd replica is placed on a datanode
>  which is on a different node of the rack as the second replica.
> {quote}
> *if the writer is on a datanode, the 1st replica is placed on the local 
> machine*, actually this can be decided by the hdfs client. The client can 
> pass {{CreateFlag#NO_LOCAL_WRITE}} that request to not put a block replica on 
> the local datanode. But subsequent replicas will still follow default block 
> placement policy.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to