kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject [7/8] kylin git commit: KYLIN-1579 IT preparation classes like BuildCubeWithEngine should exit with status code upon build exception
Date Wed, 13 Apr 2016 03:39:56 GMT
KYLIN-1579 IT preparation classes like BuildCubeWithEngine should exit with status code upon
build exception


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

Branch: refs/heads/master
Commit: 71d3f303058afa66608440ae3db91e32e921740c
Parents: 11be1e3
Author: Hongbin Ma <mahongbin@apache.org>
Authored: Tue Apr 12 11:35:54 2016 +0800
Committer: Hongbin Ma <mahongbin@apache.org>
Committed: Wed Apr 13 11:11:15 2016 +0800

----------------------------------------------------------------------
 .../kylin/provision/BuildCubeWithEngine.java    | 26 ++++++++++--------
 .../kylin/provision/BuildCubeWithStream.java    | 28 ++++++++++++--------
 .../kylin/provision/BuildIIWithStream.java      | 22 ++++++++-------
 .../coprocessor/endpoint/CubeVisitService.java  |  4 +--
 4 files changed, 47 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/71d3f303/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java b/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
index e1cbe1f..71bb34f 100644
--- a/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
+++ b/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
@@ -41,7 +41,6 @@ import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.kylin.common.KylinConfig;
-import org.apache.kylin.common.util.AbstractKylinTestCase;
 import org.apache.kylin.common.util.ClassUtil;
 import org.apache.kylin.common.util.HBaseMetadataTestCase;
 import org.apache.kylin.common.util.Pair;
@@ -76,15 +75,20 @@ public class BuildCubeWithEngine {
     private static final Log logger = LogFactory.getLog(BuildCubeWithEngine.class);
 
     public static void main(String[] args) throws Exception {
-        beforeClass();
-
-        BuildCubeWithEngine buildCubeWithEngine = new BuildCubeWithEngine();
-        buildCubeWithEngine.before();
-        buildCubeWithEngine.build();
-        logger.info("Build is done");
-        afterClass();
-        logger.info("Going to exit");
-        System.exit(0);
+        try {
+            beforeClass();
+
+            BuildCubeWithEngine buildCubeWithEngine = new BuildCubeWithEngine();
+            buildCubeWithEngine.before();
+            buildCubeWithEngine.build();
+            logger.info("Build is done");
+            afterClass();
+            logger.info("Going to exit");
+            System.exit(0);
+        } catch (Exception e) {
+            logger.error("error", e);
+            System.exit(1);
+        }
     }
 
     public static void beforeClass() throws Exception {
@@ -99,7 +103,7 @@ public class BuildCubeWithEngine {
             logger.info("Will not use fast build mode");
         }
 
-        System.setProperty(KylinConfig.KYLIN_CONF,HBaseMetadataTestCase.SANDBOX_TEST_DATA);
+        System.setProperty(KylinConfig.KYLIN_CONF, HBaseMetadataTestCase.SANDBOX_TEST_DATA);
         if (StringUtils.isEmpty(System.getProperty("hdp.version"))) {
             throw new RuntimeException("No hdp.version set; Please set hdp.version in your
jvm option, for example: -Dhdp.version=2.2.4.2-2");
         }

http://git-wip-us.apache.org/repos/asf/kylin/blob/71d3f303/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithStream.java
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithStream.java b/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithStream.java
index 99da26f..d8a9c21 100644
--- a/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithStream.java
+++ b/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithStream.java
@@ -23,7 +23,6 @@ import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.kylin.common.KylinConfig;
-import org.apache.kylin.common.util.AbstractKylinTestCase;
 import org.apache.kylin.common.util.ClassUtil;
 import org.apache.kylin.common.util.DateFormat;
 import org.apache.kylin.common.util.HBaseMetadataTestCase;
@@ -53,21 +52,28 @@ public class BuildCubeWithStream {
     private KylinConfig kylinConfig;
 
     public static void main(String[] args) throws Exception {
-        beforeClass();
-        BuildCubeWithStream buildCubeWithStream = new BuildCubeWithStream();
-        buildCubeWithStream.before();
-        buildCubeWithStream.build();
-        logger.info("Build is done");
-        afterClass();
-        logger.info("Going to exit");
-        System.exit(0);
-        
+
+        try {
+            beforeClass();
+
+            BuildCubeWithStream buildCubeWithStream = new BuildCubeWithStream();
+            buildCubeWithStream.before();
+            buildCubeWithStream.build();
+            logger.info("Build is done");
+            afterClass();
+            logger.info("Going to exit");
+            System.exit(0);
+        } catch (Exception e) {
+            logger.error("error", e);
+            System.exit(1);
+        }
+
     }
 
     public static void beforeClass() throws Exception {
         logger.info("Adding to classpath: " + new File(HBaseMetadataTestCase.SANDBOX_TEST_DATA).getAbsolutePath());
         ClassUtil.addClasspath(new File(HBaseMetadataTestCase.SANDBOX_TEST_DATA).getAbsolutePath());
-        System.setProperty(KylinConfig.KYLIN_CONF,HBaseMetadataTestCase.SANDBOX_TEST_DATA);
+        System.setProperty(KylinConfig.KYLIN_CONF, HBaseMetadataTestCase.SANDBOX_TEST_DATA);
         if (StringUtils.isEmpty(System.getProperty("hdp.version"))) {
             throw new RuntimeException("No hdp.version set; Please set hdp.version in your
jvm option, for example: -Dhdp.version=2.2.4.2-2");
         }

http://git-wip-us.apache.org/repos/asf/kylin/blob/71d3f303/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java b/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java
index ace1a2f..6d077e7 100644
--- a/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java
+++ b/kylin-it/src/test/java/org/apache/kylin/provision/BuildIIWithStream.java
@@ -50,7 +50,6 @@ import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.kylin.common.KylinConfig;
-import org.apache.kylin.common.util.AbstractKylinTestCase;
 import org.apache.kylin.common.util.ClassUtil;
 import org.apache.kylin.common.util.DateFormat;
 import org.apache.kylin.common.util.HBaseMetadataTestCase;
@@ -93,14 +92,19 @@ public class BuildIIWithStream {
     private KylinConfig kylinConfig;
 
     public static void main(String[] args) throws Exception {
-        beforeClass();
-        BuildIIWithStream buildCubeWithEngine = new BuildIIWithStream();
-        buildCubeWithEngine.before();
-        buildCubeWithEngine.build();
-        logger.info("Build is done");
-        afterClass();
-        logger.info("Going to exit");
-        System.exit(0);
+        try {
+            beforeClass();
+            BuildIIWithStream buildCubeWithEngine = new BuildIIWithStream();
+            buildCubeWithEngine.before();
+            buildCubeWithEngine.build();
+            logger.info("Build is done");
+            afterClass();
+            logger.info("Going to exit");
+            System.exit(0);
+        } catch (Exception e) {
+            logger.error("error", e);
+            System.exit(1);
+        }
     }
 
     public static void beforeClass() throws Exception {

http://git-wip-us.apache.org/repos/asf/kylin/blob/71d3f303/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
index 5158b33..2f1bb9b 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
@@ -227,7 +227,7 @@ public class CubeVisitService extends CubeVisitProtos.CubeVisitService
implement
             }
 
             final MutableBoolean normalComplete = new MutableBoolean(true);
-            final long startTime = request.getStartTime();
+            final long startTime = this.serviceStartTime;//request.getStartTime();
             final long timeout = (long) (request.getTimeout() * 0.95);
 
             final CellListIterator cellListIterator = new CellListIterator() {
@@ -294,7 +294,7 @@ public class CubeVisitService extends CubeVisitProtos.CubeVisitService
implement
                 allRows = new byte[0];
             }
             compressedAllRows = CompressionUtils.compress(allRows);
-            
+
             appendProfileInfo(sb, "compress done");
 
             OperatingSystemMXBean operatingSystemMXBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();


Mime
View raw message