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 2015/06/25 07:26:13 UTC

incubator-kylin git commit: KYLIN-844 default observer behavior if no attribute hint found

Repository: incubator-kylin
Updated Branches:
  refs/heads/0.7-staging cc25a0424 -> de7b13b0b


KYLIN-844 default observer behavior if no attribute hint found


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

Branch: refs/heads/0.7-staging
Commit: de7b13b0b877aded419e9d057f10dbeff3cc76b1
Parents: cc25a04
Author: honma <ho...@ebay.com>
Authored: Thu Jun 25 13:26:02 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Thu Jun 25 13:26:02 2015 +0800

----------------------------------------------------------------------
 .../hbase/coprocessor/observer/AggregateRegionObserver.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/de7b13b0/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/AggregateRegionObserver.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/AggregateRegionObserver.java b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/AggregateRegionObserver.java
index aea2cea..8771bf4 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/AggregateRegionObserver.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/observer/AggregateRegionObserver.java
@@ -48,7 +48,6 @@ public class AggregateRegionObserver extends BaseRegionObserver {
     static final String FILTER = "_Filter";
     static final String BEHAVIOR = "_Behavior";
 
-
     @Override
     public final RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> ctxt, final Scan scan, final RegionScanner innerScanner) throws IOException {
 
@@ -85,8 +84,11 @@ public class AggregateRegionObserver extends BaseRegionObserver {
         byte[] filterBytes = scan.getAttribute(FILTER);
         CoprocessorFilter filter = CoprocessorFilter.deserialize(filterBytes);
 
+        ObserverBehavior observerBehavior = ObserverBehavior.SCAN_FILTER_AGGR;
         byte[] behavior = scan.getAttribute(BEHAVIOR);
-        ObserverBehavior observerBehavior = ObserverBehavior.valueOf(new String(behavior));
+        if (behavior != null && behavior.length != 0) {
+            observerBehavior = ObserverBehavior.valueOf(new String(behavior));
+        }
 
         // start/end region operation & sync on scanner is suggested by the
         // javadoc of RegionScanner.nextRaw()
@@ -95,7 +97,7 @@ public class AggregateRegionObserver extends BaseRegionObserver {
         region.startRegionOperation();
         try {
             synchronized (innerScanner) {
-                return new AggregationScanner(type, filter, projector, aggregators, innerScanner,observerBehavior);
+                return new AggregationScanner(type, filter, projector, aggregators, innerScanner, observerBehavior);
             }
         } finally {
             region.closeRegionOperation();