hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [46/50] [abbrv] hbase git commit: HBASE-15797 TestIPCUtil fails after HBASE-15795
Date Wed, 11 May 2016 04:58:18 GMT
HBASE-15797 TestIPCUtil fails after HBASE-15795

Signed-off-by: stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9d17e3d2
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9d17e3d2
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9d17e3d2

Branch: refs/heads/hbase-12439
Commit: 9d17e3d22a03dbff99b67837184bfe731049d56f
Parents: 1174057
Author: Jurriaan Mous <jurmous@jurmo.us>
Authored: Sun May 8 08:43:28 2016 +0200
Committer: stack <stack@apache.org>
Committed: Mon May 9 17:04:58 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9d17e3d2/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
index a87bc8d..74466b5 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
@@ -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);
       }


Mime
View raw message