KYLIN-1308 prevent query thread from forever hanging when EP went wrong
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ab778525 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ab778525 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ab778525 Branch: refs/heads/KYLIN-1122 Commit: ab77852582c2350d82201f80ae6c9b09054eadb6 Parents: eb1d276 Author: honma <ho...@ebay.com> Authored: Wed Jan 13 15:41:31 2016 +0800 Committer: Xiaoyu Wang <wangxia...@apache.org> Committed: Mon Jan 18 13:38:30 2016 +0800 ---------------------------------------------------------------------- .../apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/ab778525/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 05c9ffe..be8c011 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 @@ -27,6 +27,7 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.DataFormatException; @@ -93,7 +94,7 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC { } try { current++; - return queue.take(); + return queue.poll(1, TimeUnit.HOURS); } catch (InterruptedException e) { throw new RuntimeException("error when waiting queue", e); }