http://git-wip-us.apache.org/repos/asf/kylin/blob/2cc0b9c4/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/LocalDictionary.java ---------------------------------------------------------------------- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/LocalDictionary.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/LocalDictionary.java deleted file mode 100644 index 6bf261f..0000000 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/LocalDictionary.java +++ /dev/null @@ -1,74 +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.storage.hbase.ii.coprocessor.endpoint; - -import java.util.Map; - -import org.apache.kylin.common.util.Dictionary; -import org.apache.kylin.dimension.DictionaryDimEnc; -import org.apache.kylin.dimension.DimensionEncoding; -import org.apache.kylin.dimension.FixedLenDimEnc; -import org.apache.kylin.dimension.IDimensionEncodingMap; -import org.apache.kylin.invertedindex.index.TableRecordInfoDigest; -import org.apache.kylin.metadata.model.TblColRef; -import org.apache.kylin.storage.hbase.common.coprocessor.CoprocessorRowType; - -import com.google.common.collect.Maps; - -/** - */ -public class LocalDictionary implements IDimensionEncodingMap { - - private CoprocessorRowType type; - private Dictionary<?>[] colDictMap; - private TableRecordInfoDigest recordInfo; - private Map<TblColRef, DimensionEncoding> encMap; - - public LocalDictionary(Dictionary<?>[] colDictMap, CoprocessorRowType type, TableRecordInfoDigest recordInfo) { - this.colDictMap = colDictMap; - this.type = type; - this.recordInfo = recordInfo; - this.encMap = Maps.newHashMap(); - } - - @Override - public DimensionEncoding get(TblColRef col) { - DimensionEncoding result = encMap.get(col); - if (result == null) { - Dictionary<String> dict = getDictionary(col); - if (dict == null) { - int idx = type.getColIndexByTblColRef(col); - int len = recordInfo.length(idx); - result = new FixedLenDimEnc(len); - } else { - result = new DictionaryDimEnc(dict); - } - encMap.put(col, result); - } - return result; - } - - @SuppressWarnings("unchecked") - @Override - public Dictionary<String> getDictionary(TblColRef col) { - int idx = type.getColIndexByTblColRef(col); - return (Dictionary<String>) this.colDictMap[idx]; - } - -}
http://git-wip-us.apache.org/repos/asf/kylin/blob/2cc0b9c4/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/SliceBitMapProvider.java ---------------------------------------------------------------------- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/SliceBitMapProvider.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/SliceBitMapProvider.java deleted file mode 100644 index 21c4096..0000000 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/SliceBitMapProvider.java +++ /dev/null @@ -1,55 +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.storage.hbase.ii.coprocessor.endpoint; - -import org.apache.kylin.invertedindex.index.Slice; -import org.apache.kylin.metadata.model.TblColRef; -import org.apache.kylin.storage.hbase.common.coprocessor.CoprocessorRowType; - -import it.uniroma3.mat.extendedset.intset.ConciseSet; - -/** - * <p/> - * an adapter - */ -public class SliceBitMapProvider implements BitMapFilterEvaluator.BitMapProvider { - - private Slice slice; - private CoprocessorRowType type; - - public SliceBitMapProvider(Slice slice, CoprocessorRowType type) { - this.slice = slice; - this.type = type; - } - - @Override - public ConciseSet getBitMap(TblColRef col, Integer startId, Integer endId) { - return slice.getColumnValueContainer(type.getColIndexByTblColRef(col)).getBitMap(startId, endId); - } - - @Override - public int getRecordCount() { - return this.slice.getRecordCount(); - } - - @Override - public int getMaxValueId(TblColRef col) { - return slice.getColumnValueContainer(type.getColIndexByTblColRef(col)).getMaxValueId(); - } -}