carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvram...@apache.org
Subject [1/2] incubator-carbondata git commit: show cost as mills instead of seconds
Date Thu, 08 Sep 2016 07:52:36 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 9c39710b8 -> 7493a834d


show cost as mills instead of seconds


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

Branch: refs/heads/master
Commit: 95457612a1205da017989a0c9d1b85be3d73e853
Parents: 9c39710
Author: foryou2030 <foryou2030@126.com>
Authored: Wed Sep 7 21:58:18 2016 +0800
Committer: Venkata Ramana G <ramana.gollamudi@huawei.com>
Committed: Thu Sep 8 13:21:10 2016 +0530

----------------------------------------------------------------------
 .../DriverQueryStatisticsRecorder.java             | 17 ++++++++---------
 .../carbon/querystatistics/QueryStatistic.java     |  4 ++--
 .../apache/carbondata/core/util/CarbonUtil.java    | 13 -------------
 3 files changed, 10 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/95457612/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/DriverQueryStatisticsRecorder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/DriverQueryStatisticsRecorder.java
b/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/DriverQueryStatisticsRecorder.java
index 534852f..c756b39 100644
--- a/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/DriverQueryStatisticsRecorder.java
+++ b/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/DriverQueryStatisticsRecorder.java
@@ -27,7 +27,6 @@ import java.util.concurrent.ConcurrentHashMap;
 import org.apache.carbondata.common.logging.LogService;
 import org.apache.carbondata.common.logging.LogServiceFactory;
 
-import static org.apache.carbondata.core.util.CarbonUtil.add;
 import static org.apache.carbondata.core.util.CarbonUtil.printLine;
 
 import org.apache.commons.lang3.StringUtils;
@@ -121,8 +120,8 @@ public class DriverQueryStatisticsRecorder {
     String load_meta_time = "";
     String block_allocation_time = "";
     String block_identification_time = "";
-    Double driver_part_time_tmp = 0.0;
-    Double driver_part_time_tmp2 = 0.0;
+    long driver_part_time_tmp = 0L;
+    long driver_part_time_tmp2 = 0L;
     String splitChar = " ";
     try {
       // get statistic time from the QueryStatistic
@@ -130,21 +129,21 @@ public class DriverQueryStatisticsRecorder {
         switch (statistic.getMessage()) {
           case QueryStatisticsConstants.SQL_PARSE:
             sql_parse_time += statistic.getTimeTaken() + splitChar;
-            driver_part_time_tmp = add(driver_part_time_tmp, statistic.getTimeTaken());
+            driver_part_time_tmp += statistic.getTimeTaken();
             break;
           case QueryStatisticsConstants.LOAD_META:
             load_meta_time += statistic.getTimeTaken() + splitChar;
-            driver_part_time_tmp = add(driver_part_time_tmp, statistic.getTimeTaken());
+            driver_part_time_tmp += statistic.getTimeTaken();
             break;
           case QueryStatisticsConstants.BLOCK_ALLOCATION:
             block_allocation_time += statistic.getTimeTaken() + splitChar;
-            driver_part_time_tmp = add(driver_part_time_tmp, statistic.getTimeTaken());
-            driver_part_time_tmp2 = add(driver_part_time_tmp2, statistic.getTimeTaken());
+            driver_part_time_tmp += statistic.getTimeTaken();
+            driver_part_time_tmp2 += statistic.getTimeTaken();
             break;
           case QueryStatisticsConstants.BLOCK_IDENTIFICATION:
             block_identification_time += statistic.getTimeTaken() + splitChar;
-            driver_part_time_tmp = add(driver_part_time_tmp, statistic.getTimeTaken());
-            driver_part_time_tmp2 = add(driver_part_time_tmp2, statistic.getTimeTaken());
+            driver_part_time_tmp += statistic.getTimeTaken();
+            driver_part_time_tmp2 += statistic.getTimeTaken();
             break;
           default:
             break;

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/95457612/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/QueryStatistic.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/QueryStatistic.java
b/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/QueryStatistic.java
index 3e44949..939b819 100644
--- a/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/QueryStatistic.java
+++ b/core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/QueryStatistic.java
@@ -98,8 +98,8 @@ public class QueryStatistic implements Serializable {
     return this.message;
   }
 
-  public double getTimeTaken() {
-    return (double)this.timeTaken/1000;
+  public long getTimeTaken() {
+    return  this.timeTaken;
   }
 
   public long getCount() {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/95457612/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
index c98456e..82c515c 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
@@ -28,7 +28,6 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.math.BigDecimal;
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
 import java.nio.charset.Charset;
@@ -1432,17 +1431,5 @@ public final class CarbonUtil {
     return builder.toString();
   }
 
-  /**
-   * Below method will for double plus double
-   *
-   * @param v1
-   * @param v2
-   */
-  public static double add(double v1, double v2)
-  {
-    BigDecimal b1 = new BigDecimal(Double.toString(v1));
-    BigDecimal b2 = new BigDecimal(Double.toString(v2));
-    return  b1.add(b2).doubleValue();
-  }
 }
 


Mime
View raw message