hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject hadoop git commit: HDFS-13712. BlockReaderRemote.read() logging improvement. Contributed by Gergo Repas.
Date Tue, 03 Jul 2018 09:08:16 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.0 98f2444a7 -> 896b51578


HDFS-13712. BlockReaderRemote.read() logging improvement. Contributed by Gergo Repas.

(cherry picked from commit 344f324710522ffb27852c1a673c4f7d3d6eac4b)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/896b5157
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/896b5157
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/896b5157

Branch: refs/heads/branch-3.0
Commit: 896b51578f751817ac9fb3d8dc55d82aa5346cea
Parents: 98f2444
Author: Andrew Wang <wang@apache.org>
Authored: Tue Jul 3 11:07:45 2018 +0200
Committer: Andrew Wang <wang@apache.org>
Committed: Tue Jul 3 11:08:05 2018 +0200

----------------------------------------------------------------------
 .../hadoop/hdfs/client/impl/BlockReaderRemote.java    | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/896b5157/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderRemote.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderRemote.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderRemote.java
index caf15e4..ea1baed 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderRemote.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderRemote.java
@@ -129,16 +129,22 @@ public class BlockReaderRemote implements BlockReader {
   @Override
   public synchronized int read(byte[] buf, int off, int len)
       throws IOException {
-    UUID randomId = (LOG.isTraceEnabled() ? UUID.randomUUID() : null);
-    LOG.trace("Starting read #{} file {} from datanode {}",
-        randomId, filename, datanodeID.getHostName());
+    boolean logTraceEnabled = LOG.isTraceEnabled();
+    UUID randomId = null;
+    if (logTraceEnabled) {
+      randomId = UUID.randomUUID();
+      LOG.trace("Starting read #{} file {} from datanode {}",
+          randomId, filename, datanodeID.getHostName());
+    }
 
     if (curDataSlice == null ||
         curDataSlice.remaining() == 0 && bytesNeededToFinish > 0) {
       readNextPacket();
     }
 
-    LOG.trace("Finishing read #{}", randomId);
+    if (logTraceEnabled) {
+      LOG.trace("Finishing read #{}", randomId);
+    }
 
     if (curDataSlice.remaining() == 0) {
       // we're at EOF now


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


Mime
View raw message