You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by Hilmi Egemen Ciritoğlu <hi...@gmail.com> on 2017/10/16 14:41:00 UTC

Changing Replication Factor

Hi all,

I am just wonder when I set replication factor for lower value than 3,

I believe this method is working: chooseReplicaToDelete
public List<DatanodeStorageInfo> chooseReplicasToDelete(
Collection<DatanodeStorageInfo> availableReplicas,
Collection<DatanodeStorageInfo> delCandidates,
int expectedNumOfReplicas,
List<StorageType> excessTypes,
DatanodeDescriptor addedNode,
DatanodeDescriptor delNodeHint)


I think delNodeHint variable is passed from outside of the class. I wonder
what is all about ? Also why the code does this for only first one. What is
logic behind ?
if (firstOne && useDelHint(delNodeHintStorage, addedNodeStorage,
moreThanOne, exactlyOne, excessTypes)) {

Also I can see comment like

// otherwise pick one with least space from priSet if it is not empty
// otherwise one node with least space from remains
What is priSet ? I would be really appreciate if somebody can make these
clear for me?

Regards,
Egemen