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 2016/07/21 06:43:46 UTC

kylin git commit: minor, fix NPE when metastore cleanup

Repository: kylin
Updated Branches:
  refs/heads/master 696fb89aa -> d7cf67554


minor, fix NPE when metastore cleanup

Signed-off-by: shaofengshi <sh...@apache.org>


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

Branch: refs/heads/master
Commit: d7cf675541771000ff37f164070a686e61f7fa8f
Parents: 696fb89
Author: Yiming Liu <li...@gmail.com>
Authored: Thu Jul 21 14:33:00 2016 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Thu Jul 21 14:43:32 2016 +0800

----------------------------------------------------------------------
 .../engine/mr/steps/MetadataCleanupJob.java     | 22 +++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/d7cf6755/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MetadataCleanupJob.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MetadataCleanupJob.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MetadataCleanupJob.java
index dd482d6..f3ab310 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MetadataCleanupJob.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MetadataCleanupJob.java
@@ -122,16 +122,18 @@ public class MetadataCleanupJob extends AbstractHadoopJob {
         // three level resources, only dictionaries
         NavigableSet<String> dictTables = getStore().listResources(ResourceStore.DICT_RESOURCE_ROOT);
 
-        for (String table : dictTables) {
-            NavigableSet<String> tableColNames = getStore().listResources(table);
-            if (tableColNames != null)
-                for (String tableCol : tableColNames) {
-                    NavigableSet<String> dictionaries = getStore().listResources(tableCol);
-                    if (dictionaries != null)
-                        for (String dict : dictionaries)
-                            if (isOlderThanThreshold(getStore().getResourceTimestamp(dict)))
-                                toDeleteResource.add(dict);
-                }
+        if (dictTables != null) {
+            for (String table : dictTables) {
+                NavigableSet<String> tableColNames = getStore().listResources(table);
+                if (tableColNames != null)
+                    for (String tableCol : tableColNames) {
+                        NavigableSet<String> dictionaries = getStore().listResources(tableCol);
+                        if (dictionaries != null)
+                            for (String dict : dictionaries)
+                                if (isOlderThanThreshold(getStore().getResourceTimestamp(dict)))
+                                    toDeleteResource.add(dict);
+                    }
+            }
         }
 
         Set<String> activeResourceList = Sets.newHashSet();