You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2016/01/14 08:17:17 UTC

kylin git commit: fix htable threadsafe potential issue

Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 160248c1f -> ba681c1d4


fix htable threadsafe potential issue


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

Branch: refs/heads/2.0-rc
Commit: ba681c1d40664b40465f899ea4c472b688ee0b8c
Parents: 160248c
Author: honma <ho...@ebay.com>
Authored: Thu Jan 14 15:17:05 2016 +0800
Committer: honma <ho...@ebay.com>
Committed: Thu Jan 14 15:17:05 2016 +0800

----------------------------------------------------------------------
 .../kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/ba681c1d/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
index 1881a23..5cca195 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
@@ -34,6 +34,7 @@ import java.util.zip.DataFormatException;
 import javax.annotation.Nullable;
 
 import org.apache.commons.lang.NotImplementedException;
+import org.apache.hadoop.hbase.client.HConnection;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.coprocessor.Batch;
 import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
@@ -217,7 +218,7 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
         final ImmutableBitSet selectedColBlocks = scanRequests.get(0).getSelectedColBlocks().set(0);
 
         // globally shared connection, does not require close
-        final HTableInterface hbaseTable = HBaseConnection.get(cubeSeg.getCubeInstance().getConfig().getStorageUrl()).getTable(cubeSeg.getStorageLocationIdentifier());
+        final HConnection conn = HBaseConnection.get(cubeSeg.getCubeInstance().getConfig().getStorageUrl());
 
         final List<IntList> hbaseColumnsToGTIntList = Lists.newArrayList();
         List<List<Integer>> hbaseColumnsToGT = getHBaseColumnsGTMapping(selectedColBlocks);
@@ -269,7 +270,7 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
 
                         Map<byte[], CubeVisitProtos.CubeVisitResponse> results;
                         try {
-                            results = getResults(builder.build(), hbaseTable, epRange.getFirst(), epRange.getSecond());
+                            results = getResults(builder.build(), conn.getTable(cubeSeg.getStorageLocationIdentifier()), epRange.getFirst(), epRange.getSecond());
                         } catch (Throwable throwable) {
                             throw new RuntimeException("Error when visiting cubes by endpoint:", throwable);
                         }