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 2018/10/30 05:48:37 UTC

[kylin] branch master updated: KYLIN-3649 segment region count and size are not correct when using mysql as Kylin metadata storage

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 43c7207  KYLIN-3649 segment region count and size are not correct when using mysql as Kylin metadata storage
43c7207 is described below

commit 43c7207524f8507e1a47552d71186e6c8d7254c6
Author: chitin <ch...@gmail.com>
AuthorDate: Tue Oct 30 11:56:17 2018 +0800

    KYLIN-3649 segment region count and size are not correct when using mysql as Kylin metadata storage
---
 .../java/org/apache/kylin/rest/job/StorageCleanupJob.java  |  2 +-
 .../java/org/apache/kylin/rest/service/CubeService.java    | 14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java b/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java
index a7dfa01..70a7b8a 100755
--- a/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java
@@ -154,7 +154,7 @@ public class StorageCleanupJob extends AbstractApplication {
     }
 
     protected void cleanUnusedHBaseTables() throws IOException {
-        if ("hbase".equals(config.getMetadataUrl().getScheme())) {
+        if ("hbase".equals(config.getStorageUrl().getScheme())) {
             final int deleteTimeoutMin = 10; // Unit minute
             try {
                 // use reflection to isolate NoClassDef errors when HBase is not available
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
index d4ff970..96d60c7 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -53,12 +53,13 @@ import org.apache.kylin.job.execution.ExecutableState;
 import org.apache.kylin.measure.percentile.PercentileMeasureType;
 import org.apache.kylin.metadata.cachesync.Broadcaster;
 import org.apache.kylin.metadata.draft.Draft;
-import org.apache.kylin.metadata.model.DataModelDesc;
-import org.apache.kylin.metadata.model.FunctionDesc;
-import org.apache.kylin.metadata.model.MeasureDesc;
+import org.apache.kylin.metadata.model.IStorageAware;
 import org.apache.kylin.metadata.model.SegmentRange;
 import org.apache.kylin.metadata.model.SegmentStatusEnum;
 import org.apache.kylin.metadata.model.TableDesc;
+import org.apache.kylin.metadata.model.DataModelDesc;
+import org.apache.kylin.metadata.model.MeasureDesc;
+import org.apache.kylin.metadata.model.FunctionDesc;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
 import org.apache.kylin.metadata.project.RealizationEntry;
@@ -471,7 +472,8 @@ public class CubeService extends BasicService implements InitializingBean {
         }
 
         hr = new HBaseResponse();
-        if ("hbase".equals(getConfig().getMetadataUrl().getScheme())) {
+        CubeInstance cube = CubeManager.getInstance(getConfig()).getCube(cubeName);
+        if (cube.getStorageType() == IStorageAware.ID_HBASE || cube.getStorageType() == IStorageAware.ID_SHARDED_HBASE) {
             try {
                 logger.debug("Loading HTable info " + cubeName + ", " + tableName);