kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [10/24] kylin git commit: minor, fix model desc NPE in diagnosis, broken cube can be exported
Date Tue, 25 Jul 2017 09:44:57 GMT
minor, fix model desc NPE in diagnosis, broken cube can be exported


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

Branch: refs/heads/2.1.x
Commit: 11aa9ff690440d1a8de4785d09a75e94a8633976
Parents: 6252ae3
Author: liveandevil <1361605435@qq.com>
Authored: Wed Jul 19 20:51:54 2017 +0800
Committer: lidongsjtu <lidong@apache.org>
Committed: Thu Jul 20 21:59:32 2017 +0800

----------------------------------------------------------------------
 .../apache/kylin/tool/CubeMetaExtractor.java    | 21 +++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/11aa9ff6/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
index ce4ebfa..5bfe96b 100644
--- a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
+++ b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
@@ -321,13 +321,7 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
 
             dealWithStreaming(cube);
 
-            for (TableRef table : modelDesc.getAllTables()) {
-                String tableName = table.getTableIdentity();
-                addRequired(TableDesc.concatResourcePath(tableName));
-                addOptional(TableDesc.concatExdResourcePath(tableName));
-            }
-
-            addRequired(DataModelDesc.concatResourcePath(modelDesc.getName()));
+            retrieveDataModelDesc(modelDesc);
             addRequired(CubeDesc.concatResourcePath(cubeDesc.getName()));
 
             if (includeSegments) {
@@ -389,6 +383,19 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
         }
     }
 
+    private void retrieveDataModelDesc(DataModelDesc modelDesc) {
+        if (modelDesc == null) {
+            return;
+        }
+        for (TableRef table : modelDesc.getAllTables()) {
+            String tableName = table.getTableIdentity();
+            addRequired(TableDesc.concatResourcePath(tableName));
+            addOptional(TableDesc.concatExdResourcePath(tableName));
+        }
+
+        addRequired(DataModelDesc.concatResourcePath(modelDesc.getName()));
+    }
+
     private void addRequired(String record) {
         logger.info("adding required resource {}", record);
         requiredResources.add(record);


Mime
View raw message