sumitagrawl commented on code in PR #10081:
URL: https://github.com/apache/ozone/pull/10081#discussion_r3151836351


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/ScmBlockLocationProtocolClientSideTranslatorPB.java:
##########
@@ -233,6 +233,13 @@ public List<AllocatedBlock> allocateBlock(
       blocks.add(builder.build());
     }
 
+    if (!blocks.isEmpty()) {
+      String blockIds = blocks.stream()
+          .map(b -> b.getBlockID().toString())
+          .collect(Collectors.joining(", "));
+      TracingUtil.getActiveSpan().addEvent("SCM allocated block(s): " + 
blockIds);

Review Comment:
   This can have performace impact as if trace is not enabled, even this string 
creation happens



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/ScmBlockLocationProtocolClientSideTranslatorPB.java:
##########
@@ -233,6 +233,13 @@ public List<AllocatedBlock> allocateBlock(
       blocks.add(builder.build());
     }
 
+    if (!blocks.isEmpty()) {
+      String blockIds = blocks.stream()
+          .map(b -> b.getBlockID().toString())
+          .collect(Collectors.joining(", "));
+      TracingUtil.getActiveSpan().addEvent("SCM allocated block(s): " + 
blockIds);

Review Comment:
   We can use setAttribute(key, value) multiple time if called multiple time
   like,
   TracingUtil.getActiveSpan().setAttribute("blockAllocated", 
resp.getContainerBlockID()) in previous loop



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

Reply via email to