navinko commented on code in PR #11805:
URL: https://github.com/apache/ozone/pull/11805#discussion_r4447224933
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ECUnderReplicationHandler.java:
##########
@@ -239,25 +234,22 @@ private Map<Integer, Pair<ContainerReplica, NodeStatus>>
filterSources(
.filter(r -> !deletionInFlight.contains(r.getDatanodeDetails()))
.map(r -> {
try {
- return Pair.of(r,
- replicationManager.getNodeStatus(r.getDatanodeDetails()));
+ return new SourceReplica(r,
replicationManager.getNodeStatus(r.getDatanodeDetails()));
} catch (NodeNotFoundException e) {
throw new IllegalStateException("Unable to find NodeStatus for "
+ r.getDatanodeDetails(), e);
}
})
- .filter(pair -> pair.getRight().isHealthy())
+ .filter(source -> source.nodeStatus().isHealthy())
// If there are multiple nodes online for a given index, we just
// pick any IN_SERVICE one. At the moment, the input streams cannot
// handle multiple replicas for the same index, so if we passed them
// all through they would not get used anyway.
// If neither of the nodes are in service, we just pass one through,
// as it will be decommission or maintenance.
- .collect(Collectors.toMap(
- pair -> pair.getLeft().getReplicaIndex(),
- pair -> pair,
- (p1, p2) -> {
- if (p1.getRight().getOperationalState() == IN_SERVICE) {
+ .collect(Collectors.toMap(source -> source.replica().getReplicaIndex(),
+ source -> source, (p1, p2) -> {
Review Comment:
updated the format.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]