You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/03/28 01:05:22 UTC

[45/50] incubator-kylin git commit: fix

fix


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

Branch: refs/heads/streaming-localdict
Commit: b5a78a600cbd294ce1457bde93c1d682064b40d1
Parents: d72f2e6
Author: qianhao.zhou <qi...@ebay.com>
Authored: Fri Mar 27 18:18:21 2015 +0800
Committer: qianhao.zhou <qi...@ebay.com>
Committed: Fri Mar 27 18:18:21 2015 +0800

----------------------------------------------------------------------
 bin/kylin.sh                                    |  2 +-
 .../kylin/job/streaming/StreamingCLI.java       |  2 +
 .../apache/kylin/job/IIStreamBuilderTest.java   | 48 ++++++++++++++++----
 3 files changed, 41 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b5a78a60/bin/kylin.sh
----------------------------------------------------------------------
diff --git a/bin/kylin.sh b/bin/kylin.sh
index 95568e1..c300915 100644
--- a/bin/kylin.sh
+++ b/bin/kylin.sh
@@ -99,7 +99,7 @@ then
     -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true \
     -Dkylin.hive.dependency=${hive_dependency} \
     -Dspring.profiles.active=${spring_profile} \
-    org.apache.hadoop.util.RunJar ${KYLIN_HOME}/lib/kylin-job-*.jar org.apache.kylin.job.streaming.StreamingCLI start $2 > ${tomcat_root}/logs/kylin.log 2>&1 & echo $! > ${KYLIN_HOME}/$2 &
+    org.apache.hadoop.util.RunJar ${KYLIN_HOME}/lib/kylin-job-*.jar org.apache.kylin.job.streaming.StreamingCLI start $2 > ${KYLIN_HOME}/logs/kylin.log 2>&1 & echo $! > ${KYLIN_HOME}$2 &
     echo "streaming started $2"
     exit 0
 else

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b5a78a60/job/src/main/java/org/apache/kylin/job/streaming/StreamingCLI.java
----------------------------------------------------------------------
diff --git a/job/src/main/java/org/apache/kylin/job/streaming/StreamingCLI.java b/job/src/main/java/org/apache/kylin/job/streaming/StreamingCLI.java
index 219ca41..1d6994f 100644
--- a/job/src/main/java/org/apache/kylin/job/streaming/StreamingCLI.java
+++ b/job/src/main/java/org/apache/kylin/job/streaming/StreamingCLI.java
@@ -59,6 +59,8 @@ public class StreamingCLI {
                 printArgsError(args);
             }
         } catch (Exception e) {
+            logger.error("error start streaming", e);
+            System.exit(-1);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b5a78a60/job/src/test/java/org/apache/kylin/job/IIStreamBuilderTest.java
----------------------------------------------------------------------
diff --git a/job/src/test/java/org/apache/kylin/job/IIStreamBuilderTest.java b/job/src/test/java/org/apache/kylin/job/IIStreamBuilderTest.java
index d42da33..bafcb61 100644
--- a/job/src/test/java/org/apache/kylin/job/IIStreamBuilderTest.java
+++ b/job/src/test/java/org/apache/kylin/job/IIStreamBuilderTest.java
@@ -34,23 +34,27 @@
 
 package org.apache.kylin.job;
 
+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.job.hadoop.cube.StorageCleanupJob;
 import org.apache.kylin.job.streaming.StreamingBootstrap;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.File;
+import java.io.IOException;
 
 /**
  * Created by qianzhou on 3/6/15.
  */
 public class IIStreamBuilderTest extends HBaseMetadataTestCase {
 
+    private static final Logger logger = LoggerFactory.getLogger(IIStreamBuilderTest.class);
+
     private KylinConfig kylinConfig;
 
     @BeforeClass
@@ -59,6 +63,30 @@ public class IIStreamBuilderTest extends HBaseMetadataTestCase {
         System.setProperty("hdp.version", "2.2.0.0-2041"); // mapred-site.xml ref this
     }
 
+    @AfterClass
+    public static void afterClass() throws Exception {
+//        backup();
+    }
+
+    private static void backup() throws Exception {
+        int exitCode = cleanupOldStorage();
+        if (exitCode == 0) {
+            exportHBaseData();
+        }
+    }
+
+    private static int cleanupOldStorage() throws Exception {
+        String[] args = {"--delete", "true"};
+
+        int exitCode = ToolRunner.run(new StorageCleanupJob(), args);
+        return exitCode;
+    }
+
+    private static void exportHBaseData() throws IOException {
+        ExportHBaseData export = new ExportHBaseData();
+        export.exportTables();
+    }
+
     @Before
     public void before() throws Exception {
         HBaseMetadataTestCase.staticCreateTestMetadata(AbstractKylinTestCase.SANDBOX_TEST_DATA);
@@ -68,13 +96,13 @@ public class IIStreamBuilderTest extends HBaseMetadataTestCase {
         DeployUtil.overrideJobJarLocations();
     }
 
-    @After
-    public void after() {
-        this.cleanupTestMetadata();
-    }
-
     @Test
     public void test() throws Exception {
-        StreamingBootstrap.getInstance(kylinConfig).startStreaming("eagle", 0);
+//        final StreamingBootstrap bootstrap = StreamingBootstrap.getInstance(kylinConfig);
+//        bootstrap.start("eagle", 0);
+//        Thread.sleep(30 * 60 * 1000);
+//        logger.info("time is up, stop streaming");
+//        bootstrap.stop();
+//        Thread.sleep(5 * 1000);
     }
 }