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/db87d462
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/db87d462
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/db87d462

Branch: refs/heads/2.0-rc
Commit: db87d46293ebe4c47284be02b09315a76e65edce
Parents: a118a27
Author: honma <ho...@ebay.com>
Authored: Fri Jan 22 11:17:21 2016 +0800
Committer: honma <ho...@ebay.com>
Committed: Fri Jan 22 11:19:33 2016 +0800

----------------------------------------------------------------------
 .../observer/ObserverAggregationCache.java      | 23 ++++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/db87d462/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 b7b12d1..d03fe16 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.metadata.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) {

Reply via email to