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 2018/09/30 03:07:31 UTC

[kylin] branch master updated (f42e937 -> 8db0330)

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git.


    from f42e937  KYLIN-3602 Enable more checkstyle rules
     new aefaf9c  KYLIN-3583 Cast to long before multiplication
     new 8db0330  KYLIN-3579 Replace keySet iterator with entrySet iterator

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../kylin/cube/cuboid/algorithm/BPUSCalculator.java      | 16 ++++++++--------
 .../org/apache/kylin/cube/gridtable/CubeCodeSystem.java  |  8 ++++----
 .../kylin/metrics/lib/impl/RecordEventTimeDetail.java    |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)


[kylin] 01/02: KYLIN-3583 Cast to long before multiplication

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit aefaf9cccef7a21d96912ac55cf622d452d4d05c
Author: chao long <wa...@qq.com>
AuthorDate: Mon Sep 24 22:18:21 2018 +0800

    KYLIN-3583 Cast to long before multiplication
---
 .../java/org/apache/kylin/metrics/lib/impl/RecordEventTimeDetail.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/RecordEventTimeDetail.java b/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/RecordEventTimeDetail.java
index c611d0f..827b5a1 100644
--- a/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/RecordEventTimeDetail.java
+++ b/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/RecordEventTimeDetail.java
@@ -71,7 +71,7 @@ public class RecordEventTimeDetail {
         this.second = calendar.get(Calendar.SECOND);
 
         long timeStampForWeekBegin = timeStamp;
-        timeStampForWeekBegin -= 3600000 * 24 * (calendar.get(Calendar.DAY_OF_WEEK) - 1);
+        timeStampForWeekBegin -= 3600000L * 24 * (calendar.get(Calendar.DAY_OF_WEEK) - 1);
         calendar.setTimeInMillis(timeStampForWeekBegin);
         this.week_begin_date = dateFormat.format(calendar.getTime());
     }


[kylin] 02/02: KYLIN-3579 Replace keySet iterator with entrySet iterator

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 8db033097833be5118655a6d88a5b96e862055ae
Author: chao long <wa...@qq.com>
AuthorDate: Tue Sep 25 15:46:07 2018 +0800

    KYLIN-3579 Replace keySet iterator with entrySet iterator
---
 .../kylin/cube/cuboid/algorithm/BPUSCalculator.java      | 16 ++++++++--------
 .../org/apache/kylin/cube/gridtable/CubeCodeSystem.java  |  8 ++++----
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/BPUSCalculator.java b/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/BPUSCalculator.java
index ea91c6c..6316858 100755
--- a/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/BPUSCalculator.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/BPUSCalculator.java
@@ -60,15 +60,15 @@ public class BPUSCalculator implements BenefitPolicy {
                 cuboidAggCostMap.put(cuboid, getCuboidCost(cuboid));
             }
         }
-        Set<Long> mandatoryCuboidSetWithStats = cuboidAggCostMap.keySet();
+
         //Initialize stats for selection cuboids
         long baseCuboidCost = getCuboidCost(cuboidStats.getBaseCuboid());
         for (Long cuboid : cuboidStats.getAllCuboidsForSelection()) {
             long leastCost = baseCuboidCost;
-            for (Long cuboidTarget : mandatoryCuboidSetWithStats) {
-                if ((cuboid | cuboidTarget) == cuboidTarget) {
-                    if (leastCost > cuboidAggCostMap.get(cuboidTarget)) {
-                        leastCost = cuboidAggCostMap.get(cuboidTarget);
+            for (Map.Entry<Long, Long> cuboidTargetEntry : cuboidAggCostMap.entrySet()) {
+                if ((cuboid | cuboidTargetEntry.getKey()) == cuboidTargetEntry.getKey()) {
+                    if (leastCost > cuboidTargetEntry.getValue()) {
+                        leastCost = cuboidTargetEntry.getValue();
                     }
                 }
             }
@@ -106,9 +106,9 @@ public class BPUSCalculator implements BenefitPolicy {
         }
         double totalCostSaving = 0;
         int benefitCount = 0;
-        for (Long cuboid : cuboidAggCostMapCopy.keySet()) {
-            if (cuboidAggCostMapCopy.get(cuboid) < processCuboidAggCostMap.get(cuboid)) {
-                totalCostSaving += processCuboidAggCostMap.get(cuboid) - cuboidAggCostMapCopy.get(cuboid);
+        for (Map.Entry<Long, Long> entry : cuboidAggCostMapCopy.entrySet()) {
+            if (entry.getValue() < processCuboidAggCostMap.get(entry.getKey())) {
+                totalCostSaving += processCuboidAggCostMap.get(entry.getKey()) - entry.getValue();
                 benefitCount++;
             }
         }
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
index 3577476..4c71fea 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
@@ -168,13 +168,13 @@ public class CubeCodeSystem implements IGTCodeSystem {
 
         // deal with holistic distinct count
         if (dependentMetricsMap != null) {
-            for (Integer child : dependentMetricsMap.keySet()) {
-                if (columns.get(child)) {
-                    Integer parent = dependentMetricsMap.get(child);
+            for (Map.Entry<Integer, Integer> childEntry : dependentMetricsMap.entrySet()) {
+                if (columns.get(childEntry.getKey())) {
+                    Integer parent = childEntry.getValue();
                     if (columns.get(parent) == false)
                         throw new IllegalStateException();
 
-                    int childIdx = columns.trueBitIndexOf(child);
+                    int childIdx = columns.trueBitIndexOf(childEntry.getKey());
                     int parentIdx = columns.trueBitIndexOf(parent);
                     result[childIdx].setDependentAggregator(result[parentIdx]);
                 }