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/11/20 01:37:37 UTC

kylin git commit: KYLIN-2178 fix the UT with jdk1.8

Repository: kylin
Updated Branches:
  refs/heads/v1.6.0-rc2 8b37b81ba -> dcb0bc333


KYLIN-2178 fix the UT with jdk1.8


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

Branch: refs/heads/v1.6.0-rc2
Commit: dcb0bc3332d2adde2e281af9bddde7374df57cfa
Parents: 8b37b81
Author: shaofengshi <sh...@apache.org>
Authored: Sun Nov 20 09:37:30 2016 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Sun Nov 20 09:37:30 2016 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kylin/cube/model/CubeDesc.java  |  9 +++++----
 .../cube/model/validation/rule/AggregationGroupRule.java | 11 +++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/dcb0bc33/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index 4a5747b..77e6179 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -616,15 +616,16 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
             }
 
             if (CollectionUtils.containsAny(mandatoryDims, hierarchyDims)) {
-                logger.warn("Aggregation group " + index + " mandatory dimensions overlap with hierarchy dimensions: " + CollectionUtils.intersection(mandatoryDims, hierarchyDims));
+
+                logger.warn("Aggregation group " + index + " mandatory dimensions overlap with hierarchy dimensions: " + Sets.intersection(mandatoryDims, hierarchyDims));
             }
             if (CollectionUtils.containsAny(mandatoryDims, jointDims)) {
-                logger.warn("Aggregation group " + index + " mandatory dimensions overlap with joint dimensions: " + CollectionUtils.intersection(mandatoryDims, jointDims));
+                logger.warn("Aggregation group " + index + " mandatory dimensions overlap with joint dimensions: " + Sets.intersection(mandatoryDims, jointDims));
             }
 
             if (CollectionUtils.containsAny(hierarchyDims, jointDims)) {
                 logger.error("Aggregation group " + index + " hierarchy dimensions overlap with joint dimensions");
-                throw new IllegalStateException("Aggregation group " + index + " hierarchy dimensions overlap with joint dimensions: " + CollectionUtils.intersection(hierarchyDims, jointDims));
+                throw new IllegalStateException("Aggregation group " + index + " hierarchy dimensions overlap with joint dimensions: " + Sets.intersection(hierarchyDims, jointDims));
             }
 
             if (hasSingle(hierarchyDimsList)) {
@@ -689,7 +690,7 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
         Set<String> overlap = new TreeSet<>();
         for (Set<String> dims : dimsList) {
             if (CollectionUtils.containsAny(existing, dims)) {
-                overlap.addAll(CollectionUtils.intersection(existing, dims));
+                overlap.addAll(Sets.intersection(existing, dims));
             }
             existing.addAll(dims);
         }

http://git-wip-us.apache.org/repos/asf/kylin/blob/dcb0bc33/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
index 341efe7..55cb844 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
@@ -18,12 +18,12 @@
 
 package org.apache.kylin.cube.model.validation.rule;
 
-import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
+import com.google.common.collect.Sets;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.kylin.cube.model.AggregationGroup;
 import org.apache.kylin.cube.model.CubeDesc;
@@ -148,8 +148,11 @@ public class AggregationGroupRule implements IValidatorRule<CubeDesc> {
                     int overlapHierarchies = 0;
                     if (agg.getSelectRule().hierarchy_dims != null) {
                         for (String[] oneHierarchy : agg.getSelectRule().hierarchy_dims) {
-                            Set<String> share = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
-                            share.addAll(CollectionUtils.intersection(oneJoint, Arrays.asList(oneHierarchy)));
+                            Set<String> oneHierarchySet = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
+                            for (String s : oneHierarchy) {
+                                oneHierarchySet.add(s);
+                            }
+                            Set<String> share = Sets.intersection(oneJoint, oneHierarchySet);
 
                             if (!share.isEmpty()) {
                                 overlapHierarchies++;
@@ -177,7 +180,7 @@ public class AggregationGroupRule implements IValidatorRule<CubeDesc> {
                             oneJoint.add(s);
                         }
                         if (CollectionUtils.containsAny(existing, oneJoint)) {
-                            overlap.addAll(CollectionUtils.intersection(existing, oneJoint));
+                            overlap.addAll(Sets.intersection(existing, oneJoint));
                         }
                         existing.addAll(oneJoint);
                     }