kylin git commit: KYLIN-2262 Get null error when trigger a build with wrong cube name

2016-12-10 Thread shaofengshi
Repository: kylin
Updated Branches:
  refs/heads/master 77d5d7d62 -> 6957fd767


KYLIN-2262 Get null error when trigger a build with wrong cube name


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

Branch: refs/heads/master
Commit: 6957fd767056864fc8e3898f2c2fc28ffbd51d03
Parents: 77d5d7d
Author: shaofengshi 
Authored: Sun Dec 11 15:04:45 2016 +0800
Committer: shaofengshi 
Committed: Sun Dec 11 15:04:45 2016 +0800

--
 .../java/org/apache/kylin/rest/controller/CubeController.java| 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/6957fd76/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
--
diff --git 
a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
 
b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
index c38ec4c..416fc88 100644
--- 
a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
+++ 
b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
@@ -287,6 +287,10 @@ public class CubeController extends BasicController {
 try {
 String submitter = 
SecurityContextHolder.getContext().getAuthentication().getName();
 CubeInstance cube = jobService.getCubeManager().getCube(cubeName);
+
+if (cube == null) {
+throw new IllegalArgumentException("Cube with name '" + 
cubeName + "' was not found.");
+}
 return jobService.submitJob(cube, startTime, endTime, startOffset, 
endOffset, //
 sourcePartitionOffsetStart, sourcePartitionOffsetEnd, 
CubeBuildTypeEnum.valueOf(buildType), force, submitter);
 } catch (Exception e) {



kylin git commit: minor, add UT for metadata copy functions

2016-12-10 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/master fbb7ed921 -> 77d5d7d62


minor, add UT for metadata copy functions


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

Branch: refs/heads/master
Commit: 77d5d7d627dcbb0ed66461a46834711106a055e1
Parents: fbb7ed9
Author: lidongsjtu 
Authored: Sat Dec 10 20:29:41 2016 +0800
Committer: lidongsjtu 
Committed: Sat Dec 10 20:36:15 2016 +0800

--
 .../org/apache/kylin/cube/model/CubeDesc.java   |  3 +-
 .../org/apache/kylin/cube/CubeDescTest.java | 26 ++--
 .../kylin/metadata/model/DataModelDesc.java |  9 +--
 .../kylin/metadata/model/DataModelDescTest.java | 67 
 4 files changed, 95 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/77d5d7d6/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
--
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java 
b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index 56a8b7e..6088bb4 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -1129,8 +1129,9 @@ public class CubeDesc extends RootPersistentEntity 
implements IEngineAware {
 newCubeDesc.setAggregationGroups(cubeDesc.getAggregationGroups());
 newCubeDesc.setOverrideKylinProps(cubeDesc.getOverrideKylinProps());
 newCubeDesc.setConfig((KylinConfigExt) cubeDesc.getConfig());
-newCubeDesc.updateRandomUuid();
+newCubeDesc.setLastModified(cubeDesc.getLastModified());
 
newCubeDesc.setPartitionOffsetStart(cubeDesc.getPartitionOffsetStart());
+newCubeDesc.updateRandomUuid();
 return newCubeDesc;
 }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/77d5d7d6/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
--
diff --git a/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java 
b/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
index 27c154b..78cf222 100644
--- a/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
+++ b/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
@@ -40,13 +40,15 @@ import org.junit.rules.ExpectedException;
 
 import com.google.common.collect.Maps;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * @author yangli9
  */
 public class CubeDescTest extends LocalFileMetadataTestCase {
 
 private static final String CUBE_WITH_SLR_DESC = 
"test_kylin_cube_with_slr_desc";
-
+
 private String SELLER_ID;
 private String SLR_SEGMENT_CD;
 private String LSTG_FORMAT_NAME;
@@ -55,14 +57,14 @@ public class CubeDescTest extends LocalFileMetadataTestCase 
{
 private String CATEG_LVL2_NAME;
 private String CATEG_LVL3_NAME;
 private String LEAF_CATEG_ID;
-
+
 @Rule
 public ExpectedException thrown = ExpectedException.none();
 
 @Before
 public void setUp() throws Exception {
 this.createTestMetadata();
-
+
 CubeDesc cubeDesc = 
CubeDescManager.getInstance(getTestConfig()).getCubeDesc(CUBE_WITH_SLR_DESC);
 AggregationGroup g = cubeDesc.getAggregationGroups().get(0);
 SELLER_ID = getColInAggrGroup(g, "SELLER_ID");
@@ -230,7 +232,7 @@ public class CubeDescTest extends LocalFileMetadataTestCase 
{
 }
 
 @Test
-public void testCombinationIntOverflow() throws  Exception {
+public void testCombinationIntOverflow() throws Exception {
 for (File f : new File(LocalFileMetadataTestCase.LOCALMETA_TEMP_DATA, 
"cube_desc").listFiles()) {
 if (f.getName().endsWith(".bad")) {
 String path = f.getPath();
@@ -254,6 +256,20 @@ public class CubeDescTest extends 
LocalFileMetadataTestCase {
 }
 
 @Test
+public void testGetCopyOf() throws Exception {
+CubeDesc desc = 
CubeDescManager.getInstance(getTestConfig()).getCubeDesc(CUBE_WITH_SLR_DESC);
+CubeDesc copyDesc = CubeDesc.getCopyOf(desc);
+
+// uuid is different, set to equals for json comparison
+copyDesc.setUuid(desc.getUuid());
+
+String descStr = JsonUtil.writeValueAsIndentString(desc);
+String copyStr = JsonUtil.writeValueAsIndentString(copyDesc);
+
+assertEquals(descStr, copyStr);
+}
+
+@Test
 public void testGetCubeDesc() throws Exception {
 CubeDesc cubeDesc = 

svn commit: r1773501 - in /kylin/site: docs16/howto/howto_cleanup_storage.html feed.xml

2016-12-10 Thread lidong
Author: lidong
Date: Sat Dec 10 08:17:11 2016
New Revision: 1773501

URL: http://svn.apache.org/viewvc?rev=1773501=rev
Log:
KYLIN-2261 revert the document change in KYLIN-2144 because it did not affect 
1.6.x branch

Modified:
kylin/site/docs16/howto/howto_cleanup_storage.html
kylin/site/feed.xml

Modified: kylin/site/docs16/howto/howto_cleanup_storage.html
URL: 
http://svn.apache.org/viewvc/kylin/site/docs16/howto/howto_cleanup_storage.html?rev=1773501=1773500=1773501=diff
==
--- kylin/site/docs16/howto/howto_cleanup_storage.html (original)
+++ kylin/site/docs16/howto/howto_cleanup_storage.html Sat Dec 10 08:17:11 2016
@@ -2052,12 +2052,12 @@ automated garbage collection, it might n
 1. Check which resources can be cleanup, this will not remove anything:
 
 export KYLIN_HOME=/path/to/kylin_home
-${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.tool.StorageCleanupJob --delete 
false
+${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.storage.hbase.util.StorageCleanupJob --delete 
false
 
 Here please replace (version) with the specific Kylin jar version in your 
installation;
 2. You can pickup 1 or 2 resources to check whether they’re no longer be 
referred; Then add the “–delete true” option to start the cleanup:
 
-${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.tool.StorageCleanupJob --delete true
+${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.storage.hbase.util.StorageCleanupJob --delete 
true
 
 On finish, the intermediate HDFS location and HTables should be dropped;
 

Modified: kylin/site/feed.xml
URL: 
http://svn.apache.org/viewvc/kylin/site/feed.xml?rev=1773501=1773500=1773501=diff
==
--- kylin/site/feed.xml (original)
+++ kylin/site/feed.xml Sat Dec 10 08:17:11 2016
@@ -19,8 +19,8 @@
 Apache Kylin Home
 http://kylin.apache.org/
 http://kylin.apache.org/feed.xml; rel="self" 
type="application/rss+xml"/>
-Tue, 06 Dec 2016 05:59:08 -0800
-Tue, 06 Dec 2016 05:59:08 -0800
+Sat, 10 Dec 2016 00:16:09 -0800
+Sat, 10 Dec 2016 00:16:09 -0800
 Jekyll v2.5.3
 
   




kylin git commit: KYLIN-2261 revert the document change in KYLIN-2144 because it did not affect 1.6.x branch

2016-12-10 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/document 1dcf042af -> b570e


KYLIN-2261 revert the document change in KYLIN-2144 because it did not affect 
1.6.x branch


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

Branch: refs/heads/document
Commit: b570e24740cb46e0601c49efdb952e51555b
Parents: 1dcf042
Author: Hongbin Ma 
Authored: Sat Dec 10 16:11:36 2016 +0800
Committer: Hongbin Ma 
Committed: Sat Dec 10 16:11:36 2016 +0800

--
 website/_docs16/howto/howto_cleanup_storage.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/b570ebbb/website/_docs16/howto/howto_cleanup_storage.md
--
diff --git a/website/_docs16/howto/howto_cleanup_storage.md 
b/website/_docs16/howto/howto_cleanup_storage.md
index 3db5d49..233d32d 100644
--- a/website/_docs16/howto/howto_cleanup_storage.md
+++ b/website/_docs16/howto/howto_cleanup_storage.md
@@ -12,11 +12,11 @@ Steps:
 1. Check which resources can be cleanup, this will not remove anything:
 {% highlight Groff markup %}
 export KYLIN_HOME=/path/to/kylin_home
-${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.tool.StorageCleanupJob --delete 
false
+${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.storage.hbase.util.StorageCleanupJob --delete false
 {% endhighlight %}
 Here please replace (version) with the specific Kylin jar version in your 
installation;
 2. You can pickup 1 or 2 resources to check whether they're no longer be 
referred; Then add the "--delete true" option to start the cleanup:
 {% highlight Groff markup %}
-${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.tool.StorageCleanupJob --delete 
true
+${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.storage.hbase.util.StorageCleanupJob --delete true
 {% endhighlight %}
 On finish, the intermediate HDFS location and HTables should be dropped;