hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-18754 (addendum) close the input resource
Date Wed, 25 Oct 2017 04:46:36 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 f887a5a3a -> f6ba8185e


HBASE-18754 (addendum) close the input resource


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

Branch: refs/heads/branch-2
Commit: f6ba8185ea2960ea8760d9bb175feda9e19cc699
Parents: f887a5a
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Wed Oct 25 12:31:37 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Wed Oct 25 12:36:56 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f6ba8185/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
index 08d9853..203bea3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
@@ -199,8 +199,9 @@ public abstract class TimeRangeTracker {
       ProtobufUtil.mergeFrom(builder, data, pblen, data.length - pblen);
       return TimeRangeTracker.create(type, builder.getFrom(), builder.getTo());
     } else {
-      DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
-      return TimeRangeTracker.create(type, in.readLong(), in.readLong());
+      try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(data))) {
+        return TimeRangeTracker.create(type, in.readLong(), in.readLong());
+      }
     }
   }
 


Mime
View raw message