From b3acc082aabfc14d012c41932a14a07a986c95d8 Mon Sep 17 00:00:00 2001 From: chunie <1443232120@qq.com> Date: Mon, 18 Apr 2022 12:16:57 +0800 Subject: [PATCH] modify block reader finish condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bytes_to_read_ is used to calculate all the data that client had received(include DATA and META length). while currently we initialize it to data length,so the stop condition should be: bytes_to_read_ < 0 --- .../src/main/native/libhdfspp/lib/reader/block_reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/block_reader.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/block_reader.cc index acecfce52374e..c7d70a8f5fa6f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/block_reader.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/block_reader.cc @@ -395,7 +395,7 @@ struct BlockReaderImpl::AckRead : continuation::Continuation virtual void Run(const Next &next) override { LOG_TRACE(kBlockReader, << "BlockReaderImpl::AckRead::Run(" << FMT_CONT_AND_PARENT_ADDR << ") called"); - if (parent_->bytes_to_read_ > 0) { + if (parent_->bytes_to_read_ >= 0) { next(Status::OK()); return; }