Description
We should change chooseTarget(..., DatanodeDescriptor writer, ...) to chooseTarget (..., node writer, ...) as the only important property of writer is to identify other nodes' location relationship so more generic one could be better. It also helps to cover cases that client node is not a Datanode. Also, the excluded nodes are not necessary to be a HashMap with the same key and value, Set is more proper in this case.