[3/4] kylin git commit: minor changes to MicroStrategy tutorial
minor changes to MicroStrategy tutorial Signed-off-by: shaofengshiProject: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2291fcee Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2291fcee Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2291fcee Branch: refs/heads/document Commit: 2291fcee5b6f0b66c4782372b8ded976352125da Parents: c8126da Author: joannahe Authored: Thu Aug 31 17:26:39 2017 +0800 Committer: shaofengshi Committed: Thu Aug 31 17:29:12 2017 +0800 -- website/_docs21/tutorial/microstrategy.md | 22 +++ website/images/tutorial/2.1/MicroStrategy/0.png | Bin 0 -> 207801 bytes 2 files changed, 13 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/2291fcee/website/_docs21/tutorial/microstrategy.md -- diff --git a/website/_docs21/tutorial/microstrategy.md b/website/_docs21/tutorial/microstrategy.md index 7c549eb..67ec4c3 100644 --- a/website/_docs21/tutorial/microstrategy.md +++ b/website/_docs21/tutorial/microstrategy.md @@ -1,31 +1,35 @@ --- layout: docs21 -title: MicroStrategy 10 +title: Integration with MicroStrategy 10.X categories: tutorial permalink: /docs21/tutorial/microstrategy.html --- -## Integration with MicroStrategy 10.X - ### Install ODBC Driver Refer to this guide: [Kylin ODBC Driver Tutorial](./odbc.html). -Please make sure to download and install Kylin ODBC Driver __v1.6__ or above. If you already installed ODBC Driver in your system, please uninstall it first. already installed ODBC Driver in your system, please uninstall it first. +Please make sure to download and install Kylin ODBC Driver __v1.6__ 64 bit or above. If you already installed ODBC Driver in your system, please uninstall it first. already installed ODBC Driver in your system, please uninstall it first. -### Connect to Kylin Server +The Kylin ODBC driver needs to be installed in the machine or virtual environment where your Microstrategy Intelligenec Server is installed. -Connect Kylin using ODBC driver: open your MicroStrategy Developer and connect to the project source where your are going to connect Kylin data source using a user account with administrative privilege. +###Create Local DSN -Once logged in, go to `Administration` -> `Configuration manager` -> `Database Instance`, create a new database instance with local ODBC connection that you created in the previous step. Under database connection type, please choose Generic DBMS. +Open your window ODBC Data Source Administrator (64bit) and create a system DSN that point to your kylin instance. + +![](/images/tutorial/2.1/MicroStrategy/0.png) ### Setting Database Instance -Depending on your business scenario, you may need to create a new project and set Kylin database instance as your primary database instance or if there is an existing project, set Kylin database instance as one of your primary or non-primary database instance. You can achieve this by right click on your project, and go to `project configuration` -> `database instance`. +Connect Kylin using ODBC driver: open your MicroStrategy Developer and connect to the project source where your are going to connect Kylin data source using a user account with administrative privilege. + +Once logged in, go to `Administration` -> `Configuration manager` -> `Database Instance`, create a new database instance with system DSN that you created in the previous step. Under database connection type, please choose Generic DBMS. ![](/images/tutorial/2.1/MicroStrategy/2.png) ![](/images/tutorial/2.1/MicroStrategy/1.png) +Depending on your business scenario, you may need to create a new project and set Kylin database instance as your primary database instance or if there is an existing project, set Kylin database instance as one of your primary or non-primary database instance. You can achieve this by right click on your project, and go to `project configuration` -> `database instance`. + ### Import Logical Table Open up your project, go to `schema` -> `warehouse catalog` to import the tables your need. @@ -77,4 +81,4 @@ Now you can start creating reports with Kylin as data source. 3. On the top menu choose `Tools` -> `show Advanced Settings`. 4. Go to `select/insert` -> `date format`. 5. Change the date format to follow date format in Kylin, for example '-mm-dd'. - 6. Restart MicroStrategy Intelligence Server so that change can be effective. \ No newline at end of file + 6. Restart MicroStrategy Intelligence Server so that change can be effective. \ No newline at end of file
[22/48] kylin git commit: minor changes on IT ports to allow concurrent CI
minor changes on IT ports to allow concurrent CI Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a21ffc83 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a21ffc83 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a21ffc83 Branch: refs/heads/master-hbase0.98 Commit: a21ffc839d46248f219cf81c0412b416059f6fa8 Parents: cde40f3 Author: Hongbin MaAuthored: Tue Mar 7 16:59:20 2017 +0800 Committer: Hongbin Ma Committed: Tue Mar 7 16:59:20 2017 +0800 -- .../org/apache/kylin/jdbc/ITJDBCDriverTest.java | 11 --- .../apache/kylin/restclient/ITRestClientTest.java | 18 ++ 2 files changed, 18 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/a21ffc83/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java -- diff --git a/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java b/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java index 05f615f..bdf61f8 100644 --- a/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java +++ b/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java @@ -28,6 +28,7 @@ import java.sql.Statement; import java.util.HashMap; import java.util.List; import java.util.Properties; +import java.util.Random; import org.apache.commons.io.FileUtils; import org.apache.kylin.common.util.HBaseMetadataTestCase; @@ -37,6 +38,8 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.collect.Lists; @@ -46,9 +49,12 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { private static Server server = null; private static SystemPropertiesOverride sysPropsOverride = new SystemPropertiesOverride(); +private static final int PORT = new Random().nextInt(100) + 37070; +private static final Logger logger = LoggerFactory.getLogger(ITJDBCDriverTest.class); @BeforeClass public static void beforeClass() throws Exception { +logger.info("random jetty port: " + PORT); sysPropsOverride.override("spring.profiles.active", "testing"); sysPropsOverride.override("catalina.home", "."); // resources/log4j.properties ref ${catalina.home} staticCreateTestMetadata(); @@ -74,7 +80,7 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { protected static void startJetty() throws Exception { -server = new Server(7070); +server = new Server(PORT); WebAppContext context = new WebAppContext(); context.setDescriptor("../server/src/main/webapp/WEB-INF/web.xml"); @@ -94,7 +100,7 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { Properties info = new Properties(); info.put("user", "ADMIN"); info.put("password", "KYLIN"); -Connection conn = driver.connect("jdbc:kylin://localhost:7070/default", info); +Connection conn = driver.connect("jdbc:kylin://localhost:" + PORT + "/default", info); return conn; } @@ -262,7 +268,6 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { } - @Test public void testResultSetWithMaxRows() throws Exception { String sql = "select LSTG_FORMAT_NAME, sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact \n" + " group by LSTG_FORMAT_NAME "; http://git-wip-us.apache.org/repos/asf/kylin/blob/a21ffc83/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java -- diff --git a/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java b/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java index 2afd5c9..c97f08b 100644 --- a/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java +++ b/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java @@ -18,6 +18,13 @@ package org.apache.kylin.restclient; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.util.HashMap; +import java.util.Random; + import org.apache.commons.io.FileUtils; import org.apache.http.HttpResponse; import org.apache.kylin.common.restclient.RestClient; @@ -30,12 +37,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; -import java.util.HashMap; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - /** */ public class ITRestClientTest extends HBaseMetadataTestCase { @@ -46,7
[29/48] kylin git commit: minor changes
minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/181890e5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/181890e5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/181890e5 Branch: refs/heads/master-hbase0.98 Commit: 181890e542783e66078ad707f37dcb273abae596 Parents: 7eb9969 Author: Hongbin MaAuthored: Thu Mar 9 21:19:26 2017 +0800 Committer: Hongbin Ma Committed: Thu Mar 9 21:19:30 2017 +0800 -- .../main/java/org/apache/kylin/common/QueryContext.java | 3 +++ .../org/apache/kylin/rest/service/QueryService.java | 12 2 files changed, 7 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/181890e5/core-common/src/main/java/org/apache/kylin/common/QueryContext.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java index 5457aa5..0b8d519 100644 --- a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java +++ b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java @@ -18,6 +18,7 @@ package org.apache.kylin.common; +import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; /** @@ -38,6 +39,8 @@ public class QueryContext { private QueryContext() { // use QueryContext.current() instead + +queryId = UUID.randomUUID().toString(); } public static QueryContext current() { http://git-wip-us.apache.org/repos/asf/kylin/blob/181890e5/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java -- diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java index 122b823..6a38638 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java +++ b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java @@ -41,7 +41,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.UUID; import javax.annotation.PostConstruct; import javax.sql.DataSource; @@ -237,7 +236,7 @@ public class QueryService extends BasicService { public void logQuery(final SQLRequest request, final SQLResponse response) { final String user = SecurityContextHolder.getContext().getAuthentication().getName(); -final Set realizationNames = new HashSet(); +final List realizationNames = new LinkedList<>(); final Set cuboidIds = new HashSet(); float duration = response.getDuration() / (float) 1000; boolean storageCacheUsed = response.isStorageCacheUsed(); @@ -251,8 +250,7 @@ public class QueryService extends BasicService { } if (ctx.realization != null) { -String realizationName = ctx.realization.getName(); -realizationNames.add(realizationName); +realizationNames.add(ctx.realization.getCanonicalName()); } } @@ -332,10 +330,8 @@ public class QueryService extends BasicService { BackdoorToggles.addToggles(sqlRequest.getBackdoorToggles()); final QueryContext queryContext = QueryContext.current(); -final String queryId = UUID.randomUUID().toString(); -queryContext.setQueryId(queryId); -try (SetThreadName ignored = new SetThreadName("Query %s", queryId)) { +try (SetThreadName ignored = new SetThreadName("Query %s", queryContext.getQueryId())) { String sql = sqlRequest.getSql(); String project = sqlRequest.getProject(); logger.info("Using project: " + project); @@ -431,7 +427,7 @@ public class QueryService extends BasicService { return response; } -private void checkQueryAuth(SQLResponse sqlResponse) throws AccessDeniedException { +protected void checkQueryAuth(SQLResponse sqlResponse) throws AccessDeniedException { if (!sqlResponse.getIsException() && KylinConfig.getInstanceFromEnv().isQuerySecureEnabled()) { checkAuthorization(sqlResponse.getCube()); }
[02/14] kylin git commit: minor changes
minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/181890e5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/181890e5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/181890e5 Branch: refs/heads/KYLIN-2360 Commit: 181890e542783e66078ad707f37dcb273abae596 Parents: 7eb9969 Author: Hongbin MaAuthored: Thu Mar 9 21:19:26 2017 +0800 Committer: Hongbin Ma Committed: Thu Mar 9 21:19:30 2017 +0800 -- .../main/java/org/apache/kylin/common/QueryContext.java | 3 +++ .../org/apache/kylin/rest/service/QueryService.java | 12 2 files changed, 7 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/181890e5/core-common/src/main/java/org/apache/kylin/common/QueryContext.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java index 5457aa5..0b8d519 100644 --- a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java +++ b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java @@ -18,6 +18,7 @@ package org.apache.kylin.common; +import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; /** @@ -38,6 +39,8 @@ public class QueryContext { private QueryContext() { // use QueryContext.current() instead + +queryId = UUID.randomUUID().toString(); } public static QueryContext current() { http://git-wip-us.apache.org/repos/asf/kylin/blob/181890e5/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java -- diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java index 122b823..6a38638 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java +++ b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java @@ -41,7 +41,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.UUID; import javax.annotation.PostConstruct; import javax.sql.DataSource; @@ -237,7 +236,7 @@ public class QueryService extends BasicService { public void logQuery(final SQLRequest request, final SQLResponse response) { final String user = SecurityContextHolder.getContext().getAuthentication().getName(); -final Set realizationNames = new HashSet(); +final List realizationNames = new LinkedList<>(); final Set cuboidIds = new HashSet(); float duration = response.getDuration() / (float) 1000; boolean storageCacheUsed = response.isStorageCacheUsed(); @@ -251,8 +250,7 @@ public class QueryService extends BasicService { } if (ctx.realization != null) { -String realizationName = ctx.realization.getName(); -realizationNames.add(realizationName); +realizationNames.add(ctx.realization.getCanonicalName()); } } @@ -332,10 +330,8 @@ public class QueryService extends BasicService { BackdoorToggles.addToggles(sqlRequest.getBackdoorToggles()); final QueryContext queryContext = QueryContext.current(); -final String queryId = UUID.randomUUID().toString(); -queryContext.setQueryId(queryId); -try (SetThreadName ignored = new SetThreadName("Query %s", queryId)) { +try (SetThreadName ignored = new SetThreadName("Query %s", queryContext.getQueryId())) { String sql = sqlRequest.getSql(); String project = sqlRequest.getProject(); logger.info("Using project: " + project); @@ -431,7 +427,7 @@ public class QueryService extends BasicService { return response; } -private void checkQueryAuth(SQLResponse sqlResponse) throws AccessDeniedException { +protected void checkQueryAuth(SQLResponse sqlResponse) throws AccessDeniedException { if (!sqlResponse.getIsException() && KylinConfig.getInstanceFromEnv().isQuerySecureEnabled()) { checkAuthorization(sqlResponse.getCube()); }
[1/2] kylin git commit: minor changes
Repository: kylin Updated Branches: refs/heads/master 182ed0094 -> 181890e54 minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/181890e5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/181890e5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/181890e5 Branch: refs/heads/master Commit: 181890e542783e66078ad707f37dcb273abae596 Parents: 7eb9969 Author: Hongbin MaAuthored: Thu Mar 9 21:19:26 2017 +0800 Committer: Hongbin Ma Committed: Thu Mar 9 21:19:30 2017 +0800 -- .../main/java/org/apache/kylin/common/QueryContext.java | 3 +++ .../org/apache/kylin/rest/service/QueryService.java | 12 2 files changed, 7 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/181890e5/core-common/src/main/java/org/apache/kylin/common/QueryContext.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java index 5457aa5..0b8d519 100644 --- a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java +++ b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java @@ -18,6 +18,7 @@ package org.apache.kylin.common; +import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; /** @@ -38,6 +39,8 @@ public class QueryContext { private QueryContext() { // use QueryContext.current() instead + +queryId = UUID.randomUUID().toString(); } public static QueryContext current() { http://git-wip-us.apache.org/repos/asf/kylin/blob/181890e5/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java -- diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java index 122b823..6a38638 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java +++ b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java @@ -41,7 +41,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.UUID; import javax.annotation.PostConstruct; import javax.sql.DataSource; @@ -237,7 +236,7 @@ public class QueryService extends BasicService { public void logQuery(final SQLRequest request, final SQLResponse response) { final String user = SecurityContextHolder.getContext().getAuthentication().getName(); -final Set realizationNames = new HashSet(); +final List realizationNames = new LinkedList<>(); final Set cuboidIds = new HashSet(); float duration = response.getDuration() / (float) 1000; boolean storageCacheUsed = response.isStorageCacheUsed(); @@ -251,8 +250,7 @@ public class QueryService extends BasicService { } if (ctx.realization != null) { -String realizationName = ctx.realization.getName(); -realizationNames.add(realizationName); +realizationNames.add(ctx.realization.getCanonicalName()); } } @@ -332,10 +330,8 @@ public class QueryService extends BasicService { BackdoorToggles.addToggles(sqlRequest.getBackdoorToggles()); final QueryContext queryContext = QueryContext.current(); -final String queryId = UUID.randomUUID().toString(); -queryContext.setQueryId(queryId); -try (SetThreadName ignored = new SetThreadName("Query %s", queryId)) { +try (SetThreadName ignored = new SetThreadName("Query %s", queryContext.getQueryId())) { String sql = sqlRequest.getSql(); String project = sqlRequest.getProject(); logger.info("Using project: " + project); @@ -431,7 +427,7 @@ public class QueryService extends BasicService { return response; } -private void checkQueryAuth(SQLResponse sqlResponse) throws AccessDeniedException { +protected void checkQueryAuth(SQLResponse sqlResponse) throws AccessDeniedException { if (!sqlResponse.getIsException() && KylinConfig.getInstanceFromEnv().isQuerySecureEnabled()) { checkAuthorization(sqlResponse.getCube()); }
kylin git commit: minor changes on IT ports to allow concurrent CI
Repository: kylin Updated Branches: refs/heads/master cde40f3f2 -> a21ffc839 minor changes on IT ports to allow concurrent CI Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a21ffc83 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a21ffc83 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a21ffc83 Branch: refs/heads/master Commit: a21ffc839d46248f219cf81c0412b416059f6fa8 Parents: cde40f3 Author: Hongbin MaAuthored: Tue Mar 7 16:59:20 2017 +0800 Committer: Hongbin Ma Committed: Tue Mar 7 16:59:20 2017 +0800 -- .../org/apache/kylin/jdbc/ITJDBCDriverTest.java | 11 --- .../apache/kylin/restclient/ITRestClientTest.java | 18 ++ 2 files changed, 18 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/a21ffc83/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java -- diff --git a/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java b/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java index 05f615f..bdf61f8 100644 --- a/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java +++ b/kylin-it/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java @@ -28,6 +28,7 @@ import java.sql.Statement; import java.util.HashMap; import java.util.List; import java.util.Properties; +import java.util.Random; import org.apache.commons.io.FileUtils; import org.apache.kylin.common.util.HBaseMetadataTestCase; @@ -37,6 +38,8 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.collect.Lists; @@ -46,9 +49,12 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { private static Server server = null; private static SystemPropertiesOverride sysPropsOverride = new SystemPropertiesOverride(); +private static final int PORT = new Random().nextInt(100) + 37070; +private static final Logger logger = LoggerFactory.getLogger(ITJDBCDriverTest.class); @BeforeClass public static void beforeClass() throws Exception { +logger.info("random jetty port: " + PORT); sysPropsOverride.override("spring.profiles.active", "testing"); sysPropsOverride.override("catalina.home", "."); // resources/log4j.properties ref ${catalina.home} staticCreateTestMetadata(); @@ -74,7 +80,7 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { protected static void startJetty() throws Exception { -server = new Server(7070); +server = new Server(PORT); WebAppContext context = new WebAppContext(); context.setDescriptor("../server/src/main/webapp/WEB-INF/web.xml"); @@ -94,7 +100,7 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { Properties info = new Properties(); info.put("user", "ADMIN"); info.put("password", "KYLIN"); -Connection conn = driver.connect("jdbc:kylin://localhost:7070/default", info); +Connection conn = driver.connect("jdbc:kylin://localhost:" + PORT + "/default", info); return conn; } @@ -262,7 +268,6 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase { } - @Test public void testResultSetWithMaxRows() throws Exception { String sql = "select LSTG_FORMAT_NAME, sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact \n" + " group by LSTG_FORMAT_NAME "; http://git-wip-us.apache.org/repos/asf/kylin/blob/a21ffc83/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java -- diff --git a/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java b/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java index 2afd5c9..c97f08b 100644 --- a/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java +++ b/kylin-it/src/test/java/org/apache/kylin/restclient/ITRestClientTest.java @@ -18,6 +18,13 @@ package org.apache.kylin.restclient; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.util.HashMap; +import java.util.Random; + import org.apache.commons.io.FileUtils; import org.apache.http.HttpResponse; import org.apache.kylin.common.restclient.RestClient; @@ -30,12 +37,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; -import java.util.HashMap; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - /** */
[20/50] [abbrv] kylin git commit: minor changes
minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2359a75e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2359a75e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2359a75e Branch: refs/heads/1.5.x-CDH5.7 Commit: 2359a75e3ca9d1a9c5f06331ab02edce1385b66d Parents: 32a9c67 Author: Hongbin MaAuthored: Thu Sep 22 10:45:08 2016 +0800 Committer: Hongbin Ma Committed: Thu Sep 22 10:45:15 2016 +0800 -- .../java/org/apache/kylin/metadata/datatype/BooleanSerializer.java | 2 +- .../kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java | 1 + .../java/org/apache/kylin/rest/controller/QueryController.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java index e843247..acb6de1 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java @@ -25,7 +25,7 @@ import org.apache.commons.lang.BooleanUtils; public class BooleanSerializer extends DataTypeSerializer { -final String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; +public final static String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; // be thread-safe and avoid repeated obj creation private ThreadLocal current = new ThreadLocal(); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java -- diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java index 0e40150..2f2691e 100644 --- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java +++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java @@ -94,6 +94,7 @@ public class SortedIteratorMergerWithLimit extends SortedIt PeekingImpl first = heap.poll(); E current = first.next(); try { +//clone is protected on Object, have to use reflection to call the overwritten clone method in subclasses current = (E) current.getClass().getMethod("clone").invoke(current); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new RuntimeException(e); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java -- diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java index 5cf6492..62cb0a7 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java +++ b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java @@ -205,7 +205,7 @@ public class QueryController extends BasicController { checkQueryAuth(sqlResponse); } catch (Throwable e) { // calcite may throw AssertError -//logger.error("Exception when execute sql", e); +logger.error("Exception when execute sql", e); String errMsg = QueryUtil.makeErrorMsgUserFriendly(e); sqlResponse = new SQLResponse(null, null, 0, true, errMsg);
[21/50] [abbrv] kylin git commit: minor changes
minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2359a75e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2359a75e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2359a75e Branch: refs/heads/1.5.x-HBase1.x Commit: 2359a75e3ca9d1a9c5f06331ab02edce1385b66d Parents: 32a9c67 Author: Hongbin MaAuthored: Thu Sep 22 10:45:08 2016 +0800 Committer: Hongbin Ma Committed: Thu Sep 22 10:45:15 2016 +0800 -- .../java/org/apache/kylin/metadata/datatype/BooleanSerializer.java | 2 +- .../kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java | 1 + .../java/org/apache/kylin/rest/controller/QueryController.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java index e843247..acb6de1 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java @@ -25,7 +25,7 @@ import org.apache.commons.lang.BooleanUtils; public class BooleanSerializer extends DataTypeSerializer { -final String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; +public final static String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; // be thread-safe and avoid repeated obj creation private ThreadLocal current = new ThreadLocal(); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java -- diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java index 0e40150..2f2691e 100644 --- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java +++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java @@ -94,6 +94,7 @@ public class SortedIteratorMergerWithLimit extends SortedIt PeekingImpl first = heap.poll(); E current = first.next(); try { +//clone is protected on Object, have to use reflection to call the overwritten clone method in subclasses current = (E) current.getClass().getMethod("clone").invoke(current); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new RuntimeException(e); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java -- diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java index 5cf6492..62cb0a7 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java +++ b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java @@ -205,7 +205,7 @@ public class QueryController extends BasicController { checkQueryAuth(sqlResponse); } catch (Throwable e) { // calcite may throw AssertError -//logger.error("Exception when execute sql", e); +logger.error("Exception when execute sql", e); String errMsg = QueryUtil.makeErrorMsgUserFriendly(e); sqlResponse = new SQLResponse(null, null, 0, true, errMsg);
[11/16] kylin git commit: minor changes
minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2359a75e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2359a75e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2359a75e Branch: refs/heads/KYLIN-2033 Commit: 2359a75e3ca9d1a9c5f06331ab02edce1385b66d Parents: 32a9c67 Author: Hongbin MaAuthored: Thu Sep 22 10:45:08 2016 +0800 Committer: Hongbin Ma Committed: Thu Sep 22 10:45:15 2016 +0800 -- .../java/org/apache/kylin/metadata/datatype/BooleanSerializer.java | 2 +- .../kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java | 1 + .../java/org/apache/kylin/rest/controller/QueryController.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java index e843247..acb6de1 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java @@ -25,7 +25,7 @@ import org.apache.commons.lang.BooleanUtils; public class BooleanSerializer extends DataTypeSerializer { -final String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; +public final static String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; // be thread-safe and avoid repeated obj creation private ThreadLocal current = new ThreadLocal(); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java -- diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java index 0e40150..2f2691e 100644 --- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java +++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java @@ -94,6 +94,7 @@ public class SortedIteratorMergerWithLimit extends SortedIt PeekingImpl first = heap.poll(); E current = first.next(); try { +//clone is protected on Object, have to use reflection to call the overwritten clone method in subclasses current = (E) current.getClass().getMethod("clone").invoke(current); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new RuntimeException(e); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java -- diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java index 5cf6492..62cb0a7 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java +++ b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java @@ -205,7 +205,7 @@ public class QueryController extends BasicController { checkQueryAuth(sqlResponse); } catch (Throwable e) { // calcite may throw AssertError -//logger.error("Exception when execute sql", e); +logger.error("Exception when execute sql", e); String errMsg = QueryUtil.makeErrorMsgUserFriendly(e); sqlResponse = new SQLResponse(null, null, 0, true, errMsg);
kylin git commit: minor changes
Repository: kylin Updated Branches: refs/heads/master 32a9c6706 -> 2359a75e3 minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2359a75e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2359a75e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2359a75e Branch: refs/heads/master Commit: 2359a75e3ca9d1a9c5f06331ab02edce1385b66d Parents: 32a9c67 Author: Hongbin MaAuthored: Thu Sep 22 10:45:08 2016 +0800 Committer: Hongbin Ma Committed: Thu Sep 22 10:45:15 2016 +0800 -- .../java/org/apache/kylin/metadata/datatype/BooleanSerializer.java | 2 +- .../kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java | 1 + .../java/org/apache/kylin/rest/controller/QueryController.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java index e843247..acb6de1 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/BooleanSerializer.java @@ -25,7 +25,7 @@ import org.apache.commons.lang.BooleanUtils; public class BooleanSerializer extends DataTypeSerializer { -final String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; +public final static String[] TRUE_VALUE_SET = { "true", "t", "on", "yes" }; // be thread-safe and avoid repeated obj creation private ThreadLocal current = new ThreadLocal(); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java -- diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java index 0e40150..2f2691e 100644 --- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java +++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SortedIteratorMergerWithLimit.java @@ -94,6 +94,7 @@ public class SortedIteratorMergerWithLimit extends SortedIt PeekingImpl first = heap.poll(); E current = first.next(); try { +//clone is protected on Object, have to use reflection to call the overwritten clone method in subclasses current = (E) current.getClass().getMethod("clone").invoke(current); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new RuntimeException(e); http://git-wip-us.apache.org/repos/asf/kylin/blob/2359a75e/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java -- diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java index 5cf6492..62cb0a7 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java +++ b/server-base/src/main/java/org/apache/kylin/rest/controller/QueryController.java @@ -205,7 +205,7 @@ public class QueryController extends BasicController { checkQueryAuth(sqlResponse); } catch (Throwable e) { // calcite may throw AssertError -//logger.error("Exception when execute sql", e); +logger.error("Exception when execute sql", e); String errMsg = QueryUtil.makeErrorMsgUserFriendly(e); sqlResponse = new SQLResponse(null, null, 0, true, errMsg);
[08/50] [abbrv] kylin git commit: Minor changes: add dimension length info in CubeStatsReader
Minor changes: add dimension length info in CubeStatsReader Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/4cd733a1 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/4cd733a1 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/4cd733a1 Branch: refs/heads/1.5.x-HBase1.x Commit: 4cd733a1465a5641229954afa5d8a6349cc6bb8a Parents: acf1bc3 Author: Hongbin MaAuthored: Wed Jul 6 18:03:12 2016 +0800 Committer: Hongbin Ma Committed: Wed Jul 6 18:03:19 2016 +0800 -- .../apache/kylin/engine/mr/common/CubeStatsReader.java| 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/4cd733a1/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java index cab0c8d..83e46e3 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java @@ -49,6 +49,7 @@ import org.apache.kylin.cube.CubeSegment; import org.apache.kylin.cube.cuboid.Cuboid; import org.apache.kylin.cube.cuboid.CuboidScheduler; import org.apache.kylin.cube.kv.CubeDimEncMap; +import org.apache.kylin.cube.kv.RowKeyEncoder; import org.apache.kylin.cube.model.CubeDesc; import org.apache.kylin.engine.mr.HadoopUtil; import org.apache.kylin.measure.hllc.HyperLogLogPlusCounter; @@ -233,6 +234,7 @@ public class CubeStatsReader { out.println("Total estimated size(MB): " + SumHelper.sumDouble(cuboidSizes.values())); out.println("Sampling percentage: " + samplingPercentage); out.println("Mapper overlap ratio: " + mapperOverlapRatioOfFirstBuild); +printKVInfo(out); printCuboidInfoTreeEntry(cuboidRows, cuboidSizes, out); out.println(""); } @@ -245,6 +247,14 @@ public class CubeStatsReader { printCuboidInfoTree(-1L, baseCuboid, scheduler, cuboidRows, cuboidSizes, dimensionCount, 0, out); } +private void printKVInfo(PrintWriter writer) { +Cuboid cuboid = Cuboid.getBaseCuboid(seg.getCubeDesc()); +RowKeyEncoder encoder = new RowKeyEncoder(seg, cuboid); +for (TblColRef col : cuboid.getColumns()) { +writer.println("Length of dimension " + col + " is " + encoder.getColumnLength(col)); +} +} + private static void printCuboidInfoTree(long parent, long cuboidID, final CuboidScheduler scheduler, Map cuboidRows, Map cuboidSizes, int dimensionCount, int depth, PrintWriter out) { printOneCuboidInfo(parent, cuboidID, cuboidRows, cuboidSizes, dimensionCount, depth, out);
kylin git commit: Minor changes: add dimension length info in CubeStatsReader
Repository: kylin Updated Branches: refs/heads/master acf1bc331 -> 4cd733a14 Minor changes: add dimension length info in CubeStatsReader Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/4cd733a1 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/4cd733a1 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/4cd733a1 Branch: refs/heads/master Commit: 4cd733a1465a5641229954afa5d8a6349cc6bb8a Parents: acf1bc3 Author: Hongbin MaAuthored: Wed Jul 6 18:03:12 2016 +0800 Committer: Hongbin Ma Committed: Wed Jul 6 18:03:19 2016 +0800 -- .../apache/kylin/engine/mr/common/CubeStatsReader.java| 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/4cd733a1/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java index cab0c8d..83e46e3 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java @@ -49,6 +49,7 @@ import org.apache.kylin.cube.CubeSegment; import org.apache.kylin.cube.cuboid.Cuboid; import org.apache.kylin.cube.cuboid.CuboidScheduler; import org.apache.kylin.cube.kv.CubeDimEncMap; +import org.apache.kylin.cube.kv.RowKeyEncoder; import org.apache.kylin.cube.model.CubeDesc; import org.apache.kylin.engine.mr.HadoopUtil; import org.apache.kylin.measure.hllc.HyperLogLogPlusCounter; @@ -233,6 +234,7 @@ public class CubeStatsReader { out.println("Total estimated size(MB): " + SumHelper.sumDouble(cuboidSizes.values())); out.println("Sampling percentage: " + samplingPercentage); out.println("Mapper overlap ratio: " + mapperOverlapRatioOfFirstBuild); +printKVInfo(out); printCuboidInfoTreeEntry(cuboidRows, cuboidSizes, out); out.println(""); } @@ -245,6 +247,14 @@ public class CubeStatsReader { printCuboidInfoTree(-1L, baseCuboid, scheduler, cuboidRows, cuboidSizes, dimensionCount, 0, out); } +private void printKVInfo(PrintWriter writer) { +Cuboid cuboid = Cuboid.getBaseCuboid(seg.getCubeDesc()); +RowKeyEncoder encoder = new RowKeyEncoder(seg, cuboid); +for (TblColRef col : cuboid.getColumns()) { +writer.println("Length of dimension " + col + " is " + encoder.getColumnLength(col)); +} +} + private static void printCuboidInfoTree(long parent, long cuboidID, final CuboidScheduler scheduler, Map cuboidRows, Map cuboidSizes, int dimensionCount, int depth, PrintWriter out) { printOneCuboidInfo(parent, cuboidID, cuboidRows, cuboidSizes, dimensionCount, depth, out);
kylin git commit: minor changes
Repository: kylin Updated Branches: refs/heads/master 06e1ea296 -> 4a6aed92e minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/4a6aed92 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/4a6aed92 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/4a6aed92 Branch: refs/heads/master Commit: 4a6aed92ea9ad1d155037dda756a19e55d50dec2 Parents: 06e1ea2 Author: Hongbin MaAuthored: Tue May 17 18:45:20 2016 +0800 Committer: Hongbin Ma Committed: Tue May 17 18:45:20 2016 +0800 -- .../kylin/common/util/NumberIterators.java | 50 .../kylin/common/util/ValueIterators.java | 50 .../apache/kylin/rest/response/SQLResponse.java | 4 ++ 3 files changed, 54 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/4a6aed92/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java b/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java deleted file mode 100644 index 4ce317d..000 --- a/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.kylin.common.util; - -import java.util.Iterator; -import java.util.Set; - -import com.google.common.collect.Sets; - -public class NumberIterators { - -public static long sum(Iterator iterator) { -long ret = 0; -while (iterator.hasNext()) { -Number element = iterator.next(); -ret += element.longValue(); -} -return ret; -} - -public static long checkSame(Iterator iterator) { -Set values = Sets.newHashSet(); -while (iterator.hasNext()) { -Number element = iterator.next(); -values.add(element.longValue()); -} - -if (values.size() > 1) { -throw new IllegalStateException("more than one distinct values exist in the collection:" + values); -} - -return values.iterator().next(); -} -} http://git-wip-us.apache.org/repos/asf/kylin/blob/4a6aed92/core-common/src/main/java/org/apache/kylin/common/util/ValueIterators.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/ValueIterators.java b/core-common/src/main/java/org/apache/kylin/common/util/ValueIterators.java new file mode 100644 index 000..9ed85be --- /dev/null +++ b/core-common/src/main/java/org/apache/kylin/common/util/ValueIterators.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.kylin.common.util; + +import java.util.Iterator; +import java.util.Set; + +import com.google.common.collect.Sets; + +public class ValueIterators { + +public static long sum(Iterator iterator) { +long ret = 0; +while (iterator.hasNext()) { +Number element = iterator.next(); +ret += element.longValue(); +} +
[01/14] kylin git commit: minor changes [Forced Update!]
Repository: kylin Updated Branches: refs/heads/1.5.x-HBase1.x a55704329 -> bfafc52a4 (forced update) minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/58f3af3b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/58f3af3b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/58f3af3b Branch: refs/heads/1.5.x-HBase1.x Commit: 58f3af3b33d7d581811e1854a4c14e4f2c6edaf8 Parents: 407fbd0 Author: Hongbin MaAuthored: Fri May 13 09:55:15 2016 +0800 Committer: Hongbin Ma Committed: Fri May 13 13:54:10 2016 +0800 -- .../apache/kylin/common/util/NumberIterators.java | 16 .../apache/kylin/rest/model/SelectedColumnMeta.java | 4 +++- .../org/apache/kylin/rest/response/SQLResponse.java | 8 3 files changed, 27 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/58f3af3b/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java b/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java index 5bfbac7..4ce317d 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java @@ -19,6 +19,9 @@ package org.apache.kylin.common.util; import java.util.Iterator; +import java.util.Set; + +import com.google.common.collect.Sets; public class NumberIterators { @@ -31,4 +34,17 @@ public class NumberIterators { return ret; } +public static long checkSame(Iterator iterator) { +Set values = Sets.newHashSet(); +while (iterator.hasNext()) { +Number element = iterator.next(); +values.add(element.longValue()); +} + +if (values.size() > 1) { +throw new IllegalStateException("more than one distinct values exist in the collection:" + values); +} + +return values.iterator().next(); +} } http://git-wip-us.apache.org/repos/asf/kylin/blob/58f3af3b/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java b/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java index 00b01db..fc8d723 100644 --- a/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java +++ b/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java @@ -18,9 +18,11 @@ package org.apache.kylin.rest.model; +import java.io.Serializable; + /** */ -public class SelectedColumnMeta { +public class SelectedColumnMeta implements Serializable{ public SelectedColumnMeta(boolean isAutoIncrement, boolean isCaseSensitive, boolean isSearchable, boolean isCurrency, int isNullalbe, boolean isSigned, int displaySize, String label, String name, String schemaName, String catelogName, String tableName, int precision, int scale, int columnType, String columnTypeName, boolean isReadOnly, boolean isWritable, boolean isDefinitelyWritable) { super(); this.isAutoIncrement = isAutoIncrement; http://git-wip-us.apache.org/repos/asf/kylin/blob/58f3af3b/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java b/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java index 75b6ce8..353dd7e 100644 --- a/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java +++ b/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java @@ -113,10 +113,18 @@ public class SQLResponse implements Serializable { return isException; } +public void setIsException(boolean v) { +isException = v; +} + public String getExceptionMessage() { return exceptionMessage; } +public void setExceptionMessage(String msg) { +exceptionMessage = msg; +} + public long getDuration() { return duration; }
kylin git commit: minor changes
Repository: kylin Updated Branches: refs/heads/master 407fbd0d4 -> 58f3af3b3 minor changes Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/58f3af3b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/58f3af3b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/58f3af3b Branch: refs/heads/master Commit: 58f3af3b33d7d581811e1854a4c14e4f2c6edaf8 Parents: 407fbd0 Author: Hongbin MaAuthored: Fri May 13 09:55:15 2016 +0800 Committer: Hongbin Ma Committed: Fri May 13 13:54:10 2016 +0800 -- .../apache/kylin/common/util/NumberIterators.java | 16 .../apache/kylin/rest/model/SelectedColumnMeta.java | 4 +++- .../org/apache/kylin/rest/response/SQLResponse.java | 8 3 files changed, 27 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/58f3af3b/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java b/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java index 5bfbac7..4ce317d 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/NumberIterators.java @@ -19,6 +19,9 @@ package org.apache.kylin.common.util; import java.util.Iterator; +import java.util.Set; + +import com.google.common.collect.Sets; public class NumberIterators { @@ -31,4 +34,17 @@ public class NumberIterators { return ret; } +public static long checkSame(Iterator iterator) { +Set values = Sets.newHashSet(); +while (iterator.hasNext()) { +Number element = iterator.next(); +values.add(element.longValue()); +} + +if (values.size() > 1) { +throw new IllegalStateException("more than one distinct values exist in the collection:" + values); +} + +return values.iterator().next(); +} } http://git-wip-us.apache.org/repos/asf/kylin/blob/58f3af3b/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java b/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java index 00b01db..fc8d723 100644 --- a/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java +++ b/server/src/main/java/org/apache/kylin/rest/model/SelectedColumnMeta.java @@ -18,9 +18,11 @@ package org.apache.kylin.rest.model; +import java.io.Serializable; + /** */ -public class SelectedColumnMeta { +public class SelectedColumnMeta implements Serializable{ public SelectedColumnMeta(boolean isAutoIncrement, boolean isCaseSensitive, boolean isSearchable, boolean isCurrency, int isNullalbe, boolean isSigned, int displaySize, String label, String name, String schemaName, String catelogName, String tableName, int precision, int scale, int columnType, String columnTypeName, boolean isReadOnly, boolean isWritable, boolean isDefinitelyWritable) { super(); this.isAutoIncrement = isAutoIncrement; http://git-wip-us.apache.org/repos/asf/kylin/blob/58f3af3b/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java b/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java index 75b6ce8..353dd7e 100644 --- a/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java +++ b/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java @@ -113,10 +113,18 @@ public class SQLResponse implements Serializable { return isException; } +public void setIsException(boolean v) { +isException = v; +} + public String getExceptionMessage() { return exceptionMessage; } +public void setExceptionMessage(String msg) { +exceptionMessage = msg; +} + public long getDuration() { return duration; }
kylin git commit: Minor changes in kylin.properties and pom.xml
Repository: kylin Updated Branches: refs/heads/master 9bd421fe9 -> 28d90ec07 Minor changes in kylin.properties and pom.xml Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/28d90ec0 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/28d90ec0 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/28d90ec0 Branch: refs/heads/master Commit: 28d90ec07d727f2953c5a19f2d612323786b4970 Parents: 9bd421f Author: shaofengshiAuthored: Wed Mar 30 11:32:36 2016 +0800 Committer: shaofengshi Committed: Wed Mar 30 11:32:44 2016 +0800 -- build/conf/kylin.properties | 6 +- examples/test_case_data/sandbox/kylin.properties | 2 ++ pom.xml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/28d90ec0/build/conf/kylin.properties -- diff --git a/build/conf/kylin.properties b/build/conf/kylin.properties index 5fb4e36..5827fd8 100644 --- a/build/conf/kylin.properties +++ b/build/conf/kylin.properties @@ -70,9 +70,6 @@ kylin.job.yarn.app.rest.check.interval.seconds=10 # Hive database name for putting the intermediate flat tables kylin.job.hive.database.for.intermediatetable=default -# Whether calculate cube in mem in each mapper; -kylin.job.cubing.inMem=true - #default compression codec for htable,snappy,lzo,gzip,lz4 kylin.hbase.default.compression.codec=snappy @@ -168,5 +165,4 @@ deploy.env=QA ###deprecated configs### kylin.sandbox=true - - kylin.web.hive.limit=20 \ No newline at end of file +kylin.web.hive.limit=20 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/28d90ec0/examples/test_case_data/sandbox/kylin.properties -- diff --git a/examples/test_case_data/sandbox/kylin.properties b/examples/test_case_data/sandbox/kylin.properties index 2fa647d..cf1f881 100644 --- a/examples/test_case_data/sandbox/kylin.properties +++ b/examples/test_case_data/sandbox/kylin.properties @@ -15,6 +15,8 @@ # limitations under the License. # +# kylin server's mode +kylin.server.mode=all # optional information for the owner of kylin platform, it can be your team's email # currently it will be attached to each kylin's htable attribute kylin.owner=who...@kylin.apache.org http://git-wip-us.apache.org/repos/asf/kylin/blob/28d90ec0/pom.xml -- diff --git a/pom.xml b/pom.xml index 593bbff..ac87fd3 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 3.4.6 0.14.0 0.14.0 -0.98.4-hadoop2 +0.98.8-hadoop2 0.8.1
kylin git commit: minor, changes on IT vm configs
Repository: kylin Updated Branches: refs/heads/2.x-staging fedd47e3c -> c9e209aea minor, changes on IT vm configs Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/c9e209ae Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/c9e209ae Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/c9e209ae Branch: refs/heads/2.x-staging Commit: c9e209aeab44b49f935091d63199c7f6dbc3bb96 Parents: fedd47e Author: honmaAuthored: Wed Feb 17 18:58:19 2016 +0800 Committer: honma Committed: Wed Feb 17 18:58:27 2016 +0800 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/c9e209ae/pom.xml -- diff --git a/pom.xml b/pom.xml index d70abce..cb1e49e 100644 --- a/pom.xml +++ b/pom.xml @@ -668,7 +668,7 @@ false --Xms1G -Xmx4G -XX:PermSize=128M -XX:MaxPermSize=512M +-Xmx4G -XX:MaxPermSize=256M
kylin git commit: minor changes on documents
Repository: kylin Updated Branches: refs/heads/document fe0d56898 -> ed810ebea minor changes on documents Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ed810ebe Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ed810ebe Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ed810ebe Branch: refs/heads/document Commit: ed810ebea8f06bbeeb432469866da56a43762caf Parents: fe0d568 Author: honmaAuthored: Thu Feb 11 20:44:56 2016 +0800 Committer: honma Committed: Wed Feb 17 10:36:03 2016 +0800 -- website/_dev/howto_test.md | 35 +++ .../_posts/blog/2016-02-03-streaming-cubing.md | 28 +++ website/images/develop/streaming.png| Bin 0 -> 211683 bytes 3 files changed, 56 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ed810ebe/website/_dev/howto_test.md -- diff --git a/website/_dev/howto_test.md b/website/_dev/howto_test.md index 150ece8..6aaa056 100644 --- a/website/_dev/howto_test.md +++ b/website/_dev/howto_test.md @@ -7,21 +7,19 @@ permalink: /development/howto_test.html In general, there should be unit tests to cover individual classes; there must be integration test to cover end-to-end scenarios like build, merge, and query. Unit test must run independently (does not require an external sandbox). - -## 2.x branches +## Test 2.x branches * `mvn test` to run unit tests, which has a limited test coverage. * Unit tests has no external dependency and can run on any machine. * The unit tests do not cover end-to-end scenarios like build, merge, and query. * The unit tests take a few minutes to complete. * `dev-support/test_all_against_hdp_2_2_4_2_2.sh` to run integration tests, which has the best test coverage. -* Integration tests __must run on a Hadoop sandbox__. Make sure all changes you want to test are avaiable on sandbox. +* Integration tests __better be run on a Hadoop sandbox__. We suggest to checkout a copy of code in your sandbox and direct run the test_all_against_hdp_2_2_4_2_2.sh in it. If you don't want to put codes on sandbox, refer to __More on 2.x UT/IT separation__ * As the name indicates, the script is only for hdp 2.2.4.2, but you get the idea of how integration test run from it. * The integration tests start from generate random data, then build cube, merge cube, and finally query the result and compare to H2 DB. -* The integration tests take a few hours to complete. - +* The integration tests take one to two hours to complete. -## 1.x branches +## Test 1.x branches * `mvn test` to run unit tests, which has a limited test coverage. * What's special about 1.x is that a hadoop/hbase mini cluster is used to cover queries in unit test. @@ -32,12 +30,34 @@ In general, there should be unit tests to cover individual classes; there must b * `mvn test -fae -P sandbox` * `mvn test -fae -Dtest=org.apache.kylin.query.test.IIQueryTest -Dhdp.version=2.2.0.0-2041 -DfailIfNoTests=false -P sandbox` +## More on 2.x UT/IT separation + +From Kylin 2.0 you can run UT(Unit test), environment cube provision and IT(Integration test) separately. +Running `mvn verify -Dhdp.version=2.2.4.2-2` (assume you're on your sandbox) is all you need to run a complete all the test suites. + +It will execute the following steps sequentially: + +1. Build Artifacts +2. Run all UTs (takes few minutes) +3. Provision cubes on the sandbox environment for IT uasge (takes 1~2 hours) +4. Run all ITs (takes few tens of minutes) +5. verify jar stuff + +If your code change is minor and it merely requires running UT, use: +`mvn test` +If your sandbox is already provisioned and your code change will not affect the result of sandbox provision, (and you don't want to wait hours of provision) just run the following commands to separately run UT and IT: +`mvn test` +`mvn failsafe:integration-test` + +### Cube Provision + +Environment cube provision is indeed running kylin cubing jobs to prepare example cubes in the sandbox. These prepared cubes will be used by the ITs. Currently provision step is bound with the maven pre-integration-test phase, and it contains running BuildCubeWithEngine (HBase required), BuildCubeWithStream(Kafka required) and BuildIIWithStream(Kafka Required). You can run the mvn commands on you sandbox or your develop computer. For the latter case you need to set kylin.job.run.as.remote.cmd=true in __$KYLIN_HOME/examples/test_case_data/sandbox/kylin.properties__. +Try appending `-DfastBuildMode=true` to mvn verify command to speed up provision by skipping incremental cubing. ##