haiyang1987 commented on code in PR #6321:
URL: https://github.com/apache/hadoop/pull/6321#discussion_r1420072279


##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java:
##########
@@ -937,13 +935,13 @@ void waitForAckedSeqno(long seqno) throws IOException {
             try {
               dataQueue.wait(1000); // when we receive an ack, we notify on
               long duration = Time.monotonicNowNanos() - begin;
-              if (duration > writeTimeout * NANOSECONDS_PER_MILLISECOND) {
+              if (TimeUnit.NANOSECONDS.toMillis(duration) > writeTimeout) {
                 LOG.error("No ack received, took {}ms (threshold={}ms). "
                     + "File being written: {}, block: {}, "
                     + "Write pipeline datanodes: {}.",
-                    duration / NANOSECONDS_PER_MILLISECOND, writeTimeout, src, 
block, nodes);
+                    TimeUnit.NANOSECONDS.toSeconds(duration), writeTimeout, 
src, block, nodes);

Review Comment:
   TimeUnit.NANOSECONDS.toMillis(duration) ?



##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java:
##########
@@ -937,13 +935,13 @@ void waitForAckedSeqno(long seqno) throws IOException {
             try {
               dataQueue.wait(1000); // when we receive an ack, we notify on
               long duration = Time.monotonicNowNanos() - begin;
-              if (duration > writeTimeout * NANOSECONDS_PER_MILLISECOND) {
+              if (TimeUnit.NANOSECONDS.toMillis(duration) > writeTimeout) {
                 LOG.error("No ack received, took {}ms (threshold={}ms). "
                     + "File being written: {}, block: {}, "
                     + "Write pipeline datanodes: {}.",
-                    duration / NANOSECONDS_PER_MILLISECOND, writeTimeout, src, 
block, nodes);
+                    TimeUnit.NANOSECONDS.toSeconds(duration), writeTimeout, 
src, block, nodes);

Review Comment:
   TimeUnit.NANOSECONDS.toMillis(duration) ?



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