HDDS-1882. TestReplicationManager failed with NPE. (#1197)

This commit is contained in:
Sammi Chen 2019-08-02 03:33:57 +08:00 committed by Nanda kumar
parent a7371a779c
commit e111789aeb
1 changed files with 5 additions and 2 deletions

View File

@ -486,8 +486,11 @@ public class ReplicationManager {
final List<DatanodeDetails> excludeList = replicas.stream() final List<DatanodeDetails> excludeList = replicas.stream()
.map(ContainerReplica::getDatanodeDetails) .map(ContainerReplica::getDatanodeDetails)
.collect(Collectors.toList()); .collect(Collectors.toList());
inflightReplication.get(id).stream().map(r -> r.datanode) List<InflightAction> actionList = inflightReplication.get(id);
.forEach(excludeList::add); if (actionList != null) {
actionList.stream().map(r -> r.datanode)
.forEach(excludeList::add);
}
final List<DatanodeDetails> selectedDatanodes = containerPlacement final List<DatanodeDetails> selectedDatanodes = containerPlacement
.chooseDatanodes(excludeList, null, delta, .chooseDatanodes(excludeList, null, delta,
container.getUsedBytes()); container.getUsedBytes());