From 9b1d3579b483069d0a211cb0b29c1f25013684dd Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Sat, 9 Jul 2022 03:05:42 +0900 Subject: [PATCH] Revert "MAPREDUCE-7388. Remove unused variable _eof in GzipCodec.cc (#4429)" This reverts commit fac895828f714b5587b57900d588acac69880c1e. --- .../src/main/native/src/codec/GzipCodec.cc | 2 ++ .../src/main/native/src/codec/GzipCodec.h | 1 + 2 files changed, 3 insertions(+) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc index 2e98436918..b0b985296c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.cc @@ -135,6 +135,7 @@ GzipDecompressStream::GzipDecompressStream(InputStream * stream, uint32_t buffer } zstream->next_in = NULL; zstream->avail_in = 0; + _eof = false; } GzipDecompressStream::~GzipDecompressStream() { @@ -155,6 +156,7 @@ int32_t GzipDecompressStream::read(void * buff, uint32_t length) { if (zstream->avail_in == 0) { int32_t rd = _stream->read(_buffer, _capacity); if (rd <= 0) { + _eof = true; size_t wt = zstream->next_out - (Bytef*)buff; return wt > 0 ? wt : -1; } else { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.h b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.h index af58d37274..a5f986ef96 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.h +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/codec/GzipCodec.h @@ -60,6 +60,7 @@ protected: char * _buffer; uint32_t _capacity; void * _zstream; + bool _eof; public: GzipDecompressStream(InputStream * stream, uint32_t bufferSizeHint);