HDFS-11449: libhdfs++: Log Datanode read size when reading from an HDFS block. Contributed by Xiaowei Zhu.
This commit is contained in:
parent
606d20c6c0
commit
0f3f8db113
@ -227,14 +227,15 @@ void FileHandleImpl::AsyncPreadSome(
|
|||||||
|
|
||||||
std::string dnIpAddr = chosen_dn.id().ipaddr();
|
std::string dnIpAddr = chosen_dn.id().ipaddr();
|
||||||
std::string dnHostName = chosen_dn.id().hostname();
|
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 offset_within_block = offset - block->offset();
|
||||||
uint64_t size_within_block = std::min<uint64_t>(
|
uint64_t size_within_block = std::min<uint64_t>(
|
||||||
block->b().numbytes() - offset_within_block, asio::buffer_size(buffers));
|
block->b().numbytes() - offset_within_block, asio::buffer_size(buffers));
|
||||||
|
|
||||||
|
LOG_DEBUG(kFileHandle, << "FileHandleImpl::AsyncPreadSome("
|
||||||
|
<< FMT_THIS_ADDR << "), ...) Datanode hostname=" << dnHostName << ", IP Address=" << dnIpAddr
|
||||||
|
<< ", file path=\"" << path_ << "\", offset=" << offset << ", read size=" << size_within_block);
|
||||||
|
|
||||||
// This is where we will put the logic for re-using a DN connection; we can
|
// This is where we will put the logic for re-using a DN connection; we can
|
||||||
// steal the FileHandle's dn and put it back when we're done
|
// steal the FileHandle's dn and put it back when we're done
|
||||||
std::shared_ptr<DataNodeConnection> dn = CreateDataNodeConnection(io_service_, chosen_dn, &block->blocktoken());
|
std::shared_ptr<DataNodeConnection> dn = CreateDataNodeConnection(io_service_, chosen_dn, &block->blocktoken());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user