kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wangxia...@apache.org
Subject [06/32] kylin git commit: Cleanup old storage after full regression test
Date Mon, 18 Jan 2016 05:39:01 GMT
Cleanup old storage after full regression test


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

Branch: refs/heads/KYLIN-1122
Commit: b18ca234ff78d0eddebfee781dd435b728cd334a
Parents: cb4b8d3
Author: shaofengshi <shaofengshi@apache.org>
Authored: Wed Jan 13 10:09:05 2016 +0800
Committer: Xiaoyu Wang <wangxiaoyu@apache.org>
Committed: Mon Jan 18 13:38:30 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/job/BuildCubeWithEngineTest.java | 11 ++++++++++-
 .../org/apache/kylin/job/BuildIIWithStreamTest.java   | 14 ++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/b18ca234/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
----------------------------------------------------------------------
diff --git a/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java b/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
index 53db99a..46bf1bb 100644
--- a/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
+++ b/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
@@ -33,6 +33,7 @@ import java.util.concurrent.Future;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+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;
@@ -49,6 +50,7 @@ import org.apache.kylin.job.execution.ExecutableState;
 import org.apache.kylin.job.impl.threadpool.DefaultScheduler;
 import org.apache.kylin.job.manager.ExecutableManager;
 import org.apache.kylin.storage.hbase.steps.HBaseMetadataTestCase;
+import org.apache.kylin.storage.hbase.util.StorageCleanupJob;
 import org.apache.kylin.storage.hbase.util.ZookeeperJobLock;
 import org.junit.After;
 import org.junit.Before;
@@ -103,9 +105,9 @@ public class BuildCubeWithEngineTest {
 
     @Before
     public void before() throws Exception {
-
         HBaseMetadataTestCase.staticCreateTestMetadata(AbstractKylinTestCase.SANDBOX_TEST_DATA);
 
+        cleanupOldStorage();
         DeployUtil.initCliWorkDir();
         DeployUtil.deployMetadata();
         DeployUtil.overrideJobJarLocations();
@@ -322,4 +324,11 @@ public class BuildCubeWithEngineTest {
         return job.getId();
     }
 
+    private int cleanupOldStorage() throws Exception {
+        String[] args = { "--delete", "true" };
+
+        int exitCode = ToolRunner.run(new StorageCleanupJob(), args);
+        return exitCode;
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/kylin/blob/b18ca234/assembly/src/test/java/org/apache/kylin/job/BuildIIWithStreamTest.java
----------------------------------------------------------------------
diff --git a/assembly/src/test/java/org/apache/kylin/job/BuildIIWithStreamTest.java b/assembly/src/test/java/org/apache/kylin/job/BuildIIWithStreamTest.java
index d4245cd..b420463 100644
--- a/assembly/src/test/java/org/apache/kylin/job/BuildIIWithStreamTest.java
+++ b/assembly/src/test/java/org/apache/kylin/job/BuildIIWithStreamTest.java
@@ -71,6 +71,8 @@ import org.apache.kylin.metadata.realization.RealizationStatusEnum;
 import org.apache.kylin.source.hive.HiveTableReader;
 import org.apache.kylin.storage.hbase.HBaseConnection;
 import org.apache.kylin.storage.hbase.steps.HBaseMetadataTestCase;
+import org.apache.kylin.storage.hbase.util.StorageCleanupJob;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -114,6 +116,11 @@ public class BuildIIWithStreamTest {
             }
         }
     }
+    
+    @AfterClass
+    public void cleanup() throws Exception {
+        cleanupOldStorage();
+    }
 
     private String createIntermediateTable(IIDesc desc, KylinConfig kylinConfig) throws IOException
{
         IIJoinedFlatTableDesc intermediateTableDesc = new IIJoinedFlatTableDesc(desc);
@@ -273,4 +280,11 @@ public class BuildIIWithStreamTest {
         return unsorted;
     }
 
+    private int cleanupOldStorage() throws Exception {
+        String[] args = { "--delete", "true" };
+
+        int exitCode = ToolRunner.run(new StorageCleanupJob(), args);
+        return exitCode;
+    }
+
 }


Mime
View raw message