kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nju_y...@apache.org
Subject [08/50] kylin git commit: minor, patch a NPE in CubeService.isCubeInProject() and CubeService.listAllCubes()
Date Mon, 18 Apr 2016 06:34:50 GMT
minor, patch a NPE in CubeService.isCubeInProject() and CubeService.listAllCubes()


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

Branch: refs/heads/1.4-rc
Commit: eb81eb72a421405c4906e3f875d550b2ce3f8931
Parents: 533c4f0
Author: janzhongi <jiazhong@ebay.com>
Authored: Tue Feb 16 11:22:35 2016 +0800
Committer: janzhongi <jiazhong@ebay.com>
Committed: Tue Feb 16 11:23:25 2016 +0800

----------------------------------------------------------------------
 .../java/org/apache/kylin/rest/service/CubeService.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/eb81eb72/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/service/CubeService.java b/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
index fc64a58..3f894ec 100644
--- a/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
+++ b/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
@@ -216,8 +216,10 @@ public class CubeService extends BasicService {
         for (RealizationEntry projectDataModel : project.getRealizationEntries()) {
             if (projectDataModel.getType() == RealizationType.CUBE) {
                 CubeInstance cube = getCubeManager().getCube(projectDataModel.getRealization());
-                assert cube != null;
-                result.add(cube);
+                if (cube != null)
+                    result.add(cube);
+                else
+                    logger.error("Cube instance " + projectDataModel.getRealization() + "
is failed to load");
             }
         }
         return result;
@@ -232,7 +234,10 @@ public class CubeService extends BasicService {
         for (RealizationEntry projectDataModel : project.getRealizationEntries()) {
             if (projectDataModel.getType() == RealizationType.CUBE) {
                 CubeInstance cube = getCubeManager().getCube(projectDataModel.getRealization());
-                assert cube != null;
+                if (cube == null) {
+                    logger.error("Project " + projectName + " contains realization " + projectDataModel.getRealization()
+ " which is not found by CubeManager");
+                    continue;
+                }
                 if (cube.equals(target)) {
                     return true;
                 }


Mime
View raw message