kylin git commit: KYLIN-976 Pass CI tests; Amend javadoc
Repository: kylin Updated Branches: refs/heads/2.x-staging fb14135a0 -> 2f76a96bd KYLIN-976 Pass CI tests; Amend javadoc Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2f76a96b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2f76a96b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2f76a96b Branch: refs/heads/2.x-staging Commit: 2f76a96bd1eb6df2ee9f8a4bb00717765c33c5be Parents: fb14135 Author: Li, YangAuthored: Tue Dec 8 16:36:07 2015 +0800 Committer: Li, Yang Committed: Tue Dec 8 16:36:38 2015 +0800 -- .../kylin/cube/CubeCapabilityChecker.java | 21 ++-- .../org/apache/kylin/measure/MeasureType.java | 48 +++- .../kylin/measure/MeasureTypeFactory.java | 47 +++- .../kylin/measure/topn/TopNMeasureType.java | 3 +- .../kylin/metadata/datatype/DataType.java | 8 +- .../metadata/datatype/DataTypeSerializer.java | 2 - .../metadata/realization/CapabilityResult.java | 4 +- .../invertedindex/IICapabilityChecker.java | 109 --- .../apache/kylin/invertedindex/IIInstance.java | 12 +- .../storage/hbase/cube/v1/CubeStorageQuery.java | 2 +- .../hbase/cube/v2/CubeSegmentScanner.java | 9 +- .../storage/hbase/cube/v2/CubeStorageQuery.java | 2 +- .../cube/v2/SequentialCubeTupleIterator.java| 2 +- 13 files changed, 209 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/2f76a96b/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 90a3656..48b3f90 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 @@ -50,22 +50,19 @@ public class CubeCapabilityChecker { CapabilityResult result = new CapabilityResult(); result.capable = false; -// retrieve members from olapContext -Collection dimensionColumns = getDimensionColumns(digest); -Collection aggrFunctions = digest.aggregations; -Collection joins = digest.joinDescs; - -// match dimensions & aggregations & joins - -Collection unmatchedDimensions = unmatchedDimensions(dimensionColumns, cube); -Collection unmatchedAggregations = unmatchedAggregations(aggrFunctions, cube); -boolean isJoinMatch = isJoinMatch(joins, cube); - +// match joins +boolean isJoinMatch = isJoinMatch(digest.joinDescs, cube); if (!isJoinMatch) { logger.info("Exclude cube " + cube.getName() + " because unmatched joins"); return result; } +// dimensions & measures +Collection dimensionColumns = getDimensionColumns(digest); +Collection aggrFunctions = digest.aggregations; +Collection unmatchedDimensions = unmatchedDimensions(dimensionColumns, cube); +Collection unmatchedAggregations = unmatchedAggregations(aggrFunctions, cube); + // try custom measure types if (!unmatchedDimensions.isEmpty() || !unmatchedAggregations.isEmpty()) { tryCustomMeasureTypes(unmatchedDimensions, unmatchedAggregations, digest, cube, result); @@ -163,7 +160,7 @@ public class CubeCapabilityChecker { continue; } -// only inverted-index cube does not have count, and let calcite handle in this case +// let calcite handle count if (functionDesc.isCount()) { it.remove(); continue; http://git-wip-us.apache.org/repos/asf/kylin/blob/2f76a96b/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java b/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java index cf04c60..f7523cf 100644 --- a/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java +++ b/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java @@ -32,16 +32,26 @@ import org.apache.kylin.metadata.realization.SQLDigest; import org.apache.kylin.metadata.tuple.Tuple; import org.apache.kylin.metadata.tuple.TupleInfo; +/** + * MeasureType captures how a kind of aggregation is defined, how it is calculated + * during cube build, and how it is involved in query and storage scan. + * + * @param the Java type of aggregation data object, e.g. HyperLogLogPlusCounter + */ abstract public class
[1/5] kylin git commit: KYLIN-976 Extract fillTuple() methods
Repository: kylin Updated Branches: refs/heads/KYLIN-976 63f376a5a -> 21f56da50 http://git-wip-us.apache.org/repos/asf/kylin/blob/37f92de0/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java -- diff --git a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java index c395fd9..bde8dd2 100644 --- a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java +++ b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java @@ -26,7 +26,7 @@ import java.util.List; import org.apache.kylin.metadata.filter.TupleFilter; import org.apache.kylin.metadata.filter.TupleFilterSerializer; import org.apache.kylin.metadata.model.TblColRef; -import org.apache.kylin.storage.tuple.Tuple; +import org.apache.kylin.metadata.tuple.Tuple; import org.junit.Test; /**
[16/21] kylin git commit: KYLIN-976 Extract fillTuple() methods
http://git-wip-us.apache.org/repos/asf/kylin/blob/636aeecf/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java -- diff --git a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java index c395fd9..bde8dd2 100644 --- a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java +++ b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/common/coprocessor/FilterEvaluateTest.java @@ -26,7 +26,7 @@ import java.util.List; import org.apache.kylin.metadata.filter.TupleFilter; import org.apache.kylin.metadata.filter.TupleFilterSerializer; import org.apache.kylin.metadata.model.TblColRef; -import org.apache.kylin.storage.tuple.Tuple; +import org.apache.kylin.metadata.tuple.Tuple; import org.junit.Test; /**
[10/21] kylin git commit: KYLIN-976 Add ingester; Build part done, in-mem cube test pass
http://git-wip-us.apache.org/repos/asf/kylin/blob/99396828/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilderTest.java -- diff --git a/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilderTest.java b/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilderTest.java index ed0a166..832584c 100644 --- a/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilderTest.java +++ b/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilderTest.java @@ -33,10 +33,10 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.apache.kylin.common.KylinConfig; +import org.apache.kylin.common.util.Dictionary; import org.apache.kylin.common.util.LocalFileMetadataTestCase; import org.apache.kylin.cube.CubeInstance; import org.apache.kylin.cube.CubeManager; -import org.apache.kylin.dict.Dictionary; import org.apache.kylin.gridtable.GTRecord; import org.apache.kylin.metadata.model.TblColRef; import org.junit.AfterClass; @@ -58,7 +58,7 @@ public class DoggedCubeBuilderTest extends LocalFileMetadataTestCase { private static CubeInstance cube; private static String flatTable; -private static MapdictionaryMap; +private static Map dictionaryMap; @BeforeClass public static void before() throws IOException { http://git-wip-us.apache.org/repos/asf/kylin/blob/99396828/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilderTest.java -- diff --git a/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilderTest.java b/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilderTest.java index f853b08..ab87c2b 100644 --- a/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilderTest.java +++ b/core-cube/src/test/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilderTest.java @@ -33,13 +33,13 @@ import java.util.concurrent.Future; import org.apache.commons.io.FileUtils; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.util.Bytes; +import org.apache.kylin.common.util.Dictionary; import org.apache.kylin.common.util.LocalFileMetadataTestCase; import org.apache.kylin.cube.CubeInstance; import org.apache.kylin.cube.CubeManager; import org.apache.kylin.cube.cuboid.Cuboid; import org.apache.kylin.cube.model.CubeDesc; import org.apache.kylin.cube.model.CubeJoinedFlatTableDesc; -import org.apache.kylin.dict.Dictionary; import org.apache.kylin.dict.DictionaryGenerator; import org.apache.kylin.dict.IterableDictionaryValueEnumerator; import org.apache.kylin.gridtable.GTRecord; @@ -66,7 +66,7 @@ public class InMemCubeBuilderTest extends LocalFileMetadataTestCase { private static CubeInstance cube; private static String flatTable; -private static Map dictionaryMap; +private static Map dictionaryMap; @BeforeClass public static void before() throws IOException { @@ -166,8 +166,8 @@ public class InMemCubeBuilderTest extends LocalFileMetadataTestCase { queue.put(new ArrayList(0)); } -static Map getDictionaryMap(CubeInstance cube, String flatTable) throws IOException { -Map result = Maps.newHashMap(); +static Map getDictionaryMap(CubeInstance cube, String flatTable) throws IOException { +Map result = Maps.newHashMap(); CubeDesc desc = cube.getDescriptor(); CubeJoinedFlatTableDesc flatTableDesc = new CubeJoinedFlatTableDesc(desc, null); int nColumns = flatTableDesc.getColumnList().size(); @@ -178,7 +178,7 @@ public class InMemCubeBuilderTest extends LocalFileMetadataTestCase { if (desc.getRowkey().isUseDictionary(col)) { logger.info("Building dictionary for " + col); List valueList = readValueList(flatTable, nColumns, flatTableDesc.getRowKeyColumnIndexes()[c]); -Dictionary dict = DictionaryGenerator.buildDictionaryFromValueEnumerator(col.getType(), new IterableDictionaryValueEnumerator(valueList)); +Dictionary dict = DictionaryGenerator.buildDictionaryFromValueEnumerator(col.getType(), new IterableDictionaryValueEnumerator(valueList)); result.put(col, dict); } } @@ -192,7 +192,7 @@ public class InMemCubeBuilderTest extends LocalFileMetadataTestCase { TblColRef literalCol = func.getTopNLiteralColumn(); logger.info("Building dictionary for " + literalCol); List valueList = readValueList(flatTable, nColumns, literalColIdx); -Dictionary dict =
[07/21] kylin git commit: KYLIN-976 AggregationType interface, serializer and aggregator
KYLIN-976 AggregationType interface, serializer and aggregator Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b2d82d38 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b2d82d38 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b2d82d38 Branch: refs/heads/2.x-staging Commit: b2d82d3863a9aaa68a3b370d6f0cb598e07b4ce5 Parents: 836f233 Author: Li, YangAuthored: Wed Nov 25 11:13:18 2015 +0800 Committer: Yang Li Committed: Sat Dec 5 06:48:43 2015 +0800 -- .../kylin/job/dataGen/FactTableGenerator.java | 2 +- .../streaming/StreamingTableDataGenerator.java | 2 +- .../common/datatype/BigDecimalSerializer.java | 109 +++ .../apache/kylin/common/datatype/DataType.java | 289 ++ .../common/datatype/DataTypeSerializer.java | 108 +++ .../common/datatype/DateTimeSerializer.java | 62 .../kylin/common/datatype/DoubleMutable.java| 68 + .../kylin/common/datatype/DoubleSerializer.java | 81 + .../kylin/common/datatype/LongMutable.java | 70 + .../kylin/common/datatype/LongSerializer.java | 88 ++ .../kylin/common/datatype/StringSerializer.java | 54 .../kylin/common/debug/BackdoorToggles.java | 5 - .../kylin/common/topn/DoublyLinkedList.java | 2 - .../apache/kylin/common/util/DoubleMutable.java | 68 - .../apache/kylin/common/util/LongMutable.java | 70 - .../datatype/BigDecimalSerializerTest.java | 51 .../apache/kylin/aggregation/Aggregation.java | 42 --- .../kylin/aggregation/AggregationType.java | 97 ++ .../kylin/aggregation/DataTypeSerializer.java | 118 .../kylin/aggregation/IAggregationFactory.java | 6 + .../kylin/aggregation/MeasureAggregator.java| 61 +--- .../apache/kylin/aggregation/MeasureCodec.java | 1 + .../aggregation/basic/BasicAggregation.java | 128 .../basic/BasicAggregationFactory.java | 31 ++ .../aggregation/basic/BigDecimalSerializer.java | 111 --- .../aggregation/basic/DateTimeSerializer.java | 65 .../aggregation/basic/DoubleMaxAggregator.java | 2 +- .../aggregation/basic/DoubleMinAggregator.java | 2 +- .../aggregation/basic/DoubleSerializer.java | 84 -- .../aggregation/basic/DoubleSumAggregator.java | 2 +- .../aggregation/basic/LongMaxAggregator.java| 2 +- .../aggregation/basic/LongMinAggregator.java| 2 +- .../kylin/aggregation/basic/LongSerializer.java | 91 -- .../aggregation/basic/LongSumAggregator.java| 2 +- .../aggregation/basic/StringSerializer.java | 56 .../kylin/aggregation/hllc/HLLCAggregation.java | 78 + .../hllc/HLLCAggregationFactory.java| 35 +++ .../kylin/aggregation/hllc/HLLCSerializer.java | 4 +- .../kylin/aggregation/hllc/LDCAggregator.java | 2 +- .../kylin/aggregation/topn/TopNAggregation.java | 76 + .../topn/TopNAggregationFactory.java| 35 +++ .../aggregation/topn/TopNCounterSerializer.java | 12 +- .../kylin/cube/gridtable/CubeCodeSystem.java| 4 +- .../kylin/cube/gridtable/CubeGridTable.java | 1 - .../gridtable/CuboidToGridTableMapping.java | 2 +- .../cube/gridtable/TrimmedCubeCodeSystem.java | 3 +- .../cube/inmemcubing/InMemCubeBuilder.java | 2 +- .../InMemCubeBuilderInputConverter.java | 2 +- .../apache/kylin/cube/kv/RowKeyColumnOrder.java | 2 +- .../model/validation/rule/FunctionRule.java | 2 +- .../java/org/apache/kylin/gridtable/GTInfo.java | 2 +- .../kylin/gridtable/GTSampleCodeSystem.java | 2 +- .../apache/kylin/gridtable/UnitTestSupport.java | 14 +- .../basic/BigDecimalSerializerTest.java | 53 .../topn/TopNCounterSerializerTest.java | 9 +- .../gridtable/AggregationCacheMemSizeTest.java | 4 +- .../kylin/gridtable/DictGridTableTest.java | 16 +- .../kylin/gridtable/SimpleGridTableTest.java| 2 +- .../gridtable/SimpleInvertedIndexTest.java | 13 +- .../metadata/measure/MeasureCodecTest.java | 4 +- .../apache/kylin/dict/DictionaryGenerator.java | 9 +- .../apache/kylin/dict/DictionaryManager.java| 4 +- .../apache/kylin/dict/NumberDictionaryTest.java | 9 +- .../filter/TimeConditionLiteralsReplacer.java | 2 +- .../apache/kylin/metadata/model/ColumnDesc.java | 9 +- .../apache/kylin/metadata/model/DataType.java | 295 --- .../kylin/metadata/model/FunctionDesc.java | 11 +- .../apache/kylin/metadata/model/TblColRef.java | 5 +- .../metadata/realization/SQLDigestUtil.java | 6 +- .../org/apache/kylin/storage/tuple/Tuple.java | 4 +- .../kylin/engine/mr/steps/CubeReducerTest.java | 2 +- .../engine/mr/steps/MergeCuboidMapperTest.java | 15 +- .../invertedindex/index/RawTableRecord.java | 2 +-
[19/21] kylin git commit: KYLIN-976 Clean up, remove all explict check on TopN & HLLC
KYLIN-976 Clean up, remove all explict check on TopN & HLLC Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7f50c17a Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7f50c17a Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7f50c17a Branch: refs/heads/2.x-staging Commit: 7f50c17a5202be9508c21d9cc301d231c8b5843e Parents: 636aeec Author: Li, YangAuthored: Fri Dec 4 16:38:04 2015 +0800 Committer: Yang Li Committed: Sat Dec 5 06:55:39 2015 +0800 -- .../org/apache/kylin/common/KylinConfig.java| 16 ++- .../apache/kylin/common/topn/TopNCounter.java | 2 +- .../kylin/common/util/CliCommandExecutor.java | 4 +- .../java/org/apache/kylin/common/util/Pair.java | 3 +- .../kylin/common/topn/TopNCounterTest.java | 4 +- .../kylin/cube/CubeCapabilityChecker.java | 5 - .../org/apache/kylin/cube/CubeDescManager.java | 15 ++- .../org/apache/kylin/cube/CubeInstance.java | 3 - .../java/org/apache/kylin/cube/CubeManager.java | 4 +- .../kylin/cube/gridtable/CubeCodeSystem.java| 2 +- .../gridtable/CuboidToGridTableMapping.java | 30 + .../cube/gridtable/TrimmedCubeCodeSystem.java | 2 +- .../InMemCubeBuilderInputConverter.java | 3 +- .../cube/inmemcubing/InMemCubeBuilderUtils.java | 30 + .../org/apache/kylin/cube/model/CubeDesc.java | 11 +- .../model/validation/rule/FunctionRule.java | 4 - .../kylin/gridtable/GTSampleCodeSystem.java | 2 +- .../cube/inmemcubing/InMemCubeBuilderTest.java | 25 ++-- .../apache/kylin/dict/lookup/LookupTable.java | 2 +- .../apache/kylin/measure/IMeasureFactory.java | 24 .../apache/kylin/measure/MeasureAggregator.java | 6 +- .../kylin/measure/MeasureAggregators.java | 2 +- .../org/apache/kylin/measure/MeasureType.java | 50 ++-- .../kylin/measure/MeasureTypeFactory.java | 89 ++ .../measure/basic/BasicMeasureFactory.java | 32 - .../kylin/measure/basic/BasicMeasureType.java | 74 +++- .../measure/hllc/HLLCAggregationFactory.java| 36 -- .../kylin/measure/hllc/HLLCMeasureType.java | 76 .../kylin/measure/hllc/HLLCSerializer.java | 3 +- .../kylin/measure/hllc/LDCAggregator.java | 63 -- .../kylin/measure/topn/TopNMeasureFactory.java | 36 -- .../kylin/measure/topn/TopNMeasureType.java | 116 +-- .../kylin/metadata/datatype/DataType.java | 33 -- .../metadata/datatype/DataTypeSerializer.java | 38 +++--- .../kylin/metadata/model/FunctionDesc.java | 65 ++- .../kylin/metadata/tuple/TeeTupleIterator.java | 5 - .../org/apache/kylin/metadata/tuple/Tuple.java | 12 +- .../kylin/storage/translate/HBaseKeyRange.java | 2 +- .../apache/kylin/engine/mr/DFSFileTable.java| 2 +- .../engine/mr/steps/BaseCuboidMapperBase.java | 3 +- .../apache/kylin/engine/mr/steps/CuboidJob.java | 5 +- .../mr/steps/MergeCuboidFromStorageMapper.java | 2 +- .../engine/mr/steps/MergeCuboidMapper.java | 2 +- .../apache/kylin/engine/spark/SparkCubing.java | 11 +- .../measure/FixedLenMeasureCodec.java | 3 +- .../cube/v1/CubeSegmentTopNTupleIterator.java | 86 -- .../hbase/cube/v1/CubeSegmentTupleIterator.java | 2 +- .../storage/hbase/cube/v1/CubeStorageQuery.java | 46 ++-- .../hbase/cube/v1/CubeTupleConverter.java | 60 +- .../cube/v1/SerializedHBaseTupleIterator.java | 14 +-- .../observer/ObserverAggregators.java | 20 +++- .../hbase/cube/v1/filter/FuzzyRowFilterV2.java | 6 +- .../storage/hbase/cube/v2/CubeHBaseRPC.java | 4 +- .../storage/hbase/cube/v2/CubeStorageQuery.java | 67 +++ .../hbase/cube/v2/CubeTupleConverter.java | 65 +-- .../hbase/cube/v2/HBaseReadonlyStore.java | 1 - .../v2/SequentialCubeTopNTupleIterator.java | 68 --- .../cube/v2/SequentialCubeTupleIterator.java| 2 +- .../endpoint/EndpointAggregators.java | 7 +- .../endpoint/EndpointTupleIterator.java | 3 +- .../storage/hbase/steps/CreateHTableJob.java| 7 +- .../storage/hbase/steps/HBaseMROutput2.java | 2 +- .../hbase/steps/HBaseMROutput2Transition.java | 2 +- .../storage/hbase/steps/RowValueDecoder.java| 21 +--- .../hbase/util/GridTableHBaseBenchmark.java | 2 +- .../v1/filter/TestFuzzyRowFilterV2EndToEnd.java | 8 +- 66 files changed, 473 insertions(+), 977 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7f50c17a/core-common/src/main/java/org/apache/kylin/common/KylinConfig.java -- diff --git
kylin git commit: KYLIN-976 Bug fix on HLLCMeasureType
Repository: kylin Updated Branches: refs/heads/2.x-staging 7fdf1fda0 -> 9203b230e KYLIN-976 Bug fix on HLLCMeasureType Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9203b230 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9203b230 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9203b230 Branch: refs/heads/2.x-staging Commit: 9203b230ea285c6c26b094d1305ce6f493ba7b05 Parents: 7fdf1fd Author: Li, YangAuthored: Wed Dec 9 15:02:46 2015 +0800 Committer: Li, Yang Committed: Wed Dec 9 15:03:21 2015 +0800 -- .../java/org/apache/kylin/measure/hllc/HLLCMeasureType.java| 3 +-- .../java/org/apache/kylin/query/relnode/OLAPAggregateRel.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9203b230/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCMeasureType.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCMeasureType.java b/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCMeasureType.java index 5c4d8b4..fffb0d1 100644 --- a/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCMeasureType.java +++ b/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCMeasureType.java @@ -117,8 +117,7 @@ public class HLLCMeasureType extends MeasureType { @Override public Class getRewriteCalciteAggrFunctionClass() { -// TODO Auto-generated method stub -return null; +return HLLDistinctCountAggFunc.class; } public static boolean isCountDistinct(FunctionDesc func) { http://git-wip-us.apache.org/repos/asf/kylin/blob/9203b230/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 cebfd12..0c53703 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 @@ -302,7 +302,7 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel { if (func.isCount()) { newAgg = SqlStdOperatorTable.SUM0; } else if (func.getMeasureType().getRewriteCalciteAggrFunctionClass() != null) { -newAgg = createCustomAggFunction(fieldType, func.getMeasureType().getRewriteCalciteAggrFunctionClass()); +newAgg = createCustomAggFunction(func.getExpression(), fieldType, func.getMeasureType().getRewriteCalciteAggrFunctionClass()); } // rebuild aggregate call @@ -310,9 +310,9 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel { return newAggCall; } -private SqlAggFunction createCustomAggFunction(RelDataType returnType, Class customAggFuncClz) { +private SqlAggFunction createCustomAggFunction(String funcName, RelDataType returnType, Class customAggFuncClz) { RelDataTypeFactory typeFactory = getCluster().getTypeFactory(); -SqlIdentifier sqlIdentifier = new SqlIdentifier(customAggFuncClz.getSimpleName(), new SqlParserPos(1, 1)); +SqlIdentifier sqlIdentifier = new SqlIdentifier(funcName, new SqlParserPos(1, 1)); AggregateFunction aggFunction = AggregateFunctionImpl.create(customAggFuncClz); List argTypes = new ArrayList(); List typeFamilies = new ArrayList();
kylin git commit: KYLIN-1205 Make HBase scan parameters configurable and allow reset of HConnection
Repository: kylin Updated Branches: refs/heads/1.x-staging e85b24399 -> b0c5fd3bc KYLIN-1205 Make HBase scan parameters configurable and allow reset of HConnection Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b0c5fd3b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b0c5fd3b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b0c5fd3b Branch: refs/heads/1.x-staging Commit: b0c5fd3bc7cce69dd5f0413d172fd7c7a79d9f5a Parents: e85b243 Author: Li, YangAuthored: Tue Dec 8 10:43:03 2015 +0800 Committer: Li, Yang Committed: Tue Dec 8 10:43:03 2015 +0800 -- .../org/apache/kylin/common/KylinConfig.java | 8 .../common/persistence/HBaseConnection.java | 4 .../apache/kylin/rest/service/CacheService.java | 2 ++ .../storage/hbase/CubeSegmentTupleIterator.java | 19 +++ 4 files changed, 29 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/common/src/main/java/org/apache/kylin/common/KylinConfig.java -- diff --git a/common/src/main/java/org/apache/kylin/common/KylinConfig.java b/common/src/main/java/org/apache/kylin/common/KylinConfig.java index 9645b81..7816487 100644 --- a/common/src/main/java/org/apache/kylin/common/KylinConfig.java +++ b/common/src/main/java/org/apache/kylin/common/KylinConfig.java @@ -499,7 +499,15 @@ public class KylinConfig { public int getHBaseKeyValueSize() { return Integer.parseInt(this.getOptional("kylin.hbase.client.keyvalue.maxsize", "10485760")); } + +public int getHBaseScanCacheRows() { +return Integer.parseInt(this.getOptional("kylin.hbase.scan.cache_rows", "1024")); +} +public int getHBaseScanMaxResultSize() { +return Integer.parseInt(this.getOptional("kylin.hbase.scan.max_result_size", "" + (5 * 1024 * 1024))); // 5 MB +} + public String getHbaseDefaultCompressionCodec() { return getOptional(HTABLE_DEFAULT_COMPRESSION_CODEC, ""); http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java -- diff --git a/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java index dcefc24..9c86376 100644 --- a/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java +++ b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java @@ -58,6 +58,10 @@ public class HBaseConnection { } }); } + +public static void clearCache() { +ConnPool.clear(); +} public static HConnection get(String url) { // find configuration http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java index 38d7400..2328592 100644 --- a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java +++ b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java @@ -21,6 +21,7 @@ package org.apache.kylin.rest.service; import java.io.IOException; import java.util.List; +import org.apache.kylin.common.persistence.HBaseConnection; import org.apache.kylin.common.restclient.Broadcaster; import org.apache.kylin.cube.CubeDescManager; import org.apache.kylin.cube.CubeManager; @@ -101,6 +102,7 @@ public class CacheService extends BasicService { RealizationRegistry.clearCache(); ProjectManager.clearCache(); BasicService.resetOLAPDataSources(); +HBaseConnection.clearCache(); break; default: throw new RuntimeException("invalid cacheType:" + cacheType); http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java -- diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java index 9efbb79..fa4ccd7 100644 --- a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java +++ b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java @@ -38,6 +38,7 @@ import
kylin git commit: minor, ResourceTool support -Dinclude option
Repository: kylin Updated Branches: refs/heads/2.0-rc 183b31a66 -> 22e439272 minor, ResourceTool support -Dinclude option Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/22e43927 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/22e43927 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/22e43927 Branch: refs/heads/2.0-rc Commit: 22e439272970640ae3554561928a95f1ada3cc30 Parents: 183b31a Author: Li, YangAuthored: Mon Dec 14 17:49:26 2015 +0800 Committer: Li, Yang Committed: Mon Dec 14 17:49:26 2015 +0800 -- .../kylin/common/persistence/ResourceTool.java | 31 ++-- 1 file changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/22e43927/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java index 0efea6d..d2801ff 100644 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java +++ b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java @@ -26,6 +26,7 @@ import org.apache.kylin.common.util.StringUtil; public class ResourceTool { +private static String[] includes = null; private static String[] excludes = null; public static void main(String[] args) throws IOException { @@ -38,6 +39,10 @@ public class ResourceTool { return; } +String include = System.getProperty("include"); +if (include != null) { +includes = include.split("\\s*,\\s*"); +} String exclude = System.getProperty("exclude"); if (exclude != null) { excludes = exclude.split("\\s*,\\s*"); @@ -83,7 +88,7 @@ public class ResourceTool { // case of resource (not a folder) if (children == null) { -if (matchExclude(path) == false) { +if (matchFilter(path)) { RawResource res = src.getResource(path); if (res != null) { dst.putResource(path, res.inputStream, res.timestamp); @@ -100,14 +105,22 @@ public class ResourceTool { } } -private static boolean matchExclude(String path) { -if (excludes == null) -return false; -for (String exclude : excludes) { -if (path.startsWith(exclude)) -return true; +private static boolean matchFilter(String path) { +if (includes != null) { +boolean in = false; +for (String include : includes) { +in = in || path.startsWith(include); +} +if (!in) +return false; +} +if (excludes != null) { +for (String exclude : excludes) { +if (path.startsWith(exclude)) +return false; +} } -return false; +return true; } public static void reset(KylinConfig config) throws IOException { @@ -118,7 +131,7 @@ public class ResourceTool { private static void resetR(ResourceStore store, String path) throws IOException { ArrayList children = store.listResources(path); if (children == null) { // path is a resource (not a folder) -if (matchExclude(path) == false) { +if (matchFilter(path) == false) { store.deleteResource(path); } } else {
kylin git commit: KYLIN-1226 A new way to estimate aggr cache size, MemoryWaterLevel
Repository: kylin Updated Branches: refs/heads/2.0-rc af883ef39 -> 949efc558 KYLIN-1226 A new way to estimate aggr cache size, MemoryWaterLevel Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/949efc55 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/949efc55 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/949efc55 Branch: refs/heads/2.0-rc Commit: 949efc5580f5507f548f935653c74deab9a8007b Parents: af883ef Author: Yang LiAuthored: Tue Dec 15 06:36:17 2015 +0800 Committer: Yang Li Committed: Tue Dec 15 06:36:17 2015 +0800 -- .../common/util/MemoryBudgetController.java | 22 + .../cube/inmemcubing/DoggedCubeBuilder.java | 9 +--- .../cube/inmemcubing/InMemCubeBuilder.java | 52 +--- .../kylin/gridtable/GTAggregateScanner.java | 14 +- .../engine/mr/steps/InMemCuboidMapper.java | 2 +- 5 files changed, 60 insertions(+), 39 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/949efc55/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java b/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java index d94f32b..37b0bd4 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java @@ -271,4 +271,26 @@ public class MemoryBudgetController { return (int) (getSystemAvailBytes() / ONE_MB); } + +// protective estimate of memory usage, prefer overestimate rather than underestimate +public static class MemoryWaterLevel { +int lowAvail = Integer.MAX_VALUE; +int highAvail = Integer.MIN_VALUE; + +public void markHigh() { +// get avail mem without gc +lowAvail = Math.min(lowAvail, MemoryBudgetController.getSystemAvailMB()); +logger.info("Lower system avail " + lowAvail + " MB in markHigh()"); +} + +public void markLow() { +// get avail mem after gc +highAvail = Math.max(highAvail, MemoryBudgetController.gcAndGetSystemAvailMB()); +logger.info("Higher system avail " + highAvail + " MB in markLow()"); +} + +public int getEstimateMB() { +return highAvail - lowAvail; +} +} } http://git-wip-us.apache.org/repos/asf/kylin/blob/949efc55/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java index 7f6e173..36a45e1 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java @@ -73,15 +73,10 @@ public class DoggedCubeBuilder extends AbstractInMemCubeBuilder { } private class BuildOnce { -private int cutAheadMB; BuildOnce() { int systemAvailMB = MemoryBudgetController.getSystemAvailMB(); -// InMemCubeBuilder will over-estimate base cuboid size by a factor, must cut ahead at least the same factor -cutAheadMB = (int) (systemAvailMB * InMemCubeBuilder.getAggrCacheOversizeFactor(cubeDesc)); -logger.info("Cut ahead MB is " + cutAheadMB); - int half = systemAvailMB / 2; if (getReserveMemoryMB() > half) { logger.info("Reserve " + getReserveMemoryMB() + " MB is more than half of system avail " + systemAvailMB + " MB, override to " + half); @@ -264,8 +259,8 @@ public class DoggedCubeBuilder extends AbstractInMemCubeBuilder { return true; } -if (systemAvailMB <= reserveMemoryMB + cutAheadMB) { -logger.info("Split cut due to hitting memory threshold, system avail " + systemAvailMB + " MB <= reserve " + reserveMemoryMB + " MB + cut ahead " + cutAheadMB + " MB"); +if (systemAvailMB <= reserveMemoryMB) { +logger.info("Split cut due to hitting memory threshold, system avail " + systemAvailMB + " MB <= reserve " + reserveMemoryMB + " MB"); return true; } http://git-wip-us.apache.org/repos/asf/kylin/blob/949efc55/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java
kylin git commit: KYLIN-1226 A better wait GC done
Repository: kylin Updated Branches: refs/heads/2.0-rc 0ba1e065c -> 183b31a66 KYLIN-1226 A better wait GC done Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/183b31a6 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/183b31a6 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/183b31a6 Branch: refs/heads/2.0-rc Commit: 183b31a664e4a79ca889462a5d8e4d5d69d7dc5a Parents: 0ba1e06 Author: Li, YangAuthored: Mon Dec 14 15:20:19 2015 +0800 Committer: Li, Yang Committed: Mon Dec 14 15:20:49 2015 +0800 -- .../common/util/MemoryBudgetController.java | 24 + .../cube/inmemcubing/InMemCubeBuilder.java | 28 +--- 2 files changed, 31 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/183b31a6/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java b/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java index e454414..d94f32b 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java @@ -233,6 +233,30 @@ public class MemoryBudgetController { return true; } +public static int gcAndGetSystemAvailMB() { +final int tolerance = 1; +try { +int lastMB = -1; +while (true) { +Runtime.getRuntime().gc(); +Thread.sleep(1000); +int thisMB = getSystemAvailMB(); + +if (lastMB < 0) { +lastMB = thisMB; +continue; +} +if (lastMB - thisMB < tolerance) { +return thisMB; +} +lastMB = thisMB; +} +} catch (InterruptedException e) { +logger.error("", e); +return getSystemAvailMB(); +} +} + public static long getSystemAvailBytes() { Runtime runtime = Runtime.getRuntime(); long totalMemory = runtime.totalMemory(); // current heap allocated to the VM process http://git-wip-us.apache.org/repos/asf/kylin/blob/183b31a6/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java index a3e3a03..97c96fb 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java @@ -295,21 +295,7 @@ public class InMemCubeBuilder extends AbstractInMemCubeBuilder { } private int getSystemAvailMB() { -// GC to be precise on memory left -Runtime.getRuntime().gc(); -try { -Thread.sleep(2500); -} catch (InterruptedException e) { -logger.error("", e); -} -// GC again to be precise on memory left -Runtime.getRuntime().gc(); -try { -Thread.sleep(2500); -} catch (InterruptedException e) { -logger.error("", e); -} -return MemoryBudgetController.getSystemAvailMB(); +return MemoryBudgetController.gcAndGetSystemAvailMB(); } private void makeMemoryBudget() { @@ -330,20 +316,20 @@ public class InMemCubeBuilder extends AbstractInMemCubeBuilder { } private CuboidResult createBaseCuboid(BlockingQueue input) throws IOException { +int mbBefore = getSystemAvailMB(); +int mbAfter = 0; + +long startTime = System.currentTimeMillis(); +logger.info("Calculating base cuboid " + baseCuboidId + ", system avail " + mbBefore + " MB"); + GridTable baseCuboid = newGridTableByCuboidID(baseCuboidId); GTBuilder baseBuilder = baseCuboid.rebuild(); IGTScanner baseInput = new InputConverter(baseCuboid.getInfo(), input); -int mbBefore = getSystemAvailMB(); -int mbAfter = 0; - Pair
dimensionMetricsBitSet = InMemCubeBuilderUtils.getDimensionAndMetricColumnBitSet(baseCuboidId, measureCount); GTScanRequest req = new GTScanRequest(baseCuboid.getInfo(), null, dimensionMetricsBitSet.getFirst(), dimensionMetricsBitSet.getSecond(), metricsAggrFuncs, null); GTAggregateScanner
kylin git commit: KYLIN-1226 A better default of reserved memory
Repository: kylin Updated Branches: refs/heads/2.0-rc 949efc558 -> 9c450617b KYLIN-1226 A better default of reserved memory Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9c450617 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9c450617 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9c450617 Branch: refs/heads/2.0-rc Commit: 9c450617b2ee245e7a3354f89de166fb2fd6eafb Parents: 949efc5 Author: Yang LiAuthored: Tue Dec 15 06:59:10 2015 +0800 Committer: Yang Li Committed: Tue Dec 15 06:59:10 2015 +0800 -- .../cube/inmemcubing/DoggedCubeBuilder.java | 24 1 file changed, 15 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9c450617/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java index 36a45e1..e87d8ff 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/DoggedCubeBuilder.java @@ -56,10 +56,23 @@ public class DoggedCubeBuilder extends AbstractInMemCubeBuilder { public DoggedCubeBuilder(CubeDesc cubeDesc, Map dictionaryMap) { super(cubeDesc, dictionaryMap); - + // check memory more often if a single row is big if (cubeDesc.hasMemoryHungryCountDistinctMeasures()) unitRows /= 10; + +// a meaningful default reserved memory +int sysAvailMB = MemoryBudgetController.getSystemAvailMB(); +int reserve = Math.max(sysAvailMB / 10, 100); // 10% of system available, or 100 MB at least +int halfSysAvail = sysAvailMB / 2; +if (reserve > halfSysAvail) { // but no more than half of system available +logger.info("Reserve " + reserve + " MB is more than half of system avail " + sysAvailMB + " MB, override to " + halfSysAvail); +reserve = halfSysAvail; +} + +setReserveMemoryMB(reserve); +logger.info("Reserve memory is set to " + reserve + " MB"); + } public void setSplitRowThreshold(int rowThreshold) { @@ -75,13 +88,6 @@ public class DoggedCubeBuilder extends AbstractInMemCubeBuilder { private class BuildOnce { BuildOnce() { -int systemAvailMB = MemoryBudgetController.getSystemAvailMB(); - -int half = systemAvailMB / 2; -if (getReserveMemoryMB() > half) { -logger.info("Reserve " + getReserveMemoryMB() + " MB is more than half of system avail " + systemAvailMB + " MB, override to " + half); -setReserveMemoryMB(half); -} } public void build(BlockingQueue input, ICuboidWriter output) throws IOException { @@ -241,7 +247,7 @@ public class DoggedCubeBuilder extends AbstractInMemCubeBuilder { // wait cuboid build done last.join(); - + } catch (InterruptedException e) { throw new RuntimeException(e); }
kylin git commit: minor, bug fix in HBaseResourceStore.getFromHTable()
Repository: kylin Updated Branches: refs/heads/2.0-rc 11f5aa095 -> f0015e7c2 minor, bug fix in HBaseResourceStore.getFromHTable() Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/f0015e7c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/f0015e7c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/f0015e7c Branch: refs/heads/2.0-rc Commit: f0015e7c29a6fdd4e60bb072d512ef0590635b74 Parents: 11f5aa0 Author: Li, YangAuthored: Mon Jan 4 10:21:52 2016 +0800 Committer: Li, Yang Committed: Mon Jan 4 10:22:33 2016 +0800 -- .../java/org/apache/kylin/storage/hbase/HBaseResourceStore.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/f0015e7c/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java index 43b4871..44de3a2 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java @@ -296,8 +296,9 @@ public class HBaseResourceStore extends ResourceStore { HTableInterface table = getConnection().getTable(getAllInOneTableName()); try { -Result result = table.get(get); -return result == null || result.isEmpty() ? null : result; +Result result = table.get(get); +boolean exists = result != null && (!result.isEmpty() || (result.getExists() != null && result.getExists())); +return exists ? result : null; } finally { IOUtils.closeQuietly(table); }
kylin git commit: KYLIN-1266 Fix for DebugTomcat
Repository: kylin Updated Branches: refs/heads/2.0-rc f0015e7c2 -> 89b96519a KYLIN-1266 Fix for DebugTomcat Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/89b96519 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/89b96519 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/89b96519 Branch: refs/heads/2.0-rc Commit: 89b96519a60c64558c770e0561b5c43d35068261 Parents: f0015e7 Author: Li, YangAuthored: Mon Jan 4 15:52:52 2016 +0800 Committer: Li, Yang Committed: Mon Jan 4 15:53:46 2016 +0800 -- server/pom.xml | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/89b96519/server/pom.xml -- diff --git a/server/pom.xml b/server/pom.xml index a2c3c1f..fb20d49 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -125,6 +125,12 @@ com.thetransactioncompany cors-filter 1.3.2 + + +javax.servlet +servlet-api + +
kylin git commit: KYLIN-1266 Fix for DebugTomcat
Repository: kylin Updated Branches: refs/heads/2.x-staging e24adf7e7 -> f554ebe71 KYLIN-1266 Fix for DebugTomcat Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/f554ebe7 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/f554ebe7 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/f554ebe7 Branch: refs/heads/2.x-staging Commit: f554ebe71511ff28522e21291a36196e4c180fee Parents: e24adf7 Author: Li, YangAuthored: Mon Jan 4 15:52:52 2016 +0800 Committer: Li, Yang Committed: Mon Jan 4 15:52:52 2016 +0800 -- server/pom.xml | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/f554ebe7/server/pom.xml -- diff --git a/server/pom.xml b/server/pom.xml index b12fa77..3fac498 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -125,6 +125,12 @@ com.thetransactioncompany cors-filter 1.3.2 + + +javax.servlet +servlet-api + +
kylin git commit: KYLIN-1286 Add apache licenses in package metadata.filter
Repository: kylin Updated Branches: refs/heads/2.0-rc 7dae0cf4a -> b33990e5a KYLIN-1286 Add apache licenses in package metadata.filter Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b33990e5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b33990e5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b33990e5 Branch: refs/heads/2.0-rc Commit: b33990e5aa5daf11d7361d8e4faebccf30b206ba Parents: 7dae0cf Author: Li, YangAuthored: Tue Jan 5 11:23:26 2016 +0800 Committer: Li, Yang Committed: Tue Jan 5 11:23:53 2016 +0800 -- .../kylin/metadata/filter/IFilterCodeSystem.java | 18 ++ .../kylin/metadata/filter/StringCodeSystem.java | 18 ++ .../filter/TimeConditionLiteralsReplacer.java| 19 +++ .../kylin/metadata/filter/TsConditionEraser.java | 18 ++ 4 files changed, 73 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/b33990e5/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java index 9bbf1c3..3cd1940 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java @@ -1,3 +1,21 @@ +/* + * 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.nio.ByteBuffer; http://git-wip-us.apache.org/repos/asf/kylin/blob/b33990e5/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java index 2d5ac81..e20b2a0 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java @@ -1,3 +1,21 @@ +/* + * 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.nio.ByteBuffer; http://git-wip-us.apache.org/repos/asf/kylin/blob/b33990e5/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java index 20fbe7a..a20a8ba 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE
kylin git commit: minor, correct print message in ResourceTool
Repository: kylin Updated Branches: refs/heads/2.x-staging 5d1734b5e -> 155f1a9ce minor, correct print message in ResourceTool Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/155f1a9c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/155f1a9c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/155f1a9c Branch: refs/heads/2.x-staging Commit: 155f1a9ce35fbc0fc876d0f7ccad6864785a0c75 Parents: 5d1734b Author: Li, YangAuthored: Tue Jan 5 10:56:15 2016 +0800 Committer: Li, Yang Committed: Tue Jan 5 10:58:10 2016 +0800 -- .../java/org/apache/kylin/common/persistence/ResourceTool.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/155f1a9c/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java index 0efea6d..c3038dd 100644 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java +++ b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java @@ -32,9 +32,9 @@ public class ResourceTool { args = StringUtil.filterSystemArgs(args); if (args.length == 0) { -System.out.println("Usage: MetadataTool list RESOURCE_PATH"); -System.out.println("Usage: MetadataTool download LOCAL_DIR"); -System.out.println("Usage: MetadataTool uploadLOCAL_DIR"); +System.out.println("Usage: ResourceTool list RESOURCE_PATH"); +System.out.println("Usage: ResourceTool download LOCAL_DIR"); +System.out.println("Usage: ResourceTool uploadLOCAL_DIR"); return; }
kylin git commit: minor, correct print message in ResourceTool
Repository: kylin Updated Branches: refs/heads/2.0-rc 3368475ae -> 604268d9f minor, correct print message in ResourceTool Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/604268d9 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/604268d9 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/604268d9 Branch: refs/heads/2.0-rc Commit: 604268d9f488ea1ed7dbf3cc51b8cc90a347afb9 Parents: 3368475 Author: Li, YangAuthored: Tue Jan 5 10:56:15 2016 +0800 Committer: Li, Yang Committed: Tue Jan 5 10:56:45 2016 +0800 -- .../java/org/apache/kylin/common/persistence/ResourceTool.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/604268d9/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java index d2801ff..f13b723 100644 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java +++ b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java @@ -33,9 +33,9 @@ public class ResourceTool { args = StringUtil.filterSystemArgs(args); if (args.length == 0) { -System.out.println("Usage: MetadataTool list RESOURCE_PATH"); -System.out.println("Usage: MetadataTool download LOCAL_DIR"); -System.out.println("Usage: MetadataTool uploadLOCAL_DIR"); +System.out.println("Usage: ResourceTool list RESOURCE_PATH"); +System.out.println("Usage: ResourceTool download LOCAL_DIR"); +System.out.println("Usage: ResourceTool uploadLOCAL_DIR"); return; }
kylin git commit: KYLIN-1286 Add apache licenses in package metadata.filter
Repository: kylin Updated Branches: refs/heads/2.x-staging 72e315966 -> a65e95af2 KYLIN-1286 Add apache licenses in package metadata.filter Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a65e95af Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a65e95af Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a65e95af Branch: refs/heads/2.x-staging Commit: a65e95af24ca8c53e6ceb98a442b50ab1ce2edf5 Parents: 72e3159 Author: Li, YangAuthored: Tue Jan 5 11:23:26 2016 +0800 Committer: Li, Yang Committed: Tue Jan 5 11:26:34 2016 +0800 -- .../kylin/metadata/filter/IFilterCodeSystem.java | 18 ++ .../kylin/metadata/filter/StringCodeSystem.java | 18 ++ .../filter/TimeConditionLiteralsReplacer.java| 19 +++ .../kylin/metadata/filter/TsConditionEraser.java | 18 ++ 4 files changed, 73 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/a65e95af/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java index 9bbf1c3..3cd1940 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/IFilterCodeSystem.java @@ -1,3 +1,21 @@ +/* + * 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.nio.ByteBuffer; http://git-wip-us.apache.org/repos/asf/kylin/blob/a65e95af/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java index 2d5ac81..e20b2a0 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/StringCodeSystem.java @@ -1,3 +1,21 @@ +/* + * 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.nio.ByteBuffer; http://git-wip-us.apache.org/repos/asf/kylin/blob/a65e95af/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java index b894fd3..6bd7030 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/TimeConditionLiteralsReplacer.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the
kylin git commit: KYLIN-967 fix test case
Repository: kylin Updated Branches: refs/heads/2.x-staging c007a64bb -> 9161c5801 KYLIN-967 fix test case Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9161c580 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9161c580 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9161c580 Branch: refs/heads/2.x-staging Commit: 9161c580134bc64560709c5c1a1192f1b8d5a0cb Parents: c007a64 Author: Li, YangAuthored: Tue Jan 5 17:16:08 2016 +0800 Committer: Li, Yang Committed: Tue Jan 5 17:16:51 2016 +0800 -- .../apache/kylin/rest/service/BadQueryDetectorTest.java | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9161c580/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java -- diff --git a/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java b/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java index 2358d7a..e0c7704 100644 --- a/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java +++ b/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java @@ -35,7 +35,7 @@ public class BadQueryDetectorTest { String mockSql = "select * from just_a_test"; final ArrayList alerts = new ArrayList<>(); -BadQueryDetector badQueryDetector = new BadQueryDetector(alertRunningSec * 1000, alertMB, alertRunningSec, Integer.MAX_VALUE); +BadQueryDetector badQueryDetector = new BadQueryDetector(alertRunningSec * 1000, alertMB, alertRunningSec); badQueryDetector.registerNotifier(new BadQueryDetector.Notifier() { @Override public void badQueryFound(String adj, int runningSec, String sql, Thread t) { @@ -59,11 +59,8 @@ public class BadQueryDetectorTest { badQueryDetector.stop(); -assertEquals(3, alerts.size()); -// first check founds Low mem -assertArrayEquals(new String[] { "Low mem", mockSql }, alerts.get(0)); -// second check founds Low mem & Slow -assertArrayEquals(new String[] { "Slow", mockSql }, alerts.get(1)); -assertArrayEquals(new String[] { "Low mem", mockSql }, alerts.get(2)); +assertEquals(1, alerts.size()); +// second check founds a Slow +assertArrayEquals(new String[] { "Slow", mockSql }, alerts.get(0)); } }
kylin git commit: KYLIN-967 fix test case
Repository: kylin Updated Branches: refs/heads/2.0-rc 5ac4a90dd -> ea702c8a0 KYLIN-967 fix test case Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ea702c8a Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ea702c8a Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ea702c8a Branch: refs/heads/2.0-rc Commit: ea702c8a02ca3485d85f0aa3e668a51640644880 Parents: 5ac4a90 Author: Li, YangAuthored: Tue Jan 5 17:16:08 2016 +0800 Committer: Li, Yang Committed: Tue Jan 5 17:16:08 2016 +0800 -- .../apache/kylin/rest/service/BadQueryDetectorTest.java | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ea702c8a/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java -- diff --git a/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java b/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java index 2358d7a..e0c7704 100644 --- a/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java +++ b/server/src/test/java/org/apache/kylin/rest/service/BadQueryDetectorTest.java @@ -35,7 +35,7 @@ public class BadQueryDetectorTest { String mockSql = "select * from just_a_test"; final ArrayList alerts = new ArrayList<>(); -BadQueryDetector badQueryDetector = new BadQueryDetector(alertRunningSec * 1000, alertMB, alertRunningSec, Integer.MAX_VALUE); +BadQueryDetector badQueryDetector = new BadQueryDetector(alertRunningSec * 1000, alertMB, alertRunningSec); badQueryDetector.registerNotifier(new BadQueryDetector.Notifier() { @Override public void badQueryFound(String adj, int runningSec, String sql, Thread t) { @@ -59,11 +59,8 @@ public class BadQueryDetectorTest { badQueryDetector.stop(); -assertEquals(3, alerts.size()); -// first check founds Low mem -assertArrayEquals(new String[] { "Low mem", mockSql }, alerts.get(0)); -// second check founds Low mem & Slow -assertArrayEquals(new String[] { "Slow", mockSql }, alerts.get(1)); -assertArrayEquals(new String[] { "Low mem", mockSql }, alerts.get(2)); +assertEquals(1, alerts.size()); +// second check founds a Slow +assertArrayEquals(new String[] { "Slow", mockSql }, alerts.get(0)); } }
kylin git commit: KYLIN-967 Stop interrupting query which turns out to be unstable
Repository: kylin Updated Branches: refs/heads/2.0-rc 0705de781 -> 5ac4a90dd KYLIN-967 Stop interrupting query which turns out to be unstable Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5ac4a90d Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5ac4a90d Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5ac4a90d Branch: refs/heads/2.0-rc Commit: 5ac4a90ddcf64e8da88fd1239b1ad8ee1ac22016 Parents: 0705de7 Author: Li, YangAuthored: Tue Jan 5 16:48:22 2016 +0800 Committer: Li, Yang Committed: Tue Jan 5 16:48:54 2016 +0800 -- .../kylin/rest/service/BadQueryDetector.java| 25 +--- 1 file changed, 6 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/5ac4a90d/server/src/main/java/org/apache/kylin/rest/service/BadQueryDetector.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/service/BadQueryDetector.java b/server/src/main/java/org/apache/kylin/rest/service/BadQueryDetector.java index 622dd35..11062d9 100644 --- a/server/src/main/java/org/apache/kylin/rest/service/BadQueryDetector.java +++ b/server/src/main/java/org/apache/kylin/rest/service/BadQueryDetector.java @@ -36,21 +36,19 @@ public class BadQueryDetector extends Thread { private final long detectionInterval; private final int alertMB; private final int alertRunningSec; -private final int killRunningSec; private ArrayList notifiers = new ArrayList(); public BadQueryDetector() { -this(60 * 1000, 100, 60, 5 * 60); // 1 minute, 100 MB, 60 seconds, 5 minutes +this(60 * 1000, 100, 90); // 1 minute, 100 MB, 90 seconds } -public BadQueryDetector(long detectionInterval, int alertMB, int alertRunningSec, int killRunningSec) { +public BadQueryDetector(long detectionInterval, int alertMB, int alertRunningSec) { super("BadQueryDetector"); this.setDaemon(true); this.detectionInterval = detectionInterval; this.alertMB = alertMB; this.alertRunningSec = alertRunningSec; -this.killRunningSec = killRunningSec; this.notifiers.add(new Notifier() { @Override @@ -130,6 +128,7 @@ public class BadQueryDetector extends Thread { int runningSec = (int) ((now - e.startTime) / 1000); if (runningSec >= alertRunningSec) { notify("Slow", runningSec, e.sqlRequest.getSql(), e.thread); +dumpStackTrace(e.thread); } else { break; // entries are sorted by startTime } @@ -138,25 +137,13 @@ public class BadQueryDetector extends Thread { // report if low memory if (getSystemAvailMB() < alertMB) { logger.info("System free memory less than " + alertMB + " MB. " + entries.size() + " queries running."); - -for (Entry e : entries) { -int duration = (int) ((now - e.startTime) / 1000); -if (duration > killRunningSec) { -notify("Kill", duration, e.sqlRequest.getSql(), e.thread); -killQueryThread(e.thread); -} else { -notify("Low mem", duration, e.sqlRequest.getSql(), e.thread); -} -} } } -private void killQueryThread(Thread t) { +// log the stack trace of bad query thread for further analysis +private void dumpStackTrace(Thread t) { StackTraceElement[] stackTrace = t.getStackTrace(); -t.interrupt(); - -// log the stack trace of bad query thread for further analysis -StringBuilder buf = new StringBuilder("Interrupted thread 0x" + Long.toHexString(t.getId())); +StringBuilder buf = new StringBuilder("Problematic thread 0x" + Long.toHexString(t.getId())); buf.append("\n"); for (StackTraceElement e : stackTrace) { buf.append("\t").append("at ").append(e.toString()).append("\n");
kylin git commit: KYLIN-1268 Move logs to KYLIN_HOME/logs/
Repository: kylin Updated Branches: refs/heads/2.0-rc 71c8033c4 -> 0cd6bbbf6 KYLIN-1268 Move logs to KYLIN_HOME/logs/ Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/0cd6bbbf Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/0cd6bbbf Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/0cd6bbbf Branch: refs/heads/2.0-rc Commit: 0cd6bbbf634492832849f37e662aa004d0b4f9ca Parents: 71c8033 Author: Li, YangAuthored: Thu Dec 31 16:29:31 2015 +0800 Committer: Li, Yang Committed: Thu Dec 31 16:29:31 2015 +0800 -- .../kylin/common/util/LogTitlePrinter.java | 31 .../kylin/job/execution/AbstractExecutable.java | 6 ++-- .../mr/invertedindex/InvertedIndexJob.java | 2 +- .../kylin/engine/mr/steps/MergeCuboidJob.java | 2 +- server/pom.xml | 5 .../org/apache/kylin/rest/util/QueryUtil.java | 19 .../resources/kylin-server-log4j.properties | 12 +++- .../cardinality/HiveColumnCardinalityJob.java | 4 +-- .../HiveColumnCardinalityUpdateJob.java | 6 ++-- .../storage/hbase/ii/IICreateHTableJob.java | 4 +-- 10 files changed, 25 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/0cd6bbbf/core-common/src/main/java/org/apache/kylin/common/util/LogTitlePrinter.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/LogTitlePrinter.java b/core-common/src/main/java/org/apache/kylin/common/util/LogTitlePrinter.java deleted file mode 100644 index f7d3a16..000 --- a/core-common/src/main/java/org/apache/kylin/common/util/LogTitlePrinter.java +++ /dev/null @@ -1,31 +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; - -/** - */ -public class LogTitlePrinter { -public static void printTitle(String title) { -String leftAlignFormat = "| %-100s | %n"; - - System.out.format("+--+%n"); -System.out.format(leftAlignFormat, title); - System.out.format("+--+%n"); -} -} http://git-wip-us.apache.org/repos/asf/kylin/blob/0cd6bbbf/core-job/src/main/java/org/apache/kylin/job/execution/AbstractExecutable.java -- diff --git a/core-job/src/main/java/org/apache/kylin/job/execution/AbstractExecutable.java b/core-job/src/main/java/org/apache/kylin/job/execution/AbstractExecutable.java index 18d3193..e1d7106 100644 --- a/core-job/src/main/java/org/apache/kylin/job/execution/AbstractExecutable.java +++ b/core-job/src/main/java/org/apache/kylin/job/execution/AbstractExecutable.java @@ -28,7 +28,6 @@ import java.util.UUID; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.apache.kylin.common.KylinConfig; -import org.apache.kylin.common.util.LogTitlePrinter; import org.apache.kylin.common.util.MailService; import org.apache.kylin.job.exception.ExecuteException; import org.apache.kylin.job.impl.threadpool.DefaultContext; @@ -97,8 +96,7 @@ public abstract class AbstractExecutable implements Executable, Idempotent { @Override public final ExecuteResult execute(ExecutableContext executableContext) throws ExecuteException { -//print a eye-catching title in log -LogTitlePrinter.printTitle(this.getName()); +logger.info("Executing > " + this.getName() + " <"); Preconditions.checkArgument(executableContext instanceof DefaultContext); ExecuteResult result; @@ -269,7 +267,7 @@ public abstract class AbstractExecutable implements Executable, Idempotent { protected final void addExtraInfo(String key, String value)
kylin git commit: minor, replace HBaseResourceStore.getByScan() with a simpler Get request
Repository: kylin Updated Branches: refs/heads/2.x-staging 95d952da5 -> 9e25b2374 minor, replace HBaseResourceStore.getByScan() with a simpler Get request Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9e25b237 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9e25b237 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9e25b237 Branch: refs/heads/2.x-staging Commit: 9e25b237415fed2f94f4c5518285dd71931cc84c Parents: 95d952d Author: Li, YangAuthored: Thu Dec 31 11:46:34 2015 +0800 Committer: Li, Yang Committed: Thu Dec 31 11:47:27 2015 +0800 -- .../kylin/storage/hbase/HBaseResourceStore.java | 28 1 file changed, 11 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9e25b237/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java index f1659c3..10ef6c0 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java @@ -34,6 +34,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.client.Delete; +import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HConnection; import org.apache.hadoop.hbase.client.HTableInterface; import org.apache.hadoop.hbase.client.Put; @@ -147,7 +148,7 @@ public class HBaseResourceStore extends ResourceStore { @Override protected boolean existsImpl(String resPath) throws IOException { -Result r = getByScan(resPath, false, false); +Result r = getFromHTable(resPath, false, false); return r != null; } @@ -250,7 +251,7 @@ public class HBaseResourceStore extends ResourceStore { @Override protected RawResource getResourceImpl(String resPath) throws IOException { -Result r = getByScan(resPath, true, true); +Result r = getFromHTable(resPath, true, true); if (r == null) return null; else @@ -259,7 +260,7 @@ public class HBaseResourceStore extends ResourceStore { @Override protected long getResourceTimestampImpl(String resPath) throws IOException { -return getTimestamp(getByScan(resPath, false, true)); +return getTimestamp(getFromHTable(resPath, false, true)); } @Override @@ -320,30 +321,23 @@ public class HBaseResourceStore extends ResourceStore { return getAllInOneTableName() + "(key='" + resPath + "')@" + kylinConfig.getMetadataUrl(); } -private Result getByScan(String path, boolean fetchContent, boolean fetchTimestamp) throws IOException { -byte[] startRow = Bytes.toBytes(path); -byte[] endRow = plusZero(startRow); +private Result getFromHTable(String path, boolean fetchContent, boolean fetchTimestamp) throws IOException { +byte[] rowkey = Bytes.toBytes(path); -Scan scan = new Scan(startRow, endRow); -scan.setCaching(1); -scan.setMaxResultSize(kylinConfig.getHBaseScanMaxResultSize()); +Get get = new Get(rowkey); if (!fetchContent && !fetchTimestamp) { -scan.setFilter(new KeyOnlyFilter()); +get.setCheckExistenceOnly(true); } else { if (fetchContent) -scan.addColumn(B_FAMILY, B_COLUMN); +get.addColumn(B_FAMILY, B_COLUMN); if (fetchTimestamp) -scan.addColumn(B_FAMILY, B_COLUMN_TS); +get.addColumn(B_FAMILY, B_COLUMN_TS); } HTableInterface table = getConnection().getTable(getAllInOneTableName()); try { -ResultScanner scanner = table.getScanner(scan); -Result result = null; -for (Result r : scanner) { -result = r; -} +Result result = table.get(get); return result == null || result.isEmpty() ? null : result; } finally { IOUtils.closeQuietly(table);
[17/42] kylin git commit: minor, tutorial for DSN configuration of ODBC Driver
minor, tutorial for DSN configuration of ODBC Driver Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/97c2eac7 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/97c2eac7 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/97c2eac7 Branch: refs/heads/1.x-HBase1.1.3 Commit: 97c2eac79b8eea09dda5d8aaa3703860d4ec08c7 Parents: 54fbce4 Author: lidongsjtuAuthored: Sun Dec 27 23:37:49 2015 +0800 Committer: lidongsjtu Committed: Sun Dec 27 23:38:53 2015 +0800 -- website/_docs/tutorial/odbc.md | 17 - website/images/Kylin-ODBC-DSN/1.png | Bin 0 -> 103154 bytes website/images/Kylin-ODBC-DSN/2.png | Bin 0 -> 147630 bytes website/images/Kylin-ODBC-DSN/3.png | Bin 0 -> 71034 bytes website/images/Kylin-ODBC-DSN/4.png | Bin 0 -> 113661 bytes 5 files changed, 16 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/97c2eac7/website/_docs/tutorial/odbc.md -- diff --git a/website/_docs/tutorial/odbc.md b/website/_docs/tutorial/odbc.md index a41f41c..96957ee 100644 --- a/website/_docs/tutorial/odbc.md +++ b/website/_docs/tutorial/odbc.md @@ -13,7 +13,7 @@ since: v0.7.1 > > Tested Operation System: Windows 7, Windows Server 2008 R2 > -> Tested Application: Tableau 8.0.4 and Tableau 8.1.3 +> Tested Application: Tableau 8.0.4, Tableau 8.1.3 and Tableau 9.1 ## Prerequisites 1. Microsoft Visual C++ 2012 Redistributable @@ -31,5 +31,20 @@ since: v0.7.1 3. Both drivers already be installed on Tableau Server, you properly should be able to publish to there without issues +## DSN configuration +1. Open ODBCAD to configure DSN. + * For 32 bit driver, please use the 32bit version in C:\Windows\SysWOW64\odbcad32.exe + * For 64 bit driver, please use the default "Data Sources (ODBC)" in Control Panel/Administrator Tools +![]( /images/Kylin-ODBC-DSN/1.png) + +2. Open "System DSN" tab, and click "Add", you will see KylinODBCDriver listed as an option, Click "Finish" to continue. +![]( /images/Kylin-ODBC-DSN/2.png) + +3. In the pop up dialog, fill in all the blanks, The server host is where your Kylin Rest Server is started. +![]( /images/Kylin-ODBC-DSN/3.png) + +4. Click "Done", and you will see your new DSN listed in the "System Data Sources", you can use this DSN afterwards. +![]( /images/Kylin-ODBC-DSN/4.png) + ## Bug Report Please open Apache Kylin JIRA to report bug, or send to dev mailing list. http://git-wip-us.apache.org/repos/asf/kylin/blob/97c2eac7/website/images/Kylin-ODBC-DSN/1.png -- diff --git a/website/images/Kylin-ODBC-DSN/1.png b/website/images/Kylin-ODBC-DSN/1.png new file mode 100644 index 000..dfaaeee Binary files /dev/null and b/website/images/Kylin-ODBC-DSN/1.png differ http://git-wip-us.apache.org/repos/asf/kylin/blob/97c2eac7/website/images/Kylin-ODBC-DSN/2.png -- diff --git a/website/images/Kylin-ODBC-DSN/2.png b/website/images/Kylin-ODBC-DSN/2.png new file mode 100644 index 000..30fe4e5 Binary files /dev/null and b/website/images/Kylin-ODBC-DSN/2.png differ http://git-wip-us.apache.org/repos/asf/kylin/blob/97c2eac7/website/images/Kylin-ODBC-DSN/3.png -- diff --git a/website/images/Kylin-ODBC-DSN/3.png b/website/images/Kylin-ODBC-DSN/3.png new file mode 100644 index 000..8e4ac09 Binary files /dev/null and b/website/images/Kylin-ODBC-DSN/3.png differ http://git-wip-us.apache.org/repos/asf/kylin/blob/97c2eac7/website/images/Kylin-ODBC-DSN/4.png -- diff --git a/website/images/Kylin-ODBC-DSN/4.png b/website/images/Kylin-ODBC-DSN/4.png new file mode 100644 index 000..5c0255f Binary files /dev/null and b/website/images/Kylin-ODBC-DSN/4.png differ
[01/42] kylin git commit: update v1.2 binary package for hbase1.1
Repository: kylin Updated Branches: refs/heads/1.x-HBase1.1.3 bf8f51ae2 -> 0cec6fb2b update v1.2 binary package for hbase1.1 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/43031931 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/43031931 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/43031931 Branch: refs/heads/1.x-HBase1.1.3 Commit: 430319316f40874982964ed35dc8c4fd438c9000 Parents: 0603a19 Author: shaofengshiAuthored: Wed Dec 23 10:55:30 2015 +0800 Committer: shaofengshi Committed: Wed Dec 23 10:55:30 2015 +0800 -- website/download/index.cn.md | 4 ++-- website/download/index.md| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/43031931/website/download/index.cn.md -- diff --git a/website/download/index.cn.md b/website/download/index.cn.md index 7da5740..b5710d9 100644 --- a/website/download/index.cn.md +++ b/website/download/index.cn.md @@ -22,8 +22,8 @@ __äºè¿å¶å for HBase 1.1.3åæ´é«çæ¬__ 请注ææ¤å®è£ å éè¦HBase 1.1.3ææ´é«çæ¬ï¼ä¹åçæ¬ä¸æä¸ä¸ªå·²ç¥çå ³äºfuzzy keyè¿æ»¤å¨ç缺é·ï¼ä¼å¯¼è´Kylinæ¥è¯¢ç»æ缺å°è®°å½: [HBASE-14269](https://issues.apache.org/jira/browse/HBASE-14269) æ¤å¤è¯·æ³¨æï¼è¿ä¸æ¯ä¸ä¸ªæ£å¼çåå¸çï¼æ²¡æç»è¿å®æ´çæµè¯ã - * [apache-kylin-1.2-HBase1.1-incubating-SNAPSHOT-bin.tar.gz](https://dist.apache.org/repos/dist/dev/kylin/apache-kylin-1.2-incubating-snapshot/apache-kylin-1.2-HBase1.1-incubating-SNAPSHOT-bin.tar.gz) - * Git commit [3623dd6ff93d76141bb6a5fb623a3421ae78ca93](https://github.com/apache/kylin/commit/3623dd6ff93d76141bb6a5fb623a3421ae78ca93) + * [apache-kylin-1.3-HBase-1.1-SNAPSHOT-bin.tar.gz](https://dist.apache.org/repos/dist/dev/kylin/apache-kylin-1.3-snapshot/apache-kylin-1.3-HBase-1.1-SNAPSHOT-bin.tar.gz) + * Git commit [a3b8eb04955310abec158ea30f61deb0119679d1](https://github.com/apache/kylin/commit/a3b8eb04955310abec158ea30f61deb0119679d1) 对äºHBase 1.0ç¨æ·ï¼å»ºè®®æ¨å级å°1.1.3æé级å°0.98/0.99. http://git-wip-us.apache.org/repos/asf/kylin/blob/43031931/website/download/index.md -- diff --git a/website/download/index.md b/website/download/index.md index 98ae1ae..52d3413 100644 --- a/website/download/index.md +++ b/website/download/index.md @@ -24,8 +24,8 @@ Note the requirement of HBase version 1.1.3 (or above). There is a known bug in missing rows or lesser aggregations in Kylin query result: [HBASE-14269](https://issues.apache.org/jira/browse/HBASE-14269) Also, please aware this is not a formal release, and it is not fully tested: -* [apache-kylin-1.2-HBase1.1-incubating-SNAPSHOT-bin.tar.gz](https://dist.apache.org/repos/dist/dev/kylin/apache-kylin-1.2-incubating-snapshot/apache-kylin-1.2-HBase1.1-incubating-SNAPSHOT-bin.tar.gz) -* Git commit [3623dd6ff93d76141bb6a5fb623a3421ae78ca93](https://github.com/apache/kylin/commit/3623dd6ff93d76141bb6a5fb623a3421ae78ca93) +* [apache-kylin-1.3-HBase-1.1-SNAPSHOT-bin.tar.gz](https://dist.apache.org/repos/dist/dev/kylin/apache-kylin-1.3-snapshot/apache-kylin-1.3-HBase-1.1-SNAPSHOT-bin.tar.gz) +* Git commit [a3b8eb04955310abec158ea30f61deb0119679d1](https://github.com/apache/kylin/commit/a3b8eb04955310abec158ea30f61deb0119679d1) If you're using HBase 1.0, we suggest you to upgrade to 1.1.3+ or downgrade to 0.98/0.99.
[22/42] kylin git commit: minor, fix some style and typo issues for website
minor, fix some style and typo issues for website Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/16e5466c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/16e5466c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/16e5466c Branch: refs/heads/1.x-HBase1.1.3 Commit: 16e5466c008b35ee2ff1f511f1fc1f0b47e7725e Parents: 1e0a79e Author: lidongsjtuAuthored: Mon Dec 28 22:23:13 2015 +0800 Committer: lidongsjtu Committed: Mon Dec 28 22:23:37 2015 +0800 -- website/_dev/about_temp_files.md | 20 ++-- website/_dev/dev_env.md | 18 +- website/_docs/howto/howto_cleanup_storage.md | 9 ++--- website/community/poweredby.md | 2 +- 4 files changed, 22 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/16e5466c/website/_dev/about_temp_files.md -- diff --git a/website/_dev/about_temp_files.md b/website/_dev/about_temp_files.md index b3fba83..b46a764 100644 --- a/website/_dev/about_temp_files.md +++ b/website/_dev/about_temp_files.md @@ -6,24 +6,24 @@ permalink: /development/about_temp_files.html --- As we reviewed the code we found that Kylin left lots of garbage files in: -1. Local file system of the CLI -2. HDFS -3. Local file system of the hadoop nodes. -A ticked was opened to track this issue: -https://issues.apache.org/jira/browse/KYLIN-926 +* Local file system of the CLI +* HDFS +* Local file system of the hadoop nodes. + +A ticket was opened to track this issue: +[https://issues.apache.org/jira/browse/KYLIN-926](https://issues.apache.org/jira/browse/KYLIN-926) For future developments, please: -1. Whenever you want to create temp files at Local, choose + +* Whenever you want to create temp files at Local, choose File.createTempFile or use the folder: BatchConstants.CFG_KYLIN_LOCAL_TEMP_DIR(/tmp/kylin), do not randomly use another folder in /tmp, it will end up a mess, and look unprofessional. - -2. Whenever you create temp files at Local, remember to delete it after +* Whenever you create temp files at Local, remember to delete it after using it. It's best to use FileUtils.forceDelete, as it also works for deleting folders. Try avoid deleteOnExit, in case Kylin exits abnormally. - -3. Whenever you want to create files in HDFS, try to create it under +* Whenever you want to create files in HDFS, try to create it under kylin.hdfs.working.dir or BatchConstants.CFG_KYLIN_HDFS_TEMP_DIR, and remember to delete it after it is no longer useful. Try avoid throwing everything into hdfs:///tmp and leave it as garbage. http://git-wip-us.apache.org/repos/asf/kylin/blob/16e5466c/website/_dev/dev_env.md -- diff --git a/website/_dev/dev_env.md b/website/_dev/dev_env.md index 5722ac4..ec0d3fa 100644 --- a/website/_dev/dev_env.md +++ b/website/_dev/dev_env.md @@ -46,13 +46,13 @@ ln -s /root/apache-maven-3.2.5/bin/mvn /usr/bin/mvn First clone the Kylin project to your local: {% highlight Groff markup %} - git clone https://github.com/apache/kylin.git +git clone https://github.com/apache/kylin.git {% endhighlight %} Install Kylin artifacts to the maven repo {% highlight Groff markup %} - mvn clean install -DskipTests +mvn clean install -DskipTests {% endhighlight %} ### Modify local configuration @@ -75,15 +75,15 @@ Run a end-to-end cube building test, these special test cases will populate some It might take a while (maybe one hour), please keep patient. {% highlight Groff markup %} - mvn test -Dtest=org.apache.kylin.job.BuildCubeWithEngineTest -DfailIfNoTests=false -Dhdp.version= -P sandbox +mvn test -Dtest=org.apache.kylin.job.BuildCubeWithEngineTest -DfailIfNoTests=false -Dhdp.version= -P sandbox - mvn test -Dtest=org.apache.kylin.job.BuildIIWithEngineTest -DfailIfNoTests=false -Dhdp.version= -P sandbox +mvn test -Dtest=org.apache.kylin.job.BuildIIWithEngineTest -DfailIfNoTests=false -Dhdp.version= -P sandbox {% endhighlight %} Run other tests, the end-to-end cube building test is exclueded {% highlight Groff markup %} - mvn test -fae -P sandbox +mvn test -fae -P sandbox {% endhighlight %} ### Launch Kylin Web Server @@ -91,15 +91,15 @@ Run other tests, the end-to-end cube building test is exclueded Copy server/src/main/webapp/WEB-INF to webapp/app/WEB-INF {% highlight Groff markup %} - cp -r server/src/main/webapp/WEB-INF webapp/app/WEB-INF +cp -r server/src/main/webapp/WEB-INF webapp/app/WEB-INF {% endhighlight %} Download JS for Kylin web GUI. `npm` is part of `Node.js`, please search about how to
[06/42] kylin git commit: KYLIN-1244 In query window, enable fast copy by double clicking tables/columns' names.
KYLIN-1244 In query window, enable fast copy by double clicking tables/columns' names. Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/21810238 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/21810238 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/21810238 Branch: refs/heads/1.x-HBase1.1.3 Commit: 21810238cb543d752759c6aad382a6a8d6d56d4b Parents: 7a41f44 Author: jianAuthored: Thu Dec 24 16:09:41 2015 +0800 Committer: jian Committed: Thu Dec 24 16:09:41 2015 +0800 -- webapp/app/js/controllers/projectMeta.js | 26 +- webapp/app/partials/query/query.html | 3 ++- 2 files changed, 23 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/21810238/webapp/app/js/controllers/projectMeta.js -- diff --git a/webapp/app/js/controllers/projectMeta.js b/webapp/app/js/controllers/projectMeta.js index 0cc5ac4..d34c414 100644 --- a/webapp/app/js/controllers/projectMeta.js +++ b/webapp/app/js/controllers/projectMeta.js @@ -35,13 +35,29 @@ KylinApp labelSelected: "a8" } }; +$scope.lastSelected = null; $scope.showSelected = function (table) { - if (table.uuid) { -$scope.selectedSrcTable = table; - } - else { -$scope.selectedSrcTable.selectedSrcColumn = table; + if (!angular.isUndefined(table.table_NAME)){ +var selectColumn = true; +if (angular.isUndefined(table.column_NAME)) { + $scope.selectedSrcTable = table; + selectColumn = false; +} else { + $scope.selectedSrcTable.selectedSrcColumn = table; +} +if($scope.lastSelected == table){ + $scope.lastSelected = null; + if(angular.isUndefined($scope.$parent.queryString)){ +$scope.$parent.queryString=''; + } + if(selectColumn) +$scope.$parent.queryString += (table.table_NAME + '.' + table.column_NAME + ' '); + else +$scope.$parent.queryString += (table.table_NAME + ' '); +} else { + $scope.lastSelected = table; +} } } http://git-wip-us.apache.org/repos/asf/kylin/blob/21810238/webapp/app/partials/query/query.html -- diff --git a/webapp/app/partials/query/query.html b/webapp/app/partials/query/query.html index 25dcf9f..0fe8ea5 100644 --- a/webapp/app/partials/query/query.html +++ b/webapp/app/partials/query/query.html @@ -68,7 +68,8 @@ -Tips: Ctrl+Shift+Space or Alt+Space(Windows), Command+Option+Space(Mac) to list tables/columns in query box. +Tips: Ctrl+Shift+Space or Alt+Space(Windows), Command+Option+Space(Mac) to list tables/columns in query box. + Double click tables/columns' names on the left to fast copy
[19/42] kylin git commit: KYLIN-1230 copy cube ACL when do release
KYLIN-1230 copy cube ACL when do release Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9d7c42b3 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9d7c42b3 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9d7c42b3 Branch: refs/heads/1.x-HBase1.1.3 Commit: 9d7c42b3dd9febba8960ad8dac3645e799fb0747 Parents: f9de5a6 Author: shaofengshiAuthored: Mon Dec 28 11:19:36 2015 +0800 Committer: shaofengshi Committed: Mon Dec 28 11:23:44 2015 +0800 -- .../kylin/job/tools/CubeMigrationCLI.java | 63 ++-- 1 file changed, 46 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9d7c42b3/job/src/main/java/org/apache/kylin/job/tools/CubeMigrationCLI.java -- diff --git a/job/src/main/java/org/apache/kylin/job/tools/CubeMigrationCLI.java b/job/src/main/java/org/apache/kylin/job/tools/CubeMigrationCLI.java index 962a4ee..44bc2c3 100644 --- a/job/src/main/java/org/apache/kylin/job/tools/CubeMigrationCLI.java +++ b/job/src/main/java/org/apache/kylin/job/tools/CubeMigrationCLI.java @@ -24,6 +24,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; +import org.apache.hadoop.hdfs.web.JsonUtil; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.persistence.*; import org.apache.kylin.common.util.Bytes; @@ -72,23 +73,29 @@ public class CubeMigrationCLI { private static FileSystem hdfsFS; private static HBaseAdmin hbaseAdmin; +public static final String ACL_INFO_FAMILY = "i"; +private static final String ACL_TABLE_NAME = "_acl"; +private static final String ACL_INFO_FAMILY_TYPE_COLUMN = "t"; +private static final String ACL_INFO_FAMILY_OWNER_COLUMN = "o"; +private static final String ACL_INFO_FAMILY_PARENT_COLUMN = "p"; + public static void main(String[] args) throws IOException, InterruptedException { -if (args.length != 7) { +if (args.length != 8) { usage(); System.exit(1); } -moveCube(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); +moveCube(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); } private static void usage() { -System.out.println("Usage: CubeMigrationCLI srcKylinConfigUri dstKylinConfigUri cubeName projectName copyAclOrNot overwriteIfExists realExecute"); -System.out.println(" srcKylinConfigUri: The KylinConfig of the cubeâs source \n" + "dstKylinConfigUri: The KylinConfig of the cubeâs new home \n" + "cubeName: the name of cube to be migrated. \n" + "projectName: The target project in the target environment.(Make sure it exist) \n" + "copyAclOrNot: true or false: whether copy cube ACL to target environment. \n" + "overwriteIfExists: overwrite cube if it already exists in the target environment. \n" + "realExecute: if false, just print the operations to take, if true, do the real migration. \n"); +System.out.println("Usage: CubeMigrationCLI srcKylinConfigUri dstKylinConfigUri cubeName projectName copyAclOrNot purgeOrNot overwriteIfExists realExecute"); +System.out.println(" srcKylinConfigUri: The KylinConfig of the cubeâs source \n" + "dstKylinConfigUri: The KylinConfig of the cubeâs new home \n" + "cubeName: the name of cube to be migrated. \n" + "projectName: The target project in the target environment.(Make sure it exist) \n" + "copyAclOrNot: true or false: whether copy cube ACL to target environment. \n" + "purgeOrNot: true or false: whether purge the cube from src server after the migration. \n" + "overwriteIfExists: overwrite cube if it already exists in the target environment. \n" + "realExecute: if false, just print the operations to take, if true, do the real migration. \n"); } -public static void moveCube(KylinConfig srcCfg, KylinConfig dstCfg, String cubeName, String projectName, String copyAcl, String overwriteIfExists, String realExecute) throws IOException, InterruptedException { +public static void moveCube(KylinConfig srcCfg, KylinConfig dstCfg, String cubeName, String projectName, String copyAcl, String purgeAndDisable, String overwriteIfExists, String realExecute) throws IOException, InterruptedException { srcConfig = srcCfg; srcStore = ResourceStore.getStore(srcConfig); @@ -122,10 +129,13 @@ public class CubeMigrationCLI { changeHtableHost(cube); addCubeIntoProject(cubeName, projectName); if (Boolean.parseBoolean(copyAcl) == true) { -copyACL(cube); +copyACL(cube,
[24/42] kylin git commit: set 0 for all HTable cell’s timestamp
set 0 for all HTable cellâs timestamp Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/fe79ed9b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/fe79ed9b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/fe79ed9b Branch: refs/heads/1.x-HBase1.1.3 Commit: fe79ed9bdd3b695c6338594edb6474793caefbee Parents: 7fef205 Author: shaofengshiAuthored: Wed Dec 30 10:20:34 2015 +0800 Committer: shaofengshi Committed: Wed Dec 30 10:20:34 2015 +0800 -- .../java/org/apache/kylin/job/hadoop/cube/CubeHFileMapper.java | 2 +- .../java/org/apache/kylin/job/hadoop/hbase/CreateHTableJob.java| 1 - 2 files changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/fe79ed9b/job/src/main/java/org/apache/kylin/job/hadoop/cube/CubeHFileMapper.java -- diff --git a/job/src/main/java/org/apache/kylin/job/hadoop/cube/CubeHFileMapper.java b/job/src/main/java/org/apache/kylin/job/hadoop/cube/CubeHFileMapper.java index c19e54b..f12d229 100644 --- a/job/src/main/java/org/apache/kylin/job/hadoop/cube/CubeHFileMapper.java +++ b/job/src/main/java/org/apache/kylin/job/hadoop/cube/CubeHFileMapper.java @@ -120,7 +120,7 @@ public class CubeHFileMapper extends KylinMapper
[13/42] kylin git commit: add tableau, excel, power bi tutorial and blog
add tableau, excel, power bi tutorial and blog Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9c2fe8c1 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9c2fe8c1 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9c2fe8c1 Branch: refs/heads/1.x-HBase1.1.3 Commit: 9c2fe8c145f2c2538386b9455c0850eb7ea5044b Parents: 7c98901 Author: Luke HanAuthored: Sat Dec 26 00:45:49 2015 +0800 Committer: Luke Han Committed: Sat Dec 26 00:45:49 2015 +0800 -- website/_docs/tutorial/powerbi.cn.md| 56 website/_docs/tutorial/tableau_91.cn.md | 50 + .../2015-12-25-support-powerbi-tableau9.cn.md | 28 ++ .../blog/2015-12-25-support-powerbi-tableau9.md | 28 ++ 4 files changed, 162 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9c2fe8c1/website/_docs/tutorial/powerbi.cn.md -- diff --git a/website/_docs/tutorial/powerbi.cn.md b/website/_docs/tutorial/powerbi.cn.md new file mode 100644 index 000..9c2a539 --- /dev/null +++ b/website/_docs/tutorial/powerbi.cn.md @@ -0,0 +1,56 @@ +--- +layout: docs-cn +title: 微软ExcelåPower BIæç¨ +categories: tutorial +permalink: /cn/docs/tutorial/powerbi.html +version: v1.2 +since: v1.2 +--- + +Microsoft Excelæ¯å½ä»Windowså¹³å°ä¸ææµè¡çæ°æ®å¤ç软件ä¹ä¸ï¼æ¯æå¤ç§æ°æ®å¤çåè½ï¼å¯ä»¥å©ç¨Power Queryä»ODBCæ°æ®æºè¯»åæ°æ®å¹¶è¿åå°æ°æ®è¡¨ä¸ã + +Microsoft Power BI æ¯ç±å¾®è½¯æ¨åºçåä¸æºè½çä¸ä¸åæå·¥å ·ï¼ç»ç¨æ·æä¾ç®åä¸ä¸°å¯çæ°æ®å¯è§åååæåè½ã + +> Apache Kylinç®åçæ¬ä¸æ¯æåå§æ°æ®çæ¥è¯¢ï¼é¨åæ¥è¯¢ä¼å æ¤å¤±è´¥ï¼å¯¼è´åºç¨ç¨åºåçå¼å¸¸ï¼å»ºè®®æä¸KYLIN-1075è¡¥ä¸å 以ä¼åæ¥è¯¢ç»æçæ¾ç¤ºã + + +> Power BIåExcelä¸æ¯æ"connect live"模å¼ï¼è¯·æ³¨æ并添å whereæ¡ä»¶å¨æ¥è¯¢è¶ 大æ°æ®éæ¶åï¼ä»¥é¿å ä»æå¡å¨æå»è¿å¤çæ°æ®å°æ¬å°ï¼çè³å¨æäºæ åµä¸æ¥è¯¢æ§è¡å¤±è´¥ã + +### Install ODBC Driver +åè页é¢[Kylin ODBC 驱å¨ç¨åºæç¨](./odbc.html)ï¼è¯·ç¡®ä¿ä¸è½½å¹¶å®è£ Kylin ODBC Driver __v1.2__. å¦æä½ å®è£ ææ©åçæ¬ï¼è¯·å¸è½½ååå®è£ ã + +### è¿æ¥Excelå°Kylin +1. ä»å¾®è½¯å®ç½ä¸è½½åå®è£ Power Queryï¼å®è£ å®æåå¨Excelä¸ä¼çå°Power QueryçFast Tabï¼åå»ï½From other sourcesï½ä¸ææé®ï¼å¹¶éæ©ï½From ODBCï½é¡¹ +![](/images/tutorial/odbc/ms_tool/Picture1.png) + +2. å¨å¼¹åºç`From ODBC`æ°æ®è¿æ¥å导ä¸è¾å ¥Apache Kylinæå¡å¨çè¿æ¥å符串ï¼ä¹å¯ä»¥å¨ï½SQLï½ææ¬æ¡ä¸è¾å ¥æ¨æ³è¦æ§è¡çSQLè¯å¥ï¼åå»ï½OKï½ï¼SQLçæ§è¡ç»æå°±ä¼ç«å³å è½½å°Excelçæ°æ®è¡¨ä¸ +![](/images/tutorial/odbc/ms_tool/Picture2.png) + +> 为äºç®åè¿æ¥å符串çè¾å ¥ï¼æ¨èå建Apache KylinçDSNï¼å¯ä»¥å°è¿æ¥å符串ç®å为DSN=[YOUR_DSN_NAME]ï¼æå ³DSNçå建请åèï¼[https://support.microsoft.com/en-us/kb/305599](https://support.microsoft.com/en-us/kb/305599)ã + + +3. å¦ææ¨éæ©ä¸è¾å ¥SQLè¯å¥ï¼Power Queryå°ä¼ååºææçæ°æ®åºè¡¨ï¼æ¨å¯ä»¥æ ¹æ®éè¦å¯¹æ´å¼ 表çæ°æ®è¿è¡å è½½ãä½æ¯ï¼Apache Kylinæä¸æ¯æåæ°æ®çæ¥è¯¢ï¼é¨å表çå è½½å¯è½å æ¤åé +![](/images/tutorial/odbc/ms_tool/Picture3.png) + +4. ç¨ççå»ï¼æ°æ®å·²æåå è½½å°Excelä¸ +![](/images/tutorial/odbc/ms_tool/Picture4.png) + +5. ä¸æ¦æå¡å¨ç«¯æ°æ®äº§çæ´æ°ï¼åéè¦å¯¹Excelä¸çæ°æ®è¿è¡åæ¥ï¼å³é®åå»å³ä¾§å表ä¸çæ°æ®æºï¼éæ©ï½Refreshï½ï¼ææ°çæ°æ®ä¾¿ä¼æ´æ°å°æ°æ®è¡¨ä¸. + +6. 1. 为äºæåæ§è½ï¼å¯ä»¥å¨Power Queryä¸æå¼ï½Query Optionsï½è®¾ç½®ï¼ç¶åå¼å¯ï½Fast data loadï½ï¼è¿å°æé«æ°æ®å è½½é度ï¼ä½å¯è½é æçé¢çææ¶æ ååº + +### Power BI +1. å¯å¨æ¨å·²ç»å®è£ çPower BIæ¡é¢çç¨åºï¼åå»ï½Get dataï½æé®ï¼å¹¶éä¸ODBCæ°æ®æº. +![](/images/tutorial/odbc/ms_tool/Picture5.png) + +2. å¨å¼¹åºç`From ODBC`æ°æ®è¿æ¥å导ä¸è¾å ¥Apache Kylinæå¡å¨çæ°æ®åºè¿æ¥å符串ï¼ä¹å¯ä»¥å¨ï½SQLï½ææ¬æ¡ä¸è¾å ¥æ¨æ³è¦æ§è¡çSQLè¯å¥ãåå»ï½OKï½ï¼SQLçæ§è¡ç»æå°±ä¼ç«å³å è½½å°Power BIä¸ +![](/images/tutorial/odbc/ms_tool/Picture6.png) + +3. å¦ææ¨éæ©ä¸è¾å ¥SQLè¯å¥ï¼Power BIå°ä¼ååºé¡¹ç®ä¸ææç表ï¼æ¨å¯ä»¥æ ¹æ®éè¦å°æ´å¼ 表çæ°æ®è¿è¡å è½½ãä½æ¯ï¼Apache Kylinæä¸æ¯æåæ°æ®çæ¥è¯¢ï¼é¨å表çå è½½å¯è½å æ¤åé +![](/images/tutorial/odbc/ms_tool/Picture7.png) + +4. ç°å¨ä½ å¯ä»¥è¿ä¸æ¥ä½¿ç¨Power BIè¿è¡å¯è§ååæï¼
[21/42] kylin git commit: KYLIN-1254 CubeController unit test update, update model create case
KYLIN-1254 CubeController unit test update,update model create case Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/1e0a79ef Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/1e0a79ef Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/1e0a79ef Branch: refs/heads/1.x-HBase1.1.3 Commit: 1e0a79ef1ac7e951d4b79f6143176bd32682ceb1 Parents: 2533fe5 Author: jianAuthored: Mon Dec 28 17:09:38 2015 +0800 Committer: jian Committed: Mon Dec 28 17:10:06 2015 +0800 -- .../kylin/rest/controller/ModelController.java | 15 +++ .../kylin/rest/controller/CubeControllerTest.java| 11 +++ 2 files changed, 22 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/1e0a79ef/server/src/main/java/org/apache/kylin/rest/controller/ModelController.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/controller/ModelController.java b/server/src/main/java/org/apache/kylin/rest/controller/ModelController.java index 811ad3e..e9ce7ef 100644 --- a/server/src/main/java/org/apache/kylin/rest/controller/ModelController.java +++ b/server/src/main/java/org/apache/kylin/rest/controller/ModelController.java @@ -23,6 +23,7 @@ import java.io.IOException; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.metadata.MetadataManager; import org.apache.kylin.metadata.model.DataModelDesc; +import org.apache.kylin.rest.exception.InternalErrorException; import org.apache.kylin.rest.service.CubeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -59,6 +60,20 @@ public class ModelController { } +@RequestMapping(value = "/{modelName}", method = {RequestMethod.DELETE}) +@ResponseBody +public void deleteModel(@PathVariable String modelName) { +MetadataManager metaManager = MetadataManager.getInstance(cubeService.getConfig()); +DataModelDesc modeDesc = metaManager.getDataModelDesc(modelName); +try { +metaManager.dropModel(modeDesc); +} catch (IOException e) { +throw new InternalErrorException("Failed to delete model", e); +} +} + + + public void setCubeService(CubeService cubeService) { this.cubeService = cubeService; } http://git-wip-us.apache.org/repos/asf/kylin/blob/1e0a79ef/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java -- diff --git a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java index 09ce6c5..feb8261 100644 --- a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java +++ b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java @@ -43,6 +43,7 @@ import com.google.common.collect.Lists; public class CubeControllerTest extends ServiceTestBase { private static final String SRC_CUBE_NAME = "test_kylin_cube_with_slr_ready"; private static final String TEST_CUBE_NAME = SRC_CUBE_NAME + "_test_save"; +private static final String TEST_MODEL_NAME = SRC_CUBE_NAME + "_test_model_save"; private CubeController cubeController; private CubeDescController cubeDescController; @@ -72,11 +73,12 @@ public class CubeControllerTest extends ServiceTestBase { srcCubeDesc = getCubeDescByName(SRC_CUBE_NAME); -saveTestCube(TEST_CUBE_NAME); +saveTestCube(TEST_CUBE_NAME,TEST_MODEL_NAME); } @After public void tearDown() throws Exception { +modelController.deleteModel(TEST_MODEL_NAME); cubeController.deleteCube(TEST_CUBE_NAME); super.after(); } @@ -89,17 +91,18 @@ public class CubeControllerTest extends ServiceTestBase { return cubes[0]; } -private void saveTestCube(final String newCubeName) throws IOException { +private void saveTestCube(final String newCubeName,final String newModelName) throws IOException { CubeDesc newCube = new CubeDesc(); try { +modelController.deleteModel(newModelName); cubeController.deleteCube(newCubeName); } catch (Exception e) { // it may not exist, ignore the exception } newCube.setName(newCubeName); -newCube.setModelName(newCubeName); +newCube.setModelName(newModelName); newCube.setModel(srcCubeDesc.getModel()); newCube.setDimensions(srcCubeDesc.getDimensions()); newCube.setHBaseMapping(srcCubeDesc.getHBaseMapping()); @@ -107,7 +110,7 @@ public
[05/42] kylin git commit: KYLIN-1234 enable ACL check on query
KYLIN-1234 enable ACL check on query Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7a41f44c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7a41f44c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7a41f44c Branch: refs/heads/1.x-HBase1.1.3 Commit: 7a41f44c5a254189b938668d505c1c611818f253 Parents: 87ac53b Author: shaofengshiAuthored: Thu Dec 24 11:14:21 2015 +0800 Committer: shaofengshi Committed: Thu Dec 24 11:15:24 2015 +0800 -- common/src/main/java/org/apache/kylin/common/KylinConfig.java | 2 +- conf/kylin.properties | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7a41f44c/common/src/main/java/org/apache/kylin/common/KylinConfig.java -- diff --git a/common/src/main/java/org/apache/kylin/common/KylinConfig.java b/common/src/main/java/org/apache/kylin/common/KylinConfig.java index 8a123dc..b043b2a 100644 --- a/common/src/main/java/org/apache/kylin/common/KylinConfig.java +++ b/common/src/main/java/org/apache/kylin/common/KylinConfig.java @@ -485,7 +485,7 @@ public class KylinConfig { } public boolean isQuerySecureEnabled() { -return Boolean.parseBoolean(this.getOptional("kylin.query.security.enabled", "false")); +return Boolean.parseBoolean(this.getOptional("kylin.query.security.enabled", "true")); } public boolean isQueryCacheEnabled() { http://git-wip-us.apache.org/repos/asf/kylin/blob/7a41f44c/conf/kylin.properties -- diff --git a/conf/kylin.properties b/conf/kylin.properties index 7f2af8a..68db224 100644 --- a/conf/kylin.properties +++ b/conf/kylin.properties @@ -80,6 +80,9 @@ kylin.hbase.region.cut.large=100 kylin.hbase.region.count.min=1 kylin.hbase.region.count.max=500 +# Enable/disable ACL check for cube query +kylin.query.security.enabled=true + ## Config for Restful APP ## # database connection settings: ldap.server=
[33/42] kylin git commit: website: fix a wrong statement in LDAP enablement
website: fix a wrong statement in LDAP enablement Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/62361770 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/62361770 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/62361770 Branch: refs/heads/1.x-HBase1.1.3 Commit: 62361770477fdafd6fb043fa0ef1e8d7fa7480a3 Parents: e32f8dc Author: shaofengshiAuthored: Thu Jan 7 15:49:03 2016 +0800 Committer: shaofengshi Committed: Thu Jan 7 15:49:33 2016 +0800 -- website/_docs/howto/howto_backup_metadata.md | 16 website/_docs/howto/howto_optimize_cubes.md | 2 +- website/_docs/index.md | 21 + website/_docs/install/advance_settings.md| 22 +- website/_docs/tutorial/powerbi.md| 2 +- 5 files changed, 28 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/62361770/website/_docs/howto/howto_backup_metadata.md -- diff --git a/website/_docs/howto/howto_backup_metadata.md b/website/_docs/howto/howto_backup_metadata.md index 1934a60..cf250b7 100644 --- a/website/_docs/howto/howto_backup_metadata.md +++ b/website/_docs/howto/howto_backup_metadata.md @@ -11,10 +11,10 @@ Kylin organizes all of its metadata (including cube descriptions and instances, {% highlight Groff markup %} ## The metadata store in hbase -kylin.metadata.url=kylin_metadata_qa@hbase +kylin.metadata.url=kylin_metadata@hbase {% endhighlight %} -This indicates that the metadata will be saved as a htable called `kylin_metadata_qa`. You can scan the htable in hbase shell to check it out. +This indicates that the metadata will be saved as a htable called `kylin_metadata`. You can scan the htable in hbase shell to check it out. ## Backup Metadata Store with binary package @@ -22,7 +22,7 @@ Sometimes you need to backup the Kylin's Metadata Store from hbase to your disk In such cases, assuming you're on the hadoop CLI(or sandbox) where you deployed Kylin, you can go to KYLIN_HOME and run : {% highlight Groff markup %} -bin/metastore.sh backup +./bin/metastore.sh backup {% endhighlight %} to dump your metadata to your local folder a folder under KYLIN_HOME/metadata_backps, the folder is named after current time with the syntax: KYLIN_HOME/meta_backups/meta_year_month_day_hour_minute_second @@ -34,15 +34,15 @@ In case you find your metadata store messed up, and you want to restore to a pre Firstly, reset the metadata store (this will clean everything of the Kylin metadata store in hbase, make sure to backup): {% highlight Groff markup %} -bin/metastore.sh reset +./bin/metastore.sh reset {% endhighlight %} Then upload the backup metadata to Kylin's metadata store: {% highlight Groff markup %} -bin/metastore.sh restore $KYLIN_HOME/meta_backups/meta__xx_xx_xx_xx_xx +./bin/metastore.sh restore $KYLIN_HOME/meta_backups/meta__xx_xx_xx_xx_xx {% endhighlight %} -## Backup/Restore metadata in development env (available since 0.7.3) +## Backup/restore metadata in development env (available since 0.7.3) When developing/debugging Kylin, typically you have a dev machine with an IDE, and a backend sandbox. Usually you'll write code and run test cases at dev machine. It would be troublesome if you always have to put a binary package in the sandbox to check the metadata. There is a helper class called SandboxMetastoreCLI to help you download/upload metadata locally at your dev machine. Follow the Usage information and run it in your IDE. @@ -51,12 +51,12 @@ As time goes on, some resources like dictionary, table snapshots became useless Firstly, run a check, this is safe as it will not change anything: {% highlight Groff markup %} -bin/metastore.sh clean +./bin/metastore.sh clean {% endhighlight %} The resources that will be dropped will be listed; Next, add the "--delete true" parameter to cleanup those resources; before this, make sure you have made a backup of the metadata store; {% highlight Groff markup %} -bin/metastore.sh clean --delete true +./bin/metastore.sh clean --delete true {% endhighlight %} http://git-wip-us.apache.org/repos/asf/kylin/blob/62361770/website/_docs/howto/howto_optimize_cubes.md -- diff --git a/website/_docs/howto/howto_optimize_cubes.md b/website/_docs/howto/howto_optimize_cubes.md index 50b42d4..4ebf7be 100644 --- a/website/_docs/howto/howto_optimize_cubes.md +++ b/website/_docs/howto/howto_optimize_cubes.md @@ -1,6 +1,6 @@ --- layout: docs -title: How to optimize cubes +title: How to Optimize Cubes categories: howto permalink:
[23/42] kylin git commit: fix ci and enable HTable read-only
fix ci and enable HTable read-only Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7fef2052 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7fef2052 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7fef2052 Branch: refs/heads/1.x-HBase1.1.3 Commit: 7fef205240afabd44effddfafc26cad3472a7382 Parents: 16e5466 Author: shaofengshiAuthored: Tue Dec 29 17:36:57 2015 +0800 Committer: shaofengshi Committed: Tue Dec 29 17:36:57 2015 +0800 -- .../org/apache/kylin/job/hadoop/hbase/CreateHTableJob.java| 1 + .../java/org/apache/kylin/rest/controller/CubeController.java | 7 --- .../org/apache/kylin/rest/controller/CubeControllerTest.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7fef2052/job/src/main/java/org/apache/kylin/job/hadoop/hbase/CreateHTableJob.java -- diff --git a/job/src/main/java/org/apache/kylin/job/hadoop/hbase/CreateHTableJob.java b/job/src/main/java/org/apache/kylin/job/hadoop/hbase/CreateHTableJob.java index 027c0ca..af2850c 100644 --- a/job/src/main/java/org/apache/kylin/job/hadoop/hbase/CreateHTableJob.java +++ b/job/src/main/java/org/apache/kylin/job/hadoop/hbase/CreateHTableJob.java @@ -79,6 +79,7 @@ public class CreateHTableJob extends AbstractHadoopJob { // https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.html tableDesc.setValue(HTableDescriptor.SPLIT_POLICY, ConstantSizeRegionSplitPolicy.class.getName()); tableDesc.setValue(IRealizationConstants.HTableTag, config.getMetadataUrlPrefix()); +tableDesc.setReadOnly(true); Configuration conf = HadoopUtil.getCurrentHBaseConfiguration(); HBaseAdmin admin = new HBaseAdmin(conf); http://git-wip-us.apache.org/repos/asf/kylin/blob/7fef2052/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java index 2538f57..182a34d 100644 --- a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java +++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java @@ -278,7 +278,7 @@ public class CubeController extends BasicController { //model name same as cube modelDesc.setName(targetCubeName); modelDesc.setLastModified(0); -modelDesc.setUuid(UUID.randomUUID().toString()); +modelDesc.updateRandomUuid(); DataModelDesc newModel = null; try { newModel = metaManager.createDataModelDesc(modelDesc); @@ -288,7 +288,7 @@ public class CubeController extends BasicController { cubeDesc.setName(targetCubeName); cubeDesc.setLastModified(0); -cubeDesc.setUuid(UUID.randomUUID().toString()); +cubeDesc.updateRandomUuid(); cubeDesc.setModelName(targetCubeName); CubeInstance newCube = null; try { @@ -372,6 +372,7 @@ public class CubeController extends BasicController { } try { +modelDesc.updateRandomUuid(); metaManager.createDataModelDesc(modelDesc); } catch (IOException e) { logger.error("Failed to deal with the request:" + e.getLocalizedMessage(), e); @@ -382,7 +383,7 @@ public class CubeController extends BasicController { try { -desc.setUuid(UUID.randomUUID().toString()); +desc.updateRandomUuid(); String projectName = (null == cubeRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME : cubeRequest.getProject(); CubeInstance createdCube = cubeService.createCubeAndDesc(desc.getName(), projectName, desc); updateCubeSuccess = true; http://git-wip-us.apache.org/repos/asf/kylin/blob/7fef2052/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java -- diff --git a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java index feb8261..0d14711 100644 --- a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java +++ b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java @@ -127,7 +127,7 @@ public class CubeControllerTest extends ServiceTestBase { Assert.assertNotNull(cubeController.getSql(SRC_CUBE_NAME, "2013033108_2013121208"));
kylin git commit: minor, correct typo in error message
Repository: kylin Updated Branches: refs/heads/2.0-rc 33f48f6a7 -> 71c8033c4 minor, correct typo in error message Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/71c8033c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/71c8033c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/71c8033c Branch: refs/heads/2.0-rc Commit: 71c8033c4eb6c0f098ca1592c7123f5ed47ad121 Parents: 33f48f6 Author: Li, YangAuthored: Thu Dec 31 14:37:16 2015 +0800 Committer: Li, Yang Committed: Thu Dec 31 14:37:16 2015 +0800 -- core-cube/.settings/org.eclipse.core.resources.prefs | 1 - .../kylin/metadata/measure/serializer/DataTypeSerializer.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/71c8033c/core-cube/.settings/org.eclipse.core.resources.prefs -- diff --git a/core-cube/.settings/org.eclipse.core.resources.prefs b/core-cube/.settings/org.eclipse.core.resources.prefs index 04cfa2c..365bbd6 100644 --- a/core-cube/.settings/org.eclipse.core.resources.prefs +++ b/core-cube/.settings/org.eclipse.core.resources.prefs @@ -2,5 +2,4 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 encoding//src/test/java=UTF-8 -encoding//src/test/resources=UTF-8 encoding/=UTF-8 http://git-wip-us.apache.org/repos/asf/kylin/blob/71c8033c/core-metadata/src/main/java/org/apache/kylin/metadata/measure/serializer/DataTypeSerializer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/measure/serializer/DataTypeSerializer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/measure/serializer/DataTypeSerializer.java index d542098..bceae52 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/measure/serializer/DataTypeSerializer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/measure/serializer/DataTypeSerializer.java @@ -71,7 +71,7 @@ abstract public class DataTypeSerializer implements BytesSerializer { Class clz = implementations.get(type.getName()); if (clz == null) -throw new RuntimeException("No MeasureSerializer for type " + type); +throw new RuntimeException("No DataTypeSerializer for type " + type); try { return (DataTypeSerializer) clz.getConstructor(DataType.class).newInstance(type);
kylin git commit: KYLIN-976 Minor document enrichment.
Repository: kylin Updated Branches: refs/heads/2.x-staging a95cef67d -> 95d952da5 KYLIN-976 Minor document enrichment. Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/95d952da Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/95d952da Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/95d952da Branch: refs/heads/2.x-staging Commit: 95d952da5b9d8dbb60005235c5c2b42c13a29c78 Parents: a95cef6 Author: Li, YangAuthored: Thu Dec 31 10:53:47 2015 +0800 Committer: Li, Yang Committed: Thu Dec 31 10:54:23 2015 +0800 -- .../kylin/metadata/datatype/DataTypeSerializer.java | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/95d952da/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeSerializer.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeSerializer.java b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeSerializer.java index a66776c..df5513c 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeSerializer.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeSerializer.java @@ -66,21 +66,23 @@ abstract public class DataTypeSerializer implements BytesSerializer { } } -/** peek into buffer and return the length of serialization */ +/** Peek into buffer and return the length of serialization which is previously written by this.serialize(). + * The current position of input buffer is guaranteed to be at the beginning of the serialization. + * The implementation must not alter the buffer position by its return. */ abstract public int peekLength(ByteBuffer in); -/** return the max number of bytes to the longest serialization */ +/** Return the max number of bytes to the longest possible serialization */ abstract public int maxLength(); -/** get an estimate of size in bytes of the serialized data */ +/** Get an estimate of size in bytes of the serialized data */ abstract public int getStorageBytesEstimate(); -/** an optional convenient method that converts a string to this data type (for dimensions) */ +/** An optional convenient method that converts a string to this data type (for dimensions) */ public T valueOf(String str) { throw new UnsupportedOperationException(); } -/** convert from obj to string */ +/** Convert from obj to string */ public String toString(T value) { if (value == null) return "NULL";
kylin git commit: minor, typo in comment
Repository: kylin Updated Branches: refs/heads/2.x-staging bfe72bf6a -> 2ef13d08e minor, typo in comment Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2ef13d08 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2ef13d08 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2ef13d08 Branch: refs/heads/2.x-staging Commit: 2ef13d08ecf10379dc922a000772dbf4daad0d05 Parents: bfe72bf Author: Yang LiAuthored: Mon Dec 21 14:02:28 2015 +0800 Committer: Yang Li Committed: Mon Dec 21 14:02:28 2015 +0800 -- .../src/main/java/org/apache/kylin/measure/MeasureType.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/2ef13d08/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java b/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java index f7523cf..e9d97c6 100644 --- a/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java +++ b/core-metadata/src/main/java/org/apache/kylin/measure/MeasureType.java @@ -122,7 +122,7 @@ abstract public class MeasureType { return false; } -/** The simply filling mode, one tuple per storage record. */ +/** The simple filling mode, one tuple per storage record. */ public void fillTupleSimply(Tuple tuple, int indexInTuple, Object measureValue) { tuple.setMeasureValue(indexInTuple, measureValue); }
[05/50] [abbrv] kylin git commit: KYLIN-1160 code review
KYLIN-1160 code review Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/55c448b3 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/55c448b3 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/55c448b3 Branch: refs/heads/1.x-HBase1.1.3 Commit: 55c448b30907eefca3561b8c15c61baccc4fba66 Parents: b7b6793 Author: Li, YangAuthored: Wed Nov 25 15:39:39 2015 +0800 Committer: Li, Yang Committed: Wed Nov 25 15:39:39 2015 +0800 -- .../main/java/org/apache/kylin/common/util/Log4jConfigurer.java | 4 ++-- .../main/java/org/apache/kylin/jdbc/util/Log4jConfigurer.java| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/55c448b3/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java -- diff --git a/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java b/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java index c329ced..6f887b7 100644 --- a/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java +++ b/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java @@ -17,15 +17,15 @@ public class Log4jConfigurer { public static void initLogger() { if (!INITIALIZED && !isConfigured()) { org.apache.log4j.BasicConfigurator.configure(new ConsoleAppender(new PatternLayout(DEFAULT_PATTERN_LAYOUT))); -INITIALIZED = true; } +INITIALIZED = true; } private static boolean isConfigured() { if (LogManager.getRootLogger().getAllAppenders().hasMoreElements()) { return true; } else { -Enumeration loggers = LogManager.getCurrentLoggers(); +Enumeration loggers = LogManager.getCurrentLoggers(); while (loggers.hasMoreElements()) { Logger logger = (Logger) loggers.nextElement(); if (logger.getAllAppenders().hasMoreElements()) http://git-wip-us.apache.org/repos/asf/kylin/blob/55c448b3/jdbc/src/main/java/org/apache/kylin/jdbc/util/Log4jConfigurer.java -- diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/util/Log4jConfigurer.java b/jdbc/src/main/java/org/apache/kylin/jdbc/util/Log4jConfigurer.java index 715d190..8bf35e2 100644 --- a/jdbc/src/main/java/org/apache/kylin/jdbc/util/Log4jConfigurer.java +++ b/jdbc/src/main/java/org/apache/kylin/jdbc/util/Log4jConfigurer.java @@ -17,15 +17,15 @@ public class Log4jConfigurer { public static void initLogger() { if (!INITIALIZED && !isConfigured()) { org.apache.log4j.BasicConfigurator.configure(new ConsoleAppender(new PatternLayout(DEFAULT_PATTERN_LAYOUT))); -INITIALIZED = true; } +INITIALIZED = true; } private static boolean isConfigured() { if (LogManager.getRootLogger().getAllAppenders().hasMoreElements()) { return true; } else { -Enumeration loggers = LogManager.getCurrentLoggers(); +Enumeration loggers = LogManager.getCurrentLoggers(); while (loggers.hasMoreElements()) { Logger logger = (Logger) loggers.nextElement(); if (logger.getAllAppenders().hasMoreElements())
[37/50] [abbrv] kylin git commit: KYLIN-976 Support Custom Aggregation Types
http://git-wip-us.apache.org/repos/asf/kylin/blob/c721d679/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 fd86138..f225fe2 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 @@ -59,7 +59,6 @@ import org.apache.kylin.metadata.model.FunctionDesc; import org.apache.kylin.metadata.model.ParameterDesc; import org.apache.kylin.metadata.model.TableDesc; import org.apache.kylin.metadata.model.TblColRef; -import org.apache.kylin.query.sqlfunc.HLLDistinctCountAggFunc; import com.google.common.base.Preconditions; @@ -74,7 +73,6 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel { AGGR_FUNC_MAP.put("$SUM0", "SUM"); AGGR_FUNC_MAP.put("COUNT", "COUNT"); AGGR_FUNC_MAP.put("COUNT_DISTINCT", "COUNT_DISTINCT"); -AGGR_FUNC_MAP.put("HLL_COUNT", "COUNT_DISTINCT"); AGGR_FUNC_MAP.put("MAX", "MAX"); AGGR_FUNC_MAP.put("MIN", "MIN"); } @@ -301,10 +299,10 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel { // rebuild function RelDataType fieldType = aggCall.getType(); SqlAggFunction newAgg = aggCall.getAggregation(); -if (func.isCountDistinct()) { -newAgg = createHyperLogLogAggFunction(fieldType); -} else if (func.isCount()) { +if (func.isCount()) { newAgg = SqlStdOperatorTable.SUM0; +} else if (func.getMeasureType().getRewriteCalciteAggrFunctionClass() != null) { +newAgg = createCustomAggFunction(func.getExpression(), fieldType, func.getMeasureType().getRewriteCalciteAggrFunctionClass()); } // rebuild aggregate call @@ -312,10 +310,10 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel { return newAggCall; } -private SqlAggFunction createHyperLogLogAggFunction(RelDataType returnType) { +private SqlAggFunction createCustomAggFunction(String funcName, RelDataType returnType, Class customAggFuncClz) { RelDataTypeFactory typeFactory = getCluster().getTypeFactory(); -SqlIdentifier sqlIdentifier = new SqlIdentifier("HLL_COUNT", new SqlParserPos(1, 1)); -AggregateFunction aggFunction = AggregateFunctionImpl.create(HLLDistinctCountAggFunc.class); +SqlIdentifier sqlIdentifier = new SqlIdentifier(funcName, new SqlParserPos(1, 1)); +AggregateFunction aggFunction = AggregateFunctionImpl.create(customAggFuncClz); List argTypes = new ArrayList(); List typeFamilies = new ArrayList(); for (FunctionParameter o : aggFunction.getParameters()) { http://git-wip-us.apache.org/repos/asf/kylin/blob/c721d679/query/src/main/java/org/apache/kylin/query/routing/Candidate.java -- diff --git a/query/src/main/java/org/apache/kylin/query/routing/Candidate.java b/query/src/main/java/org/apache/kylin/query/routing/Candidate.java new file mode 100644 index 000..22608a0 --- /dev/null +++ b/query/src/main/java/org/apache/kylin/query/routing/Candidate.java @@ -0,0 +1,100 @@ +/* + * 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.query.routing; + +import java.util.Map; + +import org.apache.kylin.metadata.realization.CapabilityResult; +import org.apache.kylin.metadata.realization.IRealization; +import org.apache.kylin.metadata.realization.RealizationType; +import org.apache.kylin.metadata.realization.SQLDigest; +import org.apache.kylin.storage.hybrid.HybridInstance; + +import com.google.common.collect.Maps; + +public class Candidate implements Comparable { + +static final MapPRIORITIES = Maps.newHashMap(); + +static { +PRIORITIES.put(RealizationType.HYBRID, 0); +PRIORITIES.put(RealizationType.CUBE, 0); +PRIORITIES.put(RealizationType.INVERTED_INDEX,
[42/50] [abbrv] kylin git commit: KYLIN-976 remove holistic hll in cube desc
KYLIN-976 remove holistic hll in cube desc Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/623e70f4 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/623e70f4 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/623e70f4 Branch: refs/heads/1.x-HBase1.1.3 Commit: 623e70f47624dd67de01b02cf8b227cf5381eae5 Parents: c721d67 Author: honmaAuthored: Tue Dec 15 18:23:21 2015 +0800 Committer: honma Committed: Tue Dec 15 18:23:21 2015 +0800 -- .../cube_desc/test_kylin_cube_without_slr_desc.json | 16 +--- .../test_kylin_cube_without_slr_left_join_desc.json | 16 +--- 2 files changed, 2 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/623e70f4/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json -- diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json index fedb2c1..bf29268 100644 --- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json +++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json @@ -151,19 +151,6 @@ }, { "id": 7, - "name": "SELLER_CNT_LONG", - "function": { -"expression": "COUNT_DISTINCT", -"parameter": { - "type": "column", - "value": "SELLER_ID" -}, -"returntype": "bigint" - }, - "dependent_measure_ref": "SELLER_CNT_HLL" -}, -{ - "id": 8, "name": "SELLER_FORMAT_CNT", "function": { "expression": "COUNT_DISTINCT", @@ -263,8 +250,7 @@ "gmv_min", "gmv_max", "trans_cnt", - "item_count_sum", - "seller_cnt_long" + "item_count_sum" ] } ] http://git-wip-us.apache.org/repos/asf/kylin/blob/623e70f4/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json -- diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json index 7e6934b..2f314f0 100644 --- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json +++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json @@ -151,19 +151,6 @@ }, { "id": 7, - "name": "SELLER_CNT_LONG", - "function": { -"expression": "COUNT_DISTINCT", -"parameter": { - "type": "column", - "value": "SELLER_ID" -}, -"returntype": "bigint" - }, - "dependent_measure_ref": "SELLER_CNT_HLL" -}, -{ - "id": 8, "name": "SELLER_FORMAT_CNT", "function": { "expression": "COUNT_DISTINCT", @@ -263,8 +250,7 @@ "gmv_min", "gmv_max", "trans_cnt", - "item_count_sum", - "seller_cnt_long" + "item_count_sum" ] } ]
[41/50] [abbrv] kylin git commit: KYLIN-976 Support Custom Aggregation Types
KYLIN-976 Support Custom Aggregation Types Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/c721d679 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/c721d679 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/c721d679 Branch: refs/heads/1.x-HBase1.1.3 Commit: c721d679727b0345a7fcdd8335a088e7c336aacc Parents: cdea731 Author: honmaAuthored: Fri Dec 11 16:08:59 2015 +0800 Committer: honma Committed: Tue Dec 15 16:50:58 2015 +0800 -- .../org/apache/kylin/common/KylinConfig.java| 40 +- .../common/hll/HyperLogLogPlusCounter.java | 87 +++- .../org/apache/kylin/common/util/BytesUtil.java | 16 + .../apache/kylin/common/util/Dictionary.java| 199 + .../kylin/cube/CubeCapabilityChecker.java | 147 --- .../org/apache/kylin/cube/CubeInstance.java | 20 +- .../java/org/apache/kylin/cube/CubeManager.java | 6 +- .../java/org/apache/kylin/cube/CubeSegment.java | 14 +- .../cube/estimation/CubeSizeEstimationCLI.java | 4 +- .../kylin/cube/kv/AbstractRowKeyEncoder.java| 2 +- .../apache/kylin/cube/kv/RowKeyColumnIO.java| 2 +- .../apache/kylin/cube/kv/RowKeyColumnOrder.java | 2 +- .../apache/kylin/cube/kv/RowValueDecoder.java | 27 +- .../org/apache/kylin/cube/model/CubeDesc.java | 61 ++- .../apache/kylin/cube/model/v1/CubeDesc.java| 9 - .../model/validation/rule/FunctionRule.java | 33 +- .../kylin/cube/DictionaryManagerTest.java | 2 +- .../kylin/cube/kv/RowValueDecoderTest.java | 6 +- .../metadata/measure/MeasureCodecTest.java | 3 +- cube/src/test/resources/data/TEST1_desc.json| 7 +- cube/src/test/resources/data/TEST2_desc.json| 7 +- cube/src/test/resources/data/TEST3_desc.json| 418 +++ .../apache/kylin/dict/DateStrDictionary.java| 1 + .../java/org/apache/kylin/dict/Dictionary.java | 199 - .../apache/kylin/dict/DictionaryGenerator.java | 91 ++-- .../org/apache/kylin/dict/DictionaryInfo.java | 1 + .../kylin/dict/DictionaryInfoSerializer.java| 1 + .../apache/kylin/dict/DictionaryManager.java| 1 + .../java/org/apache/kylin/dict/ISegment.java| 3 +- .../dict/MultipleDictionaryValueEnumerator.java | 1 + .../org/apache/kylin/dict/TrieDictionary.java | 1 + .../apache/kylin/dict/lookup/SnapshotTable.java | 2 +- .../test_kylin_cube_without_slr_desc.json | 7 +- ...t_kylin_cube_without_slr_left_join_desc.json | 7 +- .../invertedindex/IICapabilityChecker.java | 182 .../apache/kylin/invertedindex/IIInstance.java | 16 +- .../apache/kylin/invertedindex/IIManager.java | 2 +- .../apache/kylin/invertedindex/IISegment.java | 4 +- .../invertedindex/index/BitMapContainer.java| 2 +- .../index/CompressedValueContainer.java | 2 +- .../invertedindex/index/RawTableRecord.java | 2 +- .../invertedindex/index/TableRecordInfo.java| 2 +- .../index/TableRecordInfoDigest.java| 2 +- .../kylin/invertedindex/model/IIDesc.java | 4 + .../invertedindex/IIInstanceTest.java | 2 +- .../invertedindex/InvertedIndexLocalTest.java | 2 +- .../kylin/job/hadoop/cube/BaseCuboidMapper.java | 76 ++-- .../kylin/job/hadoop/cube/CubeHFileMapper.java | 4 +- .../apache/kylin/job/hadoop/cube/CuboidJob.java | 5 +- .../kylin/job/hadoop/cube/CuboidReducer.java| 6 +- .../job/hadoop/cube/MergeCuboidMapper.java | 57 ++- .../job/hadoop/cube/NewBaseCuboidMapper.java| 346 --- .../kylin/job/dataGen/FactTableGenerator.java | 2 +- .../job/hadoop/cube/BaseCuboidMapperTest.java | 7 +- .../job/hadoop/cube/CubeHFileMapper2Test.java | 2 +- .../kylin/job/hadoop/cube/CubeReducerTest.java | 2 +- .../job/hadoop/cube/MergeCuboidMapperTest.java | 2 +- .../job/hadoop/cube/NDCuboidMapperTest.java | 17 +- .../apache/kylin/measure/MeasureAggregator.java | 78 .../kylin/measure/MeasureAggregators.java | 81 .../org/apache/kylin/measure/MeasureCodec.java | 79 .../apache/kylin/measure/MeasureIngester.java | 48 +++ .../org/apache/kylin/measure/MeasureType.java | 146 +++ .../kylin/measure/MeasureTypeFactory.java | 93 + .../kylin/measure/basic/BasicMeasureType.java | 152 +++ .../kylin/measure/basic/BigDecimalIngester.java | 41 ++ .../measure/basic/BigDecimalMaxAggregator.java | 56 +++ .../measure/basic/BigDecimalMinAggregator.java | 57 +++ .../measure/basic/BigDecimalSumAggregator.java | 53 +++ .../kylin/measure/basic/DoubleIngester.java | 46 ++ .../measure/basic/DoubleMaxAggregator.java | 55 +++ .../measure/basic/DoubleMinAggregator.java | 55 +++ .../measure/basic/DoubleSumAggregator.java | 52 +++ .../kylin/measure/basic/LongIngester.java | 46 ++
[45/50] [abbrv] kylin git commit: Merge branch 'v1.2-release-fourth-try' into 1.x-staging
Merge branch 'v1.2-release-fourth-try' into 1.x-staging Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/11946ae0 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/11946ae0 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/11946ae0 Branch: refs/heads/1.x-HBase1.1.3 Commit: 11946ae0db1add87f52c8e1ecad9a2ff5bf5d29e Parents: 7f99c3b 390c4e7 Author: shaofengshiAuthored: Tue Dec 22 16:28:47 2015 +0800 Committer: shaofengshi Committed: Tue Dec 22 16:28:47 2015 +0800 -- atopcalcite/pom.xml | 2 +- common/pom.xml| 2 +- cube/pom.xml | 2 +- dictionary/pom.xml| 2 +- invertedindex/pom.xml | 2 +- jdbc/pom.xml | 2 +- job/pom.xml | 2 +- metadata/pom.xml | 2 +- monitor/pom.xml | 2 +- pom.xml | 2 +- query/pom.xml | 2 +- server/pom.xml| 2 +- storage/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) --
[03/50] [abbrv] kylin git commit: KYLIN-980 spill to disk when sys available memory is low
KYLIN-980 spill to disk when sys available memory is low Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/0f8fc239 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/0f8fc239 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/0f8fc239 Branch: refs/heads/1.x-HBase1.1.3 Commit: 0f8fc239162bbca913b1eceb380d89f674928400 Parents: 4c44080 Author: shaofengshiAuthored: Wed Nov 25 14:38:14 2015 +0800 Committer: shaofengshi Committed: Wed Nov 25 14:40:07 2015 +0800 -- .../common/util/MemoryBudgetController.java | 249 +++ .../hadoop/cube/FactDistinctColumnsReducer.java | 33 ++- 2 files changed, 274 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/0f8fc239/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java -- diff --git a/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java b/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java new file mode 100644 index 000..4715ef6 --- /dev/null +++ b/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java @@ -0,0 +1,249 @@ +/* + * 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 com.google.common.base.Preconditions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.locks.ReentrantLock; + +public class MemoryBudgetController { + +private static final boolean debug = true; + +public interface MemoryConsumer { +// return number MB released +int freeUp(int mb); +} + +@SuppressWarnings("serial") +public static class NotEnoughBudgetException extends IllegalStateException { + +public NotEnoughBudgetException() { +super(); +} + +public NotEnoughBudgetException(Throwable cause) { +super(cause); +} +} + +private static class ConsumerEntry { +final MemoryConsumer consumer; +int reservedMB; + +ConsumerEntry(MemoryConsumer consumer) { +this.consumer = consumer; +} +} + +public static final MemoryBudgetController ZERO_BUDGET = new MemoryBudgetController(0); +public static final int ONE_MB = 1024 * 1024; +public static final long ONE_GB = 1024 * 1024 * 1024; + +private static final Logger logger = LoggerFactory.getLogger(MemoryBudgetController.class); + +// all budget numbers are in MB +private final int totalBudgetMB; +private final ConcurrentHashMap booking = new ConcurrentHashMap (); +private int totalReservedMB; +private final ReentrantLock lock = new ReentrantLock(); + +public MemoryBudgetController(int totalBudgetMB) { +Preconditions.checkArgument(totalBudgetMB >= 0); +Preconditions.checkState(totalBudgetMB <= getSystemAvailMB()); +this.totalBudgetMB = totalBudgetMB; +this.totalReservedMB = 0; +} + +public int getTotalBudgetMB() { +return totalBudgetMB; +} + +public int getTotalReservedMB() { +lock.lock(); +try { +return totalReservedMB; +} finally { +lock.unlock(); +} +} + +public int getRemainingBudgetMB() { +lock.lock(); +try { +return totalBudgetMB - totalReservedMB; +} finally { +lock.unlock(); +} +} + +public void reserveInsist(MemoryConsumer consumer, int requestMB) { +long waitStart = 0; +while (true) { +try { +reserve(consumer, requestMB); +if (debug && waitStart > 0) +logger.debug(consumer + " waited " + (System.currentTimeMillis() - waitStart) + " ms on the " + requestMB + " MB
[18/50] [abbrv] kylin git commit: KYLIN-1168 bug fix
KYLIN-1168 bug fix Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/95bc7dfa Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/95bc7dfa Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/95bc7dfa Branch: refs/heads/1.x-HBase1.1.3 Commit: 95bc7dfa6d892ac01000f45152f45979b5150c7f Parents: 62012ad Author: shaofengshiAuthored: Fri Dec 4 17:07:16 2015 +0800 Committer: shaofengshi Committed: Fri Dec 4 17:07:16 2015 +0800 -- .../src/main/java/org/apache/kylin/rest/service/CacheService.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/95bc7dfa/server/src/main/java/org/apache/kylin/rest/service/CacheService.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java index 398577d..38d7400 100644 --- a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java +++ b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java @@ -90,8 +90,6 @@ public class CacheService extends BasicService { // new data model getMetadataManager().reloadDataModelDesc(cacheKey); } -IIDescManager.clearCache(); -CubeDescManager.clearCache(); break; case ALL: MetadataManager.clearCache();
[12/50] [abbrv] kylin git commit: upgrade website content from incubator-kylin to kylin
upgrade website content from incubator-kylin to kylin Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/316bc048 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/316bc048 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/316bc048 Branch: refs/heads/1.x-HBase1.1.3 Commit: 316bc048376618577885857496a89e2c57aba7fd Parents: 7888c87 Author: honmaAuthored: Wed Dec 2 16:03:24 2015 +0800 Committer: honma Committed: Wed Dec 2 16:03:24 2015 +0800 -- README.md | 10 ++-- docs/README.md | 2 +- website/README.md | 6 +-- website/_config.yml | 4 +- website/_config_prod.yml| 2 +- website/_dev/dev_env.md | 2 +- website/_dev/howto_docs.md | 6 +-- website/_dev/howto_package.md | 2 +- website/_dev/howto_release.md | 48 ++-- website/_dev/index.md | 6 +-- website/_docs/index.md | 2 +- website/_docs/install/index.cn.md | 2 +- website/_docs/install/index.md | 2 +- website/_docs/release_notes.md | 16 +++ website/_includes/footer.html | 42 - website/_includes/head.cn.html | 6 +-- website/_includes/head.html | 6 +-- website/_includes/header.cn.html| 2 +- website/_includes/header.html | 2 +- .../2015-06-10-release-v0.7.1-incubating.md | 4 +- website/_posts/blog/2015-08-15-fast-cubing.md | 4 +- .../blog/2015-09-06-release-v1.0-incubating.md | 4 +- .../blog/2015-09-09-fast-cubing-on-spark.md | 2 +- .../2015-10-25-release-v1.1-incubating.cn.md| 4 +- .../blog/2015-10-25-release-v1.1-incubating.md | 4 +- website/community/index.md | 10 ++-- website/community/poweredby.md | 2 +- website/download/index.cn.md| 23 +- website/download/index.md | 22 - 29 files changed, 121 insertions(+), 126 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/316bc048/README.md -- diff --git a/README.md b/README.md index 73313f5..176d89c 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,20 @@ Apache Kylin Apache Kylin is an open source Distributed Analytics Engine, contributed by eBay Inc., provides SQL interface and multi-dimensional analysis (OLAP) on Hadoop supporting extremely large datasets. -For more details, see the website [http://kylin.incubator.apache.org](http://kylin.incubator.apache.org). +For more details, see the website [http://kylin.apache.org](http://kylin.apache.org). Documentation = -Please refer to [http://kylin.incubator.apache.org/docs/](http://kylin.incubator.apache.org/docs/). +Please refer to [http://kylin.apache.org/docs/](http://kylin.apache.org/docs/). Get Help -The fastest way to get response from our developers is to send email to our mail list , -and remember to subscribe our mail list via +The fastest way to get response from our developers is to send email to our mail list , +and remember to subscribe our mail list via Licnese -Please refer to [LICENSE](https://github.com/apache/incubator-kylin/blob/master/LICENSE) file. +Please refer to [LICENSE](https://github.com/apache/kylin/blob/master/LICENSE) file. http://git-wip-us.apache.org/repos/asf/kylin/blob/316bc048/docs/README.md -- diff --git a/docs/README.md b/docs/README.md index 166f9fd..22b84f9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Apache Kylin Documentation __All documentations have been moved to Kylin website at:__ -[http://kylin.incubator.apache.org/docs](http://kylin.incubator.apache.org/docs) +[http://kylin.apache.org/docs](http://kylin.apache.org/docs) Please visit there for furthe reference. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/316bc048/website/README.md -- diff --git a/website/README.md b/website/README.md index 873ea58..4f0f8a2 100644 --- a/website/README.md +++ b/website/README.md @@ -19,7 +19,7 @@ limitations under the License. # Apache Kylin website This directory contains the source code for
[07/50] [abbrv] kylin git commit: KYLIN-1168 fix UT
KYLIN-1168 fix UT Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/0f5b1561 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/0f5b1561 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/0f5b1561 Branch: refs/heads/1.x-HBase1.1.3 Commit: 0f5b1561712b290a00c100e00faf97f430742698 Parents: 04c6607 Author: shaofengshiAuthored: Thu Nov 26 11:27:56 2015 +0800 Committer: shaofengshi Committed: Thu Nov 26 11:27:56 2015 +0800 -- .../org/apache/kylin/rest/controller/CubeController.java | 1 + .../java/org/apache/kylin/rest/service/CacheService.java | 7 +-- .../org/apache/kylin/rest/service/CacheServiceTest.java | 11 --- 3 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/0f5b1561/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java index 8565d5e..f27f312 100644 --- a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java +++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java @@ -414,6 +414,7 @@ public class CubeController extends BasicController { if (updateModelSuccess == true && updateCubeSuccess == false ) { // recover data model try { +oldModelDesc.setLastModified(modelDesc.getLastModified()); metadataManager.updateDataModelDesc(oldModelDesc); } catch (IOException e) { logger.error("Failed to recover data model desc:" + e.getLocalizedMessage(), e); http://git-wip-us.apache.org/repos/asf/kylin/blob/0f5b1561/server/src/main/java/org/apache/kylin/rest/service/CacheService.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java index c953b7e..7a3238c 100644 --- a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java +++ b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java @@ -59,8 +59,10 @@ public class CacheService extends BasicService { cleanProjectCacheByRealization(RealizationType.CUBE, cacheKey); break; case CUBE_DESC: -String modelName = getCubeDescManager().getCubeDesc(cacheKey).getModelName(); -getMetadataManager().reloadDataModelDesc(modelName); +if (getCubeDescManager().getCubeDesc(cacheKey) != null) { +String modelName = getCubeDescManager().getCubeDesc(cacheKey).getModelName(); +getMetadataManager().reloadDataModelDesc(modelName); +} getCubeDescManager().reloadCubeDesc(cacheKey); IIDescManager.clearCache(); CubeDescManager.clearCache(); @@ -143,4 +145,5 @@ public class CacheService extends BasicService { throw new RuntimeException("error " + log, e); } } + } http://git-wip-us.apache.org/repos/asf/kylin/blob/0f5b1561/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java -- diff --git a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java index 0436dc9..44755d4 100644 --- a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java +++ b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java @@ -47,17 +47,13 @@ import org.apache.kylin.rest.broadcaster.BroadcasterReceiveServlet; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.*; import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; /** - * Created by qianzhou on 1/16/15. */ - +@Ignore ("Not working for some time") public class CacheServiceTest extends LocalFileMetadataTestCase { private static Server server; @@ -281,6 +277,7 @@ public class CacheServiceTest extends LocalFileMetadataTestCase { } @Test +//@Ignore ("disable this as only data model change will not trigger a broad cast event, see KYLIN-1168") public void testMetaCRUD()
[28/50] [abbrv] kylin git commit: KYLIN-1215 minor, update website member's info on community page
KYLIN-1215 minor, update website member's info on community page Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b8d7d43d Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b8d7d43d Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b8d7d43d Branch: refs/heads/1.x-HBase1.1.3 Commit: b8d7d43d6e4969a0b856f9eaf33c7c499c9747f8 Parents: d5f3d6c Author: Xiaoyu WangAuthored: Wed Dec 9 13:07:10 2015 +0800 Committer: Xiaoyu Wang Committed: Wed Dec 9 13:07:10 2015 +0800 -- website/_data/contributors.yml | 16 1 file changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/b8d7d43d/website/_data/contributors.yml -- diff --git a/website/_data/contributors.yml b/website/_data/contributors.yml index 41145f3..d32b93f 100644 --- a/website/_data/contributors.yml +++ b/website/_data/contributors.yml @@ -91,28 +91,28 @@ org: eBay role: PMC - name: Dayue Gao (é«å¤§æ) - apacheId: + apacheId: gaodayue githubId: gaodayue org: Meituan role: PMC - name: Hua Huang (é»æ¡¦) - apacheId: + apacheId: hhuang githubId: superhua org: MiningLAMP - role: PMC + role: PMC - name: Dong Li (ææ ) - apacheId: lidong + apacheId: lidong githubId: lidongsjtu org: eBay - role: committer + role: committer - name: Xiaoyu Wang (çæé¨) apacheId: wangxiaoyu - githubId: + githubId: xiaowangyu org: JD.com - role: committer + role: committer - name: Yerui Sun (åå¶é) apacheId: sunyerui - githubId: + githubId: sunyerui org: Meituan role: PMC
[21/50] [abbrv] kylin git commit: KYLIN-1205 Make HBase scan parameters configurable and allow reset of HConnection
KYLIN-1205 Make HBase scan parameters configurable and allow reset of HConnection Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b0c5fd3b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b0c5fd3b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b0c5fd3b Branch: refs/heads/1.x-HBase1.1.3 Commit: b0c5fd3bc7cce69dd5f0413d172fd7c7a79d9f5a Parents: e85b243 Author: Li, YangAuthored: Tue Dec 8 10:43:03 2015 +0800 Committer: Li, Yang Committed: Tue Dec 8 10:43:03 2015 +0800 -- .../org/apache/kylin/common/KylinConfig.java | 8 .../common/persistence/HBaseConnection.java | 4 .../apache/kylin/rest/service/CacheService.java | 2 ++ .../storage/hbase/CubeSegmentTupleIterator.java | 19 +++ 4 files changed, 29 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/common/src/main/java/org/apache/kylin/common/KylinConfig.java -- diff --git a/common/src/main/java/org/apache/kylin/common/KylinConfig.java b/common/src/main/java/org/apache/kylin/common/KylinConfig.java index 9645b81..7816487 100644 --- a/common/src/main/java/org/apache/kylin/common/KylinConfig.java +++ b/common/src/main/java/org/apache/kylin/common/KylinConfig.java @@ -499,7 +499,15 @@ public class KylinConfig { public int getHBaseKeyValueSize() { return Integer.parseInt(this.getOptional("kylin.hbase.client.keyvalue.maxsize", "10485760")); } + +public int getHBaseScanCacheRows() { +return Integer.parseInt(this.getOptional("kylin.hbase.scan.cache_rows", "1024")); +} +public int getHBaseScanMaxResultSize() { +return Integer.parseInt(this.getOptional("kylin.hbase.scan.max_result_size", "" + (5 * 1024 * 1024))); // 5 MB +} + public String getHbaseDefaultCompressionCodec() { return getOptional(HTABLE_DEFAULT_COMPRESSION_CODEC, ""); http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java -- diff --git a/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java index dcefc24..9c86376 100644 --- a/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java +++ b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java @@ -58,6 +58,10 @@ public class HBaseConnection { } }); } + +public static void clearCache() { +ConnPool.clear(); +} public static HConnection get(String url) { // find configuration http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java index 38d7400..2328592 100644 --- a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java +++ b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java @@ -21,6 +21,7 @@ package org.apache.kylin.rest.service; import java.io.IOException; import java.util.List; +import org.apache.kylin.common.persistence.HBaseConnection; import org.apache.kylin.common.restclient.Broadcaster; import org.apache.kylin.cube.CubeDescManager; import org.apache.kylin.cube.CubeManager; @@ -101,6 +102,7 @@ public class CacheService extends BasicService { RealizationRegistry.clearCache(); ProjectManager.clearCache(); BasicService.resetOLAPDataSources(); +HBaseConnection.clearCache(); break; default: throw new RuntimeException("invalid cacheType:" + cacheType); http://git-wip-us.apache.org/repos/asf/kylin/blob/b0c5fd3b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java -- diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java index 9efbb79..fa4ccd7 100644 --- a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java +++ b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeSegmentTupleIterator.java @@ -38,6 +38,7 @@ import org.apache.hadoop.hbase.filter.Filter; import
[11/50] [abbrv] kylin git commit: KYLIN-1190 Make memory budget per query configurable
KYLIN-1190 Make memory budget per query configurable 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/7888c87f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7888c87f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7888c87f Branch: refs/heads/1.x-HBase1.1.3 Commit: 7888c87fa190e950227eee80d59f8a108b93a18f Parents: e280002 Author: lidongsjtu Authored: Tue Dec 1 16:32:17 2015 +0800 Committer: Li, Yang Committed: Wed Dec 2 11:11:59 2015 +0800 -- .../main/java/org/apache/kylin/common/KylinConfig.java| 4 .../org/apache/kylin/storage/hbase/CubeStorageEngine.java | 10 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7888c87f/common/src/main/java/org/apache/kylin/common/KylinConfig.java -- diff --git a/common/src/main/java/org/apache/kylin/common/KylinConfig.java b/common/src/main/java/org/apache/kylin/common/KylinConfig.java index a8f7c5d..9645b81 100644 --- a/common/src/main/java/org/apache/kylin/common/KylinConfig.java +++ b/common/src/main/java/org/apache/kylin/common/KylinConfig.java @@ -492,6 +492,10 @@ public class KylinConfig { return Boolean.parseBoolean(this.getOptional("kylin.query.cache.enabled", "true")); } +public long getQueryMemBudget() { +return Long.parseLong(this.getOptional("kylin.query.mem.budget", String.valueOf(3L * 1024 * 1024 * 1024))); +} + public int getHBaseKeyValueSize() { return Integer.parseInt(this.getOptional("kylin.hbase.client.keyvalue.maxsize", "10485760")); } http://git-wip-us.apache.org/repos/asf/kylin/blob/7888c87f/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java -- diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java index ed12781..bbf088e 100644 --- a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java +++ b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java @@ -76,7 +76,6 @@ public class CubeStorageEngine implements IStorageEngine { private static final Logger logger = LoggerFactory.getLogger(CubeStorageEngine.class); private static final int MERGE_KEYRANGE_THRESHOLD = 100; -private static final long MEM_BUDGET_PER_QUERY = 3L * 1024 * 1024 * 1024; // 3G private final CubeInstance cubeInstance; private final CubeDesc cubeDesc; @@ -643,8 +642,13 @@ public class CubeStorageEngine implements IStorageEngine { } } -long rowEst = MEM_BUDGET_PER_QUERY / rowSizeEst; -context.setThreshold((int) rowEst); +long rowEst = this.cubeInstance.getConfig().getQueryMemBudget() / rowSizeEst; +if (rowEst > 0) { +logger.info("Memory budget is set to: " + rowEst); +context.setThreshold((int) rowEst); +} else { +logger.info("Memory budget is not set."); +} } private void setLimit(TupleFilter filter, StorageContext context) {
[39/50] [abbrv] kylin git commit: KYLIN-976 Support Custom Aggregation Types
http://git-wip-us.apache.org/repos/asf/kylin/blob/c721d679/metadata/src/main/java/org/apache/kylin/measure/MeasureType.java -- diff --git a/metadata/src/main/java/org/apache/kylin/measure/MeasureType.java b/metadata/src/main/java/org/apache/kylin/measure/MeasureType.java new file mode 100644 index 000..66ca209 --- /dev/null +++ b/metadata/src/main/java/org/apache/kylin/measure/MeasureType.java @@ -0,0 +1,146 @@ +/* + * 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.measure; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.apache.kylin.common.util.Dictionary; +import org.apache.kylin.metadata.model.FunctionDesc; +import org.apache.kylin.metadata.model.MeasureDesc; +import org.apache.kylin.metadata.model.TblColRef; +import org.apache.kylin.metadata.realization.CapabilityResult.CapabilityInfluence; +import org.apache.kylin.metadata.realization.SQLDigest; +import org.apache.kylin.metadata.tuple.Tuple; +import org.apache.kylin.metadata.tuple.TupleInfo; + +/** + * MeasureType captures how a kind of aggregation is defined, how it is calculated + * during cube build, and how it is involved in query and storage scan. + * + * @param the Java type of aggregation data object, e.g. HyperLogLogPlusCounter + */ +abstract public class MeasureType { + +/* + * Define + * */ + +/** Validates a user defined FunctionDesc has expected parameter etc. Throw IllegalArgumentException if anything wrong. */ +public void validate(FunctionDesc functionDesc) throws IllegalArgumentException { +return; +} + +/** Although most aggregated object takes only 8 bytes like long or double, + * some advanced aggregation like HyperLogLog or TopN can consume more than 10 KB for + * each object, which requires special care on memory allocation. */ +public boolean isMemoryHungry() { +return false; +} + +/* + * Build + * */ + +/** Return a MeasureIngester which knows how to init aggregation object from raw records. */ +abstract public MeasureIngester newIngester(); + +/** Return a MeasureAggregator which does aggregation. */ +abstract public MeasureAggregator newAggregator(); + +/** Some special measures need dictionary to encode column values for optimal storage. TopN is an example. */ +public List getColumnsNeedDictionary(FunctionDesc functionDesc) { +return Collections.emptyList(); +} + +/* + * Cube Selection + * */ + +/** + * Some special measures hold columns which are usually treated as dimensions (or vice-versa). + * This is where they override to influence cube capability check. + * + * A SQLDigest contains dimensions and measures extracted from a query. After comparing to + * cube definition, the matched dimensions and measures are crossed out, and what's left is + * the unmatchedDimensions and unmatchedAggregations. + * + * Each measure type on the cube is then called on this method to check if any of the unmatched + * can be fulfilled. If a measure type cannot fulfill any of the unmatched, it simply return null. + * Or otherwise, unmatchedDimensions and unmatchedAggregations must + * be modified to drop the satisfied dimension or measure, and a CapabilityInfluence object + * must be returned to mark the contribution of this measure type. + */ +public CapabilityInfluence influenceCapabilityCheck(Collection unmatchedDimensions, Collection unmatchedAggregations, SQLDigest digest, MeasureDesc measureDesc) { +return null; +} + +/*
[04/50] [abbrv] kylin git commit: KYLIN-1160 Set default logging configuration in JDBC and Backend code
KYLIN-1160 Set default logging configuration in JDBC and Backend code 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/b7b6793f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b7b6793f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b7b6793f Branch: refs/heads/1.x-HBase1.1.3 Commit: b7b6793f814eff6eda6bff6eaef22106e11b789c Parents: 2b0c3a5 Author: lidongsjtu Authored: Tue Nov 24 14:06:46 2015 +0800 Committer: Li, Yang Committed: Wed Nov 25 15:15:35 2015 +0800 -- .../org/apache/kylin/common/KylinConfig.java| 4 +++ .../kylin/common/util/Log4jConfigurer.java | 37 .../main/java/org/apache/kylin/jdbc/Driver.java | 2 ++ .../java/org/apache/kylin/jdbc/KylinClient.java | 4 +-- .../org/apache/kylin/jdbc/KylinConnection.java | 4 +-- .../kylin/jdbc/util/DefaultLoggerFactory.java | 21 --- .../util/DefaultSslProtocolSocketFactory.java | 5 +-- .../jdbc/util/DefaultX509TrustManager.java | 13 +++ .../apache/kylin/jdbc/util/Log4jConfigurer.java | 37 9 files changed, 94 insertions(+), 33 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/b7b6793f/common/src/main/java/org/apache/kylin/common/KylinConfig.java -- diff --git a/common/src/main/java/org/apache/kylin/common/KylinConfig.java b/common/src/main/java/org/apache/kylin/common/KylinConfig.java index edb2586..a8f7c5d 100644 --- a/common/src/main/java/org/apache/kylin/common/KylinConfig.java +++ b/common/src/main/java/org/apache/kylin/common/KylinConfig.java @@ -35,6 +35,7 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.apache.kylin.common.restclient.RestClient; import org.apache.kylin.common.util.CliCommandExecutor; +import org.apache.kylin.common.util.Log4jConfigurer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -243,12 +244,15 @@ public class KylinConfig { * @return */ private static KylinConfig loadKylinConfig() { +Log4jConfigurer.initLogger(); + InputStream is = getKylinPropertiesAsInputSteam(); if (is == null) { throw new IllegalArgumentException("Failed to load kylin config"); } KylinConfig config = new KylinConfig(); config.reloadKylinConfig(is); + return config; } http://git-wip-us.apache.org/repos/asf/kylin/blob/b7b6793f/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java -- diff --git a/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java b/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java new file mode 100644 index 000..c329ced --- /dev/null +++ b/common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java @@ -0,0 +1,37 @@ +package org.apache.kylin.common.util; + +import java.util.Enumeration; + +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.apache.log4j.PatternLayout; + +/** + * Created by dongli on 11/24/15. + */ +public class Log4jConfigurer { +private final static String DEFAULT_PATTERN_LAYOUT = "L4J [%d{-MM-dd HH:mm:ss,SSS}][%p][%c] - %m%n"; +private static boolean INITIALIZED = false; + +public static void initLogger() { +if (!INITIALIZED && !isConfigured()) { +org.apache.log4j.BasicConfigurator.configure(new ConsoleAppender(new PatternLayout(DEFAULT_PATTERN_LAYOUT))); +INITIALIZED = true; +} +} + +private static boolean isConfigured() { +if (LogManager.getRootLogger().getAllAppenders().hasMoreElements()) { +return true; +} else { +Enumeration loggers = LogManager.getCurrentLoggers(); +while (loggers.hasMoreElements()) { +Logger logger = (Logger) loggers.nextElement(); +if (logger.getAllAppenders().hasMoreElements()) +return true; +} +} +return false; +} +} http://git-wip-us.apache.org/repos/asf/kylin/blob/b7b6793f/jdbc/src/main/java/org/apache/kylin/jdbc/Driver.java -- diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/Driver.java b/jdbc/src/main/java/org/apache/kylin/jdbc/Driver.java index b58e8ff..a0074b1 100644 --- a/jdbc/src/main/java/org/apache/kylin/jdbc/Driver.java +++ b/jdbc/src/main/java/org/apache/kylin/jdbc/Driver.java @@ -25,6 +25,7 @@ import org.apache.calcite.avatica.AvaticaConnection; import
[33/50] [abbrv] kylin git commit: [maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare for next development iteration Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/390c4e7a Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/390c4e7a Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/390c4e7a Branch: refs/heads/1.x-HBase1.1.3 Commit: 390c4e7ad2278563a1a224d7b4090093cd9b55c7 Parents: c2589ae Author: shaofengshiAuthored: Tue Dec 15 13:50:39 2015 +0800 Committer: shaofengshi Committed: Tue Dec 15 13:50:39 2015 +0800 -- atopcalcite/pom.xml | 2 +- common/pom.xml| 2 +- cube/pom.xml | 2 +- dictionary/pom.xml| 2 +- invertedindex/pom.xml | 2 +- jdbc/pom.xml | 2 +- job/pom.xml | 2 +- metadata/pom.xml | 2 +- monitor/pom.xml | 2 +- pom.xml | 2 +- query/pom.xml | 2 +- server/pom.xml| 2 +- storage/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/atopcalcite/pom.xml -- diff --git a/atopcalcite/pom.xml b/atopcalcite/pom.xml index 2833b71..03c926c 100644 --- a/atopcalcite/pom.xml +++ b/atopcalcite/pom.xml @@ -27,7 +27,7 @@ org.apache.kylin kylin -1.2 +1.3-SNAPSHOT http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/common/pom.xml -- diff --git a/common/pom.xml b/common/pom.xml index 1e7d5b2..2f01bde 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -27,7 +27,7 @@ org.apache.kylin kylin -1.2 +1.3-SNAPSHOT http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/cube/pom.xml -- diff --git a/cube/pom.xml b/cube/pom.xml index 7c4038f..b4fa9da 100644 --- a/cube/pom.xml +++ b/cube/pom.xml @@ -27,7 +27,7 @@ org.apache.kylin kylin -1.2 +1.3-SNAPSHOT http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/dictionary/pom.xml -- diff --git a/dictionary/pom.xml b/dictionary/pom.xml index f0b2d13..ce86c66 100644 --- a/dictionary/pom.xml +++ b/dictionary/pom.xml @@ -27,7 +27,7 @@ org.apache.kylin kylin -1.2 +1.3-SNAPSHOT http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/invertedindex/pom.xml -- diff --git a/invertedindex/pom.xml b/invertedindex/pom.xml index c8d72b8..7fa3e52 100644 --- a/invertedindex/pom.xml +++ b/invertedindex/pom.xml @@ -21,7 +21,7 @@ kylin org.apache.kylin -1.2 +1.3-SNAPSHOT 4.0.0 kylin-invertedindex http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/jdbc/pom.xml -- diff --git a/jdbc/pom.xml b/jdbc/pom.xml index fc76490..6a1f836 100644 --- a/jdbc/pom.xml +++ b/jdbc/pom.xml @@ -27,7 +27,7 @@ org.apache.kylin kylin - 1.2 + 1.3-SNAPSHOT http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/job/pom.xml -- diff --git a/job/pom.xml b/job/pom.xml index 23085d0..c6b8b01 100644 --- a/job/pom.xml +++ b/job/pom.xml @@ -22,7 +22,7 @@ org.apache.kylin kylin -1.2 +1.3-SNAPSHOT kylin-job http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/metadata/pom.xml -- diff --git a/metadata/pom.xml b/metadata/pom.xml index 5ea8b13..c7c849f 100644 --- a/metadata/pom.xml +++ b/metadata/pom.xml @@ -27,7 +27,7 @@ org.apache.kylin kylin -1.2 +1.3-SNAPSHOT http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/monitor/pom.xml -- diff --git a/monitor/pom.xml b/monitor/pom.xml index b67969d..820934f 100644 --- a/monitor/pom.xml +++ b/monitor/pom.xml @@ -22,7 +22,7 @@ org.apache.kylin kylin -1.2 +1.3-SNAPSHOT 4.0.0 http://git-wip-us.apache.org/repos/asf/kylin/blob/390c4e7a/pom.xml -- diff --git a/pom.xml b/pom.xml index b1c81e2..06a9043 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ org.apache.kylin kylin
[06/50] [abbrv] kylin git commit: KYLIN-1168 fix "Update data model is not allowed! Please create a new cube if needed" error
KYLIN-1168 fix "Update data model is not allowed! Please create a new cube if needed" error Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/04c6607f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/04c6607f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/04c6607f Branch: refs/heads/1.x-HBase1.1.3 Commit: 04c6607fee3775c7225d19ff55503e38238cecdb Parents: 55c448b Author: shaofengshiAuthored: Wed Nov 25 17:25:14 2015 +0800 Committer: shaofengshi Committed: Wed Nov 25 17:25:44 2015 +0800 -- .../kylin/metadata/model/DataModelDesc.java | 38 --- .../kylin/rest/controller/CubeController.java | 39 +--- .../apache/kylin/rest/service/CacheService.java | 8 ++-- .../apache/kylin/rest/service/CubeService.java | 2 +- 4 files changed, 31 insertions(+), 56 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/04c6607f/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java -- diff --git a/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java b/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java index 88fafdf..f8dc54d 100644 --- a/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java +++ b/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java @@ -220,44 +220,6 @@ public class DataModelDesc extends RootPersistentEntity { } } -/** - * Check whether two data model are compatible or not. Compatible means - * having the same structure. Tow models could be compatible even they - * have different UUID or last modified time. - * @param that model to compare with - * @return true if compatible, false otherwise. - */ -public boolean compatibleWith(DataModelDesc that) { -if (this == that) -return true; - -if (that == null) -return false; - -try { -String thisRepr = excludeHeaderInfo(this); -String thatRepr = excludeHeaderInfo(that); -return StringUtils.equals(thisRepr, thatRepr); - -} catch (IOException e) { -logger.error("Failed to serialize DataModelDesc to string", e); -return false; -} -} - -private String excludeHeaderInfo(DataModelDesc modelDesc) throws IOException { -// make a copy -String repr = JsonUtil.writeValueAsString(modelDesc); -DataModelDesc copy = JsonUtil.readValue(repr, DataModelDesc.class); - -copy.setUuid(null); -copy.setLastModified(0); -copy.setCapacity(RealizationCapacity.MEDIUM); -copy.setFilterCondition(null); -copy.setPartitionDesc(null); -return JsonUtil.writeValueAsString(copy); -} - @Override public String toString() { return "DataModelDesc [name=" + name + "]"; http://git-wip-us.apache.org/repos/asf/kylin/blob/04c6607f/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java index 9d1dfad..8565d5e 100644 --- a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java +++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java @@ -359,8 +359,8 @@ public class CubeController extends BasicController { } MetadataManager metadataManager = MetadataManager.getInstance(KylinConfig.getInstanceFromEnv()); -// KYLIN-958: disallow data model structure change DataModelDesc modelDesc = null; +DataModelDesc oldModelDesc = null; if (StringUtils.isNotEmpty(cubeRequest.getModelDescData())) { modelDesc = deserializeDataModelDesc(cubeRequest); if (modelDesc == null) { @@ -373,15 +373,11 @@ public class CubeController extends BasicController { return errorRequest(cubeRequest, "CubeDesc.model_name " + desc.getModelName() + " not consistent with model " + modeName); } -DataModelDesc oldModelDesc = metadataManager.getDataModelDesc(modeName); +oldModelDesc = metadataManager.getDataModelDesc(modeName); if (oldModelDesc == null) { return errorRequest(cubeRequest, "Data model " + modeName + " not found"); } -if (!modelDesc.compatibleWith(oldModelDesc)) { -return errorRequest(cubeRequest, "Update data model is not allowed! Please create a new cube if needed"); -
[40/50] [abbrv] kylin git commit: KYLIN-976 Support Custom Aggregation Types
http://git-wip-us.apache.org/repos/asf/kylin/blob/c721d679/dictionary/src/main/java/org/apache/kylin/dict/DictionaryGenerator.java -- diff --git a/dictionary/src/main/java/org/apache/kylin/dict/DictionaryGenerator.java b/dictionary/src/main/java/org/apache/kylin/dict/DictionaryGenerator.java index e399a70..0ba6566 100644 --- a/dictionary/src/main/java/org/apache/kylin/dict/DictionaryGenerator.java +++ b/dictionary/src/main/java/org/apache/kylin/dict/DictionaryGenerator.java @@ -21,15 +21,14 @@ package org.apache.kylin.dict; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.*; -import com.google.common.collect.Lists; +import com.google.common.collect.Lists; import org.apache.commons.lang.StringUtils; import org.apache.kylin.common.KylinConfig; -import org.apache.kylin.common.util.Bytes; -import org.apache.kylin.common.util.JsonUtil; +import org.apache.kylin.common.util.*; import org.apache.kylin.dict.lookup.ReadableTable; -import org.apache.kylin.metadata.model.DataType; +import org.apache.kylin.metadata.datatype.DataType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,7 +42,7 @@ public class DictionaryGenerator { private static final Logger logger = LoggerFactory.getLogger(DictionaryGenerator.class); -private static final String[] DATE_PATTERNS = new String[] { "-MM-dd", "MMdd" }; +private static final String[] DATE_PATTERNS = new String[] { "-MM-dd", "MMdd" }; private static int getDictionaryMaxCardinality() { try { @@ -53,20 +52,20 @@ public class DictionaryGenerator { } } -public static Dictionary buildDictionaryFromValueEnumerator(DictionaryInfo info, IDictionaryValueEnumerator valueEnumerator) throws IOException{ -Dictionary dict = null; +public static org.apache.kylin.common.util.Dictionary buildDictionaryFromValueEnumerator(DictionaryInfo info, IDictionaryValueEnumerator valueEnumerator) throws IOException{ +org.apache.kylin.common.util.Dictionary dict = null; int baseId = 0; // always 0 for now -final int nSamples = 5; -ArrayList samples = Lists.newArrayListWithCapacity(nSamples); +final int nSamples = 5; +ArrayList samples = Lists.newArrayListWithCapacity(nSamples); // build dict, case by data type DataType dataType = DataType.getInstance(info.getDataType()); if (dataType.isDateTimeFamily()) -dict = buildDateStrDict(valueEnumerator, baseId, nSamples, samples); +dict = buildDateStrDict(valueEnumerator, baseId, nSamples, samples); else if (dataType.isNumberFamily()) -dict = buildNumberDict(valueEnumerator, baseId, nSamples, samples); +dict = buildNumberDict(valueEnumerator, baseId, nSamples, samples); else -dict = buildStringDict(valueEnumerator, baseId, nSamples, samples); +dict = buildStringDict(valueEnumerator, baseId, nSamples, samples); // log a few samples StringBuilder buf = new StringBuilder(); @@ -76,54 +75,54 @@ public class DictionaryGenerator { buf.append(s.toString()).append("=>").append(dict.getIdFromValue(s)); } logger.info("Dictionary value samples: " + buf.toString()); -logger.info("Dictionary cardinality: " + dict.getSize()); +logger.info("Dictionary cardinality: " + dict.getSize()); -if (dict instanceof TrieDictionary && dict.getSize() > DICT_MAX_CARDINALITY) -throw new IllegalArgumentException("Too high cardinality is not suitable for dictionary -- " + info.getSourceTable() + "." + info.getSourceColumn() + " cardinality: " + dict.getSize()); +if (dict instanceof TrieDictionary && dict.getSize() > DICT_MAX_CARDINALITY) +throw new IllegalArgumentException("Too high cardinality is not suitable for dictionary -- " + info.getSourceTable() + "." + info.getSourceColumn() + " cardinality: " + dict.getSize()); return dict; } -public static Dictionary mergeDictionaries(DictionaryInfo targetInfo, List sourceDicts) throws IOException { -return buildDictionaryFromValueEnumerator(targetInfo, new MultipleDictionaryValueEnumerator(sourceDicts)); +public static org.apache.kylin.common.util.Dictionary mergeDictionaries(DictionaryInfo targetInfo, List sourceDicts) throws IOException { +return buildDictionaryFromValueEnumerator(targetInfo, new MultipleDictionaryValueEnumerator(sourceDicts)); } -public static Dictionary buildDictionary(DictionaryInfo info, ReadableTable inpTable) throws IOException { +public static org.apache.kylin.common.util.Dictionary buildDictionary(DictionaryInfo info, ReadableTable inpTable) throws IOException { // currently all data types are casted to
[22/50] [abbrv] kylin git commit: KYLIN-1128 clone cube metadata
KYLIN-1128 clone cube metadata Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9ad77cca Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9ad77cca Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9ad77cca Branch: refs/heads/1.x-HBase1.1.3 Commit: 9ad77cca832dfabb562b8e12d5e28e9e505e245d Parents: d18b73a Author: jianAuthored: Fri Dec 4 12:48:38 2015 +0800 Committer: jian Committed: Tue Dec 8 11:03:05 2015 +0800 -- .../apache/kylin/metadata/MetadataManager.java | 21 .../kylin/rest/controller/CubeController.java | 15 ++ webapp/app/js/controllers/cubes.js | 4 +--- webapp/app/partials/cubes/cube_clone.html | 13 4 files changed, 33 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9ad77cca/metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java -- diff --git a/metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java b/metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java index b540588..800ea44 100644 --- a/metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java +++ b/metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java @@ -40,6 +40,7 @@ import org.apache.kylin.common.restclient.CaseInsensitiveStringCache; import org.apache.kylin.common.util.JsonUtil; import org.apache.kylin.metadata.model.DataModelDesc; import org.apache.kylin.metadata.model.TableDesc; +import org.apache.kylin.metadata.project.ProjectManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -341,6 +342,26 @@ public class MetadataManager { return saveDataModelDesc(desc); } +// sync on update +public DataModelDesc dropModel(DataModelDesc desc) throws IOException { +logger.info("Dropping model '" + desc.getName() + "'"); +ResourceStore store = getStore(); +if (desc != null) +store.deleteResource(desc.getResourcePath()); +// clean model cache +this.afterModelDropped(desc); +return desc; +} + +private void afterModelDropped(DataModelDesc desc) { +removeModelCache(desc); +} + +private void removeModelCache(DataModelDesc desc) { +dataModelDescMap.remove(desc.getName()); +} + + private DataModelDesc saveDataModelDesc(DataModelDesc dataModelDesc) throws IOException { dataModelDesc.init(this.getAllTablesMap()); http://git-wip-us.apache.org/repos/asf/kylin/blob/9ad77cca/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java index b35a35c..95169da 100644 --- a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java +++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.UUID; import org.apache.commons.lang.StringUtils; +import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.util.JsonUtil; import org.apache.kylin.cube.CubeInstance; import org.apache.kylin.cube.CubeSegment; @@ -260,7 +261,6 @@ public class CubeController extends BasicController { @ResponseBody public CubeInstance cloneCube(@PathVariable String cubeName,@RequestBody CubeRequest cubeRequest) { String targetCubeName = cubeRequest.getCubeName(); -String targetModelName = cubeRequest.getModelDescData(); String project = cubeRequest.getProject(); CubeInstance cube = cubeService.getCubeManager().getCube(cubeName); @@ -275,11 +275,13 @@ public class CubeController extends BasicController { DataModelDesc modelDesc = metaManager.getDataModelDesc(modelName); -modelDesc.setName(targetModelName); +//model name same as cube +modelDesc.setName(targetCubeName); modelDesc.setLastModified(0); modelDesc.setUuid(UUID.randomUUID().toString()); +DataModelDesc newModel = null; try { -metaManager.createDataModelDesc(modelDesc); +newModel = metaManager.createDataModelDesc(modelDesc); } catch (IOException e) { throw new InternalErrorException("failed to clone DataModelDesc",e); } @@ -287,11 +289,16 @@ public class CubeController extends BasicController { cubeDesc.setName(targetCubeName); cubeDesc.setLastModified(0); cubeDesc.setUuid(UUID.randomUUID().toString()); -
[25/50] [abbrv] kylin git commit: KYLIN-1203 refresh model timestamp at frontend after backend updated
KYLIN-1203 refresh model timestamp at frontend after backend updated Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a1c940dd Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a1c940dd Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a1c940dd Branch: refs/heads/1.x-HBase1.1.3 Commit: a1c940dd5cffd007d62c71e3700ac71df6845973 Parents: 9ad77cc Author: jianAuthored: Tue Dec 8 15:12:55 2015 +0800 Committer: jian Committed: Tue Dec 8 15:12:55 2015 +0800 -- webapp/app/js/controllers/cubeEdit.js | 12 1 file changed, 12 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/a1c940dd/webapp/app/js/controllers/cubeEdit.js -- diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js index 2dade99..1178bee 100755 --- a/webapp/app/js/controllers/cubeEdit.js +++ b/webapp/app/js/controllers/cubeEdit.js @@ -289,6 +289,18 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio if ($scope.metaModel.model && ($scope.metaModel.model.partition_desc.partition_date_start || $scope.metaModel.model.partition_desc.partition_date_start == 0)) { $scope.metaModel.model.partition_desc.partition_date_start += new Date().getTimezoneOffset() * 6; } + +//update model last modified +$scope.statusRefresh(); + } + + $scope.statusRefresh = function(){ +ModelService.get({model_name: $scope.cubeMetaFrame.model_name}, function (model) { + if (model) { +//MetaModel.setMetaModel(model); +$scope.metaModel.model.last_modified = model.last_modified; + } +}); } $scope.updateMandatory = function (rowkey_column) {
[15/50] [abbrv] kylin git commit: KYLIN-1168 Update CubeControllerTest and JobControllerTest
KYLIN-1168 Update CubeControllerTest and JobControllerTest Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e568c46d Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e568c46d Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e568c46d Branch: refs/heads/1.x-HBase1.1.3 Commit: e568c46d9c390db40b3680dcfd7e68b6eeb0d5c6 Parents: 4c7bb8d Author: shaofengshiAuthored: Fri Dec 4 11:10:51 2015 +0800 Committer: shaofengshi Committed: Fri Dec 4 11:10:51 2015 +0800 -- .../java/org/apache/kylin/rest/controller/CubeController.java| 2 -- .../org/apache/kylin/rest/controller/CubeControllerTest.java | 4 .../java/org/apache/kylin/rest/controller/JobControllerTest.java | 4 3 files changed, 8 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/e568c46d/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java -- diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java index 42cf206..b94ded3 100644 --- a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java +++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java @@ -27,7 +27,6 @@ import java.util.Map; import java.util.UUID; import org.apache.commons.lang.StringUtils; -import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.util.JsonUtil; import org.apache.kylin.cube.CubeInstance; import org.apache.kylin.cube.CubeSegment; @@ -43,7 +42,6 @@ import org.apache.kylin.metadata.model.SegmentStatusEnum; import org.apache.kylin.metadata.project.ProjectInstance; import org.apache.kylin.metadata.project.ProjectManager; import org.apache.kylin.metadata.realization.RealizationType; -import org.apache.kylin.rest.exception.BadRequestException; import org.apache.kylin.rest.exception.ForbiddenException; import org.apache.kylin.rest.exception.InternalErrorException; import org.apache.kylin.rest.exception.NotFoundException; http://git-wip-us.apache.org/repos/asf/kylin/blob/e568c46d/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java -- diff --git a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java index bb8cb65..09ce6c5 100644 --- a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java +++ b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java @@ -28,6 +28,7 @@ import org.apache.kylin.cube.model.CubeDesc; import org.apache.kylin.cube.model.RowKeyColDesc; import org.apache.kylin.metadata.model.DataModelDesc; import org.apache.kylin.rest.request.CubeRequest; +import org.apache.kylin.rest.service.AccessService; import org.apache.kylin.rest.service.CubeService; import org.apache.kylin.rest.service.JobService; import org.apache.kylin.rest.service.ServiceTestBase; @@ -52,6 +53,8 @@ public class CubeControllerTest extends ServiceTestBase { CubeService cubeService; @Autowired JobService jobService; +@Autowired +private AccessService accessService; @Before public void setUp() throws Exception { @@ -59,6 +62,7 @@ public class CubeControllerTest extends ServiceTestBase { cubeController = new CubeController(); cubeController.setCubeService(cubeService); cubeController.setJobService(jobService); +cubeController.setAccessService(accessService); cubeDescController = new CubeDescController(); cubeDescController.setCubeService(cubeService); http://git-wip-us.apache.org/repos/asf/kylin/blob/e568c46d/server/src/test/java/org/apache/kylin/rest/controller/JobControllerTest.java -- diff --git a/server/src/test/java/org/apache/kylin/rest/controller/JobControllerTest.java b/server/src/test/java/org/apache/kylin/rest/controller/JobControllerTest.java index fccb294..24de879 100644 --- a/server/src/test/java/org/apache/kylin/rest/controller/JobControllerTest.java +++ b/server/src/test/java/org/apache/kylin/rest/controller/JobControllerTest.java @@ -33,6 +33,7 @@ import org.apache.kylin.job.dao.ExecutableDao; import org.apache.kylin.job.exception.PersistentException; import org.apache.kylin.rest.request.JobBuildRequest; import org.apache.kylin.rest.request.JobListRequest; +import org.apache.kylin.rest.service.AccessService; import org.apache.kylin.rest.service.CubeService; import
[19/50] [abbrv] kylin git commit: update website, add TM mark, added 2 companies on powered by page.
update website, add TM mark, added 2 companies on powered by page. Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9457552e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9457552e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9457552e Branch: refs/heads/1.x-HBase1.1.3 Commit: 9457552e07555a67a5b8c0389981cb5eadd59214 Parents: 95bc7df Author: lukehanAuthored: Fri Dec 4 22:50:44 2015 +0800 Committer: lukehan Committed: Fri Dec 4 22:50:44 2015 +0800 -- website/_data/contributors.yml | 30 -- website/community/poweredby.md | 5 + website/download/index.cn.md | 2 +- website/download/index.md | 2 +- website/index.cn.md| 7 +++ website/index.md | 7 +++ 6 files changed, 37 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/9457552e/website/_data/contributors.yml -- diff --git a/website/_data/contributors.yml b/website/_data/contributors.yml index dfc3d9b..17b9e38 100644 --- a/website/_data/contributors.yml +++ b/website/_data/contributors.yml @@ -39,7 +39,7 @@ githubId: julianhyde org: Hortonworks role: Mentor -- name: Luke Han (é©å¿) +- name: Luke Han (é©å¿) (Chair) apacheId: lukehan githubId: lukehan org: eBay @@ -74,12 +74,12 @@ apacheId: xduo githubId: xduo org: Alipay - role: PMC + role: Emeritus PMC - name: Ankur Bansal apacheId: abansal githubId: abansal org: eBay - role: PMC + role: Emeritus PMC - name: Xu Jiang (èæ) apacheId: jiangxu githubId: jiangxuchina @@ -94,12 +94,30 @@ apacheId: githubId: gaodayue org: Meituan - role: committer + role: PMC - name: Hua Huang (é»æ¡¦) apacheId: githubId: superhua org: MiningLAMP + role: PMC +- name: Dong Li (ææ ) + apacheId: + githubId: + org: eBay + role: committer +- name: Xiaoyu Wang (çæé¨) + apacheId: + githubId: + org: JD.com role: committer - - +- name: Dong Li (ææ ) + apacheId: + githubId: lidongsjtu + org: eBay + role: committer +- name: Yerui Sun (åå¶é) + apacheId: sunyerui + githubId: + org: Meituan + role: PMC http://git-wip-us.apache.org/repos/asf/kylin/blob/9457552e/website/community/poweredby.md -- diff --git a/website/community/poweredby.md b/website/community/poweredby.md index 10d1b93..27448cc 100644 --- a/website/community/poweredby.md +++ b/website/community/poweredby.md @@ -25,4 +25,9 @@ __Companies & Organizations__ * DreamSoft is using Apache Kylin as Big Data Analytics Engine for their customers coming from Retail, Manufacturing, Finance and others. * [Exponential](http://www.exponential.com) * Using Kylin as a component in it's data platform LAMBDA to power inventory, campaign, behavior and demand analysis for advertising. It has been great at handling the size and speed constraints of old gen systems. With the first version already in production, we are looking forward to pushing more data into kylin and achieve near real time updates. +* [Baidu Map](http://map.baidu.com/) (_NASDAQ: BIDU_) + * Apache Kylin is used for analysis Baidu Map's huge amounts of data about users, channels and etc, it performs quite fast with its own pre-calculation and index technologies along with the cubes. +* [NetEase](http://www.163.com/) (_NASDAQ: NTES_) + * Apache has been introduced as an OLAP engine for the data platform at NetEase, powering data analysis for various products & business with great performance. + http://git-wip-us.apache.org/repos/asf/kylin/blob/9457552e/website/download/index.cn.md -- diff --git a/website/download/index.cn.md b/website/download/index.cn.md index 81afb2e..ff4cacb 100644 --- a/website/download/index.cn.md +++ b/website/download/index.cn.md @@ -4,7 +4,7 @@ title: ä¸è½½ --- __ææ°åå¸(æºä»£ç )__ -ææ°åå¸çApache Kylinå¯ä»¥ä»ASFç½ç«ä¸è½½ï¼: +ææ°åå¸çApache Kylinâ¢å¯ä»¥ä»ASFç½ç«ä¸è½½ï¼: * [Apache Kylin v1.1.1-incubating](http://www.apache.org/dyn/closer.cgi/kylin/apache-kylin-1.1.1-incubating/) * [åå¸æ¥å¿](http://kylin.apache.org/docs/release_notes.html) http://git-wip-us.apache.org/repos/asf/kylin/blob/9457552e/website/download/index.md -- diff --git a/website/download/index.md b/website/download/index.md index e834ccf..eed1a4b 100644 --- a/website/download/index.md +++ b/website/download/index.md @@ -5,7 +5,7 @@ permalink: /download/index.html --- __Latest
[17/50] [abbrv] kylin git commit: KYLIN-930 list cube realization under each project
KYLIN-930 list cube realization under each project 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/62012ad5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/62012ad5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/62012ad5 Branch: refs/heads/1.x-HBase1.1.3 Commit: 62012ad564b53c2fa666444977fd21cf1f042f00 Parents: eb692f3 Author: jian Authored: Fri Dec 4 14:16:09 2015 +0800 Committer: shaofengshi Committed: Fri Dec 4 16:15:42 2015 +0800 -- webapp/app/partials/projects/project_detail.html | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/62012ad5/webapp/app/partials/projects/project_detail.html -- diff --git a/webapp/app/partials/projects/project_detail.html b/webapp/app/partials/projects/project_detail.html index 35c8ef0..2644f08 100644 --- a/webapp/app/partials/projects/project_detail.html +++ b/webapp/app/partials/projects/project_detail.html @@ -32,7 +32,7 @@ - + Cube Name @@ -40,14 +40,14 @@ - -{{cube}} -Detail + +{{item.realization}} +Detail - +
[49/50] [abbrv] kylin git commit: KYLIN-920 & KYLIN-782 Upgrade to HBase 1.1 (with help from murkrishn <murkris...@ebay.com>)
KYLIN-920 & KYLIN-782 Upgrade to HBase 1.1 (with help from murkrishn) Signed-off-by: Li, Yang Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5a871c60 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5a871c60 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5a871c60 Branch: refs/heads/1.x-HBase1.1.3 Commit: 5a871c607f86d623ae3dc7f42a0c489c6e5d558a Parents: 0603a19 Author: Yang Li Authored: Sun Aug 16 20:22:13 2015 +0800 Committer: Li, Yang Committed: Wed Dec 23 10:19:13 2015 +0800 -- .../common/persistence/HBaseConnection.java | 254 .../common/persistence/HBaseResourceStore.java | 31 +- .../common/util/HBaseRegionSizeCalculator.java | 41 +- .../kylin/common/util/BasicHadoopTest.java | 11 +- .../kylin/job/cube/GarbageCollectionStep.java | 22 +- .../kylin/job/hadoop/cube/CubeHFileJob.java | 18 +- .../job/hadoop/cube/StorageCleanupJob.java | 26 +- .../kylin/job/hadoop/hbase/CreateHTableJob.java | 8 +- .../hadoop/invertedindex/IICreateHFileJob.java | 22 +- .../hadoop/invertedindex/IICreateHTableJob.java | 11 +- .../apache/kylin/job/tools/CleanHtableCLI.java | 8 +- .../kylin/job/tools/CubeMigrationCLI.java | 64 +- .../kylin/job/tools/DeployCoprocessorCLI.java | 625 ++- .../job/tools/GridTableHBaseBenchmark.java | 37 +- .../kylin/job/tools/HtableAlterMetadataCLI.java | 8 +- .../apache/kylin/job/tools/RowCounterCLI.java | 11 +- .../org/apache/kylin/job/ExportHBaseData.java | 18 +- .../kylin/job/hadoop/hbase/TestHbaseClient.java | 13 +- .../kylin/job/tools/HBaseRowDigestTest.java | 11 +- monitor/pom.xml | 6 + .../kylin/monitor/MonitorMetaManager.java | 49 +- pom.xml | 14 +- .../apache/kylin/rest/service/AclService.java | 38 +- .../apache/kylin/rest/service/CubeService.java | 35 +- .../apache/kylin/rest/service/QueryService.java | 21 +- .../apache/kylin/rest/service/UserService.java | 27 +- .../storage/filter/BitMapFilterEvaluator.java | 1 - .../storage/hbase/CubeSegmentTupleIterator.java | 19 +- .../kylin/storage/hbase/CubeStorageEngine.java | 4 +- .../storage/hbase/HBaseClientKVIterator.java| 187 +++--- .../hbase/InvertedIndexStorageEngine.java | 114 ++-- .../kylin/storage/hbase/PingHBaseCLI.java | 179 +++--- .../storage/hbase/RegionScannerAdapter.java | 10 +- .../hbase/SerializedHBaseTupleIterator.java | 4 +- .../endpoint/EndpointTupleIterator.java | 15 +- .../hbase/coprocessor/endpoint/IIEndpoint.java | 2 +- .../observer/AggregateRegionObserver.java | 2 +- .../observer/AggregationScanner.java| 14 +- .../observer/ObserverAggregationCache.java | 10 +- .../coprocessor/observer/ObserverEnabler.java | 4 +- .../storage/hbase/InvertedIndexHBaseTest.java | 227 --- .../observer/AggregateRegionObserverTest.java | 72 +-- .../minicluster/HiveMiniClusterTest.java| 3 +- 43 files changed, 1151 insertions(+), 1145 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/5a871c60/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java -- diff --git a/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java index 9c86376..3c07654 100644 --- a/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java +++ b/common/src/main/java/org/apache/kylin/common/persistence/HBaseConnection.java @@ -1,122 +1,132 @@ -/* - * 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.persistence; - -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import
[09/50] [abbrv] kylin git commit: Revert "KYLIN-980 spill to disk when sys available memory is low"
Revert "KYLIN-980 spill to disk when sys available memory is low" This reverts commit 0f8fc239162bbca913b1eceb380d89f674928400. Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/cfe9f0a8 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/cfe9f0a8 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/cfe9f0a8 Branch: refs/heads/1.x-HBase1.1.3 Commit: cfe9f0a8ac960b59281aefa0245e79ed4b534294 Parents: 6f93a4d Author: shaofengshiAuthored: Mon Nov 30 14:08:27 2015 +0800 Committer: shaofengshi Committed: Mon Nov 30 14:08:27 2015 +0800 -- .../common/util/MemoryBudgetController.java | 249 --- .../hadoop/cube/FactDistinctColumnsReducer.java | 33 +-- 2 files changed, 8 insertions(+), 274 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/cfe9f0a8/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java -- diff --git a/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java b/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java deleted file mode 100644 index 4715ef6..000 --- a/common/src/main/java/org/apache/kylin/common/util/MemoryBudgetController.java +++ /dev/null @@ -1,249 +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 com.google.common.base.Preconditions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.ReentrantLock; - -public class MemoryBudgetController { - -private static final boolean debug = true; - -public interface MemoryConsumer { -// return number MB released -int freeUp(int mb); -} - -@SuppressWarnings("serial") -public static class NotEnoughBudgetException extends IllegalStateException { - -public NotEnoughBudgetException() { -super(); -} - -public NotEnoughBudgetException(Throwable cause) { -super(cause); -} -} - -private static class ConsumerEntry { -final MemoryConsumer consumer; -int reservedMB; - -ConsumerEntry(MemoryConsumer consumer) { -this.consumer = consumer; -} -} - -public static final MemoryBudgetController ZERO_BUDGET = new MemoryBudgetController(0); -public static final int ONE_MB = 1024 * 1024; -public static final long ONE_GB = 1024 * 1024 * 1024; - -private static final Logger logger = LoggerFactory.getLogger(MemoryBudgetController.class); - -// all budget numbers are in MB -private final int totalBudgetMB; -private final ConcurrentHashMap booking = new ConcurrentHashMap (); -private int totalReservedMB; -private final ReentrantLock lock = new ReentrantLock(); - -public MemoryBudgetController(int totalBudgetMB) { -Preconditions.checkArgument(totalBudgetMB >= 0); -Preconditions.checkState(totalBudgetMB <= getSystemAvailMB()); -this.totalBudgetMB = totalBudgetMB; -this.totalReservedMB = 0; -} - -public int getTotalBudgetMB() { -return totalBudgetMB; -} - -public int getTotalReservedMB() { -lock.lock(); -try { -return totalReservedMB; -} finally { -lock.unlock(); -} -} - -public int getRemainingBudgetMB() { -lock.lock(); -try { -return totalBudgetMB - totalReservedMB; -} finally { -lock.unlock(); -} -} - -public void reserveInsist(MemoryConsumer consumer, int requestMB) { -long waitStart = 0; -while (true) { -try { -reserve(consumer, requestMB); -if (debug && waitStart > 0) -logger.debug(consumer + " waited " +
kylin git commit: KYLIN-1245 Save 'mapper overlap ratio' in cube stats
Repository: kylin Updated Branches: refs/heads/2.x-staging 1410d9d30 -> db95d72ca KYLIN-1245 Save 'mapper overlap ratio' in cube stats Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/db95d72c Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/db95d72c Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/db95d72c Branch: refs/heads/2.x-staging Commit: db95d72caa801151824177c613acc91c5549f478 Parents: 1410d9d Author: Li, YangAuthored: Wed Dec 23 14:02:17 2015 +0800 Committer: Li, Yang Committed: Wed Dec 23 14:03:25 2015 +0800 -- build/conf/kylin_hive_conf.xml | 2 +- .../org/apache/kylin/cube/CubeInstance.java | 10 - .../java/org/apache/kylin/cube/CubeManager.java | 6 +- .../org/apache/kylin/cube/CubeSegmentsTest.java | 2 +- .../kylin/engine/mr/common/CubeStatsReader.java | 227 +++ .../kylin/engine/mr/common/CuboidStatsUtil.java | 14 +- .../mr/steps/FactDistinctColumnsReducer.java| 19 +- .../kylin/engine/mr/steps/InMemCuboidJob.java | 153 + .../apache/kylin/engine/spark/SparkCubing.java | 5 +- .../streaming/monitor/StreamingMonitor.java | 2 +- .../apache/kylin/rest/service/CubeService.java | 2 +- .../apache/kylin/rest/service/JobService.java | 2 +- .../storage/hbase/steps/CreateHTableJob.java| 3 +- 13 files changed, 267 insertions(+), 180 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/db95d72c/build/conf/kylin_hive_conf.xml -- diff --git a/build/conf/kylin_hive_conf.xml b/build/conf/kylin_hive_conf.xml index afa53f7..f91f489 100644 --- a/build/conf/kylin_hive_conf.xml +++ b/build/conf/kylin_hive_conf.xml @@ -8,7 +8,7 @@ dfs.block.size -10485760 +3200 Want more mappers for in-mem cubing, thus smaller the DFS block size http://git-wip-us.apache.org/repos/asf/kylin/blob/db95d72c/core-cube/src/main/java/org/apache/kylin/cube/CubeInstance.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeInstance.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeInstance.java index dccc3f1..8363a2b 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeInstance.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeInstance.java @@ -299,16 +299,6 @@ public class CubeInstance extends RootPersistentEntity implements IRealization, return result; } -public List getSegment(SegmentStatusEnum status) { -List result = Lists.newArrayList(); -for (CubeSegment segment : segments) { -if (segment.getStatus() == status) { -result.add(segment); -} -} -return result; -} - public CubeSegment getSegment(String name, SegmentStatusEnum status) { for (CubeSegment segment : segments) { if ((null != segment.getName() && segment.getName().equals(name)) && segment.getStatus() == status) { http://git-wip-us.apache.org/repos/asf/kylin/blob/db95d72c/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java index 88904bb..8e4906b 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java @@ -271,7 +271,7 @@ public class CubeManager implements IRealizationProvider { } private boolean validateReadySegments(CubeInstance cube) { -final List readySegments = cube.getSegment(SegmentStatusEnum.READY); +final List readySegments = cube.getSegments(SegmentStatusEnum.READY); if (readySegments.size() == 0) { return true; } @@ -475,7 +475,7 @@ public class CubeManager implements IRealizationProvider { } private Pair alignMergeRange(CubeInstance cube, long startDate, long endDate) { -List readySegments = cube.getSegment(SegmentStatusEnum.READY); +List readySegments = cube.getSegments(SegmentStatusEnum.READY); if (readySegments.isEmpty()) { throw new IllegalStateException("there are no segments in ready state"); } @@ -610,7 +610,7 @@ public class CubeManager implements IRealizationProvider { return null; } -List readySegments = Lists.newArrayList(cube.getSegment(SegmentStatusEnum.READY)); +List readySegments = Lists.newArrayList(cube.getSegments(SegmentStatusEnum.READY));
kylin git commit: KYLIN-1245 bug fix when reading stats seq file
Repository: kylin Updated Branches: refs/heads/2.x-staging db95d72ca -> 54071e311 KYLIN-1245 bug fix when reading stats seq file Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/54071e31 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/54071e31 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/54071e31 Branch: refs/heads/2.x-staging Commit: 54071e311d1bfcbc96390631a2d98d3ce70aaef6 Parents: db95d72 Author: Li, YangAuthored: Wed Dec 23 15:13:57 2015 +0800 Committer: Li, Yang Committed: Wed Dec 23 15:13:57 2015 +0800 -- .../kylin/engine/mr/common/CubeStatsReader.java | 29 +++- 1 file changed, 22 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/54071e31/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 fc27a81..bbc724a 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 @@ -18,6 +18,8 @@ package org.apache.kylin.engine.mr.common; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; @@ -29,7 +31,7 @@ import java.util.Map; import javax.annotation.Nullable; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FSDataInputStream; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.io.LongWritable; @@ -76,14 +78,14 @@ public class CubeStatsReader { public CubeStatsReader(CubeSegment cubeSegment, KylinConfig kylinConfig) throws IOException { ResourceStore store = ResourceStore.getStore(kylinConfig); String statsKey = cubeSegment.getStatisticsResourcePath(); -InputStream is = store.getResource(statsKey).inputStream; +File tmpSeqFile = writeTmpSeqFile(store.getResource(statsKey).inputStream); Reader reader = null; try { Configuration hadoopConf = HadoopUtil.getCurrentConfiguration(); -Option streamInput = SequenceFile.Reader.stream(new FSDataInputStream(is)); -reader = new SequenceFile.Reader(hadoopConf, streamInput); +Option seqInput = SequenceFile.Reader.file(new Path("file://" + tmpSeqFile.getAbsolutePath())); +reader = new SequenceFile.Reader(hadoopConf, seqInput); int percentage = 100; double mapperOverlapRatio = 0; @@ -111,10 +113,23 @@ public class CubeStatsReader { } finally { IOUtils.closeStream(reader); -IOUtils.closeStream(is); +tmpSeqFile.delete(); } } +private File writeTmpSeqFile(InputStream inputStream) throws IOException { +File tempFile = File.createTempFile("kylin_stats_tmp", ".seq"); +FileOutputStream out = null; +try { +out = new FileOutputStream(tempFile); +org.apache.commons.io.IOUtils.copy(inputStream, out); +} finally { +IOUtils.closeStream(inputStream); +IOUtils.closeStream(out); +} +return tempFile; +} + public Map getCuboidRowCountMap() { return getCuboidRowCountMapFromSampling(cuboidRowCountMap, samplingPercentage); } @@ -211,12 +226,12 @@ public class CubeStatsReader { logger.info("Cuboid " + cuboidId + " has " + rowCount + " rows, each row size is " + bytesLength + " bytes." + " Total size is " + ret + "M."); return ret; } - + public static void main(String[] args) throws IOException { KylinConfig config = KylinConfig.getInstanceFromEnv(); CubeInstance cube = CubeManager.getInstance(config).getCube(args[0]); List segments = cube.getSegments(SegmentStatusEnum.READY); - + PrintWriter out = new PrintWriter(System.out); for (CubeSegment seg : segments) { new CubeStatsReader(seg, config).print(out);
kylin git commit: minor, set default of kylin.job.cubing.inMem.sampling.percent to 30
Repository: kylin Updated Branches: refs/heads/2.0-rc 45d021b73 -> 07b1c6aaa minor, set default of kylin.job.cubing.inMem.sampling.percent to 30 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/07b1c6aa Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/07b1c6aa Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/07b1c6aa Branch: refs/heads/2.0-rc Commit: 07b1c6aaa24ef93ebf8134383a774ec22ac9500a Parents: 45d021b Author: Li, YangAuthored: Fri Dec 25 17:46:30 2015 +0800 Committer: Li, Yang Committed: Fri Dec 25 17:46:30 2015 +0800 -- build/conf/kylin_job_conf.xml | 2 ++ .../java/org/apache/kylin/common/KylinConfigBase.java | 2 +- .../kylin/engine/mr/steps/FactDistinctColumnsReducer.java | 4 ++-- .../engine/mr/steps/FactDistinctHiveColumnsMapper.java| 10 +++--- 4 files changed, 8 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/07b1c6aa/build/conf/kylin_job_conf.xml -- diff --git a/build/conf/kylin_job_conf.xml b/build/conf/kylin_job_conf.xml index 099605f..aab6e09 100644 --- a/build/conf/kylin_job_conf.xml +++ b/build/conf/kylin_job_conf.xml @@ -70,6 +70,7 @@ limitations under the License. See accompanying LICENSE file. + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/07b1c6aa/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java index 302a2db..aee1bd8 100644 --- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java +++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java @@ -445,7 +445,7 @@ public class KylinConfigBase implements Serializable { } public int getCubingInMemSamplingPercent() { -int percent = Integer.parseInt(this.getOptional("kylin.job.cubing.inMem.sampling.percent", "100")); +int percent = Integer.parseInt(this.getOptional("kylin.job.cubing.inMem.sampling.percent", "30")); percent = Math.max(percent, 1); percent = Math.min(percent, 100); return percent; http://git-wip-us.apache.org/repos/asf/kylin/blob/07b1c6aa/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java index 5fa37fa..0416c3a 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java @@ -61,7 +61,7 @@ public class FactDistinctColumnsReducer extends KylinReducer
kylin git commit: KYLIN-1245 done, ready for test
Repository: kylin Updated Branches: refs/heads/2.x-staging 5b967a59d -> 6174bd3a1 KYLIN-1245 done, ready for test Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6174bd3a Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6174bd3a Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6174bd3a Branch: refs/heads/2.x-staging Commit: 6174bd3a182a9f2294fcb585019ae146a05356d2 Parents: 5b967a5 Author: Li, YangAuthored: Fri Dec 25 15:30:35 2015 +0800 Committer: Li, Yang Committed: Fri Dec 25 15:30:35 2015 +0800 -- .../kylin/common/AbstractKylinConfig.java | 498 -- .../org/apache/kylin/common/KylinConfig.java| 2 +- .../apache/kylin/common/KylinConfigBase.java| 506 +++ .../org/apache/kylin/common/KylinConfigExt.java | 23 + .../kylin/common/KylinConfigOverride.java | 23 - .../kylin/job/execution/AbstractExecutable.java | 4 + .../kylin/engine/mr/BatchCubingJobBuilder2.java | 19 +- .../org/apache/kylin/engine/mr/CubingJob.java | 23 +- .../engine/mr/common/AbstractHadoopJob.java | 6 + .../kylin/engine/mr/common/CubeStatsReader.java | 6 +- .../engine/mr/common/MapReduceExecutable.java | 4 + .../kylin/engine/mr/steps/BaseCuboidJob.java| 3 +- .../apache/kylin/engine/mr/steps/CuboidJob.java | 26 + .../kylin/engine/mr/steps/InMemCuboidJob.java | 34 +- .../engine/mr/steps/SaveStatisticsStep.java | 37 ++ 15 files changed, 674 insertions(+), 540 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/6174bd3a/core-common/src/main/java/org/apache/kylin/common/AbstractKylinConfig.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/AbstractKylinConfig.java b/core-common/src/main/java/org/apache/kylin/common/AbstractKylinConfig.java deleted file mode 100644 index 544bd1e..000 --- a/core-common/src/main/java/org/apache/kylin/common/AbstractKylinConfig.java +++ /dev/null @@ -1,498 +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; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.util.Properties; -import java.util.SortedSet; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.kylin.common.util.CliCommandExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Sets; - -@SuppressWarnings("serial") -/** - * An abstract class to encapsulate access to a set of 'properties'. - * Subclass can override methods in this class to extend the content of the 'properties', - * with some override values for example. - */ -public class AbstractKylinConfig implements Serializable { - -private static final Logger logger = LoggerFactory.getLogger(AbstractKylinConfig.class); - -/* - * DON'T DEFINE CONSTANTS FOR PROPERTY KEYS! - * - * For 1), no external need to access property keys, all accesses are by public methods. - * For 2), it's cumbersome to maintain constants at top and code at bottom. - * For 3), key literals usually appear only once. - */ - -public static String getKylinHome() { -String kylinHome = System.getenv("KYLIN_HOME"); -if (StringUtils.isEmpty(kylinHome)) { -logger.warn("KYLIN_HOME was not set"); -} -return kylinHome; -} - -// - -private volatile Properties properties = new Properties(); - -public String getOptional(String prop) { -return getOptional(prop, null); -} - -public String getOptional(String prop, String dft) { -final String property = System.getProperty(prop); -return property != null ? property :
kylin git commit: KYLIN-1245 bug fix and better log
Repository: kylin Updated Branches: refs/heads/2.0-rc 07b1c6aaa -> ed63365fc KYLIN-1245 bug fix and better log Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ed63365f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ed63365f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ed63365f Branch: refs/heads/2.0-rc Commit: ed63365fc3ca2c9745fa51126fc10cf7a2477823 Parents: 07b1c6a Author: Li, YangAuthored: Fri Dec 25 18:12:38 2015 +0800 Committer: Li, Yang Committed: Fri Dec 25 18:14:56 2015 +0800 -- .../src/main/java/org/apache/kylin/cube/CubeSegment.java| 9 +++-- .../java/org/apache/kylin/engine/mr/steps/CuboidJob.java| 2 +- .../kylin/engine/mr/steps/FactDistinctColumnsReducer.java | 2 +- .../org/apache/kylin/engine/mr/steps/InMemCuboidJob.java| 2 +- .../apache/kylin/engine/mr/steps/SaveStatisticsStep.java| 4 ++-- 5 files changed, 8 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ed63365f/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java index 62df1e9..8d14a6f 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java @@ -31,20 +31,17 @@ import org.apache.kylin.cube.model.CubeDesc; import org.apache.kylin.cube.model.CubeJoinedFlatTableDesc; import org.apache.kylin.dict.Dictionary; import org.apache.kylin.dict.IDictionaryAware; -import org.apache.kylin.metadata.model.IBuildable; import org.apache.kylin.metadata.model.IJoinedFlatTableDesc; -import org.apache.kylin.metadata.model.IStorageAware; import org.apache.kylin.metadata.model.SegmentStatusEnum; import org.apache.kylin.metadata.model.TblColRef; +import org.apache.kylin.metadata.realization.IRealization; +import org.apache.kylin.metadata.realization.IRealizationSegment; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.Objects; import com.google.common.collect.Maps; -import org.apache.kylin.metadata.realization.IRealization; -import org.apache.kylin.metadata.realization.IRealizationSegment; @JsonAutoDetect(fieldVisibility = Visibility.NONE, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) public class CubeSegment implements Comparable, IDictionaryAware, IRealizationSegment { @@ -342,7 +339,7 @@ public class CubeSegment implements Comparable, IDictionaryAware, I @Override public String toString() { -return Objects.toStringHelper(this).add("cube", cubeInstance.getName()).add("name", name).add("status", status).add("uuid", uuid).add("create_time_utc:", createTimeUTC).add("last_build_job_id", lastBuildJobID).toString(); +return cubeInstance.getName() + "[" + name + "]"; } public void setDictionaries(ConcurrentHashMap dictionaries) { http://git-wip-us.apache.org/repos/asf/kylin/blob/ed63365f/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java index 1647480..ab5693b 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java @@ -105,7 +105,7 @@ public class CuboidJob extends AbstractHadoopJob { CubeInstance cube = cubeMgr.getCube(cubeName); if (checkSkip(cubingJobId)) { -logger.info("Skip job " + getOptionValue(OPTION_JOB_NAME) + " for " + segmentName); +logger.info("Skip job " + getOptionValue(OPTION_JOB_NAME) + " for " + cubeName + "[" + segmentName + "]"); return 0; } http://git-wip-us.apache.org/repos/asf/kylin/blob/ed63365f/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java index 0416c3a..17ed7d6 100644 ---
kylin git commit: KYLIN-1245 Set 'random' algorithm for testing
Repository: kylin Updated Branches: refs/heads/2.0-rc ed63365fc -> cbc86c265 KYLIN-1245 Set 'random' algorithm for testing Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/cbc86c26 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/cbc86c26 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/cbc86c26 Branch: refs/heads/2.0-rc Commit: cbc86c265d2fef6ccc8327cd16e32770834f0017 Parents: ed63365 Author: Li, YangAuthored: Fri Dec 25 18:21:52 2015 +0800 Committer: Li, Yang Committed: Fri Dec 25 18:21:52 2015 +0800 -- examples/test_case_data/sandbox/kylin.properties | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/cbc86c26/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 4ca8c2d..6f19cc7 100644 --- a/examples/test_case_data/sandbox/kylin.properties +++ b/examples/test_case_data/sandbox/kylin.properties @@ -70,9 +70,12 @@ kylin.hbase.region.cut.large=100 # Time interval to check hadoop job status kylin.job.yarn.app.rest.check.interval.seconds=10 -#default compression codec for htable,snappy,lzo,gzip,lz4 +# Default compression codec for htable,snappy,lzo,gzip,lz4 kylin.hbase.default.compression.codec=gzip +# 'auto', 'inmem', 'layer' or 'random' for testing +kylin.cube.algorithm=random + kylin.security.profile=testing ## Config for Restful APP ##
kylin git commit: KYLIN-1245 bug fix and better log
Repository: kylin Updated Branches: refs/heads/2.x-staging 66d275cb3 -> 6ecdd08da KYLIN-1245 bug fix and better log Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6ecdd08d Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6ecdd08d Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6ecdd08d Branch: refs/heads/2.x-staging Commit: 6ecdd08dab35f317b416f867f8350107f209b073 Parents: 66d275c Author: Li, YangAuthored: Fri Dec 25 18:12:38 2015 +0800 Committer: Li, Yang Committed: Fri Dec 25 18:12:38 2015 +0800 -- core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java | 5 ++--- .../main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java | 2 +- .../kylin/engine/mr/steps/FactDistinctColumnsReducer.java | 2 +- .../java/org/apache/kylin/engine/mr/steps/InMemCuboidJob.java | 2 +- .../org/apache/kylin/engine/mr/steps/SaveStatisticsStep.java| 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/6ecdd08d/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java index b29f83a..67dce73 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java @@ -41,7 +41,6 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.Objects; import com.google.common.collect.Maps; @JsonAutoDetect(fieldVisibility = Visibility.NONE, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) @@ -265,7 +264,7 @@ public class CubeSegment implements Comparable, IDictionaryAware, I public void setStorageLocationIdentifier(String storageLocationIdentifier) { this.storageLocationIdentifier = storageLocationIdentifier; } - + public Map buildDictionaryMap() { Map result = Maps.newHashMap(); for (TblColRef col : getCubeDesc().getAllColumnsNeedDictionary()) { @@ -348,7 +347,7 @@ public class CubeSegment implements Comparable, IDictionaryAware, I @Override public String toString() { -return Objects.toStringHelper(this).add("cube", cubeInstance.getName()).add("name", name).add("status", status).add("uuid", uuid).add("create_time_utc:", createTimeUTC).add("last_build_job_id", lastBuildJobID).toString(); +return cubeInstance.getName() + "[" + name + "]"; } public void setDictionaries(ConcurrentHashMap dictionaries) { http://git-wip-us.apache.org/repos/asf/kylin/blob/6ecdd08d/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java index 453e8fe..d24772c 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/CuboidJob.java @@ -105,7 +105,7 @@ public class CuboidJob extends AbstractHadoopJob { CubeInstance cube = cubeMgr.getCube(cubeName); if (checkSkip(cubingJobId)) { -logger.info("Skip job " + getOptionValue(OPTION_JOB_NAME) + " for " + segmentName); +logger.info("Skip job " + getOptionValue(OPTION_JOB_NAME) + " for " + cubeName + "[" + segmentName + "]"); return 0; } http://git-wip-us.apache.org/repos/asf/kylin/blob/6ecdd08d/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java index b63026e..65d1530 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java @@ -163,7 +163,7 @@ public class FactDistinctColumnsReducer extends KylinReducer
kylin git commit: KYLIN-1239 bug fix
Repository: kylin Updated Branches: refs/heads/2.0-rc b95d7282b -> 19676e6ea KYLIN-1239 bug fix Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/19676e6e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/19676e6e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/19676e6e Branch: refs/heads/2.0-rc Commit: 19676e6eabce9bacacd3e24e02a561a8a02c2be0 Parents: b95d728 Author: Yang LiAuthored: Fri Dec 25 22:46:34 2015 +0800 Committer: Yang Li Committed: Fri Dec 25 22:46:34 2015 +0800 -- .../java/org/apache/kylin/storage/hbase/steps/HBaseMRSteps.java | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/19676e6e/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMRSteps.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMRSteps.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMRSteps.java index 03db6b0..c3bd7b5 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMRSteps.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMRSteps.java @@ -73,7 +73,6 @@ public class HBaseMRSteps extends JobBuilderSupport { appendExecCmdParameters(cmd, "cubename", seg.getRealization().getName()); appendExecCmdParameters(cmd, "segmentname", seg.getName()); appendExecCmdParameters(cmd, "input", getRowkeyDistributionOutputPath(jobId) + "/part-r-0"); -appendExecCmdParameters(cmd, "htablename", seg.getStorageLocationIdentifier()); appendExecCmdParameters(cmd, "statisticsenabled", String.valueOf(withStats)); createHtableStep.setJobParams(cmd.toString());
kylin git commit: KYLIN-1205 Patch the scan in HBaseResourceStore as well
Repository: kylin Updated Branches: refs/heads/2.x-staging 406a02a15 -> 35a5d87af KYLIN-1205 Patch the scan in HBaseResourceStore as well Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/35a5d87a Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/35a5d87a Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/35a5d87a Branch: refs/heads/2.x-staging Commit: 35a5d87af4098f49bc8caced2ad0ee5d98e6d5ad Parents: 406a02a Author: Yang LiAuthored: Fri Dec 25 20:50:19 2015 +0800 Committer: Yang Li Committed: Fri Dec 25 20:50:26 2015 +0800 -- .../kylin/storage/hbase/HBaseResourceStore.java | 101 +-- 1 file changed, 50 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/35a5d87a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java index 72192a5..6777d88 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java @@ -40,10 +40,10 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.filter.CompareFilter; -import org.apache.hadoop.hbase.filter.FilterList; +import org.apache.hadoop.hbase.filter.CompareFilter; +import org.apache.hadoop.hbase.filter.FilterList; import org.apache.hadoop.hbase.filter.KeyOnlyFilter; -import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; +import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.persistence.RawResource; import org.apache.kylin.common.persistence.ResourceStore; @@ -159,6 +159,7 @@ public class HBaseResourceStore extends ResourceStore { Scan scan = new Scan(startRow, endRow); scan.addColumn(B_FAMILY, B_COLUMN_TS); scan.addColumn(B_FAMILY, B_COLUMN); +tuneScanParameters(scan); HTableInterface table = getConnection().getTable(getAllInOneTableName()); List result = Lists.newArrayList(); @@ -178,53 +179,51 @@ public class HBaseResourceStore extends ResourceStore { return result; } -@Override -protected List getAllResources(String rangeStart, String rangeEnd, long timeStartInMillis, long timeEndInMillis) throws IOException { -byte[] startRow = Bytes.toBytes(rangeStart); -byte[] endRow = plusZero(Bytes.toBytes(rangeEnd)); - -Scan scan = new Scan(startRow, endRow); -scan.addColumn(B_FAMILY, B_COLUMN_TS); -scan.addColumn(B_FAMILY, B_COLUMN); -scan.setFilter(generateTimeFilterList(timeStartInMillis, timeEndInMillis)); - -HTableInterface table = getConnection().getTable(getAllInOneTableName()); -List result = Lists.newArrayList(); -try { -ResultScanner scanner = table.getScanner(scan); -for (Result r : scanner) { -result.add(new RawResource(getInputStream(Bytes.toString(r.getRow()), r), getTimestamp(r))); -} -} catch (IOException e) { -for (RawResource rawResource : result) { -IOUtils.closeQuietly(rawResource.inputStream); -} -throw e; -} finally { -IOUtils.closeQuietly(table); -} -return result; -} - -private FilterList generateTimeFilterList(long timeStartInMillis, long timeEndInMillis) { -FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL); -SingleColumnValueFilter timeStartFilter = new SingleColumnValueFilter( -B_FAMILY, -B_COLUMN_TS, -CompareFilter.CompareOp.GREATER, -Bytes.toBytes(timeStartInMillis) -); -filterList.addFilter(timeStartFilter); -SingleColumnValueFilter timeEndFilter = new SingleColumnValueFilter( -B_FAMILY, -B_COLUMN_TS, -CompareFilter.CompareOp.LESS_OR_EQUAL, -Bytes.toBytes(timeEndInMillis) -); -filterList.addFilter(timeEndFilter); -return filterList; -} - +@Override +protected List getAllResources(String rangeStart, String rangeEnd, long timeStartInMillis, long timeEndInMillis) throws IOException { +byte[] startRow = Bytes.toBytes(rangeStart); +byte[]
kylin git commit: KYLIN-1205 Patch scan in HBaseResourceStore as well
Repository: kylin Updated Branches: refs/heads/2.0-rc cbc86c265 -> b95d7282b KYLIN-1205 Patch scan in HBaseResourceStore as well Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b95d7282 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b95d7282 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b95d7282 Branch: refs/heads/2.0-rc Commit: b95d7282babbf13b6d1b0f22760519db43e7a2a0 Parents: cbc86c2 Author: Yang LiAuthored: Fri Dec 25 20:52:48 2015 +0800 Committer: Yang Li Committed: Fri Dec 25 20:52:48 2015 +0800 -- .../apache/kylin/storage/hbase/HBaseResourceStore.java| 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/b95d7282/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java index 6f638c4..511a7cf 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java @@ -156,6 +156,7 @@ public class HBaseResourceStore extends ResourceStore { Scan scan = new Scan(startRow, endRow); scan.addColumn(B_FAMILY, B_COLUMN_TS); scan.addColumn(B_FAMILY, B_COLUMN); +tuneScanParameters(scan); HTableInterface table = getConnection().getTable(getAllInOneTableName()); List result = Lists.newArrayList(); @@ -175,6 +176,13 @@ public class HBaseResourceStore extends ResourceStore { return result; } +private void tuneScanParameters(Scan scan) { +// divide by 10 as some resource like dictionary or snapshot can be very large +scan.setCaching(kylinConfig.getHBaseScanCacheRows() / 10); +scan.setMaxResultSize(kylinConfig.getHBaseScanMaxResultSize()); +scan.setCacheBlocks(true); +} + private InputStream getInputStream(String resPath, Result r) throws IOException { if (r == null) { return null; @@ -212,7 +220,7 @@ public class HBaseResourceStore extends ResourceStore { protected long getResourceTimestampImpl(String resPath) throws IOException { return getTimestamp(getByScan(resPath, false, true)); } - + @Override protected void putResourceImpl(String resPath, InputStream content, long ts) throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream();
kylin git commit: KYLIN-1205 Patch HBaseResourceStore as well
Repository: kylin Updated Branches: refs/heads/1.x-staging 95ef74fa3 -> 7c98901bf KYLIN-1205 Patch HBaseResourceStore as well Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7c98901b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7c98901b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7c98901b Branch: refs/heads/1.x-staging Commit: 7c98901bf8acaec29504e87e210fdf5e94a4b271 Parents: 95ef74f Author: Yang LiAuthored: Fri Dec 25 21:08:21 2015 +0800 Committer: Yang Li Committed: Fri Dec 25 21:08:21 2015 +0800 -- .../kylin/common/persistence/HBaseResourceStore.java | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7c98901b/common/src/main/java/org/apache/kylin/common/persistence/HBaseResourceStore.java -- diff --git a/common/src/main/java/org/apache/kylin/common/persistence/HBaseResourceStore.java b/common/src/main/java/org/apache/kylin/common/persistence/HBaseResourceStore.java index ac14e7b..d1ff27a 100644 --- a/common/src/main/java/org/apache/kylin/common/persistence/HBaseResourceStore.java +++ b/common/src/main/java/org/apache/kylin/common/persistence/HBaseResourceStore.java @@ -148,6 +148,7 @@ public class HBaseResourceStore extends ResourceStore { Scan scan = new Scan(startRow, endRow); scan.addColumn(B_FAMILY, B_COLUMN_TS); scan.addColumn(B_FAMILY, B_COLUMN); +tuneScanParameters(scan); HTableInterface table = getConnection().getTable(getAllInOneTableName()); List result = Lists.newArrayList(); @@ -167,6 +168,13 @@ public class HBaseResourceStore extends ResourceStore { return result; } +private void tuneScanParameters(Scan scan) { +// divide by 10 as some resource like dictionary or snapshot can be very large +scan.setCaching(kylinConfig.getHBaseScanCacheRows() / 10); +scan.setMaxResultSize(kylinConfig.getHBaseScanMaxResultSize()); +scan.setCacheBlocks(true); +} + private InputStream getInputStream(String resPath, Result r) throws IOException { if (r == null) { return null; @@ -204,7 +212,7 @@ public class HBaseResourceStore extends ResourceStore { protected long getResourceTimestampImpl(String resPath) throws IOException { return getTimestamp(getByScan(resPath, false, true)); } - + @Override protected void putResourceImpl(String resPath, InputStream content, long ts) throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream();
kylin git commit: KYLIN-1233 1) drop unnecessary dependency; 2) configurable spill threshold; 3) optimize for all-in-mem case
Repository: kylin Updated Branches: refs/heads/2.0-rc 19676e6ea -> 7b53cad50 KYLIN-1233 1) drop unnecessary dependency; 2) configurable spill threshold; 3) optimize for all-in-mem case Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7b53cad5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7b53cad5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7b53cad5 Branch: refs/heads/2.0-rc Commit: 7b53cad50f2105e481f0b9f96651d5a8b453e35e Parents: 19676e6 Author: Yang LiAuthored: Sat Dec 26 19:09:02 2015 +0800 Committer: Yang Li Committed: Sat Dec 26 19:09:02 2015 +0800 -- .../java/org/apache/kylin/common/util/Pair.java | 18 +- .../cube/inmemcubing/InMemCubeBuilder.java | 2 +- .../kylin/gridtable/GTAggregateScanner.java | 181 +++ .../apache/kylin/gridtable/GTScanRequest.java | 17 +- .../gridtable/AggregationCacheSpillTest.java| 9 +- .../coprocessor/endpoint/CubeVisitService.java | 10 +- 6 files changed, 150 insertions(+), 87 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7b53cad5/core-common/src/main/java/org/apache/kylin/common/util/Pair.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/Pair.java b/core-common/src/main/java/org/apache/kylin/common/util/Pair.java index 9efdf3b..b54e517 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/Pair.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/Pair.java @@ -66,6 +66,10 @@ public class Pair implements Serializable { public void setFirst(T1 a) { this.first = a; } + +public void setKey(T1 a) { +setFirst(a); +} /** * Replace the second element of the pair. @@ -75,6 +79,10 @@ public class Pair implements Serializable { this.second = b; } +public void setValue(T2 b) { +setSecond(b); +} + /** * Return the first element stored in the pair. * @return T1 @@ -83,6 +91,10 @@ public class Pair implements Serializable { return first; } +public T1 getKey() { +return getFirst(); +} + /** * Return the second element stored in the pair. * @return T2 @@ -90,13 +102,17 @@ public class Pair implements Serializable { public T2 getSecond() { return second; } + +public T2 getValue() { +return getSecond(); +} private static boolean equals(Object x, Object y) { return (x == null && y == null) || (x != null && x.equals(y)); } +@SuppressWarnings("rawtypes") @Override -@SuppressWarnings("unchecked") public boolean equals(Object other) { return other instanceof Pair && equals(first, ((Pair) other).first) && equals(second, ((Pair) other).second); } http://git-wip-us.apache.org/repos/asf/kylin/blob/7b53cad5/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java index 73f89c1..97b2d5e 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/InMemCubeBuilder.java @@ -333,7 +333,7 @@ public class InMemCubeBuilder extends AbstractInMemCubeBuilder { Pair dimensionMetricsBitSet = InMemCubeBuilderUtils.getDimensionAndMetricColumnBitSet(baseCuboidId, measureCount); GTScanRequest req = new GTScanRequest(baseCuboid.getInfo(), null, dimensionMetricsBitSet.getFirst(), dimensionMetricsBitSet.getSecond(), metricsAggrFuncs, null); -GTAggregateScanner aggregationScanner = new GTAggregateScanner(baseInput, req, true); +GTAggregateScanner aggregationScanner = new GTAggregateScanner(baseInput, req); aggregationScanner.trackMemoryLevel(baseCuboidMemTracker); int count = 0; http://git-wip-us.apache.org/repos/asf/kylin/blob/7b53cad5/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java b/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java index 46d51a4..0dd9e61 100644 --- a/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java +++
kylin git commit: minor, pass CI
Repository: kylin Updated Branches: refs/heads/2.0-rc 7b53cad50 -> 94b0c8f0a minor, pass CI Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/94b0c8f0 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/94b0c8f0 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/94b0c8f0 Branch: refs/heads/2.0-rc Commit: 94b0c8f0a2e412e7b820f63961c9c999158b61b8 Parents: 7b53cad Author: Yang LiAuthored: Sun Dec 27 07:57:13 2015 +0800 Committer: Yang Li Committed: Sun Dec 27 07:57:13 2015 +0800 -- .../kylin/storage/hbase/cube/v2/CubeSegmentScanner.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/94b0c8f0/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java index 2f78a86..33a1180 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java @@ -94,14 +94,14 @@ public class CubeSegmentScanner implements IGTScanner { private Pair getSegmentStartAndEnd(TblColRef tblColRef, int index) { ByteArray start; if (cubeSeg.getDateRangeStart() != Long.MIN_VALUE) { -start = translateTsToString(cubeSeg.getDateRangeStart(), index, 1); +start = encodeTime(cubeSeg.getDateRangeStart(), index, 1); } else { start = new ByteArray(); } ByteArray end; if (cubeSeg.getDateRangeEnd() != Long.MAX_VALUE) { -end = translateTsToString(cubeSeg.getDateRangeEnd(), index, -1); +end = encodeTime(cubeSeg.getDateRangeEnd(), index, -1); } else { end = new ByteArray(); } @@ -109,13 +109,12 @@ public class CubeSegmentScanner implements IGTScanner { } -private ByteArray translateTsToString(long ts, int index, int roundingFlag) { +private ByteArray encodeTime(long ts, int index, int roundingFlag) { String value; DataType partitionColType = info.getColumnType(index); if (partitionColType.isDate()) { value = DateFormat.formatToDateStr(ts); -} else if (partitionColType.isDatetime()) { -//TODO: if partition col is not dict encoded, value's format may differ from expected. Though by default it is not the case +} else if (partitionColType.isDatetime() || partitionColType.isTimestamp()) { value = DateFormat.formatToTimeWithoutMilliStr(ts); } else if (partitionColType.isStringFamily()) { String partitionDateFormat = cubeSeg.getCubeDesc().getModel().getPartitionDesc().getPartitionDateFormat();
kylin git commit: minor, fix a bug introduced in af889ca002ae0d1859eb25a5a0f49ab44fa1dcf2
Repository: kylin Updated Branches: refs/heads/2.x-staging 8c2d65808 -> bfe72bf6a minor, fix a bug introduced in af889ca002ae0d1859eb25a5a0f49ab44fa1dcf2 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/bfe72bf6 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/bfe72bf6 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/bfe72bf6 Branch: refs/heads/2.x-staging Commit: bfe72bf6a4bff13cb59be27598da3d117592fd28 Parents: 8c2d658 Author: Yang LiAuthored: Sun Dec 20 09:13:55 2015 +0800 Committer: Yang Li Committed: Sun Dec 20 09:13:55 2015 +0800 -- .../hbase/cube/v1/coprocessor/observer/ObserverEnabler.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/bfe72bf6/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverEnabler.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverEnabler.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverEnabler.java index 13dbaa9..b8ac3d5 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverEnabler.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/coprocessor/observer/ObserverEnabler.java @@ -62,7 +62,7 @@ public class ObserverEnabler { public static ResultScanner scanWithCoprocessorIfBeneficial(CubeSegment segment, Cuboid cuboid, TupleFilter tupleFiler, // Collection groupBy, Collection rowValueDecoders, StorageContext context, HTableInterface table, Scan scan) throws IOException { -if (true) { +if (context.isCoprocessorEnabled() == false) { return table.getScanner(scan); }
kylin git commit: KYLIN-1233 Configurable mem usage inside coprocessor
Repository: kylin Updated Branches: refs/heads/2.0-rc d8a964b4b -> d828780ec KYLIN-1233 Configurable mem usage inside coprocessor Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/d828780e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/d828780e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/d828780e Branch: refs/heads/2.0-rc Commit: d828780ec241f8792b7574ca1eaef186f0b485e4 Parents: d8a964b Author: Yang LiAuthored: Sun Dec 27 21:27:39 2015 +0800 Committer: Yang Li Committed: Sun Dec 27 21:28:46 2015 +0800 -- .../apache/kylin/common/KylinConfigBase.java| 4 +++ .../hbase/cube/v2/CubeHBaseEndpointRPC.java | 4 +-- .../hbase/cube/v2/CubeSegmentScanner.java | 6 +++- .../coprocessor/endpoint/CubeVisitService.java | 5 ++- .../hbase/util/DeployCoprocessorCLI.java| 32 +++- 5 files changed, 44 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/d828780e/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java index aee1bd8..5968411 100644 --- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java +++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java @@ -420,6 +420,10 @@ public class KylinConfigBase implements Serializable { return Long.parseLong(this.getOptional("kylin.query.mem.budget", String.valueOf(3L * 1024 * 1024 * 1024))); } +public double getQueryCoprocessorMemGB() { +return Double.parseDouble(this.getOptional("kylin.query.coprocessor.mem.gb", "3.0")); +} + public boolean isQuerySecureEnabled() { return Boolean.parseBoolean(this.getOptional("kylin.query.security.enabled", "false")); } http://git-wip-us.apache.org/repos/asf/kylin/blob/d828780e/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java index 5bc4a00..9ca3fc8 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java @@ -223,11 +223,11 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC { future.get(1, TimeUnit.HOURS); } } catch (InterruptedException e) { -throw new RuntimeException("Visiting cube by endpoint gets interrupted"); +throw new RuntimeException("Visiting cube by endpoint gets interrupted", e); } catch (ExecutionException e) { throw new RuntimeException("Visiting cube throw exception", e); } catch (TimeoutException e) { -throw new RuntimeException("Visiting cube by endpoint timeout"); +throw new RuntimeException("Visiting cube by endpoint timeout", e); } return new EndpointResultsAsGTScanner(fullGTInfo, rowBlocks.iterator(), scanRequest.getColumns(), totalScannedCount.get()); http://git-wip-us.apache.org/repos/asf/kylin/blob/d828780e/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java index 33a1180..79e33fe 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java @@ -12,6 +12,7 @@ import java.util.NoSuchElementException; import java.util.Set; import org.apache.commons.lang3.StringUtils; +import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.debug.BackdoorToggles; import org.apache.kylin.common.util.ByteArray; import org.apache.kylin.common.util.DateFormat; @@ -84,8 +85,11 @@ public class CubeSegmentScanner implements IGTScanner { trimmedInfoBytes = GTInfo.serialize(info); GTInfo trimmedInfo = GTInfo.deserialize(trimmedInfoBytes); +KylinConfig config = cubeSeg.getCubeInstance().getConfig(); for (GTScanRange range : scanRanges) { -
[2/2] kylin git commit: KYLIN-1245 Put layer cubing and in-mem cubing side by side, random switch between them
KYLIN-1245 Put layer cubing and in-mem cubing side by side, random switch between them Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/3fc3883a Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/3fc3883a Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/3fc3883a Branch: refs/heads/2.x-staging Commit: 3fc3883a41bfab899c31b300db4c0757bd5589d3 Parents: 2ef13d0 Author: Yang LiAuthored: Mon Dec 21 19:52:31 2015 +0800 Committer: Yang Li Committed: Mon Dec 21 19:52:31 2015 +0800 -- .../kylin/engine/mr/BatchCubingJobBuilder2.java | 97 +- .../kylin/engine/mr/BatchMergeJobBuilder2.java | 35 +- .../org/apache/kylin/engine/mr/IMROutput2.java | 104 +++--- .../java/org/apache/kylin/engine/mr/MRUtil.java | 6 - .../engine/mr/common/AbstractHadoopJob.java | 1 - .../kylin/engine/mr/steps/InMemCuboidJob.java | 201 ++- .../engine/mr/steps/InMemCuboidReducer.java | 28 +- .../mr/steps/MergeCuboidFromStorageJob.java | 94 -- .../mr/steps/MergeCuboidFromStorageMapper.java | 239 - .../apache/kylin/engine/spark/SparkCubing.java | 4 +- .../storage/hbase/steps/CreateHTableJob.java| 143 +--- .../storage/hbase/steps/HBaseMROutput2.java | 290 .../hbase/steps/HBaseMROutput2Transition.java | 331 +-- 13 files changed, 378 insertions(+), 1195 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/3fc3883a/engine-mr/src/main/java/org/apache/kylin/engine/mr/BatchCubingJobBuilder2.java -- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/BatchCubingJobBuilder2.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/BatchCubingJobBuilder2.java index f8fbc33..476a763 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/BatchCubingJobBuilder2.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/BatchCubingJobBuilder2.java @@ -18,11 +18,16 @@ package org.apache.kylin.engine.mr; +import java.util.Random; + import org.apache.kylin.cube.CubeSegment; +import org.apache.kylin.cube.model.RowKeyDesc; import org.apache.kylin.engine.mr.IMRInput.IMRBatchCubingInputSide; import org.apache.kylin.engine.mr.IMROutput2.IMRBatchCubingOutputSide2; import org.apache.kylin.engine.mr.common.MapReduceExecutable; +import org.apache.kylin.engine.mr.steps.BaseCuboidJob; import org.apache.kylin.engine.mr.steps.InMemCuboidJob; +import org.apache.kylin.engine.mr.steps.NDCuboidJob; import org.apache.kylin.engine.mr.steps.SaveStatisticsStep; import org.apache.kylin.job.constant.ExecutableConstants; import org.slf4j.Logger; @@ -37,14 +42,15 @@ public class BatchCubingJobBuilder2 extends JobBuilderSupport { public BatchCubingJobBuilder2(CubeSegment newSegment, String submitter) { super(newSegment, submitter); this.inputSide = MRUtil.getBatchCubingInputSide(seg); -this.outputSide = MRUtil.getBatchCubingOutputSide2((CubeSegment)seg); +this.outputSide = MRUtil.getBatchCubingOutputSide2((CubeSegment) seg); } public CubingJob build() { logger.info("MR_V2 new job to BUILD segment " + seg); - -final CubingJob result = CubingJob.createBuildJob((CubeSegment)seg, submitter, config); + +final CubingJob result = CubingJob.createBuildJob((CubeSegment) seg, submitter, config); final String jobId = result.getId(); +final String cuboidRootPath = getCuboidRootPath(jobId); // Phase 1: Create Flat Table inputSide.addStepPhase1_CreateFlatTable(result); @@ -56,8 +62,14 @@ public class BatchCubingJobBuilder2 extends JobBuilderSupport { outputSide.addStepPhase2_BuildDictionary(result); // Phase 3: Build Cube -result.addTask(createInMemCubingStep(jobId)); -outputSide.addStepPhase3_BuildCube(result); +if (new Random().nextBoolean()) { +// layer cubing +addLayerCubingSteps(result, jobId, cuboidRootPath); +} else { +// or in-mem cubing +result.addTask(createInMemCubingStep(jobId, cuboidRootPath)); +} +outputSide.addStepPhase3_BuildCube(result, cuboidRootPath); // Phase 4: Update Metadata & Cleanup result.addTask(createUpdateCubeInfoAfterBuildStep(jobId)); @@ -67,6 +79,20 @@ public class BatchCubingJobBuilder2 extends JobBuilderSupport { return result; } +private void addLayerCubingSteps(final CubingJob result, final String jobId, final String cuboidRootPath) { +RowKeyDesc rowKeyDesc = ((CubeSegment) seg).getCubeDesc().getRowkey(); +final int groupRowkeyColumnsCount = ((CubeSegment)
[1/2] kylin git commit: KYLIN-1245 Put layer cubing and in-mem cubing side by side, random switch between them
Repository: kylin Updated Branches: refs/heads/2.x-staging 2ef13d08e -> 3fc3883a4 http://git-wip-us.apache.org/repos/asf/kylin/blob/3fc3883a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMROutput2Transition.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMROutput2Transition.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMROutput2Transition.java index ac304f5..4c2737d 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMROutput2Transition.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HBaseMROutput2Transition.java @@ -18,53 +18,12 @@ package org.apache.kylin.storage.hbase.steps; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.client.HTable; -import org.apache.hadoop.hbase.client.Result; -import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil; -import org.apache.hadoop.hbase.mapreduce.TableMapper; -import org.apache.hadoop.hbase.mapreduce.TableSplit; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.io.Writable; -import org.apache.hadoop.io.WritableComparable; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.Mapper; -import org.apache.hadoop.mapreduce.Mapper.Context; -import org.apache.hadoop.mapreduce.Reducer; -import org.apache.hadoop.mapreduce.lib.input.FileSplit; -import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat; -import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; -import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat; -import org.apache.kylin.common.KylinConfig; -import org.apache.kylin.common.util.Pair; import org.apache.kylin.cube.CubeSegment; -import org.apache.kylin.cube.kv.RowConstants; -import org.apache.kylin.cube.model.HBaseColumnDesc; -import org.apache.kylin.cube.model.HBaseColumnFamilyDesc; -import org.apache.kylin.engine.mr.ByteArrayWritable; -import org.apache.kylin.engine.mr.HadoopUtil; import org.apache.kylin.engine.mr.IMROutput2; -import org.apache.kylin.engine.mr.common.AbstractHadoopJob; -import org.apache.kylin.engine.mr.steps.MergeCuboidMapper; import org.apache.kylin.job.execution.DefaultChainedExecutable; -import org.apache.kylin.measure.MeasureCodec; -import org.apache.kylin.metadata.model.MeasureDesc; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.Lists; - /** * This "Transition" impl generates cuboid files and then convert to HFile. * The additional step slows down build process, but the gains is merge @@ -77,6 +36,7 @@ import com.google.common.collect.Lists; */ public class HBaseMROutput2Transition implements IMROutput2 { +@SuppressWarnings("unused") private static final Logger logger = LoggerFactory.getLogger(HBaseMROutput2Transition.class); @Override @@ -85,19 +45,12 @@ public class HBaseMROutput2Transition implements IMROutput2 { HBaseMRSteps steps = new HBaseMRSteps(seg); @Override -public IMRStorageOutputFormat getStorageOutputFormat() { -return new HBaseOutputFormat(seg); -} - -@Override public void addStepPhase2_BuildDictionary(DefaultChainedExecutable jobFlow) { jobFlow.addTask(steps.createCreateHTableStepWithStats(jobFlow.getId())); } @Override -public void addStepPhase3_BuildCube(DefaultChainedExecutable jobFlow) { -String cuboidRootPath = steps.getCuboidRootPath(jobFlow.getId()); - +public void addStepPhase3_BuildCube(DefaultChainedExecutable jobFlow, String cuboidRootPath) { jobFlow.addTask(steps.createConvertCuboidToHfileStep(cuboidRootPath, jobFlow.getId())); jobFlow.addTask(steps.createBulkLoadStep(jobFlow.getId())); } @@ -110,34 +63,17 @@ public class HBaseMROutput2Transition implements IMROutput2 { } @Override -public IMRBatchMergeInputSide2 getBatchMergeInputSide(final CubeSegment seg) { -return new IMRBatchMergeInputSide2() { -@Override -public IMRStorageInputFormat getStorageInputFormat() { -return new HBaseInputFormat(seg); -} -}; -} - -@Override public IMRBatchMergeOutputSide2 getBatchMergeOutputSide(final CubeSegment seg) { return new IMRBatchMergeOutputSide2() { HBaseMRSteps steps = new
kylin git commit: KYLIN-1266 Drop some unused dependencies
Repository: kylin Updated Branches: refs/heads/2.0-rc 2b222043d -> 6d7d2d71a KYLIN-1266 Drop some unused dependencies Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6d7d2d71 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6d7d2d71 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6d7d2d71 Branch: refs/heads/2.0-rc Commit: 6d7d2d71ac749d79fceb7158b7e714843fab5263 Parents: 2b22204 Author: Li, YangAuthored: Wed Dec 30 16:36:43 2015 +0800 Committer: Li, Yang Committed: Wed Dec 30 16:37:29 2015 +0800 -- assembly/pom.xml| 24 ++- core-common/pom.xml | 18 +- .../kylin/common/util/CollectionUtils.java | 29 +++ .../org/apache/kylin/common/util/Primes.java| 184 +++ .../org/apache/kylin/common/util/BasicTest.java | 4 +- .../cube/upgrade/v2/CubeMetadataUpgradeV2.java | 2 +- core-storage/pom.xml| 2 - cube/pom.xml| 4 - metadata/pom.xml| 4 - pom.xml | 12 -- server/pom.xml | 10 +- .../rest/security/MockAclHBaseStorage.java | 2 +- .../rest/security/RealAclHBaseStorage.java | 2 +- .../apache/kylin/rest/service/QueryService.java | 4 +- source-kafka/pom.xml| 1 + storage-hbase/pom.xml | 5 - .../storage/hbase/steps/CreateHTableJob.java| 2 +- 17 files changed, 243 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/6d7d2d71/assembly/pom.xml -- diff --git a/assembly/pom.xml b/assembly/pom.xml index df4a07f..cd7fc2b 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -84,11 +84,6 @@ org.apache.hadoop -hadoop-mapreduce-client-core -provided - - -org.apache.hadoop hadoop-minicluster test @@ -110,11 +105,6 @@ org.apache.hbase -hbase-client -provided - - -org.apache.hbase hbase-server provided @@ -165,6 +155,13 @@ + +org.apache.kafka +kafka_2.10 +${kafka.version} + + + @@ -184,6 +181,13 @@ false true job + + + io.netty:* + org.apache.zookeeper:* + net.sf.ehcache:* + + *:* http://git-wip-us.apache.org/repos/asf/kylin/blob/6d7d2d71/core-common/pom.xml -- diff --git a/core-common/pom.xml b/core-common/pom.xml index d02ddd3..72d8808 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -49,18 +49,10 @@ commons-lang3 -org.apache.commons -commons-math3 - - commons-io commons-io -commons-configuration -commons-configuration - - commons-cli commons-cli @@ -69,11 +61,6 @@ commons-email -org.apache.commons -commons-collections4 -${commons-collections4.version} - - commons-httpclient commons-httpclient @@ -114,6 +101,11 @@ +org.apache.commons +commons-math3 +test + + junit junit test http://git-wip-us.apache.org/repos/asf/kylin/blob/6d7d2d71/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java b/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java new file mode 100644 index 000..c4b7d1d --- /dev/null +++ b/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software
[2/2] kylin git commit: KYLIN-1266 Add back commons-collections, but a shared version not collections4
KYLIN-1266 Add back commons-collections, but a shared version not collections4 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/8d76b760 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/8d76b760 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/8d76b760 Branch: refs/heads/2.x-staging Commit: 8d76b7604f113f5c77669fb222eaa6e958f62b98 Parents: 6e78e4e Author: Li, YangAuthored: Wed Dec 30 16:55:00 2015 +0800 Committer: Li, Yang Committed: Wed Dec 30 16:55:00 2015 +0800 -- core-common/pom.xml | 4 +++ .../kylin/common/util/CollectionUtils.java | 29 .../validation/rule/AggregationGroupRule.java | 2 +- pom.xml | 6 4 files changed, 11 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/8d76b760/core-common/pom.xml -- diff --git a/core-common/pom.xml b/core-common/pom.xml index 72d8808..07a7ee1 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -49,6 +49,10 @@ commons-lang3 +commons-collections +commons-collections + + commons-io commons-io http://git-wip-us.apache.org/repos/asf/kylin/blob/8d76b760/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java b/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java deleted file mode 100644 index c4b7d1d..000 --- a/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java +++ /dev/null @@ -1,29 +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.Collection; - -public class CollectionUtils { - -public static boolean isEmpty(final Collection coll) { -return coll == null || coll.isEmpty(); -} - -} http://git-wip-us.apache.org/repos/asf/kylin/blob/8d76b760/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java index 40555c2..88a 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java @@ -22,7 +22,7 @@ import java.util.Arrays; import java.util.Set; import java.util.TreeSet; -import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections.CollectionUtils; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.cube.model.AggregationGroup; import org.apache.kylin.cube.model.CubeDesc; http://git-wip-us.apache.org/repos/asf/kylin/blob/8d76b760/pom.xml -- diff --git a/pom.xml b/pom.xml index 9311691..74bac02 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,7 @@ 1.2 2.6 3.1 +3.2.1 2.4 1.0.15 3.1 @@ -329,6 +330,11 @@ ${commons-lang3.version} +commons-collections +commons-collections +${commons-collections.version} + + org.apache.commons commons-math3 ${commons-math3.version}
kylin git commit: KYLIN-1266 Add back commons-collections, but a shared version not collections4
Repository: kylin Updated Branches: refs/heads/2.0-rc 6d7d2d71a -> e0748f5b4 KYLIN-1266 Add back commons-collections, but a shared version not collections4 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e0748f5b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e0748f5b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e0748f5b Branch: refs/heads/2.0-rc Commit: e0748f5b4cf97d671250c967666a02bb9d03a700 Parents: 6d7d2d7 Author: Li, YangAuthored: Wed Dec 30 16:55:00 2015 +0800 Committer: Li, Yang Committed: Wed Dec 30 17:00:07 2015 +0800 -- core-common/pom.xml | 4 +++ .../kylin/common/util/CollectionUtils.java | 29 .../cube/upgrade/v2/CubeMetadataUpgradeV2.java | 2 +- pom.xml | 6 4 files changed, 11 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/e0748f5b/core-common/pom.xml -- diff --git a/core-common/pom.xml b/core-common/pom.xml index 72d8808..07a7ee1 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -49,6 +49,10 @@ commons-lang3 +commons-collections +commons-collections + + commons-io commons-io http://git-wip-us.apache.org/repos/asf/kylin/blob/e0748f5b/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java b/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java deleted file mode 100644 index c4b7d1d..000 --- a/core-common/src/main/java/org/apache/kylin/common/util/CollectionUtils.java +++ /dev/null @@ -1,29 +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.Collection; - -public class CollectionUtils { - -public static boolean isEmpty(final Collection coll) { -return coll == null || coll.isEmpty(); -} - -} http://git-wip-us.apache.org/repos/asf/kylin/blob/e0748f5b/core-cube/src/main/java/org/apache/kylin/cube/upgrade/v2/CubeMetadataUpgradeV2.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/upgrade/v2/CubeMetadataUpgradeV2.java b/core-cube/src/main/java/org/apache/kylin/cube/upgrade/v2/CubeMetadataUpgradeV2.java index 4b823e6..f11d95c 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/upgrade/v2/CubeMetadataUpgradeV2.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/upgrade/v2/CubeMetadataUpgradeV2.java @@ -23,12 +23,12 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.persistence.ResourceStore; -import org.apache.kylin.common.util.CollectionUtils; import org.apache.kylin.cube.CubeDescManager; import org.apache.kylin.cube.CubeInstance; import org.apache.kylin.cube.CubeManager; http://git-wip-us.apache.org/repos/asf/kylin/blob/e0748f5b/pom.xml -- diff --git a/pom.xml b/pom.xml index c936774..7a709a6 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,7 @@ 1.2 2.6 3.1 +3.2.1 2.4 1.0.15 3.1 @@ -329,6 +330,11 @@ ${commons-lang3.version} +commons-collections +commons-collections +${commons-collections.version} + +
kylin git commit: minor, apply scan.setCaching() and scan.setMaxResultSize() on HBaseResourceStore
Repository: kylin Updated Branches: refs/heads/2.x-staging 3abb061a0 -> 10ccd0a7b minor, apply scan.setCaching() and scan.setMaxResultSize() on HBaseResourceStore Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/10ccd0a7 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/10ccd0a7 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/10ccd0a7 Branch: refs/heads/2.x-staging Commit: 10ccd0a7bd29a9c1fb376191b7fe641e22e09277 Parents: 3abb061 Author: Li, YangAuthored: Tue Dec 29 14:43:34 2015 +0800 Committer: Li, Yang Committed: Tue Dec 29 14:45:42 2015 +0800 -- .../java/org/apache/kylin/storage/hbase/HBaseResourceStore.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/10ccd0a7/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java index 6777d88..f1659c3 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseResourceStore.java @@ -325,6 +325,9 @@ public class HBaseResourceStore extends ResourceStore { byte[] endRow = plusZero(startRow); Scan scan = new Scan(startRow, endRow); +scan.setCaching(1); +scan.setMaxResultSize(kylinConfig.getHBaseScanMaxResultSize()); + if (!fetchContent && !fetchTimestamp) { scan.setFilter(new KeyOnlyFilter()); } else {
[5/7] kylin git commit: KYLIN-1379 More stable and functional precise count distinct implements after KYLIN-1186
http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv -- diff --git a/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv b/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv index ab513a5..caa8754 100644 --- a/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv +++ b/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv @@ -1,402 +1,402 @@ -2013-03-31,48028,0,\N,\N,\N,Auction,12,184.21,1001,1 -2013-11-12,164262,0,\N,\N,\N,Others,5,172.03,1002,1 -2013-04-06,82494,15,BookMagazines,NULL,Comic Books,Auction,14,66.6,1003,1 -2013-05-17,66767,15,Home & Garden,NULL,Dogs,Auction,12,92.98,1004,1 -2013-05-20,152801,0,Jewelry & Watches,NULL,Earrings,FP-GTC,5,132.33,1005,1 -2013-06-16,43398,0,Home & Garden,NULL,Cheese & Crackers,FP-GTC,13,7.12,1006,1 -2013-06-14,95173,0,Health & Beauty,Bath & Body,Bath Sets & Kits,Auction,14,204.28,1007,1 -2013-03-22,158666,15,ToyHobbies,Action Figures,Anime & Manga,Auction,13,35.72,1008,1 -2013-03-10,12688,0,eBay Premier,Books & Manuscripts,Books: Other,Auction,12,4.13,1009,1 -2013-11-01,103324,15,ClothinShoeAccessories,Women's Shoes,Mixed Items,FP-GTC,5,27.48,1010,1 -2013-06-16,108782,15,Vehicle Parts & Accessories,CaTruck Parts,Car Care & Cleaning,FP-GTC,14,9.26,1011,1 -2013-09-12,80287,0,Computers/Tablets & Networking,Software,Office & Business,Auction,12,3.18,1012,1 -2013-09-28,140746,100,eBay Motors,Parts & Accessories,Vintage Car & Truck Parts,Others,13,3.18,1013,1 -2013-06-15,87118,0,Sporting Goods,Outdoor Sports,Paintball,ABIN,14,377.94,1014,1 -2013-03-14,25147,0,Sports MeCards & Fan Shop,Fan Apparel & Souvenirs,Baseball-MLB,Auction,12,146.33,1015,1 -2013-09-01,170302,15,Crafts,Embroidery,Design CDs,FP-GTC,5,51.23,1016,1 -2013-05-29,53064,0,Business & Industrial,Heavy Equipment,Antique & Vintage Farm Equip,FP-non GTC,13,72.65,1017,1 -2013-05-31,132939,0,Jewelry & Watches,Fashion Jewelry,Other,Auction,13,66.6,1018,1 -2013-03-18,113593,15,Phones,Mobile Phones,Mobile Phones,Auction,12,9.26,1019,1 -2013-07-19,34273,100,eBay Motors,Parts & Accessories,Motorcycle,Auction,14,583.44,1020,1 -2013-06-23,106340,15,Home & Garden,Gardening,Hand Tools,FP-GTC,14,638.72,1021,1 -2013-05-20,150265,15,Baby,Baby Clothing,Boys,FP-GTC,14,4.54,1022,1 -2013-05-17,24760,0,Sports MeCards & Fan Shop,Fan Apparel & Souvenirs,Hockey-NHL,FP-GTC,12,319.79,1023,1 -2013-03-11,37831,0,Collectibles,Advertising,Merchandise & Memorabilia,Auction,12,20.35,1024,1 -2013-01-30,1120,3,Books,First Editions,Other,FP-non GTC,5,223.63,1025,1 -2013-01-26,43972,100,eBay Motors,Parts & Accessories,ATV Parts,FP-GTC,13,204.28,1026,1 -2013-03-22,166013,15,Computers,Computer Components & Parts,Video Capture & TV Tuner Cards,Auction,14,5.48,1027,1 -2013-07-23,15568,15,Baby,Baby Clothing,Unisex,Auction,14,27.48,1028,1 -2013-07-27,103178,15,ClothinShoeAccessories,Women's Bags,Women's Bags,FP-GTC,5,21.72,1029,1 -2013-10-29,2023,0,Sporting Goods,Team Sports,Basketball,ABIN,12,3.18,1030,1 -2013-10-08,94847,0,Consumer Electronics,Vehicle Electronics & GPS,Car Video,FP-GTC,11,491.32,1031,1 -2013-04-26,15868,0,Real Estate,Land,Land,Auction,14,448.8,1032,1 -2013-01-01,32876,0,Home & Garden,Home Improvement,Plumbing & Fixtures,Auction,13,415.73,1033,1 -2013-01-15,62179,0,ClothinShoes & Accessories,Women's Clothing,Athletic Apparel,Auction,13,377.94,1034,1 -2013-05-27,33038,15,Musical Instruments,Instruments,Guitars (Electric),FP-GTC,14,146.33,1035,1 -2013-11-11,156614,0,Toys & Hobbies,Diecast & Toy Vehicles,Cars: RacinNASCAR,FP-GTC,5,7.12,1036,1 -2013-03-08,106246,0,Health & Beauty,Hair Care & Styling,Shampoo & Conditioning,Auction,13,42.99,1037,1 -2013-03-25,20865,0,ClothinShoes & Accessories,Men's Clothing,Athletic Apparel,Auction,13,12.85,1038,1 -2013-08-20,15115,0,Video Games & Consoles,Video Games,Video Games,FP-GTC,13,55.89,1039,1 -2013-05-17,3838,0,Jewelry & Watches,Fashion Jewelry,Charms & Charm Bracelets,FP-GTC,14,73.26,1040,1 -2013-06-05,759,0,Toys & Hobbies,Diecast & Toy Vehicles,CarTrucks & Vans,Auction,11,112.56,1041,1 -2013-10-08,61323,0,Consumer Electronics,TVideo & Home Audio,TVideo & Audio Accessories,FP-non GTC,11,3.49,1042,1 -2013-08-14,121153,0,Baby,Nursery Decor,Night Lights,Auction,13,184.21,1043,1 -2013-08-14,88750,0,Consumer Electronics,Vehicle Electronics & GPS,Radar & Laser Detectors,Auction,13,157.14,1044,1 -2013-05-17,161567,15,Computers,Laptop & Desktop Accessories,Laptop Batteries,FP-GTC,14,72.65,1045,1 -2013-08-09,113802,15,Lots More...,Metaphysical,Herbs,FP-GTC,14,51.23,1046,1
[4/7] kylin git commit: KYLIN-1705 Global (and more scalable) dictionary
KYLIN-1705 Global (and more scalable) dictionary Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ff36ab7b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ff36ab7b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ff36ab7b Branch: refs/heads/KYLIN-1705-CI Commit: ff36ab7b579a1e754daa3070f354fd813f338214 Parents: 7d97377 Author: sunyeruiAuthored: Fri May 27 00:50:14 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:25:49 2016 +0800 -- .../apache/kylin/common/KylinConfigBase.java| 16 + .../common/persistence/ComparableWritable.java | 25 + .../apache/kylin/cube/model/DictionaryDesc.java |9 + .../model/validation/CubeMetadataValidator.java |3 +- .../model/validation/rule/DictionaryRule.java | 87 +- .../validation/rule/DictionaryRuleTest.java | 108 ++ core-dictionary/pom.xml |5 + .../apache/kylin/dict/AppendTrieDictionary.java | 1125 ++ .../org/apache/kylin/dict/CachedTreeMap.java| 348 ++ .../apache/kylin/dict/DictionaryGenerator.java | 24 +- .../apache/kylin/dict/DictionaryManager.java|2 +- .../kylin/dict/GlobalDictionaryBuilder.java | 85 ++ .../apache/kylin/dict/IDictionaryBuilder.java |2 +- .../kylin/dict/AppendTrieDictionaryTest.java| 229 .../engine/mr/steps/MergeCuboidMapper.java | 18 +- 15 files changed, 2066 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java index bc84c65..e300fd7 100644 --- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java +++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java @@ -770,4 +770,20 @@ abstract public class KylinConfigBase implements Serializable { public long getStorageCleanupTimeThreshold() { return Long.valueOf(this.getOptional("kylin.storage.cleanup.time.threshold", "17280")); //default two days } + +public int getAppendDictEntrySize() { +return Integer.parseInt(getOptional("kylin.dict.append.entry.size", "1000")); +} + +public void setAppendDictEntrySize(int entrySize) { +setProperty("kylin.dict.append.entry.size", String.valueOf(entrySize)); +} + +public int getAppendDictCacheSize() { +return Integer.parseInt(getOptional("kylin.dict.append.cache.size", "20")); +} + +public void setAppendDictCacheSize(int cacheSize) { +setProperty("kylin.dict.append.cache.size", String.valueOf(cacheSize)); +} } http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java new file mode 100644 index 000..5dae9cb --- /dev/null +++ b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java @@ -0,0 +1,25 @@ +/* + * 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.persistence; + +/** + * Created by sunyerui on 16/5/11. + */ +public interface ComparableWritable extends Comparable, Writable { +} http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-cube/src/main/java/org/apache/kylin/cube/model/DictionaryDesc.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/DictionaryDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/DictionaryDesc.java
[1/7] kylin git commit: KYLIN-1719 Add config in scan request to control compress the query result or not
Repository: kylin Updated Branches: refs/heads/KYLIN-1705-CI [created] ba7254a34 KYLIN-1719 Add config in scan request to control compress the query result or not Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7d973779 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7d973779 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7d973779 Branch: refs/heads/KYLIN-1705-CI Commit: 7d9737796374b1542467798d8ccf99eda17d5610 Parents: 4018e66 Author: sunyeruiAuthored: Wed Jun 1 22:42:39 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:24:37 2016 +0800 -- .../apache/kylin/cube/model/validation/rule/DictionaryRule.java| 1 + .../apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7d973779/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java new file mode 100644 index 000..7ce263d --- /dev/null +++ b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java @@ -0,0 +1 @@ +package org.apache.kylin.cube.model.validation.rule; /** * Created by sunyerui on 16/6/1. */ public class DictionaryRule { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/7d973779/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java index 0c6a053..e81df61 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java @@ -321,7 +321,7 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC { final AtomicInteger totalScannedCount = new AtomicInteger(0); final ExpectedSizeIterator epResultItr = new ExpectedSizeIterator(shardNum); -final boolean compressionResult = cubeSeg.getCubeDesc().getConfig().getCompressionResult(); +final boolean compressionResult = KylinConfig.getInstanceFromEnv().getCompressionResult(); final CubeVisitProtos.CubeVisitRequest.Builder builder = CubeVisitProtos.CubeVisitRequest.newBuilder(); builder.setGtScanRequest(scanRequestByteString).setHbaseRawScan(rawScanByteString); for (IntList intList : hbaseColumnsToGTIntList) {
[6/7] kylin git commit: KYLIN-1379 More stable and functional precise count distinct implements after KYLIN-1186
KYLIN-1379 More stable and functional precise count distinct implements after KYLIN-1186 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5198b877 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5198b877 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5198b877 Branch: refs/heads/KYLIN-1705-CI Commit: 5198b877e7cbedd361756dd9cd5addbef46d1ed8 Parents: 59aaeb3 Author: sunyeruiAuthored: Sat May 28 17:50:54 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:25:49 2016 +0800 -- .../validation/rule/DictionaryRuleTest.java | 8 +- .../kylin/dict/AppendTrieDictionaryTest.java| 18 + .../kylin/measure/bitmap/BitmapCounter.java | 5 + .../kylin/measure/bitmap/BitmapMeasureType.java | 82 +- ...t_kylin_cube_without_slr_left_join_desc.json | 22 +- .../flatten_data_for_without_slr_left_join.csv | 804 +-- .../apache/kylin/query/ITKylinQueryTest.java| 2 +- .../query/sql_distinct_precisely/query03.sql| 1 + .../query/sql_distinct_precisely/query04.sql| 1 + .../coprocessor/endpoint/CubeVisitService.java | 6 +- 10 files changed, 508 insertions(+), 441 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java -- diff --git a/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java b/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java index ba58d40..99ca7cf 100644 --- a/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java +++ b/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java @@ -71,16 +71,16 @@ public class DictionaryRuleTest extends LocalFileMetadataTestCase { @Test public void testBadDesc() throws IOException { -testBadDictionaryDesc("Column DEFAULT.TEST_KYLIN_FACT.SELLER_ID has inconsistent builders " + +testBadDictionaryDesc("Column EDW.TEST_SITES.SITE_NAME has inconsistent builders " + "FakeBuilderClass and org.apache.kylin.dict.GlobalDictionaryBuilder", -DictionaryDesc.create("SELLER_ID", null, "FakeBuilderClass")); +DictionaryDesc.create("SITE_NAME", null, "FakeBuilderClass")); } @Test public void testBadDesc2() throws IOException { -testBadDictionaryDesc("Column DEFAULT.TEST_KYLIN_FACT.SELLER_ID has inconsistent builders " + +testBadDictionaryDesc("Column EDW.TEST_SITES.SITE_NAME has inconsistent builders " + "FakeBuilderClass and org.apache.kylin.dict.GlobalDictionaryBuilder", -DictionaryDesc.create("lstg_site_id", "SELLER_ID", "FakeBuilderClass")); +DictionaryDesc.create("lstg_site_id", "SITE_NAME", "FakeBuilderClass")); } @Test http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java -- diff --git a/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java index 10bbb77..e7603ec 100644 --- a/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java +++ b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java @@ -1,3 +1,21 @@ +/* + * 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.dict; import org.apache.hadoop.conf.Configuration; http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/core-metadata/src/main/java/org/apache/kylin/measure/bitmap/BitmapCounter.java -- diff --git
[7/7] kylin git commit: KYLIN-1705 code review & cleanup
KYLIN-1705 code review & cleanup Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ba7254a3 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ba7254a3 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ba7254a3 Branch: refs/heads/KYLIN-1705-CI Commit: ba7254a34438e170709a640fa6c5194eb026e7cf Parents: 5198b87 Author: Yang LiAuthored: Sun Jun 5 09:11:30 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 09:11:30 2016 +0800 -- .../apache/kylin/common/KylinConfigBase.java| 2 + .../common/persistence/ComparableWritable.java | 25 -- .../kylin/common/persistence/Writable.java | 82 .../apache/kylin/common/util/Dictionary.java| 26 ++- core-dictionary/pom.xml | 6 +- .../apache/kylin/dict/AppendTrieDictionary.java | 36 - .../org/apache/kylin/dict/CachedTreeMap.java| 27 --- .../hbase/cube/v2/CubeHBaseEndpointRPC.java | 2 +- 8 files changed, 64 insertions(+), 142 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ba7254a3/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java index e300fd7..68e3b6c 100644 --- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java +++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java @@ -775,6 +775,7 @@ abstract public class KylinConfigBase implements Serializable { return Integer.parseInt(getOptional("kylin.dict.append.entry.size", "1000")); } +// for test public void setAppendDictEntrySize(int entrySize) { setProperty("kylin.dict.append.entry.size", String.valueOf(entrySize)); } @@ -783,6 +784,7 @@ abstract public class KylinConfigBase implements Serializable { return Integer.parseInt(getOptional("kylin.dict.append.cache.size", "20")); } +// for test public void setAppendDictCacheSize(int cacheSize) { setProperty("kylin.dict.append.cache.size", String.valueOf(cacheSize)); } http://git-wip-us.apache.org/repos/asf/kylin/blob/ba7254a3/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java deleted file mode 100644 index 5dae9cb..000 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java +++ /dev/null @@ -1,25 +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.persistence; - -/** - * Created by sunyerui on 16/5/11. - */ -public interface ComparableWritable extends Comparable, Writable { -} http://git-wip-us.apache.org/repos/asf/kylin/blob/ba7254a3/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java b/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java deleted file mode 100644 index 7a7fd32..000 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java +++ /dev/null @@ -1,82 +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
[3/7] kylin git commit: KYLIN-1705 Global (and more scalable) dictionary
http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java -- diff --git a/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java new file mode 100644 index 000..10bbb77 --- /dev/null +++ b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java @@ -0,0 +1,229 @@ +package org.apache.kylin.dict; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.kylin.common.KylinConfig; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import java.io.*; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +/** + * Created by sunyerui on 16/4/28. + */ +public class AppendTrieDictionaryTest { + +@BeforeClass +public static void setUp() { +KylinConfig.destroyInstance(); +System.setProperty(KylinConfig.KYLIN_CONF, "../examples/test_case_data/localmeta"); +KylinConfig config = KylinConfig.getInstanceFromEnv(); +config.setAppendDictEntrySize(5); +config.setAppendDictCacheSize(3); +config.setProperty("kylin.hdfs.working.dir", "/tmp"); +} + +@AfterClass +public static void tearDown() { +String workingDir = KylinConfig.getInstanceFromEnv().getHdfsWorkingDirectory(); +try { +FileSystem.get(new Path(workingDir).toUri(), new Configuration()).delete(new Path(workingDir), true); +} catch (IOException e) {} +} + +public static final String[] words = new String[]{ +"paint", "par", "part", "parts", "partition", "partitions", +"party", "partie", "parties", "patient", +"taste", "tar", "trie", "try", "tries", +"åå ¸", "åå ¸æ ", "åæ¯", // non-ascii characters +"", // empty +"paint", "tar", "try", // some dup +}; + +@Test +public void testStringRepeatly() throws IOException { +ArrayList list = new ArrayList<>(); +Collections.addAll(list, words); +ArrayList notfound = new ArrayList<>(); +notfound.add("pa"); +notfound.add("pars"); +notfound.add("tri"); +notfound.add("å"); +for (int i = 0; i < 100; i++) { +testStringDictAppend(list, notfound, true); +} +} + +@Test +public void englishWordsTest() throws Exception { +InputStream is = new FileInputStream("src/test/resources/dict/english-words.80 (scowl-2015.05.18).txt"); +ArrayList str = loadStrings(is); +testStringDictAppend(str, null, false); +} + +@Test +public void categoryNamesTest() throws Exception { +InputStream is = new FileInputStream("src/test/resources/dict/dw_category_grouping_names.dat"); +ArrayList str = loadStrings(is); +testStringDictAppend(str, null, true); +} + +private static ArrayList loadStrings(InputStream is) throws Exception { +ArrayList r = new ArrayList(); +BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); +try { +String word; +while ((word = reader.readLine()) != null) { +word = word.trim(); +if (word.isEmpty() == false) +r.add(word); +} +} finally { +reader.close(); +is.close(); +} +return r; +} + +@Ignore("need huge key set") +@Test +public void testHugeKeySet() throws IOException { +BytesConverter converter = new StringBytesConverter(); +AppendTrieDictionary.Builder b = AppendTrieDictionary.Builder.create("/tmp"); +AppendTrieDictionary dict = null; + +InputStream is = new FileInputStream("src/test/resources/dict/huge_key"); +BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); +try { +String word; +while ((word = reader.readLine()) != null) { +word = word.trim(); +if (!word.isEmpty()); +b.addValue(word); +} +} finally { +reader.close(); +is.close(); +} +dict = b.build(0); +dict.dump(System.out); +} + +private static void testStringDictAppend(ArrayList list, ArrayList notfound, boolean shuffleList) throws IOException { +Random rnd = new Random(System.currentTimeMillis()); +ArrayList strList = new ArrayList(); +strList.addAll(list); +if (shuffleList) { +Collections.shuffle(strList, rnd); +} +BytesConverter converter = new
[2/7] kylin git commit: KYLIN-1728 Introduce dictionary metadata
KYLIN-1728 Introduce dictionary metadata Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/59aaeb30 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/59aaeb30 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/59aaeb30 Branch: refs/heads/KYLIN-1705-CI Commit: 59aaeb3057442dbf621aeefc634db1ae1060daff Parents: ff36ab7 Author: sunyeruiAuthored: Fri May 27 01:27:01 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:25:49 2016 +0800 -- .../java/org/apache/kylin/cube/CubeSegment.java | 3 +- .../org/apache/kylin/cube/model/CubeDesc.java | 30 ++-- .../cube/model/CubeJoinedFlatTableDesc.java | 19 + 3 files changed, 48 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/59aaeb30/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java index a030b92..cbcee14 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java @@ -303,7 +303,8 @@ public class CubeSegment implements Comparable, IRealizationSegment } public Dictionary getDictionary(TblColRef col) { -return CubeManager.getInstance(this.getCubeInstance().getConfig()).getDictionary(this, col); +TblColRef reuseCol = getCubeDesc().getDictionaryReuseColumn(col); +return CubeManager.getInstance(this.getCubeInstance().getConfig()).getDictionary(this, reuseCol); } public CubeDimEncMap getDimensionEncodingMap() { http://git-wip-us.apache.org/repos/asf/kylin/blob/59aaeb30/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 5b72b7e..fec385f 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 @@ -918,6 +918,10 @@ public class CubeDesc extends RootPersistentEntity { if (dictionaries != null) { for (DictionaryDesc dictDesc : dictionaries) { dictDesc.init(this); +allColumns.add(dictDesc.getColumnRef()); +if (dictDesc.getResuseColumnRef() != null) { +allColumns.add(dictDesc.getResuseColumnRef()); +} } } } @@ -1057,13 +1061,28 @@ public class CubeDesc extends RootPersistentEntity { // remove columns that reuse other's dictionary if (dictionaries != null) { for (DictionaryDesc dictDesc : dictionaries) { -if (dictDesc.getResuseColumnRef() != null) +if (dictDesc.getResuseColumnRef() != null) { result.remove(dictDesc.getColumnRef()); +result.add(dictDesc.getResuseColumnRef()); +} } } return result; } + +/** A column may reuse dictionary of another column, find the dict column, return same col if there's no reuse column*/ +public TblColRef getDictionaryReuseColumn(TblColRef col) { +if (dictionaries == null) { +return col; +} +for (DictionaryDesc dictDesc : dictionaries) { +if (dictDesc.getColumnRef().equals(col) && dictDesc.getResuseColumnRef() != null) { +return dictDesc.getResuseColumnRef(); +} +} +return col; +} /** Get a column which can be used in distributing the source table */ public TblColRef getDistributedByColumn() { @@ -1080,8 +1099,13 @@ public class CubeDesc extends RootPersistentEntity { return null; for (DictionaryDesc desc : dictionaries) { -if (col.equals(desc.getColumnRef()) && desc.getBuilderClass() != null) -return desc.getBuilderClass(); +if (desc.getBuilderClass() != null) { +if (col.equals(desc.getResuseColumnRef())) { +return desc.getBuilderClass(); +} else if (col.equals(desc.getColumnRef())) { +return desc.getBuilderClass(); +} +} } return null; } http://git-wip-us.apache.org/repos/asf/kylin/blob/59aaeb30/core-cube/src/main/java/org/apache/kylin/cube/model/CubeJoinedFlatTableDesc.java
[kylin] Git Push Summary
Repository: kylin Updated Branches: refs/heads/KYLIN-1379-1705-1718-1719 [deleted] 47189e117
[6/7] kylin git commit: KYLIN-1379 More stable and functional precise count distinct implements after KYLIN-1186
KYLIN-1379 More stable and functional precise count distinct implements after KYLIN-1186 Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5198b877 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5198b877 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5198b877 Branch: refs/heads/master Commit: 5198b877e7cbedd361756dd9cd5addbef46d1ed8 Parents: 59aaeb3 Author: sunyeruiAuthored: Sat May 28 17:50:54 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:25:49 2016 +0800 -- .../validation/rule/DictionaryRuleTest.java | 8 +- .../kylin/dict/AppendTrieDictionaryTest.java| 18 + .../kylin/measure/bitmap/BitmapCounter.java | 5 + .../kylin/measure/bitmap/BitmapMeasureType.java | 82 +- ...t_kylin_cube_without_slr_left_join_desc.json | 22 +- .../flatten_data_for_without_slr_left_join.csv | 804 +-- .../apache/kylin/query/ITKylinQueryTest.java| 2 +- .../query/sql_distinct_precisely/query03.sql| 1 + .../query/sql_distinct_precisely/query04.sql| 1 + .../coprocessor/endpoint/CubeVisitService.java | 6 +- 10 files changed, 508 insertions(+), 441 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java -- diff --git a/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java b/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java index ba58d40..99ca7cf 100644 --- a/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java +++ b/core-cube/src/test/java/org/apache/kylin/cube/model/validation/rule/DictionaryRuleTest.java @@ -71,16 +71,16 @@ public class DictionaryRuleTest extends LocalFileMetadataTestCase { @Test public void testBadDesc() throws IOException { -testBadDictionaryDesc("Column DEFAULT.TEST_KYLIN_FACT.SELLER_ID has inconsistent builders " + +testBadDictionaryDesc("Column EDW.TEST_SITES.SITE_NAME has inconsistent builders " + "FakeBuilderClass and org.apache.kylin.dict.GlobalDictionaryBuilder", -DictionaryDesc.create("SELLER_ID", null, "FakeBuilderClass")); +DictionaryDesc.create("SITE_NAME", null, "FakeBuilderClass")); } @Test public void testBadDesc2() throws IOException { -testBadDictionaryDesc("Column DEFAULT.TEST_KYLIN_FACT.SELLER_ID has inconsistent builders " + +testBadDictionaryDesc("Column EDW.TEST_SITES.SITE_NAME has inconsistent builders " + "FakeBuilderClass and org.apache.kylin.dict.GlobalDictionaryBuilder", -DictionaryDesc.create("lstg_site_id", "SELLER_ID", "FakeBuilderClass")); +DictionaryDesc.create("lstg_site_id", "SITE_NAME", "FakeBuilderClass")); } @Test http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java -- diff --git a/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java index 10bbb77..e7603ec 100644 --- a/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java +++ b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java @@ -1,3 +1,21 @@ +/* + * 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.dict; import org.apache.hadoop.conf.Configuration; http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/core-metadata/src/main/java/org/apache/kylin/measure/bitmap/BitmapCounter.java -- diff --git
[7/7] kylin git commit: KYLIN-1705 code review & cleanup
KYLIN-1705 code review & cleanup Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ba7254a3 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ba7254a3 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ba7254a3 Branch: refs/heads/master Commit: ba7254a34438e170709a640fa6c5194eb026e7cf Parents: 5198b87 Author: Yang LiAuthored: Sun Jun 5 09:11:30 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 09:11:30 2016 +0800 -- .../apache/kylin/common/KylinConfigBase.java| 2 + .../common/persistence/ComparableWritable.java | 25 -- .../kylin/common/persistence/Writable.java | 82 .../apache/kylin/common/util/Dictionary.java| 26 ++- core-dictionary/pom.xml | 6 +- .../apache/kylin/dict/AppendTrieDictionary.java | 36 - .../org/apache/kylin/dict/CachedTreeMap.java| 27 --- .../hbase/cube/v2/CubeHBaseEndpointRPC.java | 2 +- 8 files changed, 64 insertions(+), 142 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ba7254a3/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java index e300fd7..68e3b6c 100644 --- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java +++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java @@ -775,6 +775,7 @@ abstract public class KylinConfigBase implements Serializable { return Integer.parseInt(getOptional("kylin.dict.append.entry.size", "1000")); } +// for test public void setAppendDictEntrySize(int entrySize) { setProperty("kylin.dict.append.entry.size", String.valueOf(entrySize)); } @@ -783,6 +784,7 @@ abstract public class KylinConfigBase implements Serializable { return Integer.parseInt(getOptional("kylin.dict.append.cache.size", "20")); } +// for test public void setAppendDictCacheSize(int cacheSize) { setProperty("kylin.dict.append.cache.size", String.valueOf(cacheSize)); } http://git-wip-us.apache.org/repos/asf/kylin/blob/ba7254a3/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java deleted file mode 100644 index 5dae9cb..000 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java +++ /dev/null @@ -1,25 +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.persistence; - -/** - * Created by sunyerui on 16/5/11. - */ -public interface ComparableWritable extends Comparable, Writable { -} http://git-wip-us.apache.org/repos/asf/kylin/blob/ba7254a3/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java b/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java deleted file mode 100644 index 7a7fd32..000 --- a/core-common/src/main/java/org/apache/kylin/common/persistence/Writable.java +++ /dev/null @@ -1,82 +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
[5/7] kylin git commit: KYLIN-1379 More stable and functional precise count distinct implements after KYLIN-1186
http://git-wip-us.apache.org/repos/asf/kylin/blob/5198b877/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv -- diff --git a/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv b/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv index ab513a5..caa8754 100644 --- a/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv +++ b/examples/test_case_data/localmeta/data/flatten_data_for_without_slr_left_join.csv @@ -1,402 +1,402 @@ -2013-03-31,48028,0,\N,\N,\N,Auction,12,184.21,1001,1 -2013-11-12,164262,0,\N,\N,\N,Others,5,172.03,1002,1 -2013-04-06,82494,15,BookMagazines,NULL,Comic Books,Auction,14,66.6,1003,1 -2013-05-17,66767,15,Home & Garden,NULL,Dogs,Auction,12,92.98,1004,1 -2013-05-20,152801,0,Jewelry & Watches,NULL,Earrings,FP-GTC,5,132.33,1005,1 -2013-06-16,43398,0,Home & Garden,NULL,Cheese & Crackers,FP-GTC,13,7.12,1006,1 -2013-06-14,95173,0,Health & Beauty,Bath & Body,Bath Sets & Kits,Auction,14,204.28,1007,1 -2013-03-22,158666,15,ToyHobbies,Action Figures,Anime & Manga,Auction,13,35.72,1008,1 -2013-03-10,12688,0,eBay Premier,Books & Manuscripts,Books: Other,Auction,12,4.13,1009,1 -2013-11-01,103324,15,ClothinShoeAccessories,Women's Shoes,Mixed Items,FP-GTC,5,27.48,1010,1 -2013-06-16,108782,15,Vehicle Parts & Accessories,CaTruck Parts,Car Care & Cleaning,FP-GTC,14,9.26,1011,1 -2013-09-12,80287,0,Computers/Tablets & Networking,Software,Office & Business,Auction,12,3.18,1012,1 -2013-09-28,140746,100,eBay Motors,Parts & Accessories,Vintage Car & Truck Parts,Others,13,3.18,1013,1 -2013-06-15,87118,0,Sporting Goods,Outdoor Sports,Paintball,ABIN,14,377.94,1014,1 -2013-03-14,25147,0,Sports MeCards & Fan Shop,Fan Apparel & Souvenirs,Baseball-MLB,Auction,12,146.33,1015,1 -2013-09-01,170302,15,Crafts,Embroidery,Design CDs,FP-GTC,5,51.23,1016,1 -2013-05-29,53064,0,Business & Industrial,Heavy Equipment,Antique & Vintage Farm Equip,FP-non GTC,13,72.65,1017,1 -2013-05-31,132939,0,Jewelry & Watches,Fashion Jewelry,Other,Auction,13,66.6,1018,1 -2013-03-18,113593,15,Phones,Mobile Phones,Mobile Phones,Auction,12,9.26,1019,1 -2013-07-19,34273,100,eBay Motors,Parts & Accessories,Motorcycle,Auction,14,583.44,1020,1 -2013-06-23,106340,15,Home & Garden,Gardening,Hand Tools,FP-GTC,14,638.72,1021,1 -2013-05-20,150265,15,Baby,Baby Clothing,Boys,FP-GTC,14,4.54,1022,1 -2013-05-17,24760,0,Sports MeCards & Fan Shop,Fan Apparel & Souvenirs,Hockey-NHL,FP-GTC,12,319.79,1023,1 -2013-03-11,37831,0,Collectibles,Advertising,Merchandise & Memorabilia,Auction,12,20.35,1024,1 -2013-01-30,1120,3,Books,First Editions,Other,FP-non GTC,5,223.63,1025,1 -2013-01-26,43972,100,eBay Motors,Parts & Accessories,ATV Parts,FP-GTC,13,204.28,1026,1 -2013-03-22,166013,15,Computers,Computer Components & Parts,Video Capture & TV Tuner Cards,Auction,14,5.48,1027,1 -2013-07-23,15568,15,Baby,Baby Clothing,Unisex,Auction,14,27.48,1028,1 -2013-07-27,103178,15,ClothinShoeAccessories,Women's Bags,Women's Bags,FP-GTC,5,21.72,1029,1 -2013-10-29,2023,0,Sporting Goods,Team Sports,Basketball,ABIN,12,3.18,1030,1 -2013-10-08,94847,0,Consumer Electronics,Vehicle Electronics & GPS,Car Video,FP-GTC,11,491.32,1031,1 -2013-04-26,15868,0,Real Estate,Land,Land,Auction,14,448.8,1032,1 -2013-01-01,32876,0,Home & Garden,Home Improvement,Plumbing & Fixtures,Auction,13,415.73,1033,1 -2013-01-15,62179,0,ClothinShoes & Accessories,Women's Clothing,Athletic Apparel,Auction,13,377.94,1034,1 -2013-05-27,33038,15,Musical Instruments,Instruments,Guitars (Electric),FP-GTC,14,146.33,1035,1 -2013-11-11,156614,0,Toys & Hobbies,Diecast & Toy Vehicles,Cars: RacinNASCAR,FP-GTC,5,7.12,1036,1 -2013-03-08,106246,0,Health & Beauty,Hair Care & Styling,Shampoo & Conditioning,Auction,13,42.99,1037,1 -2013-03-25,20865,0,ClothinShoes & Accessories,Men's Clothing,Athletic Apparel,Auction,13,12.85,1038,1 -2013-08-20,15115,0,Video Games & Consoles,Video Games,Video Games,FP-GTC,13,55.89,1039,1 -2013-05-17,3838,0,Jewelry & Watches,Fashion Jewelry,Charms & Charm Bracelets,FP-GTC,14,73.26,1040,1 -2013-06-05,759,0,Toys & Hobbies,Diecast & Toy Vehicles,CarTrucks & Vans,Auction,11,112.56,1041,1 -2013-10-08,61323,0,Consumer Electronics,TVideo & Home Audio,TVideo & Audio Accessories,FP-non GTC,11,3.49,1042,1 -2013-08-14,121153,0,Baby,Nursery Decor,Night Lights,Auction,13,184.21,1043,1 -2013-08-14,88750,0,Consumer Electronics,Vehicle Electronics & GPS,Radar & Laser Detectors,Auction,13,157.14,1044,1 -2013-05-17,161567,15,Computers,Laptop & Desktop Accessories,Laptop Batteries,FP-GTC,14,72.65,1045,1 -2013-08-09,113802,15,Lots More...,Metaphysical,Herbs,FP-GTC,14,51.23,1046,1
[1/7] kylin git commit: KYLIN-1719 Add config in scan request to control compress the query result or not
Repository: kylin Updated Branches: refs/heads/master 4018e6671 -> ba7254a34 KYLIN-1719 Add config in scan request to control compress the query result or not Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7d973779 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7d973779 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7d973779 Branch: refs/heads/master Commit: 7d9737796374b1542467798d8ccf99eda17d5610 Parents: 4018e66 Author: sunyeruiAuthored: Wed Jun 1 22:42:39 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:24:37 2016 +0800 -- .../apache/kylin/cube/model/validation/rule/DictionaryRule.java| 1 + .../apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/7d973779/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java new file mode 100644 index 000..7ce263d --- /dev/null +++ b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/DictionaryRule.java @@ -0,0 +1 @@ +package org.apache.kylin.cube.model.validation.rule; /** * Created by sunyerui on 16/6/1. */ public class DictionaryRule { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/7d973779/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java -- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java index 0c6a053..e81df61 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java @@ -321,7 +321,7 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC { final AtomicInteger totalScannedCount = new AtomicInteger(0); final ExpectedSizeIterator epResultItr = new ExpectedSizeIterator(shardNum); -final boolean compressionResult = cubeSeg.getCubeDesc().getConfig().getCompressionResult(); +final boolean compressionResult = KylinConfig.getInstanceFromEnv().getCompressionResult(); final CubeVisitProtos.CubeVisitRequest.Builder builder = CubeVisitProtos.CubeVisitRequest.newBuilder(); builder.setGtScanRequest(scanRequestByteString).setHbaseRawScan(rawScanByteString); for (IntList intList : hbaseColumnsToGTIntList) {
[3/7] kylin git commit: KYLIN-1705 Global (and more scalable) dictionary
http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java -- diff --git a/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java new file mode 100644 index 000..10bbb77 --- /dev/null +++ b/core-dictionary/src/test/java/org/apache/kylin/dict/AppendTrieDictionaryTest.java @@ -0,0 +1,229 @@ +package org.apache.kylin.dict; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.kylin.common.KylinConfig; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import java.io.*; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +/** + * Created by sunyerui on 16/4/28. + */ +public class AppendTrieDictionaryTest { + +@BeforeClass +public static void setUp() { +KylinConfig.destroyInstance(); +System.setProperty(KylinConfig.KYLIN_CONF, "../examples/test_case_data/localmeta"); +KylinConfig config = KylinConfig.getInstanceFromEnv(); +config.setAppendDictEntrySize(5); +config.setAppendDictCacheSize(3); +config.setProperty("kylin.hdfs.working.dir", "/tmp"); +} + +@AfterClass +public static void tearDown() { +String workingDir = KylinConfig.getInstanceFromEnv().getHdfsWorkingDirectory(); +try { +FileSystem.get(new Path(workingDir).toUri(), new Configuration()).delete(new Path(workingDir), true); +} catch (IOException e) {} +} + +public static final String[] words = new String[]{ +"paint", "par", "part", "parts", "partition", "partitions", +"party", "partie", "parties", "patient", +"taste", "tar", "trie", "try", "tries", +"åå ¸", "åå ¸æ ", "åæ¯", // non-ascii characters +"", // empty +"paint", "tar", "try", // some dup +}; + +@Test +public void testStringRepeatly() throws IOException { +ArrayList list = new ArrayList<>(); +Collections.addAll(list, words); +ArrayList notfound = new ArrayList<>(); +notfound.add("pa"); +notfound.add("pars"); +notfound.add("tri"); +notfound.add("å"); +for (int i = 0; i < 100; i++) { +testStringDictAppend(list, notfound, true); +} +} + +@Test +public void englishWordsTest() throws Exception { +InputStream is = new FileInputStream("src/test/resources/dict/english-words.80 (scowl-2015.05.18).txt"); +ArrayList str = loadStrings(is); +testStringDictAppend(str, null, false); +} + +@Test +public void categoryNamesTest() throws Exception { +InputStream is = new FileInputStream("src/test/resources/dict/dw_category_grouping_names.dat"); +ArrayList str = loadStrings(is); +testStringDictAppend(str, null, true); +} + +private static ArrayList loadStrings(InputStream is) throws Exception { +ArrayList r = new ArrayList(); +BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); +try { +String word; +while ((word = reader.readLine()) != null) { +word = word.trim(); +if (word.isEmpty() == false) +r.add(word); +} +} finally { +reader.close(); +is.close(); +} +return r; +} + +@Ignore("need huge key set") +@Test +public void testHugeKeySet() throws IOException { +BytesConverter converter = new StringBytesConverter(); +AppendTrieDictionary.Builder b = AppendTrieDictionary.Builder.create("/tmp"); +AppendTrieDictionary dict = null; + +InputStream is = new FileInputStream("src/test/resources/dict/huge_key"); +BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); +try { +String word; +while ((word = reader.readLine()) != null) { +word = word.trim(); +if (!word.isEmpty()); +b.addValue(word); +} +} finally { +reader.close(); +is.close(); +} +dict = b.build(0); +dict.dump(System.out); +} + +private static void testStringDictAppend(ArrayList list, ArrayList notfound, boolean shuffleList) throws IOException { +Random rnd = new Random(System.currentTimeMillis()); +ArrayList strList = new ArrayList(); +strList.addAll(list); +if (shuffleList) { +Collections.shuffle(strList, rnd); +} +BytesConverter converter = new
[4/7] kylin git commit: KYLIN-1705 Global (and more scalable) dictionary
KYLIN-1705 Global (and more scalable) dictionary Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ff36ab7b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ff36ab7b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ff36ab7b Branch: refs/heads/master Commit: ff36ab7b579a1e754daa3070f354fd813f338214 Parents: 7d97377 Author: sunyeruiAuthored: Fri May 27 00:50:14 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:25:49 2016 +0800 -- .../apache/kylin/common/KylinConfigBase.java| 16 + .../common/persistence/ComparableWritable.java | 25 + .../apache/kylin/cube/model/DictionaryDesc.java |9 + .../model/validation/CubeMetadataValidator.java |3 +- .../model/validation/rule/DictionaryRule.java | 87 +- .../validation/rule/DictionaryRuleTest.java | 108 ++ core-dictionary/pom.xml |5 + .../apache/kylin/dict/AppendTrieDictionary.java | 1125 ++ .../org/apache/kylin/dict/CachedTreeMap.java| 348 ++ .../apache/kylin/dict/DictionaryGenerator.java | 24 +- .../apache/kylin/dict/DictionaryManager.java|2 +- .../kylin/dict/GlobalDictionaryBuilder.java | 85 ++ .../apache/kylin/dict/IDictionaryBuilder.java |2 +- .../kylin/dict/AppendTrieDictionaryTest.java| 229 .../engine/mr/steps/MergeCuboidMapper.java | 18 +- 15 files changed, 2066 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java index bc84c65..e300fd7 100644 --- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java +++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java @@ -770,4 +770,20 @@ abstract public class KylinConfigBase implements Serializable { public long getStorageCleanupTimeThreshold() { return Long.valueOf(this.getOptional("kylin.storage.cleanup.time.threshold", "17280")); //default two days } + +public int getAppendDictEntrySize() { +return Integer.parseInt(getOptional("kylin.dict.append.entry.size", "1000")); +} + +public void setAppendDictEntrySize(int entrySize) { +setProperty("kylin.dict.append.entry.size", String.valueOf(entrySize)); +} + +public int getAppendDictCacheSize() { +return Integer.parseInt(getOptional("kylin.dict.append.cache.size", "20")); +} + +public void setAppendDictCacheSize(int cacheSize) { +setProperty("kylin.dict.append.cache.size", String.valueOf(cacheSize)); +} } http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java -- diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java new file mode 100644 index 000..5dae9cb --- /dev/null +++ b/core-common/src/main/java/org/apache/kylin/common/persistence/ComparableWritable.java @@ -0,0 +1,25 @@ +/* + * 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.persistence; + +/** + * Created by sunyerui on 16/5/11. + */ +public interface ComparableWritable extends Comparable, Writable { +} http://git-wip-us.apache.org/repos/asf/kylin/blob/ff36ab7b/core-cube/src/main/java/org/apache/kylin/cube/model/DictionaryDesc.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/DictionaryDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/DictionaryDesc.java index
[2/7] kylin git commit: KYLIN-1728 Introduce dictionary metadata
KYLIN-1728 Introduce dictionary metadata Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/59aaeb30 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/59aaeb30 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/59aaeb30 Branch: refs/heads/master Commit: 59aaeb3057442dbf621aeefc634db1ae1060daff Parents: ff36ab7 Author: sunyeruiAuthored: Fri May 27 01:27:01 2016 +0800 Committer: Yang Li Committed: Sun Jun 5 08:25:49 2016 +0800 -- .../java/org/apache/kylin/cube/CubeSegment.java | 3 +- .../org/apache/kylin/cube/model/CubeDesc.java | 30 ++-- .../cube/model/CubeJoinedFlatTableDesc.java | 19 + 3 files changed, 48 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/59aaeb30/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java -- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java index a030b92..cbcee14 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java @@ -303,7 +303,8 @@ public class CubeSegment implements Comparable, IRealizationSegment } public Dictionary getDictionary(TblColRef col) { -return CubeManager.getInstance(this.getCubeInstance().getConfig()).getDictionary(this, col); +TblColRef reuseCol = getCubeDesc().getDictionaryReuseColumn(col); +return CubeManager.getInstance(this.getCubeInstance().getConfig()).getDictionary(this, reuseCol); } public CubeDimEncMap getDimensionEncodingMap() { http://git-wip-us.apache.org/repos/asf/kylin/blob/59aaeb30/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 5b72b7e..fec385f 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 @@ -918,6 +918,10 @@ public class CubeDesc extends RootPersistentEntity { if (dictionaries != null) { for (DictionaryDesc dictDesc : dictionaries) { dictDesc.init(this); +allColumns.add(dictDesc.getColumnRef()); +if (dictDesc.getResuseColumnRef() != null) { +allColumns.add(dictDesc.getResuseColumnRef()); +} } } } @@ -1057,13 +1061,28 @@ public class CubeDesc extends RootPersistentEntity { // remove columns that reuse other's dictionary if (dictionaries != null) { for (DictionaryDesc dictDesc : dictionaries) { -if (dictDesc.getResuseColumnRef() != null) +if (dictDesc.getResuseColumnRef() != null) { result.remove(dictDesc.getColumnRef()); +result.add(dictDesc.getResuseColumnRef()); +} } } return result; } + +/** A column may reuse dictionary of another column, find the dict column, return same col if there's no reuse column*/ +public TblColRef getDictionaryReuseColumn(TblColRef col) { +if (dictionaries == null) { +return col; +} +for (DictionaryDesc dictDesc : dictionaries) { +if (dictDesc.getColumnRef().equals(col) && dictDesc.getResuseColumnRef() != null) { +return dictDesc.getResuseColumnRef(); +} +} +return col; +} /** Get a column which can be used in distributing the source table */ public TblColRef getDistributedByColumn() { @@ -1080,8 +1099,13 @@ public class CubeDesc extends RootPersistentEntity { return null; for (DictionaryDesc desc : dictionaries) { -if (col.equals(desc.getColumnRef()) && desc.getBuilderClass() != null) -return desc.getBuilderClass(); +if (desc.getBuilderClass() != null) { +if (col.equals(desc.getResuseColumnRef())) { +return desc.getBuilderClass(); +} else if (col.equals(desc.getColumnRef())) { +return desc.getBuilderClass(); +} +} } return null; } http://git-wip-us.apache.org/repos/asf/kylin/blob/59aaeb30/core-cube/src/main/java/org/apache/kylin/cube/model/CubeJoinedFlatTableDesc.java
kylin git commit: minor, fix MeasureDecoder getPeekLength method
Repository: kylin Updated Branches: refs/heads/master 800fbd218 -> 6788ee6e1 minor, fix MeasureDecoder getPeekLength method 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/6788ee6e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6788ee6e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6788ee6e Branch: refs/heads/master Commit: 6788ee6e1aa925334c79bb422a09ea7957363537 Parents: 800fbd2 Author: Roger Shi Authored: Wed Jun 8 11:32:53 2016 +0800 Committer: Li Yang Committed: Wed Jun 8 11:40:53 2016 +0800 -- .../src/main/java/org/apache/kylin/measure/MeasureDecoder.java| 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/6788ee6e/core-metadata/src/main/java/org/apache/kylin/measure/MeasureDecoder.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/MeasureDecoder.java b/core-metadata/src/main/java/org/apache/kylin/measure/MeasureDecoder.java index 87b4603..9656020 100644 --- a/core-metadata/src/main/java/org/apache/kylin/measure/MeasureDecoder.java +++ b/core-metadata/src/main/java/org/apache/kylin/measure/MeasureDecoder.java @@ -78,8 +78,11 @@ public class MeasureDecoder { public int[] getPeekLength(ByteBuffer buf) { int[] length = new int[nMeasures]; +int offset = 0; for (int i = 0; i < nMeasures; i++) { length[i] = serializers[i].peekLength(buf); +offset += length[i]; +buf.position(offset); } return length; }
kylin git commit: minor, add serialVersionUID to DimensionEncoding
Repository: kylin Updated Branches: refs/heads/master 4668bd31e -> c5db38786 minor, add serialVersionUID to DimensionEncoding Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/c5db3878 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/c5db3878 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/c5db3878 Branch: refs/heads/master Commit: c5db387863ca7fa05c5eecf1c44082c605845d03 Parents: 4668bd3 Author: Yang LiAuthored: Mon Jun 6 22:26:21 2016 +0800 Committer: Yang Li Committed: Mon Jun 6 22:26:21 2016 +0800 -- .../src/main/java/org/apache/kylin/dimension/DimensionEncoding.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/kylin/blob/c5db3878/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncoding.java -- diff --git a/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncoding.java b/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncoding.java index 87dfc08..994982b 100644 --- a/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncoding.java +++ b/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncoding.java @@ -33,6 +33,7 @@ import org.apache.kylin.metadata.datatype.DataTypeSerializer; * cannot work on DimensionEncoding. */ public abstract class DimensionEncoding implements Externalizable { +private static final long serialVersionUID = 1L; // it's convention that all 0xff means NULL public static final byte NULL = (byte) 0xff;