You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/10/07 12:57:38 UTC

[GitHub] [hadoop] coder-chenzhi commented on a change in pull request #2358: HADOOP-17295 Move dedicated pre-logging statements into existing logg…

coder-chenzhi commented on a change in pull request #2358:
URL: https://github.com/apache/hadoop/pull/2358#discussion_r500989847



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
##########
@@ -486,12 +486,11 @@ DatanodeCommand cacheReport() throws IOException {
 
       cmd = bpNamenode.cacheReport(bpRegistration, bpid, blockIds);
       long sendTime = monotonicNow();
-      long createCost = createTime - startTime;
       long sendCost = sendTime - createTime;
       dn.getMetrics().addCacheReport(sendCost);
       if (LOG.isDebugEnabled()) {
         LOG.debug("CacheReport of " + blockIds.size()
-            + " block(s) took " + createCost + " msecs to generate and "
+            + " block(s) took " + (createTime - startTime) + " msecs to generate and "

Review comment:
       IMHO, another reason for this change is that it can improve the maintainability, as the `sendCost` only used by the logging call. But I will leave it alone. We can not move the call to `monotonicNow()`, because the result is also used by  `dn.getMetrics().addCacheReport(sendCost)`.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org