swamirishi commented on code in PR #8125:
URL: https://github.com/apache/ozone/pull/8125#discussion_r2020338669
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -628,39 +627,35 @@ public Response getContainerMisMatchInsights(
case OM:
List<ContainerInfo> nonOMContainers = new ArrayList<>();
while (scmContainerInfo != null && nonOMContainers.size() < limit) {
- Long omContainerID = containerMetadata == null ? null :
containerMetadata.getContainerID();
+ Long omContainerID = omContainers.peekNextKey();
Review Comment:
Same as above
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -721,30 +716,28 @@ public Response getOmContainersDeletedInSCM(
limit = Integer.MAX_VALUE;
}
long minContainerID = prevKey + 1;
- Iterator<ContainerInfo> deletedStateSCMContainers =
containerManager.getContainers().stream()
- .filter(containerInfo -> containerInfo.getContainerID() >=
minContainerID)
- .filter(containerInfo -> containerInfo.getState() ==
HddsProtos.LifeCycleState.DELETED)
-
.sorted(Comparator.comparingLong(ContainerInfo::getContainerID)).iterator();
+ Iterator<ContainerInfo> deletedStateSCMContainers =
containerManager.getContainerInfoIterator(
+ HddsProtos.LifeCycleState.DELETED,
ContainerID.valueOf(minContainerID));
List<ContainerDiscrepancyInfo> containerDiscrepancyInfoList;
try (SeekableIterator<Long, ContainerMetadata> omContainers =
reconContainerMetadataManager.getContainersIterator()) {
ContainerInfo scmContainerInfo = deletedStateSCMContainers.hasNext() ?
deletedStateSCMContainers.next() : null;
- ContainerMetadata containerMetadata = omContainers.hasNext() ?
omContainers.next() : null;
List<ContainerMetadata> omContainersDeletedInSCM = new ArrayList<>();
- while (containerMetadata != null && scmContainerInfo != null
+ while (omContainers.hasNext() && scmContainerInfo != null
&& omContainersDeletedInSCM.size() < limit) {
- Long omContainerID = containerMetadata.getContainerID();
+ Long omContainerID = omContainers.peekNextKey();
Review Comment:
Same as above
--
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]