You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2017/04/18 02:39:46 UTC

kylin git commit: add check: DeployCoprocessorCLI should ensure the cube is using HBase as storage

Repository: kylin
Updated Branches:
  refs/heads/master 7d6329b0d -> 47e8be5d5


add check: DeployCoprocessorCLI should ensure the cube is using HBase as storage


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

Branch: refs/heads/master
Commit: 47e8be5d55b4210c84e5f5d20a19bdb3eb8e8c6f
Parents: 7d6329b
Author: shaofengshi <sh...@apache.org>
Authored: Tue Apr 18 10:39:16 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Tue Apr 18 10:39:42 2017 +0800

----------------------------------------------------------------------
 .../kylin/storage/hbase/util/DeployCoprocessorCLI.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/47e8be5d/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java
index d51b71e..c437e66 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java
@@ -53,6 +53,7 @@ import org.apache.kylin.common.util.Bytes;
 import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.cube.CubeManager;
 import org.apache.kylin.cube.CubeSegment;
+import org.apache.kylin.metadata.model.IStorageAware;
 import org.apache.kylin.metadata.model.SegmentStatusEnum;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
@@ -465,11 +466,13 @@ public class DeployCoprocessorCLI {
 
         ArrayList<String> result = new ArrayList<String>();
         for (CubeInstance cube : cubeMgr.listAllCubes()) {
-            for (CubeSegment seg : cube.getSegments(SegmentStatusEnum.READY)) {
-                String tableName = seg.getStorageLocationIdentifier();
-                if (StringUtils.isBlank(tableName) == false) {
-                    result.add(tableName);
-                    System.out.println("added new table: " + tableName);
+            if (cube.getStorageType() == IStorageAware.ID_HBASE || cube.getStorageType() == IStorageAware.ID_SHARDED_HBASE) {
+                for (CubeSegment seg : cube.getSegments(SegmentStatusEnum.READY)) {
+                    String tableName = seg.getStorageLocationIdentifier();
+                    if (StringUtils.isBlank(tableName) == false) {
+                        result.add(tableName);
+                        System.out.println("added new table: " + tableName);
+                    }
                 }
             }
         }