symious commented on a change in pull request #2172:
URL: https://github.com/apache/ozone/pull/2172#discussion_r619839864



##########
File path: 
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconContainerReportHandler.java
##########
@@ -48,26 +46,16 @@ public ReconContainerReportHandler(NodeManager nodeManager,
   @Override
   public void onMessage(final ContainerReportFromDatanode reportFromDatanode,
                         final EventPublisher publisher) {
-
-    final ContainerReportsProto containerReport =
-        reportFromDatanode.getReport();
     ReconContainerManager containerManager =
         (ReconContainerManager) getContainerManager();
-
-    List<ContainerReplicaProto> reportsList = containerReport.getReportsList();
-    for (ContainerReplicaProto containerReplicaProto : reportsList) {
-      final ContainerID id = ContainerID.valueOf(
-          containerReplicaProto.getContainerID());
-      try {
-        containerManager.checkAndAddNewContainer(id,
-            containerReplicaProto.getState(),
-            reportFromDatanode.getDatanodeDetails());
-      } catch (IOException ioEx) {
-        LOG.error("Exception while checking and adding new container.", ioEx);
-      }
-      LOG.debug("Got container report for containerID {} ",
-          containerReplicaProto.getContainerID());
+    List<ContainerReplicaProto> containerReplicaProtoList =
+        reportFromDatanode.getReport().getReportsList();
+    try {
+      containerManager.checkAndAddNewContainerBatch(containerReplicaProtoList);

Review comment:
       Maybe we can set a batch size limit here to avoid the performance impact 
on SCM?




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to