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 2017/07/23 05:42:30 UTC

[1/2] kylin git commit: KYLIN-2556 Introduce Spotbugs plugin

Repository: kylin
Updated Branches:
  refs/heads/master fd4a009d4 -> f70c18f0b


KYLIN-2556 Introduce Spotbugs plugin


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

Branch: refs/heads/master
Commit: f70c18f0b8d5be87f13f1ec65a83b208e6b4367f
Parents: 2182c07
Author: shaofengshi <sh...@apache.org>
Authored: Sun Jul 23 13:41:16 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Sun Jul 23 13:42:15 2017 +0800

----------------------------------------------------------------------
 pom.xml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/f70c18f0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f765f00..e1eecd1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -113,6 +113,8 @@
         <cors.version>2.5</cors.version>
         <tomcat.version>7.0.69</tomcat.version>
         <t-digest.version>3.1</t-digest.version>
+        <findbugs.version>3.0.4</findbugs.version>
+        <spotbugs.version>3.1.0-RC4</spotbugs.version>
 
         <!-- REST Service, ref https://github.com/spring-projects/spring-boot/blob/v1.3.8.RELEASE/spring-boot-dependencies/pom.xml -->
         <spring.boot.version>1.3.8.RELEASE</spring.boot.version>
@@ -1016,7 +1018,14 @@
                 <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>findbugs-maven-plugin</artifactId>
-                    <version>3.0.4</version>
+                    <version>${findbugs.version}}</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>com.github.spotbugs</groupId>
+                            <artifactId>spotbugs</artifactId>
+                            <version>${spotbugs.version}</version>
+                        </dependency>
+                    </dependencies>
                     <configuration>
                         <xmlOutput>true</xmlOutput>
                         <effort>Max</effort>


[2/2] kylin git commit: Improvements on coding styles

Posted by sh...@apache.org.
Improvements on coding styles


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

Branch: refs/heads/master
Commit: 2182c07b1ef01bb37d168572600a2f4fe7d39da3
Parents: fd4a009
Author: shaofengshi <sh...@apache.org>
Authored: Sun Jul 23 13:40:47 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Sun Jul 23 13:42:15 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/kylin/query/relnode/OLAPAggregateRel.java | 4 ++--
 .../java/org/apache/kylin/query/relnode/OLAPWindowRel.java    | 2 --
 .../org/apache/kylin/query/routing/RealizationChooser.java    | 7 ++++---
 3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/2182c07b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
index adb145a..b868267 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
@@ -84,8 +84,8 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel {
         AGGR_FUNC_MAP.put("MIN", "MIN");
 
         Map<String, MeasureTypeFactory> udafFactories = MeasureTypeFactory.getUDAFFactories();
-        for (String udaf : udafFactories.keySet()) {
-            AGGR_FUNC_MAP.put(udaf, udafFactories.get(udaf).getAggrFunctionName());
+        for (Map.Entry<String, MeasureTypeFactory> entry : udafFactories.entrySet()) {
+            AGGR_FUNC_MAP.put(entry.getKey(), entry.getValue().getAggrFunctionName());
         }
 
         Map<String, Class<?>> udafs = MeasureTypeFactory.getUDAFs();

http://git-wip-us.apache.org/repos/asf/kylin/blob/2182c07b/query/src/main/java/org/apache/kylin/query/relnode/OLAPWindowRel.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPWindowRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPWindowRel.java
index c2ea4e2..6470504 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPWindowRel.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPWindowRel.java
@@ -106,12 +106,10 @@ public class OLAPWindowRel extends Window implements OLAPRel {
 
     @Override
     public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
-        ArrayList<RelNode> relInputs = new ArrayList<>(inputs.size());
         for (EnumerableRel input : inputs) {
             if (input instanceof OLAPRel) {
                 ((OLAPRel) input).replaceTraitSet(EnumerableConvention.INSTANCE);
             }
-            relInputs.add(input);
         }
         return EnumerableWindowBridge.createEnumerableWindow(getCluster(), traitSet, inputs.get(0), constants, rowType, groups);
     }

http://git-wip-us.apache.org/repos/asf/kylin/blob/2182c07b/query/src/main/java/org/apache/kylin/query/routing/RealizationChooser.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/routing/RealizationChooser.java b/query/src/main/java/org/apache/kylin/query/routing/RealizationChooser.java
index a598ee6..3431c45 100644
--- a/query/src/main/java/org/apache/kylin/query/routing/RealizationChooser.java
+++ b/query/src/main/java/org/apache/kylin/query/routing/RealizationChooser.java
@@ -66,12 +66,13 @@ public class RealizationChooser {
             throw new NoRealizationFoundException("No model found for" + toErrorMsg(context));
         }
 
-        for (DataModelDesc model : modelMap.keySet()) {
-            Map<String, String> aliasMap = matches(model, context);
+        for (Map.Entry<DataModelDesc, Set<IRealization>> entry : modelMap.entrySet()) {
+            final DataModelDesc model = entry.getKey();
+            final Map<String, String> aliasMap = matches(model, context);
             if (aliasMap != null) {
                 fixModel(context, model, aliasMap);
 
-                IRealization realization = QueryRouter.selectRealization(context, modelMap.get(model));
+                IRealization realization = QueryRouter.selectRealization(context, entry.getValue());
                 if (realization == null) {
                     logger.info("Give up on model {} because no suitable realization is found", model);
                     unfixModel(context);