Repository: kylin Updated Branches: refs/heads/2.x-staging 30c9fd64d -> 1428bbc43
minor: wrap exceptions in Observer with IOException Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6d0c8eb1 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6d0c8eb1 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6d0c8eb1 Branch: refs/heads/2.x-staging Commit: 6d0c8eb15e363441cd557103f02840a35ffd3ddb Parents: d267396 Author: honma <ho...@ebay.com> Authored: Tue Jan 26 11:24:32 2016 +0800 Committer: honma <ho...@ebay.com> Committed: Tue Jan 26 21:40:48 2016 +0800 ---------------------------------------------------------------------- .../observer/ObserverAggregationCache.java | 23 ++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/6d0c8eb1/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverAggregationCache.java ---------------------------------------------------------------------- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverAggregationCache.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverAggregationCache.java index 6b27aaa..8404262 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverAggregationCache.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverAggregationCache.java @@ -31,8 +31,8 @@ import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.regionserver.RegionScanner; import org.apache.kylin.measure.MeasureAggregator; -import org.apache.kylin.storage.hbase.common.coprocessor.AggregationCache; import org.apache.kylin.storage.hbase.common.coprocessor.AggrKey; +import org.apache.kylin.storage.hbase.common.coprocessor.AggregationCache; /** * @author yangli9 @@ -67,15 +67,20 @@ public class ObserverAggregationCache extends AggregationCache { @Override public boolean next(List<Cell> results) throws IOException { - // AggregateRegionObserver.LOG.info("Kylin Scanner next()"); - boolean hasMore = false; - if (iterator.hasNext()) { - Entry<AggrKey, MeasureAggregator[]> entry = iterator.next(); - makeCells(entry, results); - hasMore = iterator.hasNext(); + try { + // AggregateRegionObserver.LOG.info("Kylin Scanner next()"); + boolean hasMore = false; + if (iterator.hasNext()) { + Entry<AggrKey, MeasureAggregator[]> entry = iterator.next(); + makeCells(entry, results); + hasMore = iterator.hasNext(); + } + // AggregateRegionObserver.LOG.info("Kylin Scanner next() done"); + + return hasMore; + } catch (Exception e) { + throw new IOException("Error when calling next", e); } - // AggregateRegionObserver.LOG.info("Kylin Scanner next() done"); - return hasMore; } private void makeCells(Entry<AggrKey, MeasureAggregator[]> entry, List<Cell> results) {