Browse Source

HDFS-11305: libhdfs++: Log Datanode information when reading an HDFS block. Contributed by Xiaowei Zhu.

James 8 năm trước cách đây
mục cha
commit
69d55340f8

+ 6 - 0
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc

@@ -225,6 +225,12 @@ void FileHandleImpl::AsyncPreadSome(
 
   DatanodeInfoProto &chosen_dn = *it;
 
+  std::string dnIpAddr = chosen_dn.id().ipaddr();
+  std::string dnHostName = chosen_dn.id().hostname();
+  LOG_DEBUG(kFileHandle, << "FileHandleImpl::AsyncPreadSome("
+            << FMT_THIS_ADDR << "), ...) Datanode hostname=" << dnHostName << ", IP Address=" << dnIpAddr
+            << ", file path=\"" << path_ << "\", offset=" << offset);
+
   uint64_t offset_within_block = offset - block->offset();
   uint64_t size_within_block = std::min<uint64_t>(
       block->b().numbytes() - offset_within_block, asio::buffer_size(buffers));