HBASE-15797 TestIPCUtil fails after HBASE-15795
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
11740570c1
commit
9d17e3d22a
|
@ -139,16 +139,16 @@ public class IPCUtil {
|
|||
baos = new ByteBufferOutputStream(bufferSize);
|
||||
}
|
||||
Compressor poolCompressor = null;
|
||||
try (OutputStream os = baos) {
|
||||
OutputStream os2Compress = os;
|
||||
OutputStream os = baos;
|
||||
try {
|
||||
if (compressor != null) {
|
||||
if (compressor instanceof Configurable) {
|
||||
((Configurable) compressor).setConf(this.conf);
|
||||
}
|
||||
poolCompressor = CodecPool.getCompressor(compressor);
|
||||
os2Compress = compressor.createOutputStream(os, poolCompressor);
|
||||
os = compressor.createOutputStream(os, poolCompressor);
|
||||
}
|
||||
Codec.Encoder encoder = codec.getEncoder(os2Compress);
|
||||
Codec.Encoder encoder = codec.getEncoder(os);
|
||||
int count = 0;
|
||||
while (cellScanner.advance()) {
|
||||
encoder.write(cellScanner.current());
|
||||
|
@ -163,6 +163,8 @@ public class IPCUtil {
|
|||
} catch (BufferOverflowException e) {
|
||||
throw new DoNotRetryIOException(e);
|
||||
} finally {
|
||||
os.close();
|
||||
|
||||
if (poolCompressor != null) {
|
||||
CodecPool.returnCompressor(poolCompressor);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue