[5/5] kylin git commit: improve integer type upgrade logic
improve integer type upgrade logic Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/3d0954d1 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/3d0954d1 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/3d0954d1 Branch: refs/heads/orderedbytes3 Commit: 3d0954d1e902755ce6f33719c4e74a368ee537d4 Parents: c60c2d6 Author: Hongbin MaAuthored: Fri Sep 30 18:31:04 2016 +0800 Committer: Hongbin Ma Committed: Sun Oct 16 13:27:26 2016 +0800 -- .../filter/EvaluatableFunctionTupleFilter.java | 151 --- .../metadata/filter/TupleFilterSerializer.java | 20 ++- .../apache/kylin/metadata/model/ColumnDesc.java | 21 ++- .../apache/kylin/metadata/tuple/TupleInfo.java | 4 +- .../apache/kylin/query/schema/OLAPTable.java| 31 +++- 5 files changed, 63 insertions(+), 164 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/3d0954d1/core-metadata/src/main/java/org/apache/kylin/metadata/filter/EvaluatableFunctionTupleFilter.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/EvaluatableFunctionTupleFilter.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/EvaluatableFunctionTupleFilter.java deleted file mode 100644 index ff24172..000 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/EvaluatableFunctionTupleFilter.java +++ /dev/null @@ -1,151 +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.metadata.filter; - -import java.lang.reflect.InvocationTargetException; -import java.nio.ByteBuffer; -import java.util.Collection; -import java.util.List; - -import org.apache.kylin.common.util.ByteArray; -import org.apache.kylin.common.util.BytesUtil; -import org.apache.kylin.metadata.datatype.DataType; -import org.apache.kylin.metadata.datatype.StringSerializer; -import org.apache.kylin.metadata.model.TblColRef; -import org.apache.kylin.metadata.tuple.IEvaluatableTuple; - -import com.google.common.collect.Lists; - -public class EvaluatableFunctionTupleFilter extends BuiltInFunctionTupleFilter { - -private boolean constantsInitted = false; - -//about non-like -private List values; -private Object tupleValue; - -public EvaluatableFunctionTupleFilter(String name) { -super(name, FilterOperatorEnum.EVAL_FUNC); -values = Lists.newArrayListWithCapacity(1); -values.add(null); -} - -@Override -public boolean evaluate(IEvaluatableTuple tuple, IFilterCodeSystem cs) { - -// extract tuple value -Object tupleValue = null; -for (TupleFilter filter : this.children) { -if (!isConstant(filter)) { -filter.evaluate(tuple, cs); -tupleValue = filter.getValues().iterator().next(); -} -} - -TblColRef tblColRef = this.getColumn(); -DataType strDataType = DataType.getType("string"); -if (tblColRef.getType() != strDataType) { -throw new IllegalStateException("Only String type is allow in BuiltInFunction"); -} -ByteArray valueByteArray = (ByteArray) tupleValue; -StringSerializer serializer = new StringSerializer(strDataType); -String value = serializer.deserialize(ByteBuffer.wrap(valueByteArray.array(), valueByteArray.offset(), valueByteArray.length())); - -try { -if (isLikeFunction()) { -return (Boolean) invokeFunction(value); -} else { -this.tupleValue = invokeFunction(value); -//convert back to ByteArray format because the outer EvaluatableFunctionTupleFilter assumes input as ByteArray -ByteBuffer buffer = ByteBuffer.allocate(valueByteArray.length() * 2); -serializer.serialize((String) this.tupleValue, buffer); -this.tupleValue = new ByteArray(buffer.array(), 0, buffer.position()); - -
[4/5] kylin git commit: KYLIN-2030 enhancement
KYLIN-2030 enhancement Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ae73be52 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ae73be52 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ae73be52 Branch: refs/heads/orderedbytes3 Commit: ae73be5204452face5f28a6b5799de2e22b0a198 Parents: 8f1fb6a Author: Hongbin MaAuthored: Sat Oct 8 16:14:26 2016 +0800 Committer: Hongbin Ma Committed: Sun Oct 16 13:27:26 2016 +0800 -- .../kylin/cube/CubeCapabilityChecker.java | 38 +--- .../org/apache/kylin/cube/model/CubeDesc.java | 10 +++--- .../kylin/metadata/model/FunctionDesc.java | 1 + .../test/resources/query/sql_lookup/query06.sql | 1 + .../test/resources/query/sql_lookup/query07.sql | 1 + 5 files changed, 32 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ae73be52/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java index 1eada16..ee21b1c 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java @@ -75,22 +75,34 @@ public class CubeCapabilityChecker { tryCustomMeasureTypes(unmatchedDimensions, unmatchedAggregations, digest, cube, result); //} -// try dimension-as-measure -if (!unmatchedAggregations.isEmpty()) { -if (cube.getDescriptor().getFactTable().equals(digest.factTable)) { +//more tricks +if (cube.getDescriptor().getFactTable().equals(digest.factTable)) { +//for query-on-facttable +//1. dimension as measure + +if (!unmatchedAggregations.isEmpty()) { tryDimensionAsMeasures(unmatchedAggregations, digest, cube, result, cube.getDescriptor().listDimensionColumnsIncludingDerived()); -} else { -//deal with query on lookup table, like https://issues.apache.org/jira/browse/KYLIN-2030 -if (cube.getSegments().get(0).getSnapshots().containsKey(digest.factTable)) { -TableDesc tableDesc = MetadataManager.getInstance(KylinConfig.getInstanceFromEnv()).getTableDesc(digest.factTable); -Set dimCols = Sets.newHashSet(); -for (ColumnDesc columnDesc : tableDesc.getColumns()) { -dimCols.add(columnDesc.getRef()); -} +} +} else { +//for non query-on-facttable +if (cube.getSegments().get(0).getSnapshots().containsKey(digest.factTable)) { +TableDesc tableDesc = MetadataManager.getInstance(KylinConfig.getInstanceFromEnv()).getTableDesc(digest.factTable); +Set dimCols = Sets.newHashSet(); +for (ColumnDesc columnDesc : tableDesc.getColumns()) { +dimCols.add(columnDesc.getRef()); +} + +//1. dimension as measure, like max(cal_dt) or count( distinct col) from lookup +if (!unmatchedAggregations.isEmpty()) { tryDimensionAsMeasures(unmatchedAggregations, digest, cube, result, dimCols); -} else { -logger.info("Skip tryDimensionAsMeasures because current cube {} does not touch lookup table {} at all", cube.getName(), digest.factTable); } + +//2. more "dimensions" contributed by snapshot +if (!unmatchedDimensions.isEmpty()) { +unmatchedDimensions.removeAll(dimCols); +} +} else { +logger.info("cube {} does not touch lookup table {} at all", cube.getName(), digest.factTable); } } http://git-wip-us.apache.org/repos/asf/kylin/blob/ae73be52/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 4195451..7e055be 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 @@ -33,9 +33,9 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.TreeSet; +import java.util.Map.Entry;
[1/5] kylin git commit: KYLIN-2030 bug fix
Repository: kylin Updated Branches: refs/heads/orderedbytes3 [created] 7bce09614 KYLIN-2030 bug fix Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7bce0961 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7bce0961 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7bce0961 Branch: refs/heads/orderedbytes3 Commit: 7bce09614abfeea7c567c047929a9c985f5094d0 Parents: ae73be5 Author: Hongbin MaAuthored: Sun Oct 9 19:07:52 2016 +0800 Committer: Hongbin Ma Committed: Sun Oct 16 13:27:26 2016 +0800 -- .../kylin/cube/CubeCapabilityChecker.java | 23 ++-- .../kylin/query/relnode/OLAPAggregateRel.java | 22 +++ 2 files changed, 25 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7bce0961/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java index ee21b1c..e509d98 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeCapabilityChecker.java @@ -81,7 +81,7 @@ public class CubeCapabilityChecker { //1. dimension as measure if (!unmatchedAggregations.isEmpty()) { -tryDimensionAsMeasures(unmatchedAggregations, digest, cube, result, cube.getDescriptor().listDimensionColumnsIncludingDerived()); +tryDimensionAsMeasures(unmatchedAggregations, result, cube.getDescriptor().listDimensionColumnsIncludingDerived()); } } else { //for non query-on-facttable @@ -92,10 +92,18 @@ public class CubeCapabilityChecker { dimCols.add(columnDesc.getRef()); } -//1. dimension as measure, like max(cal_dt) or count( distinct col) from lookup +//1. all aggregations on lookup table can be done. For distinct count, mark them all DimensionAsMeasures +// so that the measure has a chance to be upgraded to DimCountDistinctMeasureType in org.apache.kylin.metadata.model.FunctionDesc#reInitMeasureType if (!unmatchedAggregations.isEmpty()) { -tryDimensionAsMeasures(unmatchedAggregations, digest, cube, result, dimCols); +Iterator itr = unmatchedAggregations.iterator(); +while (itr.hasNext()) { +FunctionDesc functionDesc = itr.next(); +if (dimCols.containsAll(functionDesc.getParameter().getColRefs())) { +itr.remove(); +} +} } +tryDimensionAsMeasures(Lists.newArrayList(aggrFunctions), result, dimCols); //2. more "dimensions" contributed by snapshot if (!unmatchedDimensions.isEmpty()) { @@ -159,19 +167,12 @@ public class CubeCapabilityChecker { return result; } -private static void tryDimensionAsMeasures(Collection unmatchedAggregations, SQLDigest digest, CubeInstance cube, CapabilityResult result, Set dimCols) { -CubeDesc cubeDesc = cube.getDescriptor(); -Collection cubeFuncs = cubeDesc.listAllFunctions(); +private static void tryDimensionAsMeasures(Collection unmatchedAggregations, CapabilityResult result, Set dimCols) { Iterator it = unmatchedAggregations.iterator(); while (it.hasNext()) { FunctionDesc functionDesc = it.next(); -if (cubeFuncs.contains(functionDesc)) { -it.remove(); -continue; -} - // let calcite handle count if (functionDesc.isCount()) { it.remove(); http://git-wip-us.apache.org/repos/asf/kylin/blob/7bce0961/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java -- diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java index 97efb27..c7a1eff 100644 --- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java +++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java @@ -285,16 +285,20 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel { } private void translateAggregation() { -// now the realization is known, replace aggregations with what's defined on MeasureDesc -
[2/5] kylin git commit: KYLIN-1726 fix BuildCubeWithStream
KYLIN-1726 fix BuildCubeWithStream Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/8f1fb6ac Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/8f1fb6ac Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/8f1fb6ac Branch: refs/heads/orderedbytes3 Commit: 8f1fb6ac47b9fcf22090080b86d2ea98cc9d6132 Parents: 3d0954d Author: Hongbin MaAuthored: Sat Oct 8 14:08:41 2016 +0800 Committer: Hongbin Ma Committed: Sun Oct 16 13:27:26 2016 +0800 -- .../java/org/apache/kylin/provision/BuildCubeWithStream.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/8f1fb6ac/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 fed14d8..c2fb180 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 @@ -18,6 +18,8 @@ package org.apache.kylin.provision; +import static java.lang.Thread.sleep; + import java.io.File; import java.io.IOException; import java.text.ParseException; @@ -32,7 +34,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.FutureTask; import java.util.concurrent.TimeUnit; -import com.google.common.collect.Lists; import org.I0Itec.zkclient.ZkConnection; import org.apache.commons.lang3.StringUtils; import org.apache.kafka.common.requests.MetadataResponse; @@ -64,7 +65,7 @@ import org.junit.Assert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static java.lang.Thread.sleep; +import com.google.common.collect.Lists; /** * for streaming cubing case "test_streaming_table" @@ -323,6 +324,5 @@ public class BuildCubeWithStream { logger.error("error", e); System.exit(1); } - } }
[3/5] kylin git commit: invoke after() in buildcubewithstream
invoke after() in buildcubewithstream Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/c60c2d62 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/c60c2d62 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/c60c2d62 Branch: refs/heads/orderedbytes3 Commit: c60c2d628ed0a3a4b852129727aa8f42d77c Parents: 61a08d4 Author: Hongbin MaAuthored: Sun Oct 16 13:25:33 2016 +0800 Committer: Hongbin Ma Committed: Sun Oct 16 13:27:26 2016 +0800 -- .../test/java/org/apache/kylin/provision/BuildCubeWithStream.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/c60c2d62/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 2faa8d0..fed14d8 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 @@ -316,6 +316,7 @@ public class BuildCubeWithStream { buildCubeWithStream.build(); logger.info("Build is done"); buildCubeWithStream.cleanup(); +buildCubeWithStream.after(); logger.info("Going to exit"); System.exit(0); } catch (Throwable e) {
kylin git commit: minor, move timezone setting early to surefire command line
Repository: kylin Updated Branches: refs/heads/master 021ccfd09 -> 61a08d429 minor, move timezone setting early to surefire command line Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/61a08d42 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/61a08d42 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/61a08d42 Branch: refs/heads/master Commit: 61a08d429a2c7419751b312e41bcee82048716e2 Parents: 021ccfd Author: Yang LiAuthored: Sun Oct 16 07:59:33 2016 +0800 Committer: Yang Li Committed: Sun Oct 16 07:59:33 2016 +0800 -- .../src/test/java/org/apache/kylin/query/ITKylinQueryTest.java| 3 --- pom.xml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/61a08d42/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java -- diff --git a/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java b/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java index 93d47f1..59a3a04 100644 --- a/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java +++ b/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java @@ -24,7 +24,6 @@ import java.io.File; import java.sql.SQLException; import java.util.List; import java.util.Map; -import java.util.TimeZone; import org.apache.commons.lang3.StringUtils; import org.apache.kylin.common.KylinConfig; @@ -66,8 +65,6 @@ public class ITKylinQueryTest extends KylinTestBase { RemoveBlackoutRealizationsRule.blackList.add("CUBE[name=test_kylin_cube_with_view_left_join_empty]"); RemoveBlackoutRealizationsRule.blackList.add("CUBE[name=test_kylin_cube_with_view_inner_join_empty]"); - -TimeZone.setDefault(TimeZone.getTimeZone("UTC")); } @AfterClass http://git-wip-us.apache.org/repos/asf/kylin/blob/61a08d42/pom.xml -- diff --git a/pom.xml b/pom.xml index caa09ec..c7538e4 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,7 @@ --Xms1G -Xmx2G -XX:MaxPermSize=512M +-Xms1G -Xmx2G -XX:MaxPermSize=512M -Duser.timezone=UTC
[2/4] kylin git commit: KYLIN-1528 Create a branch for v1.5 with HBase 1.x API
http://git-wip-us.apache.org/repos/asf/kylin/blob/fe91c21f/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java index 5b2441c..2f7e164 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java @@ -24,11 +24,11 @@ import java.util.Collections; import java.util.List; import org.apache.commons.lang.StringUtils; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.Connection; import org.apache.kylin.common.KylinConfig; -import org.apache.kylin.common.util.Bytes; import org.apache.kylin.job.exception.ExecuteException; import org.apache.kylin.job.execution.AbstractExecutable; import org.apache.kylin.job.execution.ExecutableContext; @@ -69,19 +69,20 @@ public class MergeGCStep extends AbstractExecutable { List oldTables = getOldHTables(); if (oldTables != null && oldTables.size() > 0) { String metadataUrlPrefix = KylinConfig.getInstanceFromEnv().getMetadataUrlPrefix(); -Configuration conf = HBaseConnection.getCurrentHBaseConfiguration(); -HBaseAdmin admin = null; +Admin admin = null; try { -admin = new HBaseAdmin(conf); +Connection conn = HBaseConnection.get(KylinConfig.getInstanceFromEnv().getStorageUrl()); +admin = conn.getAdmin(); + for (String table : oldTables) { -if (admin.tableExists(table)) { -HTableDescriptor tableDescriptor = admin.getTableDescriptor(Bytes.toBytes(table)); +if (admin.tableExists(TableName.valueOf(table))) { +HTableDescriptor tableDescriptor = admin.getTableDescriptor(TableName.valueOf((table))); String host = tableDescriptor.getValue(IRealizationConstants.HTableTag); if (metadataUrlPrefix.equalsIgnoreCase(host)) { -if (admin.isTableEnabled(table)) { -admin.disableTable(table); +if (admin.isTableEnabled(TableName.valueOf(table))) { +admin.disableTable(TableName.valueOf(table)); } -admin.deleteTable(table); +admin.deleteTable(TableName.valueOf(table)); logger.debug("Dropped htable: " + table); output.append("HBase table " + table + " is dropped. \n"); } else { http://git-wip-us.apache.org/repos/asf/kylin/blob/fe91c21f/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java index a150607..56f867a 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java @@ -21,9 +21,11 @@ package org.apache.kylin.storage.hbase.util; import java.io.IOException; import org.apache.commons.cli.Options; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.Connection; +import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.util.AbstractApplication; import org.apache.kylin.common.util.OptionsHelper; import org.apache.kylin.metadata.realization.IRealizationConstants; @@ -38,8 +40,8 @@ public class CleanHtableCLI extends AbstractApplication { protected static final Logger logger = LoggerFactory.getLogger(CleanHtableCLI.class); private void clean() throws IOException { -Configuration conf = HBaseConnection.getCurrentHBaseConfiguration(); -HBaseAdmin hbaseAdmin = new HBaseAdmin(conf); +Connection conn = HBaseConnection.get(KylinConfig.getInstanceFromEnv().getStorageUrl()); +Admin hbaseAdmin = conn.getAdmin(); for (HTableDescriptor descriptor : hbaseAdmin.listTables()) { String name =
[3/4] kylin git commit: KYLIN-1528 Create a branch for v1.5 with HBase 1.x API
KYLIN-1528 Create a branch for v1.5 with HBase 1.x API Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/fe91c21f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/fe91c21f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/fe91c21f Branch: refs/heads/yang21-cdh5.7 Commit: fe91c21f7b74c983f7854046dbcb5ccc2faabb5b Parents: 36a404f Author: shaofengshiAuthored: Wed Mar 23 17:07:05 2016 +0800 Committer: Yang Li Committed: Sat Oct 15 08:28:28 2016 + -- examples/test_case_data/sandbox/hbase-site.xml | 19 +--- .../kylin/provision/BuildCubeWithEngine.java| 13 ++- pom.xml | 12 +-- .../kylin/rest/security/AclHBaseStorage.java| 4 +- .../rest/security/MockAclHBaseStorage.java | 8 +- .../apache/kylin/rest/security/MockHTable.java | 95 .../rest/security/RealAclHBaseStorage.java | 9 +- .../apache/kylin/rest/service/AclService.java | 25 +++--- .../apache/kylin/rest/service/CubeService.java | 36 +++- .../apache/kylin/rest/service/QueryService.java | 24 +++-- .../apache/kylin/rest/service/UserService.java | 17 ++-- .../kylin/storage/hbase/HBaseConnection.java| 44 - .../kylin/storage/hbase/HBaseResourceStore.java | 31 +++ .../kylin/storage/hbase/HBaseStorage.java | 3 +- .../storage/hbase/cube/SimpleHBaseStore.java| 20 ++--- .../hbase/cube/v1/CubeSegmentTupleIterator.java | 11 +-- .../storage/hbase/cube/v1/CubeStorageQuery.java | 6 +- .../hbase/cube/v1/RegionScannerAdapter.java | 10 ++- .../cube/v1/SerializedHBaseTupleIterator.java | 4 +- .../observer/AggregateRegionObserver.java | 4 +- .../observer/AggregationScanner.java| 14 ++- .../observer/ObserverAggregationCache.java | 10 ++- .../coprocessor/observer/ObserverEnabler.java | 4 +- .../hbase/cube/v2/CubeHBaseEndpointRPC.java | 13 +-- .../storage/hbase/cube/v2/CubeHBaseScanRPC.java | 9 +- .../coprocessor/endpoint/CubeVisitService.java | 4 +- .../storage/hbase/steps/CubeHTableUtil.java | 16 ++-- .../storage/hbase/steps/DeprecatedGCStep.java | 23 ++--- .../storage/hbase/steps/HBaseCuboidWriter.java | 7 +- .../hbase/steps/HBaseStreamingOutput.java | 9 +- .../kylin/storage/hbase/steps/MergeGCStep.java | 23 ++--- .../storage/hbase/util/CleanHtableCLI.java | 12 +-- .../storage/hbase/util/CubeMigrationCLI.java| 36 .../hbase/util/CubeMigrationCheckCLI.java | 17 ++-- .../hbase/util/DeployCoprocessorCLI.java| 22 ++--- .../hbase/util/ExtendCubeToHybridCLI.java | 8 +- .../hbase/util/GridTableHBaseBenchmark.java | 34 +++ .../kylin/storage/hbase/util/HBaseClean.java| 18 ++-- .../hbase/util/HBaseRegionSizeCalculator.java | 35 .../kylin/storage/hbase/util/HBaseUsage.java| 9 +- .../storage/hbase/util/HbaseStreamingInput.java | 30 +++ .../hbase/util/HtableAlterMetadataCLI.java | 9 +- .../storage/hbase/util/OrphanHBaseCleanJob.java | 19 ++-- .../kylin/storage/hbase/util/PingHBaseCLI.java | 15 ++-- .../kylin/storage/hbase/util/RowCounterCLI.java | 11 +-- .../storage/hbase/util/StorageCleanupJob.java | 20 +++-- .../storage/hbase/util/UpdateHTableHostCLI.java | 17 ++-- .../observer/AggregateRegionObserverTest.java | 26 ++ .../v1/filter/TestFuzzyRowFilterV2EndToEnd.java | 5 +- 49 files changed, 408 insertions(+), 462 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/fe91c21f/examples/test_case_data/sandbox/hbase-site.xml -- diff --git a/examples/test_case_data/sandbox/hbase-site.xml b/examples/test_case_data/sandbox/hbase-site.xml index 46d5345..734908e 100644 --- a/examples/test_case_data/sandbox/hbase-site.xml +++ b/examples/test_case_data/sandbox/hbase-site.xml @@ -190,22 +190,5 @@ zookeeper.znode.parent /hbase-unsecure - -hbase.client.pause -100 -General client pause value. Used mostly as value to wait -before running a retry of a failed get, region lookup, etc. -See hbase.client.retries.number for description of how we backoff from -this initial pause amount and how this pause works w/ retries. - - -hbase.client.retries.number -5 -Maximum retries. Used as maximum for all retryable -operations such as the getting of a cell's value, starting a row update, -etc. Retry interval is a rough function based on hbase.client.pause. At -first we retry at this interval but then with backoff, we pretty quickly reach -retrying every ten seconds. See
[4/4] kylin git commit: KYLIN-1672 support kylin on cdh 5.7
KYLIN-1672 support kylin on cdh 5.7 Signed-off-by: Li YangProject: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5d5e9989 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5d5e9989 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5d5e9989 Branch: refs/heads/yang21-cdh5.7 Commit: 5d5e9989810e77eea3e2929d5f15afdc7f65806b Parents: fe91c21 Author: Lynne Jiang Authored: Mon May 16 03:33:27 2016 -0700 Committer: Yang Li Committed: Sat Oct 15 08:31:27 2016 + -- dev-support/test_all_against_hdp_2_2_4_2_2.sh | 0 .../kylin/engine/mr/steps/MockupMapContext.java | 15 +- examples/test_case_data/sandbox/core-site.xml | 146 +++--- examples/test_case_data/sandbox/hbase-site.xml | 162 ++ examples/test_case_data/sandbox/hdfs-site.xml | 259 ++ examples/test_case_data/sandbox/mapred-site.xml | 398 ++- examples/test_case_data/sandbox/yarn-site.xml | 496 ++- pom.xml | 16 +- server/pom.xml | 36 ++ .../storage/hbase/steps/MockupMapContext.java | 19 +- tool/pom.xml| 12 + 11 files changed, 428 insertions(+), 1131 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/5d5e9989/dev-support/test_all_against_hdp_2_2_4_2_2.sh -- diff --git a/dev-support/test_all_against_hdp_2_2_4_2_2.sh b/dev-support/test_all_against_hdp_2_2_4_2_2.sh old mode 100644 new mode 100755 http://git-wip-us.apache.org/repos/asf/kylin/blob/5d5e9989/engine-mr/src/test/java/org/apache/kylin/engine/mr/steps/MockupMapContext.java -- diff --git a/engine-mr/src/test/java/org/apache/kylin/engine/mr/steps/MockupMapContext.java b/engine-mr/src/test/java/org/apache/kylin/engine/mr/steps/MockupMapContext.java index 847071d..9900465 100644 --- a/engine-mr/src/test/java/org/apache/kylin/engine/mr/steps/MockupMapContext.java +++ b/engine-mr/src/test/java/org/apache/kylin/engine/mr/steps/MockupMapContext.java @@ -77,6 +77,7 @@ public class MockupMapContext { outKV[0] = key; outKV[1] = value; } + } @Override @@ -99,6 +100,7 @@ public class MockupMapContext { throw new NotImplementedException(); } + @Override public float getProgress() { throw new NotImplementedException(); @@ -195,17 +197,17 @@ public class MockupMapContext { } @Override -public RawComparator getSortComparator() { +public boolean userClassesTakesPrecedence() { throw new NotImplementedException(); } @Override -public String getJar() { +public RawComparator getSortComparator() { throw new NotImplementedException(); } @Override -public RawComparator getGroupingComparator() { +public String getJar() { throw new NotImplementedException(); } @@ -221,7 +223,7 @@ public class MockupMapContext { @Override public boolean getProfileEnabled() { -throw new NotImplementedException(); +return false; } @Override @@ -308,6 +310,11 @@ public class MockupMapContext { public RawComparator getCombinerKeyGroupingComparator() { throw new NotImplementedException(); } + +@Override +public RawComparator getGroupingComparator() { +return null; +} }); } } http://git-wip-us.apache.org/repos/asf/kylin/blob/5d5e9989/examples/test_case_data/sandbox/core-site.xml -- diff --git a/examples/test_case_data/sandbox/core-site.xml b/examples/test_case_data/sandbox/core-site.xml index 9aa588c..6162406 100644 --- a/examples/test_case_data/sandbox/core-site.xml +++ b/examples/test_case_data/sandbox/core-site.xml @@ -14,152 +14,146 @@ See the License for the specific language governing permissions and limitations under the License. --> + - fs.defaultFS -hdfs://sandbox.hortonworks.com:8020 -true +hdfs://quickstart.cloudera:8020 - fs.trash.interval -360 +1 - - ha.failover-controller.active-standby-elector.zk.op.retries -120 +io.compression.codecs +
[2/3] kylin git commit: KYLIN-1528 Create a branch for v1.5 with HBase 1.x API
http://git-wip-us.apache.org/repos/asf/kylin/blob/fe91c21f/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java index 5b2441c..2f7e164 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/MergeGCStep.java @@ -24,11 +24,11 @@ import java.util.Collections; import java.util.List; import org.apache.commons.lang.StringUtils; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.Connection; import org.apache.kylin.common.KylinConfig; -import org.apache.kylin.common.util.Bytes; import org.apache.kylin.job.exception.ExecuteException; import org.apache.kylin.job.execution.AbstractExecutable; import org.apache.kylin.job.execution.ExecutableContext; @@ -69,19 +69,20 @@ public class MergeGCStep extends AbstractExecutable { List oldTables = getOldHTables(); if (oldTables != null && oldTables.size() > 0) { String metadataUrlPrefix = KylinConfig.getInstanceFromEnv().getMetadataUrlPrefix(); -Configuration conf = HBaseConnection.getCurrentHBaseConfiguration(); -HBaseAdmin admin = null; +Admin admin = null; try { -admin = new HBaseAdmin(conf); +Connection conn = HBaseConnection.get(KylinConfig.getInstanceFromEnv().getStorageUrl()); +admin = conn.getAdmin(); + for (String table : oldTables) { -if (admin.tableExists(table)) { -HTableDescriptor tableDescriptor = admin.getTableDescriptor(Bytes.toBytes(table)); +if (admin.tableExists(TableName.valueOf(table))) { +HTableDescriptor tableDescriptor = admin.getTableDescriptor(TableName.valueOf((table))); String host = tableDescriptor.getValue(IRealizationConstants.HTableTag); if (metadataUrlPrefix.equalsIgnoreCase(host)) { -if (admin.isTableEnabled(table)) { -admin.disableTable(table); +if (admin.isTableEnabled(TableName.valueOf(table))) { +admin.disableTable(TableName.valueOf(table)); } -admin.deleteTable(table); +admin.deleteTable(TableName.valueOf(table)); logger.debug("Dropped htable: " + table); output.append("HBase table " + table + " is dropped. \n"); } else { http://git-wip-us.apache.org/repos/asf/kylin/blob/fe91c21f/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java index a150607..56f867a 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/CleanHtableCLI.java @@ -21,9 +21,11 @@ package org.apache.kylin.storage.hbase.util; import java.io.IOException; import org.apache.commons.cli.Options; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.Connection; +import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.util.AbstractApplication; import org.apache.kylin.common.util.OptionsHelper; import org.apache.kylin.metadata.realization.IRealizationConstants; @@ -38,8 +40,8 @@ public class CleanHtableCLI extends AbstractApplication { protected static final Logger logger = LoggerFactory.getLogger(CleanHtableCLI.class); private void clean() throws IOException { -Configuration conf = HBaseConnection.getCurrentHBaseConfiguration(); -HBaseAdmin hbaseAdmin = new HBaseAdmin(conf); +Connection conn = HBaseConnection.get(KylinConfig.getInstanceFromEnv().getStorageUrl()); +Admin hbaseAdmin = conn.getAdmin(); for (HTableDescriptor descriptor : hbaseAdmin.listTables()) { String name =
[3/3] kylin git commit: KYLIN-1528 Create a branch for v1.5 with HBase 1.x API
KYLIN-1528 Create a branch for v1.5 with HBase 1.x API Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/fe91c21f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/fe91c21f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/fe91c21f Branch: refs/heads/yang21-hbase1.x Commit: fe91c21f7b74c983f7854046dbcb5ccc2faabb5b Parents: 36a404f Author: shaofengshiAuthored: Wed Mar 23 17:07:05 2016 +0800 Committer: Yang Li Committed: Sat Oct 15 08:28:28 2016 + -- examples/test_case_data/sandbox/hbase-site.xml | 19 +--- .../kylin/provision/BuildCubeWithEngine.java| 13 ++- pom.xml | 12 +-- .../kylin/rest/security/AclHBaseStorage.java| 4 +- .../rest/security/MockAclHBaseStorage.java | 8 +- .../apache/kylin/rest/security/MockHTable.java | 95 .../rest/security/RealAclHBaseStorage.java | 9 +- .../apache/kylin/rest/service/AclService.java | 25 +++--- .../apache/kylin/rest/service/CubeService.java | 36 +++- .../apache/kylin/rest/service/QueryService.java | 24 +++-- .../apache/kylin/rest/service/UserService.java | 17 ++-- .../kylin/storage/hbase/HBaseConnection.java| 44 - .../kylin/storage/hbase/HBaseResourceStore.java | 31 +++ .../kylin/storage/hbase/HBaseStorage.java | 3 +- .../storage/hbase/cube/SimpleHBaseStore.java| 20 ++--- .../hbase/cube/v1/CubeSegmentTupleIterator.java | 11 +-- .../storage/hbase/cube/v1/CubeStorageQuery.java | 6 +- .../hbase/cube/v1/RegionScannerAdapter.java | 10 ++- .../cube/v1/SerializedHBaseTupleIterator.java | 4 +- .../observer/AggregateRegionObserver.java | 4 +- .../observer/AggregationScanner.java| 14 ++- .../observer/ObserverAggregationCache.java | 10 ++- .../coprocessor/observer/ObserverEnabler.java | 4 +- .../hbase/cube/v2/CubeHBaseEndpointRPC.java | 13 +-- .../storage/hbase/cube/v2/CubeHBaseScanRPC.java | 9 +- .../coprocessor/endpoint/CubeVisitService.java | 4 +- .../storage/hbase/steps/CubeHTableUtil.java | 16 ++-- .../storage/hbase/steps/DeprecatedGCStep.java | 23 ++--- .../storage/hbase/steps/HBaseCuboidWriter.java | 7 +- .../hbase/steps/HBaseStreamingOutput.java | 9 +- .../kylin/storage/hbase/steps/MergeGCStep.java | 23 ++--- .../storage/hbase/util/CleanHtableCLI.java | 12 +-- .../storage/hbase/util/CubeMigrationCLI.java| 36 .../hbase/util/CubeMigrationCheckCLI.java | 17 ++-- .../hbase/util/DeployCoprocessorCLI.java| 22 ++--- .../hbase/util/ExtendCubeToHybridCLI.java | 8 +- .../hbase/util/GridTableHBaseBenchmark.java | 34 +++ .../kylin/storage/hbase/util/HBaseClean.java| 18 ++-- .../hbase/util/HBaseRegionSizeCalculator.java | 35 .../kylin/storage/hbase/util/HBaseUsage.java| 9 +- .../storage/hbase/util/HbaseStreamingInput.java | 30 +++ .../hbase/util/HtableAlterMetadataCLI.java | 9 +- .../storage/hbase/util/OrphanHBaseCleanJob.java | 19 ++-- .../kylin/storage/hbase/util/PingHBaseCLI.java | 15 ++-- .../kylin/storage/hbase/util/RowCounterCLI.java | 11 +-- .../storage/hbase/util/StorageCleanupJob.java | 20 +++-- .../storage/hbase/util/UpdateHTableHostCLI.java | 17 ++-- .../observer/AggregateRegionObserverTest.java | 26 ++ .../v1/filter/TestFuzzyRowFilterV2EndToEnd.java | 5 +- 49 files changed, 408 insertions(+), 462 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/fe91c21f/examples/test_case_data/sandbox/hbase-site.xml -- diff --git a/examples/test_case_data/sandbox/hbase-site.xml b/examples/test_case_data/sandbox/hbase-site.xml index 46d5345..734908e 100644 --- a/examples/test_case_data/sandbox/hbase-site.xml +++ b/examples/test_case_data/sandbox/hbase-site.xml @@ -190,22 +190,5 @@ zookeeper.znode.parent /hbase-unsecure - -hbase.client.pause -100 -General client pause value. Used mostly as value to wait -before running a retry of a failed get, region lookup, etc. -See hbase.client.retries.number for description of how we backoff from -this initial pause amount and how this pause works w/ retries. - - -hbase.client.retries.number -5 -Maximum retries. Used as maximum for all retryable -operations such as the getting of a cell's value, starting a row update, -etc. Retry interval is a rough function based on hbase.client.pause. At -first we retry at this interval but then with backoff, we pretty quickly reach -retrying every ten seconds. See
[1/3] kylin git commit: minor, enhance KYLIN_HOME setup [Forced Update!]
Repository: kylin Updated Branches: refs/heads/yang21-hbase1.x 237dcf77c -> fe91c21f7 (forced update) minor, enhance KYLIN_HOME setup Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/36a404f9 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/36a404f9 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/36a404f9 Branch: refs/heads/yang21-hbase1.x Commit: 36a404f959e9677ffe17d55e6b3064b883772e9f Parents: 75de81b Author: Yang LiAuthored: Sat Oct 15 15:58:48 2016 +0800 Committer: Yang Li Committed: Sat Oct 15 15:58:48 2016 +0800 -- build/bin/kylin.sh | 7 --- build/bin/metastore.sh | 9 + 2 files changed, 9 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/36a404f9/build/bin/kylin.sh -- diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh index 201b5b6..244838b 100644 --- a/build/bin/kylin.sh +++ b/build/bin/kylin.sh @@ -17,9 +17,10 @@ # limitations under the License. # -# We should set KYLIN_HOME here for multiple tomcat instances that are on the same node. -# In addition, we should set a KYLIN_HOME for the global use as normal. -KYLIN_HOME=`dirname $0`/.. +dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) + +# set KYLIN_HOME with consideration for multiple instances that are on the same node +KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"} export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd` dir="$KYLIN_HOME/bin" http://git-wip-us.apache.org/repos/asf/kylin/blob/36a404f9/build/bin/metastore.sh -- diff --git a/build/bin/metastore.sh b/build/bin/metastore.sh index 5f34bff..baf3d7a 100755 --- a/build/bin/metastore.sh +++ b/build/bin/metastore.sh @@ -24,11 +24,12 @@ # take a look at SandboxMetastoreCLI -dir=$(dirname ${0}) +dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -# We should set KYLIN_HOME here for multiple tomcat instsances that are on the same node. -# In addition, we should set a KYLIN_HOME for the global use as normal. -export KYLIN_HOME=${dir}/../ +# set KYLIN_HOME with consideration for multiple instances that are on the same node +KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"} +export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd` +dir="$KYLIN_HOME/bin" source ${dir}/check-env.sh
kylin git commit: minor, enhance KYLIN_HOME setup
Repository: kylin Updated Branches: refs/heads/master bebbc7847 -> 021ccfd09 minor, enhance KYLIN_HOME setup Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/021ccfd0 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/021ccfd0 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/021ccfd0 Branch: refs/heads/master Commit: 021ccfd0984bd41e2f2286ebec83efb551899575 Parents: bebbc78 Author: Yang LiAuthored: Sat Oct 15 15:58:48 2016 +0800 Committer: Yang Li Committed: Sat Oct 15 15:59:38 2016 +0800 -- build/bin/kylin.sh | 7 --- build/bin/metastore.sh | 9 + 2 files changed, 9 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/021ccfd0/build/bin/kylin.sh -- diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh index da53d3d..9286055e 100644 --- a/build/bin/kylin.sh +++ b/build/bin/kylin.sh @@ -17,9 +17,10 @@ # limitations under the License. # -# We should set KYLIN_HOME here for multiple tomcat instances that are on the same node. -# In addition, we should set a KYLIN_HOME for the global use as normal. -KYLIN_HOME=`dirname $0`/.. +dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) + +# set KYLIN_HOME with consideration for multiple instances that are on the same node +KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"} export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd` dir="$KYLIN_HOME/bin" http://git-wip-us.apache.org/repos/asf/kylin/blob/021ccfd0/build/bin/metastore.sh -- diff --git a/build/bin/metastore.sh b/build/bin/metastore.sh index 5f34bff..baf3d7a 100755 --- a/build/bin/metastore.sh +++ b/build/bin/metastore.sh @@ -24,11 +24,12 @@ # take a look at SandboxMetastoreCLI -dir=$(dirname ${0}) +dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -# We should set KYLIN_HOME here for multiple tomcat instsances that are on the same node. -# In addition, we should set a KYLIN_HOME for the global use as normal. -export KYLIN_HOME=${dir}/../ +# set KYLIN_HOME with consideration for multiple instances that are on the same node +KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"} +export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd` +dir="$KYLIN_HOME/bin" source ${dir}/check-env.sh
kylin git commit: minor, enhance KYLIN_HOME setup
Repository: kylin Updated Branches: refs/heads/yang21 75de81b3a -> 36a404f95 minor, enhance KYLIN_HOME setup Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/36a404f9 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/36a404f9 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/36a404f9 Branch: refs/heads/yang21 Commit: 36a404f959e9677ffe17d55e6b3064b883772e9f Parents: 75de81b Author: Yang LiAuthored: Sat Oct 15 15:58:48 2016 +0800 Committer: Yang Li Committed: Sat Oct 15 15:58:48 2016 +0800 -- build/bin/kylin.sh | 7 --- build/bin/metastore.sh | 9 + 2 files changed, 9 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/36a404f9/build/bin/kylin.sh -- diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh index 201b5b6..244838b 100644 --- a/build/bin/kylin.sh +++ b/build/bin/kylin.sh @@ -17,9 +17,10 @@ # limitations under the License. # -# We should set KYLIN_HOME here for multiple tomcat instances that are on the same node. -# In addition, we should set a KYLIN_HOME for the global use as normal. -KYLIN_HOME=`dirname $0`/.. +dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) + +# set KYLIN_HOME with consideration for multiple instances that are on the same node +KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"} export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd` dir="$KYLIN_HOME/bin" http://git-wip-us.apache.org/repos/asf/kylin/blob/36a404f9/build/bin/metastore.sh -- diff --git a/build/bin/metastore.sh b/build/bin/metastore.sh index 5f34bff..baf3d7a 100755 --- a/build/bin/metastore.sh +++ b/build/bin/metastore.sh @@ -24,11 +24,12 @@ # take a look at SandboxMetastoreCLI -dir=$(dirname ${0}) +dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -# We should set KYLIN_HOME here for multiple tomcat instsances that are on the same node. -# In addition, we should set a KYLIN_HOME for the global use as normal. -export KYLIN_HOME=${dir}/../ +# set KYLIN_HOME with consideration for multiple instances that are on the same node +KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"} +export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd` +dir="$KYLIN_HOME/bin" source ${dir}/check-env.sh