Add new realization type HYBRID2

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

Branch: refs/heads/ranger
Commit: c0e0b8f670311ee5abf400ac1cb8182054de4c7d
Parents: c297f46
Author: nichunen <chunen...@kyligence.io>
Authored: Wed Sep 6 10:59:53 2017 +0800
Committer: Hongbin Ma <m...@kyligence.io>
Committed: Wed Sep 6 12:01:03 2017 +0800

----------------------------------------------------------------------
 .../src/test/java/org/apache/kylin/RealizationRegistryTest.java    | 2 +-
 .../org/apache/kylin/metadata/realization/RealizationType.java     | 2 +-
 .../main/java/org/apache/kylin/storage/hybrid/HybridManager.java   | 2 +-
 query/src/main/java/org/apache/kylin/query/routing/Candidate.java  | 1 +
 4 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/c0e0b8f6/assembly/src/test/java/org/apache/kylin/RealizationRegistryTest.java
----------------------------------------------------------------------
diff --git 
a/assembly/src/test/java/org/apache/kylin/RealizationRegistryTest.java 
b/assembly/src/test/java/org/apache/kylin/RealizationRegistryTest.java
index 11723c8..3590431 100644
--- a/assembly/src/test/java/org/apache/kylin/RealizationRegistryTest.java
+++ b/assembly/src/test/java/org/apache/kylin/RealizationRegistryTest.java
@@ -47,6 +47,6 @@ public class RealizationRegistryTest extends 
LocalFileMetadataTestCase {
     public void test() throws Exception {
         final RealizationRegistry registry = 
RealizationRegistry.getInstance(KylinConfig.getInstanceFromEnv());
         final Set<RealizationType> realizationTypes = 
registry.getRealizationTypes();
-        assertEquals(RealizationType.values().length - 1, 
realizationTypes.size());
+        assertEquals(RealizationType.values().length - 2, 
realizationTypes.size());
     }
 }

http://git-wip-us.apache.org/repos/asf/kylin/blob/c0e0b8f6/core-metadata/src/main/java/org/apache/kylin/metadata/realization/RealizationType.java
----------------------------------------------------------------------
diff --git 
a/core-metadata/src/main/java/org/apache/kylin/metadata/realization/RealizationType.java
 
b/core-metadata/src/main/java/org/apache/kylin/metadata/realization/RealizationType.java
index 3fcfe63..fb58145 100644
--- 
a/core-metadata/src/main/java/org/apache/kylin/metadata/realization/RealizationType.java
+++ 
b/core-metadata/src/main/java/org/apache/kylin/metadata/realization/RealizationType.java
@@ -23,5 +23,5 @@ package org.apache.kylin.metadata.realization;
 
 //TODO: change to String for plugin
 public enum RealizationType {
-    CUBE, INVERTED_INDEX, HYBRID
+    CUBE, INVERTED_INDEX, HYBRID, HYBRID2
 }

http://git-wip-us.apache.org/repos/asf/kylin/blob/c0e0b8f6/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
----------------------------------------------------------------------
diff --git 
a/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java 
b/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
index 2b1c2cc..815d0ea 100644
--- 
a/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
+++ 
b/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridManager.java
@@ -106,7 +106,7 @@ public class HybridManager implements IRealizationProvider {
         @Override
         public void onProjectSchemaChange(Broadcaster broadcaster, String 
project) throws IOException {
             for (IRealization real : 
ProjectManager.getInstance(config).listAllRealizations(project)) {
-                if (real instanceof HybridInstance) {
+                if (real instanceof HybridInstance && 
real.getType().equals(RealizationType.HYBRID)) {
                     reloadHybridInstance(real.getName());
                 }
             }

http://git-wip-us.apache.org/repos/asf/kylin/blob/c0e0b8f6/query/src/main/java/org/apache/kylin/query/routing/Candidate.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/routing/Candidate.java 
b/query/src/main/java/org/apache/kylin/query/routing/Candidate.java
index bc17721..8e8ce5e 100644
--- a/query/src/main/java/org/apache/kylin/query/routing/Candidate.java
+++ b/query/src/main/java/org/apache/kylin/query/routing/Candidate.java
@@ -35,6 +35,7 @@ public class Candidate implements Comparable<Candidate> {
 
     static {
         DEFAULT_PRIORITIES.put(RealizationType.HYBRID, 0);
+        DEFAULT_PRIORITIES.put(RealizationType.HYBRID2, 0);
         DEFAULT_PRIORITIES.put(RealizationType.CUBE, 1);
         DEFAULT_PRIORITIES.put(RealizationType.INVERTED_INDEX, 1);
     }

Reply via email to