You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ch...@apache.org on 2016/08/15 07:09:00 UTC
[15/52] [partial] incubator-carbondata git commit: Renamed packages
to org.apache.carbondata and fixed errors
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataFileStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataFileStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataFileStore.java
deleted file mode 100644
index dd92dfa..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataFileStore.java
+++ /dev/null
@@ -1,110 +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.carbondata.core.datastorage.store.impl.data.compressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.MeasureDataWrapper;
-import org.carbondata.core.datastorage.store.compression.ValueCompressionModel;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.datastorage.store.impl.CompressedDataMeasureDataWrapper;
-
-public class HeavyCompressedDoubleArrayDataFileStore
- extends AbstractHeavyCompressedDoubleArrayDataStore {
- /**
- * measuresOffsetsArray.
- */
- private long[] measuresOffsetsArray;
-
- /**
- * measuresLengthArray.
- */
- private int[] measuresLengthArray;
-
- /**
- * fileName.
- */
- private String fileName;
-
- /**
- * HeavyCompressedDoubleArrayDataFileStore.
- *
- * @param compressionModel
- * @param measuresOffsetsArray
- * @param measuresLengthArray
- * @param fileName
- */
- public HeavyCompressedDoubleArrayDataFileStore(ValueCompressionModel compressionModel,
- long[] measuresOffsetsArray, int[] measuresLengthArray, String fileName) {
- super(compressionModel);
- if (null != compressionModel) {
- this.fileName = fileName;
- this.measuresLengthArray = measuresLengthArray;
- this.measuresOffsetsArray = measuresOffsetsArray;
- for (int i = 0; i < values.length; i++) {
- values[i] = compressionModel.getUnCompressValues()[i].getNew().getCompressorObject();
- }
- }
- }
-
- @Override public MeasureDataWrapper getBackData(int[] cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
-
- if (cols != null) {
- for (int i = 0; i < cols.length; i++) {
- ValueCompressonHolder.UnCompressValue copy = values[cols[i]].getNew();
- copy.setValue(fileHolder
- .readByteArray(fileName, measuresOffsetsArray[cols[i]], measuresLengthArray[cols[i]]));
- vals[cols[i]] = copy.uncompress(compressionModel.getChangedDataType()[cols[i]])
- .getValues(compressionModel.getDecimal()[cols[i]],
- compressionModel.getMaxValue()[cols[i]]);
- copy = null;
- }
- } else {
- for (int j = 0; j < vals.length; j++) {
- ValueCompressonHolder.UnCompressValue copy = values[j].getNew();
- copy.setValue(
- fileHolder.readByteArray(fileName, measuresOffsetsArray[j], measuresLengthArray[j]));
- vals[j] = copy.uncompress(compressionModel.getChangedDataType()[j])
- .getValues(compressionModel.getDecimal()[j], compressionModel.getMaxValue()[j]);
- copy = null;
- }
- }
- return new CompressedDataMeasureDataWrapper(vals);
-
- }
-
- @Override public MeasureDataWrapper getBackData(int cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
- ValueCompressonHolder.UnCompressValue copy = values[cols].getNew();
- copy.setValue(
- fileHolder.readByteArray(fileName, measuresOffsetsArray[cols], measuresLengthArray[cols]));
- vals[cols] = copy.uncompress(compressionModel.getChangedDataType()[cols])
- .getValues(compressionModel.getDecimal()[cols], compressionModel.getMaxValue()[cols]);
- return new CompressedDataMeasureDataWrapper(vals);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java
deleted file mode 100644
index cf1585e..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java
+++ /dev/null
@@ -1,76 +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.carbondata.core.datastorage.store.impl.data.compressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.MeasureDataWrapper;
-import org.carbondata.core.datastorage.store.compression.ValueCompressionModel;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.datastorage.store.impl.CompressedDataMeasureDataWrapper;
-
-public class HeavyCompressedDoubleArrayDataInMemoryStore
- extends AbstractHeavyCompressedDoubleArrayDataStore {
-
- public HeavyCompressedDoubleArrayDataInMemoryStore(ValueCompressionModel compressionModel,
- long[] measuresOffsetsArray, int[] measuresLengthArray, String fileName,
- FileHolder fileHolder) {
- super(compressionModel);
- for (int i = 0; i < measuresLengthArray.length; i++) {
- values[i] = compressionModel.getUnCompressValues()[i].getCompressorObject();
- values[i].setValue(
- fileHolder.readByteArray(fileName, measuresOffsetsArray[i], measuresLengthArray[i]));
- }
- }
-
- public HeavyCompressedDoubleArrayDataInMemoryStore(ValueCompressionModel compressionModel) {
- super(compressionModel);
- }
-
- @Override public MeasureDataWrapper getBackData(int[] cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
- if (cols != null) {
- for (int i = 0; i < cols.length; i++) {
- vals[cols[i]] = values[cols[i]].uncompress(compressionModel.getChangedDataType()[cols[i]])
- .getValues(compressionModel.getDecimal()[cols[i]],
- compressionModel.getMaxValue()[cols[i]]);
- }
- } else {
- for (int i = 0; i < vals.length; i++) {
-
- vals[i] = values[i].uncompress(compressionModel.getChangedDataType()[i])
- .getValues(compressionModel.getDecimal()[i], compressionModel.getMaxValue()[i]);
- }
- }
- return new CompressedDataMeasureDataWrapper(vals);
- }
-
- @Override public MeasureDataWrapper getBackData(int cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
- vals[cols] = values[cols].uncompress(compressionModel.getChangedDataType()[cols])
- .getValues(compressionModel.getDecimal()[cols], compressionModel.getMaxValue()[cols]);
- return new CompressedDataMeasureDataWrapper(vals);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/AbstractDoubleArrayDataStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/AbstractDoubleArrayDataStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/AbstractDoubleArrayDataStore.java
deleted file mode 100644
index 811fad0..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/AbstractDoubleArrayDataStore.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 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.carbondata.core.datastorage.store.impl.data.uncompressed;
-
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.core.datastorage.store.NodeMeasureDataStore;
-import org.carbondata.core.datastorage.store.compression.ValueCompressionModel;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.carbondata.core.datastorage.store.dataholder.CarbonWriteDataHolder;
-import org.carbondata.core.util.ValueCompressionUtil;
-
-public abstract class AbstractDoubleArrayDataStore implements NodeMeasureDataStore {
-
- protected ValueCompressonHolder.UnCompressValue[] values;
-
- protected ValueCompressionModel compressionModel;
-
- private char[] type;
-
- public AbstractDoubleArrayDataStore(ValueCompressionModel compressionModel) {
- this.compressionModel = compressionModel;
- if (null != compressionModel) {
- values =
- new ValueCompressonHolder.UnCompressValue[compressionModel.getUnCompressValues().length];
- type = compressionModel.getType();
- }
- }
-
- @Override public byte[][] getWritableMeasureDataArray(CarbonWriteDataHolder[] dataHolder) {
- values =
- new ValueCompressonHolder.UnCompressValue[compressionModel.getUnCompressValues().length];
- for (int i = 0; i < compressionModel.getUnCompressValues().length; i++) {
- values[i] = compressionModel.getUnCompressValues()[i].getNew();
- if (type[i] != CarbonCommonConstants.BYTE_VALUE_MEASURE
- && type[i] != CarbonCommonConstants.BIG_DECIMAL_MEASURE) {
- if (type[i] == CarbonCommonConstants.BIG_INT_MEASURE) {
- values[i].setValue(ValueCompressionUtil
- .getCompressedValues(compressionModel.getCompType()[i],
- dataHolder[i].getWritableLongValues(), compressionModel.getChangedDataType()[i],
- (long) compressionModel.getMaxValue()[i], compressionModel.getDecimal()[i]));
- } else {
- values[i].setValue(ValueCompressionUtil
- .getCompressedValues(compressionModel.getCompType()[i],
- dataHolder[i].getWritableDoubleValues(), compressionModel.getChangedDataType()[i],
- (double) compressionModel.getMaxValue()[i], compressionModel.getDecimal()[i]));
- }
- } else {
- values[i].setValue(dataHolder[i].getWritableByteArrayValues());
- }
- }
-
- byte[][] resturnValue = new byte[values.length][];
-
- for (int i = 0; i < values.length; i++) {
- resturnValue[i] = values[i].getBackArrayData();
- }
- return resturnValue;
- }
-
- @Override public short getLength() {
- return values != null ? (short) values.length : 0;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataFileStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataFileStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataFileStore.java
deleted file mode 100644
index bc60765..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataFileStore.java
+++ /dev/null
@@ -1,86 +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.carbondata.core.datastorage.store.impl.data.uncompressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.MeasureDataWrapper;
-import org.carbondata.core.datastorage.store.compression.ValueCompressionModel;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.datastorage.store.impl.CompressedDataMeasureDataWrapper;
-
-public class DoubleArrayDataFileStore extends AbstractDoubleArrayDataStore {
-
- private long[] measuresOffsetsArray;
-
- private int[] measuresLengthArray;
-
- private String fileName;
-
- public DoubleArrayDataFileStore(ValueCompressionModel compressionModel,
- long[] measuresOffsetsArray, String fileName, int[] measuresLengthArray) {
- super(compressionModel);
- this.fileName = fileName;
- this.measuresLengthArray = measuresLengthArray;
- this.measuresOffsetsArray = measuresOffsetsArray;
- }
-
- @Override public MeasureDataWrapper getBackData(int[] cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- UnCompressValue[] unComp = new UnCompressValue[measuresLengthArray.length];
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[measuresLengthArray.length];
- if (cols != null) {
- for (int i = 0; i < cols.length; i++) {
- unComp[cols[i]] = compressionModel.getUnCompressValues()[cols[i]].getNew();
- unComp[cols[i]].setValueInBytes(fileHolder
- .readByteArray(fileName, measuresOffsetsArray[cols[i]], measuresLengthArray[cols[i]]));
- vals[cols[i]] = unComp[cols[i]].getValues(compressionModel.getDecimal()[cols[i]],
- compressionModel.getMaxValue()[cols[i]]);
- }
- } else {
- for (int i = 0; i < unComp.length; i++) {
-
- unComp[i] = compressionModel.getUnCompressValues()[i].getNew();
- unComp[i].setValueInBytes(
- fileHolder.readByteArray(fileName, measuresOffsetsArray[i], measuresLengthArray[i]));
- vals[i] = unComp[i]
- .getValues(compressionModel.getDecimal()[i], compressionModel.getMaxValue()[i]);
- }
- }
- return new CompressedDataMeasureDataWrapper(vals);
- }
-
- @Override public MeasureDataWrapper getBackData(int cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- UnCompressValue[] unComp = new UnCompressValue[measuresLengthArray.length];
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[measuresLengthArray.length];
-
- unComp[cols] = compressionModel.getUnCompressValues()[cols].getNew();
- unComp[cols].setValueInBytes(
- fileHolder.readByteArray(fileName, measuresOffsetsArray[cols], measuresLengthArray[cols]));
- vals[cols] = unComp[cols]
- .getValues(compressionModel.getDecimal()[cols], compressionModel.getMaxValue()[cols]);
- return new CompressedDataMeasureDataWrapper(vals);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataInMemoryStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataInMemoryStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataInMemoryStore.java
deleted file mode 100644
index 3adafa2..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/data/uncompressed/DoubleArrayDataInMemoryStore.java
+++ /dev/null
@@ -1,163 +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.carbondata.core.datastorage.store.impl.data.uncompressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.MeasureDataWrapper;
-import org.carbondata.core.datastorage.store.compression.ValueCompressionModel;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.datastorage.store.impl.CompressedDataMeasureDataWrapper;
-
-/**
- * DoubleArrayDataInMemoryStore.
- *
- * @author S71955
- */
-public class DoubleArrayDataInMemoryStore extends AbstractDoubleArrayDataStore {
-
- // /**
- // * DoubleArrayDataInMemoryStore.
- // * @param size
- // * @param elementSize
- // * @param compressionModel
- // */
- // public DoubleArrayDataInMemoryStore(int size, int elementSize,
- // ValueCompressionModel compressionModel)
- // {
- // super(size, elementSize, compressionModel);
- // }
- //
- // /**
- // * DoubleArrayDataInMemoryStore.
- // * @param size
- // * @param elementSize
- // */
- // public DoubleArrayDataInMemoryStore(int size, int elementSize)
- // {
- // super(size, elementSize);
- // }
-
- // /**
- // * DoubleArrayDataInMemoryStore.
- // * @param size
- // * @param elementSize
- // * @param compressionModel
- // * @param measuresOffsetsArray
- // * @param measuresLengthArray
- // * @param fileName
- // * @param fileHolder
- // */
- // public DoubleArrayDataInMemoryStore(int size, int elementSize,
- // ValueCompressionModel compressionModel,
- // long[] measuresOffsetsArray, int[] measuresLengthArray, String fileName,
- // FileHolder fileHolder)
- // {
- // super(size, elementSize, compressionModel);
- // UnCompressValue[] unCompValues = compressionModel.getUnCompressValues();
- // if(null != unCompValues)
- // {
- // for(int i = 0;i < measuresLengthArray.length;i++)
- // {
- //
- // values[i] = unCompValues[i].getNew();
- // values[i].setValueInBytes(fileHolder.readByteArray(fileName,
- // measuresOffsetsArray[i],
- // measuresLengthArray[i]));
- // }
- // }
- // }
-
- /**
- * DoubleArrayDataInMemoryStore.
- *
- * @param size
- * @param elementSize
- * @param compressionModel
- * @param measuresOffsetsArray
- * @param measuresLengthArray
- * @param fileName
- * @param fileHolder
- */
- public DoubleArrayDataInMemoryStore(ValueCompressionModel compressionModel,
- long[] measuresOffsetsArray, int[] measuresLengthArray, String fileName,
- FileHolder fileHolder) {
- super(compressionModel);
- if (null != compressionModel) {
- UnCompressValue[] unCompValues = compressionModel.getUnCompressValues();
- if (null != unCompValues) {
- for (int i = 0; i < measuresLengthArray.length; i++) {
-
- values[i] = unCompValues[i].getNew();
- values[i].setValueInBytes(
- fileHolder.readByteArray(fileName, measuresOffsetsArray[i], measuresLengthArray[i]));
- }
- }
- }
- }
-
- /**
- * DoubleArrayDataInMemoryStore.
- *
- * @param size
- * @param elementSize
- * @param compressionModel
- * @param measuresOffsetsArray
- * @param measuresLengthArray
- * @param fileName
- * @param fileHolder
- */
- public DoubleArrayDataInMemoryStore(ValueCompressionModel compressionModel) {
- super(compressionModel);
- }
-
- @Override public MeasureDataWrapper getBackData(int[] cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
- if (null == cols) {
- for (int i = 0; i < vals.length; i++) {
- vals[i] = values[i]
- .getValues(compressionModel.getDecimal()[i], compressionModel.getMaxValue()[i]);
- }
- } else {
- for (int i = 0; i < cols.length; i++) {
- vals[cols[i]] = values[cols[i]].getValues(compressionModel.getDecimal()[cols[i]],
- compressionModel.getMaxValue()[cols[i]]);
- }
- }
- // return new CompressedDataMeasureDataWrapper(values,
- // compressionModel.getDecimal(), compressionModel.getMaxValue());
- return new CompressedDataMeasureDataWrapper(vals);
- }
-
- @Override public MeasureDataWrapper getBackData(int cols, FileHolder fileHolder) {
- if (null == compressionModel) {
- return null;
- }
- CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
-
- vals[cols] = values[cols]
- .getValues(compressionModel.getDecimal()[cols], compressionModel.getMaxValue()[cols]);
- return new CompressedDataMeasureDataWrapper(vals);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/AbstractColumnarKeyStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/AbstractColumnarKeyStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/AbstractColumnarKeyStore.java
deleted file mode 100644
index 9aa87d1..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/AbstractColumnarKeyStore.java
+++ /dev/null
@@ -1,106 +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.carbondata.core.datastorage.store.impl.key.columnar;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStore;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreInfo;
-import org.carbondata.core.datastorage.store.compression.Compressor;
-import org.carbondata.core.datastorage.store.compression.SnappyCompression;
-
-public abstract class AbstractColumnarKeyStore implements ColumnarKeyStore {
-
- /**
- * compressor will be used to compress the data
- */
- protected static final Compressor<byte[]> COMPRESSOR =
- SnappyCompression.SnappyByteCompression.INSTANCE;
-
- protected ColumnarKeyStoreInfo columnarStoreInfo;
-
- protected byte[][] columnarKeyBlockDataIndex;
-
- protected byte[][] columnarKeyBlockData;
-
- protected Map<Integer, Integer> mapOfColumnIndexAndColumnBlockIndex;
-
- protected Map<Integer, Integer> mapOfAggDataIndex;
-
- protected byte[][] columnarUniqueblockKeyBlockIndex;
-
- public AbstractColumnarKeyStore(ColumnarKeyStoreInfo columnarStoreInfo, boolean isInMemory,
- FileHolder fileHolder) {
- this.columnarStoreInfo = columnarStoreInfo;
- this.mapOfColumnIndexAndColumnBlockIndex =
- new HashMap<Integer, Integer>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
- this.mapOfAggDataIndex =
- new HashMap<Integer, Integer>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
- int index = 0;
- for (int i = 0; i < this.columnarStoreInfo.getIsSorted().length; i++) {
- if (!this.columnarStoreInfo.getIsSorted()[i]) {
- this.mapOfColumnIndexAndColumnBlockIndex.put(i, index++);
- }
- }
- index = 0;
- for (int i = 0; i < this.columnarStoreInfo.getAggKeyBlock().length; i++) {
- if (this.columnarStoreInfo.getAggKeyBlock()[i]) {
- mapOfAggDataIndex.put(i, index++);
- }
- }
- if (isInMemory) {
- this.columnarKeyBlockData = new byte[this.columnarStoreInfo.getIsSorted().length][];
- this.columnarKeyBlockDataIndex = new byte[this.mapOfColumnIndexAndColumnBlockIndex.size()][];
- this.columnarUniqueblockKeyBlockIndex = new byte[this.mapOfAggDataIndex.size()][];
- for (int i = 0; i < columnarStoreInfo.getSizeOfEachBlock().length; i++) {
- columnarKeyBlockData[i] = fileHolder.readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockOffsets()[i], columnarStoreInfo.getKeyBlockLengths()[i]);
-
- if (!this.columnarStoreInfo.getIsSorted()[i]) {
- this.columnarKeyBlockDataIndex[mapOfColumnIndexAndColumnBlockIndex.get(i)] = fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockIndexOffsets()[mapOfColumnIndexAndColumnBlockIndex
- .get(i)],
- columnarStoreInfo.getKeyBlockIndexLength()[mapOfColumnIndexAndColumnBlockIndex
- .get(i)]);
- }
-
- if (this.columnarStoreInfo.getAggKeyBlock()[i]) {
- this.columnarUniqueblockKeyBlockIndex[mapOfAggDataIndex.get(i)] = fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getDataIndexMapOffsets()[mapOfAggDataIndex.get(i)],
- columnarStoreInfo.getDataIndexMapLength()[mapOfAggDataIndex.get(i)]);
- }
- }
- }
- }
-
- protected int[] getColumnIndexForNonFilter(int[] columnIndex) {
- int[] columnIndexTemp = new int[columnIndex.length];
-
- for (int i = 0; i < columnIndex.length; i++) {
- columnIndexTemp[columnIndex[i]] = i;
- }
- return columnIndexTemp;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarFileKeyStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarFileKeyStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarFileKeyStore.java
deleted file mode 100644
index 97547e8..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarFileKeyStore.java
+++ /dev/null
@@ -1,168 +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.carbondata.core.datastorage.store.impl.key.columnar.compressed;
-
-import java.util.List;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreDataHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreInfo;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreMetadata;
-import org.carbondata.core.datastorage.store.columnar.UnBlockIndexer;
-import org.carbondata.core.datastorage.store.impl.key.columnar.AbstractColumnarKeyStore;
-import org.carbondata.core.util.CarbonUtil;
-
-public class CompressedColumnarFileKeyStore extends AbstractColumnarKeyStore {
-
- public CompressedColumnarFileKeyStore(ColumnarKeyStoreInfo columnarStoreInfo) {
- super(columnarStoreInfo, false, null);
- }
-
- @Override public ColumnarKeyStoreDataHolder[] getUnCompressedKeyArray(FileHolder fileHolder,
- int[] blockIndex, boolean[] needCompressedData, int[] noDictionaryColIndexes) {
- ColumnarKeyStoreDataHolder[] columnarKeyStoreDataHolders =
- new ColumnarKeyStoreDataHolder[blockIndex.length];
-
- for (int i = 0; i < columnarKeyStoreDataHolders.length; i++) {
- byte[] columnarKeyBlockData = null;
- int[] columnKeyBlockIndex = null;
- int[] columnKeyBlockReverseIndexes = null;
- ColumnarKeyStoreMetadata columnarKeyStoreMetadata = null;
- int[] dataIndex = null;
- boolean isUnCompressed = true;
- columnarKeyBlockData = COMPRESSOR.unCompress(fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockOffsets()[blockIndex[i]],
- columnarStoreInfo.getKeyBlockLengths()[blockIndex[i]]));
- boolean isNoDictionaryBlock =
- CompressedColumnarKeyStoreUtil.isNoDictionaryBlock(noDictionaryColIndexes, blockIndex[i]);
- if (!isNoDictionaryBlock && this.columnarStoreInfo.getAggKeyBlock()[blockIndex[i]]) {
- dataIndex = columnarStoreInfo.getNumberCompressor().unCompress(fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getDataIndexMapOffsets()[mapOfAggDataIndex.get(blockIndex[i])],
- columnarStoreInfo.getDataIndexMapLength()[mapOfAggDataIndex.get(blockIndex[i])]));
- if (!needCompressedData[i]) {
- columnarKeyBlockData = UnBlockIndexer.uncompressData(columnarKeyBlockData, dataIndex,
- columnarStoreInfo.getSizeOfEachBlock()[blockIndex[i]]);
- dataIndex = null;
- } else {
- isUnCompressed = false;
- }
- }
- if (!columnarStoreInfo.getIsSorted()[blockIndex[i]]) {
- columnKeyBlockIndex = CarbonUtil
- .getUnCompressColumnIndex(columnarStoreInfo.getKeyBlockIndexLength()[blockIndex[i]],
- fileHolder.readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockIndexOffsets()[blockIndex[i]],
- columnarStoreInfo.getKeyBlockIndexLength()[blockIndex[i]]),
- columnarStoreInfo.getNumberCompressor());
- columnKeyBlockReverseIndexes = getColumnIndexForNonFilter(columnKeyBlockIndex);
- }
- //Since its an high cardinality dimension adding the direct surrogates as part of
- //columnarKeyStoreMetadata so that later it will be used with bytearraywrapper instance.
- if (isNoDictionaryBlock) {
- columnarKeyStoreMetadata = new ColumnarKeyStoreMetadata(0);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndexes);
- columnarKeyStoreMetadata.setNoDictionaryValColumn(true);
- columnarKeyStoreMetadata.setUnCompressed(true);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex[i]]);
- //System is reading the direct surrogates data from byte array which contains both
- // length and the direct surrogates data
- List<byte[]> noDictionaryValBasedKeyBlockData = CompressedColumnarKeyStoreUtil
- .readColumnarKeyBlockDataForNoDictionaryCols(columnarKeyBlockData);
- columnarKeyStoreDataHolders[i] =
- new ColumnarKeyStoreDataHolder(noDictionaryValBasedKeyBlockData,
- columnarKeyStoreMetadata);
- } else {
- columnarKeyStoreMetadata =
- new ColumnarKeyStoreMetadata(columnarStoreInfo.getSizeOfEachBlock()[blockIndex[i]]);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex[i]]);
- columnarKeyStoreMetadata.setDataIndex(dataIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndexes);
- columnarKeyStoreMetadata.setUnCompressed(isUnCompressed);
- columnarKeyStoreDataHolders[i] =
- new ColumnarKeyStoreDataHolder(columnarKeyBlockData, columnarKeyStoreMetadata);
- }
- }
- return columnarKeyStoreDataHolders;
- }
-
- @Override
- public ColumnarKeyStoreDataHolder getUnCompressedKeyArray(FileHolder fileHolder, int blockIndex,
- boolean needCompressedData, int[] noDictionaryColIndexes) {
- byte[] columnarKeyBlockData = null;
- int[] columnKeyBlockIndex = null;
- int[] columnKeyBlockReverseIndex = null;
- ColumnarKeyStoreMetadata columnarKeyStoreMetadata = null;
- int[] dataIndex = null;
- boolean isUnCompressed = true;
- columnarKeyBlockData = COMPRESSOR.unCompress(fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockOffsets()[blockIndex],
- columnarStoreInfo.getKeyBlockLengths()[blockIndex]));
- boolean isNoDictionaryBlock =
- CompressedColumnarKeyStoreUtil.isNoDictionaryBlock(noDictionaryColIndexes, blockIndex);
- if (!isNoDictionaryBlock && this.columnarStoreInfo.getAggKeyBlock()[blockIndex]) {
- dataIndex = columnarStoreInfo.getNumberCompressor().unCompress(fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getDataIndexMapOffsets()[mapOfAggDataIndex.get(blockIndex)],
- columnarStoreInfo.getDataIndexMapLength()[mapOfAggDataIndex.get(blockIndex)]));
- if (!needCompressedData) {
- columnarKeyBlockData = UnBlockIndexer.uncompressData(columnarKeyBlockData, dataIndex,
- columnarStoreInfo.getSizeOfEachBlock()[blockIndex]);
- dataIndex = null;
- } else {
- isUnCompressed = false;
- }
- }
- if (!columnarStoreInfo.getIsSorted()[blockIndex]) {
- columnKeyBlockIndex = CarbonUtil
- .getUnCompressColumnIndex(columnarStoreInfo.getKeyBlockIndexLength()[blockIndex],
- fileHolder.readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockIndexOffsets()[blockIndex],
- columnarStoreInfo.getKeyBlockIndexLength()[blockIndex]),
- columnarStoreInfo.getNumberCompressor());
- columnKeyBlockReverseIndex = getColumnIndexForNonFilter(columnKeyBlockIndex);
- }
- //Since its an high cardinality dimension, For filter queries.
- if (isNoDictionaryBlock) {
- columnarKeyStoreMetadata = new ColumnarKeyStoreMetadata(0);
- ColumnarKeyStoreDataHolder columnarKeyStoreDataHolders = CompressedColumnarKeyStoreUtil
- .createColumnarKeyStoreMetadataForHCDims(blockIndex, columnarKeyBlockData,
- columnKeyBlockIndex, columnKeyBlockReverseIndex, columnarStoreInfo);
- new ColumnarKeyStoreDataHolder(columnarKeyBlockData, columnarKeyStoreMetadata);
- return columnarKeyStoreDataHolders;
- }
- columnarKeyStoreMetadata =
- new ColumnarKeyStoreMetadata(columnarStoreInfo.getSizeOfEachBlock()[blockIndex]);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex]);
- columnarKeyStoreMetadata.setDataIndex(dataIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndex);
- columnarKeyStoreMetadata.setUnCompressed(isUnCompressed);
-
- ColumnarKeyStoreDataHolder columnarKeyStoreDataHolders =
- new ColumnarKeyStoreDataHolder(columnarKeyBlockData, columnarKeyStoreMetadata);
- return columnarKeyStoreDataHolders;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarInMemoryStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarInMemoryStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarInMemoryStore.java
deleted file mode 100644
index 0bb73b2..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarInMemoryStore.java
+++ /dev/null
@@ -1,155 +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.carbondata.core.datastorage.store.impl.key.columnar.compressed;
-
-import java.util.List;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreDataHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreInfo;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreMetadata;
-import org.carbondata.core.datastorage.store.columnar.UnBlockIndexer;
-import org.carbondata.core.datastorage.store.impl.key.columnar.AbstractColumnarKeyStore;
-import org.carbondata.core.util.CarbonUtil;
-
-public class CompressedColumnarInMemoryStore extends AbstractColumnarKeyStore {
-
- public CompressedColumnarInMemoryStore(ColumnarKeyStoreInfo columnarStoreInfo,
- FileHolder fileHolder) {
- super(columnarStoreInfo, true, fileHolder);
- }
-
- @Override public ColumnarKeyStoreDataHolder[] getUnCompressedKeyArray(FileHolder fileHolder,
- int[] blockIndex, boolean[] needCompressedData, int[] noDictionaryColIndexes) {
- ColumnarKeyStoreDataHolder[] columnarKeyStoreDataHolders =
- new ColumnarKeyStoreDataHolder[blockIndex.length];
- for (int i = 0; i < columnarKeyStoreDataHolders.length; i++) {
- byte[] columnarKeyBlockDataTemp = null;
- int[] columnKeyBlockIndex = null;
- int[] columnKeyBlockReverseIndexes = null;
- ColumnarKeyStoreMetadata columnarKeyStoreMetadata = null;
- int columnarKeyBlockIndex = 0;
- int[] dataIndex = null;
- boolean isUnCompressed = true;
- columnarKeyBlockDataTemp = COMPRESSOR.unCompress(columnarKeyBlockData[blockIndex[i]]);
- boolean isNoDictionaryBlock =
- CompressedColumnarKeyStoreUtil.isNoDictionaryBlock(noDictionaryColIndexes, blockIndex[i]);
- if (!isNoDictionaryBlock && this.columnarStoreInfo.getAggKeyBlock()[blockIndex[i]]) {
- dataIndex = columnarStoreInfo.getNumberCompressor()
- .unCompress(columnarUniqueblockKeyBlockIndex[mapOfAggDataIndex.get(blockIndex[i])]);
- if (!needCompressedData[i]) {
- columnarKeyBlockDataTemp = UnBlockIndexer
- .uncompressData(columnarKeyBlockDataTemp, dataIndex,
- columnarStoreInfo.getSizeOfEachBlock()[blockIndex[i]]);
- dataIndex = null;
- } else {
- isUnCompressed = false;
- }
- }
- if (!columnarStoreInfo.getIsSorted()[blockIndex[i]]) {
- columnarKeyBlockIndex = mapOfColumnIndexAndColumnBlockIndex.get(blockIndex[i]);
- columnKeyBlockIndex = CarbonUtil.getUnCompressColumnIndex(
- columnarStoreInfo.getKeyBlockIndexLength()[columnarKeyBlockIndex],
- columnarKeyBlockDataIndex[columnarKeyBlockIndex],
- columnarStoreInfo.getNumberCompressor());
- columnKeyBlockReverseIndexes = getColumnIndexForNonFilter(columnKeyBlockIndex);
- }
- if (isNoDictionaryBlock) {
- columnarKeyStoreMetadata = new ColumnarKeyStoreMetadata(0);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndexes);
- columnarKeyStoreMetadata.setNoDictionaryValColumn(true);
- columnarKeyStoreMetadata.setUnCompressed(true);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex[i]]);
- //System is reading the direct surrogates data from byte array which contains both
- // length and the direct surrogates data
- List<byte[]> noDictionaryValBasedKeyBlockData = CompressedColumnarKeyStoreUtil
- .readColumnarKeyBlockDataForNoDictionaryCols(columnarKeyBlockDataTemp);
- columnarKeyStoreDataHolders[i] =
- new ColumnarKeyStoreDataHolder(noDictionaryValBasedKeyBlockData,
- columnarKeyStoreMetadata);
- }
- columnarKeyStoreMetadata =
- new ColumnarKeyStoreMetadata(columnarStoreInfo.getSizeOfEachBlock()[blockIndex[i]]);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex[i]]);
- columnarKeyStoreMetadata.setDataIndex(dataIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndexes);
- columnarKeyStoreMetadata.setUnCompressed(isUnCompressed);
- columnarKeyStoreDataHolders[i] =
- new ColumnarKeyStoreDataHolder(columnarKeyBlockDataTemp, columnarKeyStoreMetadata);
- }
- return columnarKeyStoreDataHolders;
- }
-
- @Override
- public ColumnarKeyStoreDataHolder getUnCompressedKeyArray(FileHolder fileHolder, int blockIndex,
- boolean needCompressedData, int[] noDictionaryVals) {
-
- byte[] columnarKeyBlockDataTemp = null;
- int[] columnKeyBlockIndex = null;
- int[] columnKeyBlockReverseIndex = null;
- ColumnarKeyStoreMetadata columnarKeyStoreMetadata = null;
- int columnarKeyBlockIndex = 0;
- int[] dataIndex = null;
- boolean isUnCompressed = true;
- columnarKeyBlockDataTemp = COMPRESSOR.unCompress(columnarKeyBlockData[blockIndex]);
- boolean isNoDictionaryBlock =
- CompressedColumnarKeyStoreUtil.isNoDictionaryBlock(noDictionaryVals, blockIndex);
- if (!isNoDictionaryBlock && this.columnarStoreInfo.getAggKeyBlock()[blockIndex]) {
- dataIndex = columnarStoreInfo.getNumberCompressor()
- .unCompress(columnarUniqueblockKeyBlockIndex[mapOfAggDataIndex.get(blockIndex)]);
- if (!needCompressedData) {
- columnarKeyBlockDataTemp = UnBlockIndexer
- .uncompressData(columnarKeyBlockDataTemp, dataIndex,
- columnarStoreInfo.getSizeOfEachBlock()[blockIndex]);
- dataIndex = null;
- } else {
- isUnCompressed = false;
- }
- }
- if (!columnarStoreInfo.getIsSorted()[blockIndex]) {
- columnarKeyBlockIndex = mapOfColumnIndexAndColumnBlockIndex.get(blockIndex);
- columnKeyBlockIndex = CarbonUtil.getUnCompressColumnIndex(
- columnarStoreInfo.getKeyBlockIndexLength()[columnarKeyBlockIndex],
- columnarKeyBlockDataIndex[columnarKeyBlockIndex],
- columnarStoreInfo.getNumberCompressor());
- columnKeyBlockReverseIndex = getColumnIndexForNonFilter(columnKeyBlockIndex);
- }
- if (isNoDictionaryBlock) {
- ColumnarKeyStoreDataHolder colKeystoreDataHolders = CompressedColumnarKeyStoreUtil
- .createColumnarKeyStoreMetadataForHCDims(blockIndex, columnarKeyBlockDataTemp,
- columnKeyBlockIndex, columnKeyBlockReverseIndex, columnarStoreInfo);
- return colKeystoreDataHolders;
- }
- columnarKeyStoreMetadata =
- new ColumnarKeyStoreMetadata(columnarStoreInfo.getSizeOfEachBlock()[blockIndex]);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex]);
- columnarKeyStoreMetadata.setDataIndex(dataIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndex);
- columnarKeyStoreMetadata.setUnCompressed(isUnCompressed);
- ColumnarKeyStoreDataHolder columnarKeyStoreDataHolders =
- new ColumnarKeyStoreDataHolder(columnarKeyBlockDataTemp, columnarKeyStoreMetadata);
- return columnarKeyStoreDataHolders;
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarKeyStoreUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarKeyStoreUtil.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarKeyStoreUtil.java
deleted file mode 100644
index 546eb5b..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/compressed/CompressedColumnarKeyStoreUtil.java
+++ /dev/null
@@ -1,108 +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.carbondata.core.datastorage.store.impl.key.columnar.compressed;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreDataHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreInfo;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreMetadata;
-
-/**
- * Utility helper class for managing the processing of columnar key store block.
- */
-public final class CompressedColumnarKeyStoreUtil {
-
- private CompressedColumnarKeyStoreUtil() {
-
- }
-
- /**
- * @param columnarKeyBlockData
- * @param columnarKeyStoreMetadata
- * @return
- * @author s71955 The high cardinality dimensions rows will be send in byte
- * array with its data length appended in the
- * ColumnarKeyStoreDataHolder byte array since high cardinality dim
- * data will not be part of MDKey/Surrogate keys. In this method the
- * byte array will be scanned and the length which is stored in
- * short will be removed.
- */
- public static List<byte[]> readColumnarKeyBlockDataForNoDictionaryCols(
- byte[] columnarKeyBlockData) {
- List<byte[]> columnarKeyBlockDataList = new ArrayList<byte[]>(50);
- ByteBuffer noDictionaryValKeyStoreDataHolder = ByteBuffer.allocate(columnarKeyBlockData.length);
- noDictionaryValKeyStoreDataHolder.put(columnarKeyBlockData);
- noDictionaryValKeyStoreDataHolder.flip();
- while (noDictionaryValKeyStoreDataHolder.hasRemaining()) {
- short dataLength = noDictionaryValKeyStoreDataHolder.getShort();
- byte[] noDictionaryValKeyData = new byte[dataLength];
- noDictionaryValKeyStoreDataHolder.get(noDictionaryValKeyData);
- columnarKeyBlockDataList.add(noDictionaryValKeyData);
- }
- return columnarKeyBlockDataList;
-
- }
-
- /**
- * @param blockIndex
- * @param columnarKeyBlockData
- * @param columnKeyBlockIndex
- * @param columnKeyBlockReverseIndex
- * @param columnarStoreInfo
- * @return
- */
- public static ColumnarKeyStoreDataHolder createColumnarKeyStoreMetadataForHCDims(int blockIndex,
- byte[] columnarKeyBlockData, int[] columnKeyBlockIndex, int[] columnKeyBlockReverseIndex,
- ColumnarKeyStoreInfo columnarStoreInfo) {
- ColumnarKeyStoreMetadata columnarKeyStoreMetadata;
- columnarKeyStoreMetadata = new ColumnarKeyStoreMetadata(0);
- columnarKeyStoreMetadata.setNoDictionaryValColumn(true);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndex);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex]);
- columnarKeyStoreMetadata.setUnCompressed(true);
- List<byte[]> noDictionaryValBasedKeyBlockData = CompressedColumnarKeyStoreUtil
- .readColumnarKeyBlockDataForNoDictionaryCols(columnarKeyBlockData);
- ColumnarKeyStoreDataHolder columnarKeyStoreDataHolders =
- new ColumnarKeyStoreDataHolder(noDictionaryValBasedKeyBlockData, columnarKeyStoreMetadata);
- return columnarKeyStoreDataHolders;
- }
-
- /**
- * This API will determine whether the requested block index is a No dictionary
- * column index.
- *
- * @param noDictionaryColIndexes
- * @param blockIndex
- * @return
- */
- public static boolean isNoDictionaryBlock(int[] noDictionaryColIndexes, int blockIndex) {
- if (null != noDictionaryColIndexes) {
- for (int noDictionaryValIndex : noDictionaryColIndexes) {
- if (noDictionaryValIndex == blockIndex) {
- return true;
- }
- }
- }
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarFileKeyStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarFileKeyStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarFileKeyStore.java
deleted file mode 100644
index e014135..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarFileKeyStore.java
+++ /dev/null
@@ -1,88 +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.carbondata.core.datastorage.store.impl.key.columnar.uncompressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreDataHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreInfo;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreMetadata;
-import org.carbondata.core.datastorage.store.columnar.UnBlockIndexer;
-import org.carbondata.core.datastorage.store.impl.key.columnar.AbstractColumnarKeyStore;
-import org.carbondata.core.util.CarbonUtil;
-
-public class UnCompressedColumnarFileKeyStore extends AbstractColumnarKeyStore {
-
- public UnCompressedColumnarFileKeyStore(ColumnarKeyStoreInfo columnarStoreInfo) {
- super(columnarStoreInfo, false, null);
- }
-
- @Override public ColumnarKeyStoreDataHolder[] getUnCompressedKeyArray(FileHolder fileHolder,
- int[] blockIndex, boolean[] needCompressedData, int[] noDictionaryColIndexes) {
- ColumnarKeyStoreDataHolder[] columnarKeyStoreDataHolders =
- new ColumnarKeyStoreDataHolder[blockIndex.length];
- byte[] columnarKeyBlockData = null;
- int[] columnKeyBlockIndex = null;
- ColumnarKeyStoreMetadata columnarKeyStoreMetadata = null;
- int columnarKeyBlockIndex = 0;
- int[] dataIndex = null;
- int[] columnKeyBlockReverseIndex = null;
- for (int j = 0; j < columnarKeyStoreDataHolders.length; j++) {
- columnarKeyBlockData = fileHolder.readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockOffsets()[blockIndex[j]],
- columnarStoreInfo.getKeyBlockLengths()[blockIndex[j]]);
- if (this.columnarStoreInfo.getAggKeyBlock()[blockIndex[j]]) {
- dataIndex = columnarStoreInfo.getNumberCompressor().unCompress(fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getDataIndexMapOffsets()[mapOfAggDataIndex.get(blockIndex[j])],
- columnarStoreInfo.getDataIndexMapLength()[mapOfAggDataIndex.get(blockIndex[j])]));
- if (!needCompressedData[j]) {
- columnarKeyBlockData = UnBlockIndexer.uncompressData(columnarKeyBlockData, dataIndex,
- columnarStoreInfo.getSizeOfEachBlock()[blockIndex[j]]);
- dataIndex = null;
- }
- }
- if (!columnarStoreInfo.getIsSorted()[blockIndex[j]]) {
- columnarKeyBlockIndex = mapOfColumnIndexAndColumnBlockIndex.get(blockIndex[j]);
- columnKeyBlockIndex = CarbonUtil.getUnCompressColumnIndex(
- columnarStoreInfo.getKeyBlockIndexLength()[columnarKeyBlockIndex], fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockIndexOffsets()[columnarKeyBlockIndex],
- columnarStoreInfo.getKeyBlockIndexLength()[columnarKeyBlockIndex]),
- columnarStoreInfo.getNumberCompressor());
- columnKeyBlockReverseIndex = getColumnIndexForNonFilter(columnKeyBlockIndex);
- }
- columnarKeyStoreMetadata =
- new ColumnarKeyStoreMetadata(columnarStoreInfo.getSizeOfEachBlock()[blockIndex[j]]);
- columnarKeyStoreMetadata.setSorted(columnarStoreInfo.getIsSorted()[blockIndex[j]]);
- columnarKeyStoreMetadata.setColumnIndex(columnKeyBlockIndex);
- columnarKeyStoreMetadata.setDataIndex(dataIndex);
- columnarKeyStoreMetadata.setColumnReverseIndex(columnKeyBlockReverseIndex);
- columnarKeyStoreDataHolders[j] =
- new ColumnarKeyStoreDataHolder(columnarKeyBlockData, columnarKeyStoreMetadata);
- }
- return columnarKeyStoreDataHolders;
- }
-
- @Override
- public ColumnarKeyStoreDataHolder getUnCompressedKeyArray(FileHolder fileHolder, int blockIndex,
- boolean needCompressedData, int[] noDictionaryColIndexes) {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarInMemoryStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarInMemoryStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarInMemoryStore.java
deleted file mode 100644
index e4b565b..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/columnar/uncompressed/UnCompressedColumnarInMemoryStore.java
+++ /dev/null
@@ -1,70 +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.carbondata.core.datastorage.store.impl.key.columnar.uncompressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreDataHolder;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreInfo;
-import org.carbondata.core.datastorage.store.columnar.ColumnarKeyStoreMetadata;
-import org.carbondata.core.datastorage.store.impl.key.columnar.AbstractColumnarKeyStore;
-import org.carbondata.core.util.CarbonUtil;
-
-public class UnCompressedColumnarInMemoryStore extends AbstractColumnarKeyStore {
-
- public UnCompressedColumnarInMemoryStore(ColumnarKeyStoreInfo columnarStoreInfo,
- FileHolder fileHolder) {
- super(columnarStoreInfo, true, fileHolder);
- }
-
- @Override public ColumnarKeyStoreDataHolder[] getUnCompressedKeyArray(FileHolder fileHolder,
- int[] blockIndex, boolean[] needCompressedData, int[] noDictionaryColIndexes) {
- int columnarKeyBlockIndex = 0;
- int[] columnIndex = null;
- ColumnarKeyStoreDataHolder[] columnarKeyStoreDataHolders =
- new ColumnarKeyStoreDataHolder[blockIndex.length];
- ColumnarKeyStoreMetadata columnarKeyStoreMetadataTemp = null;
- for (int i = 0; i < columnarKeyStoreDataHolders.length; i++) {
- columnarKeyStoreMetadataTemp = new ColumnarKeyStoreMetadata(0);
- if (!columnarStoreInfo.getIsSorted()[blockIndex[i]]) {
- columnarKeyBlockIndex = mapOfColumnIndexAndColumnBlockIndex.get(blockIndex[i]);
- columnIndex = CarbonUtil.getUnCompressColumnIndex(
- columnarStoreInfo.getKeyBlockIndexLength()[columnarKeyBlockIndex], fileHolder
- .readByteArray(columnarStoreInfo.getFilePath(),
- columnarStoreInfo.getKeyBlockIndexOffsets()[columnarKeyBlockIndex],
- columnarStoreInfo.getKeyBlockIndexLength()[columnarKeyBlockIndex]),
- columnarStoreInfo.getNumberCompressor());
- columnIndex = getColumnIndexForNonFilter(columnIndex);
- columnarKeyStoreMetadataTemp.setColumnIndex(columnIndex);
- }
- columnarKeyStoreMetadataTemp.setSorted(columnarStoreInfo.getIsSorted()[blockIndex[i]]);
- columnarKeyStoreDataHolders[i] =
- new ColumnarKeyStoreDataHolder(columnarKeyBlockData[blockIndex[i]],
- columnarKeyStoreMetadataTemp);
- }
- return columnarKeyStoreDataHolders;
- }
-
- @Override
- public ColumnarKeyStoreDataHolder getUnCompressedKeyArray(FileHolder fileHolder, int blockIndex,
- boolean needCompressedData, int[] noDictionaryVals) {
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/AbstractCompressedSingleArrayStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/AbstractCompressedSingleArrayStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/AbstractCompressedSingleArrayStore.java
deleted file mode 100644
index e90ad4e..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/AbstractCompressedSingleArrayStore.java
+++ /dev/null
@@ -1,119 +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.carbondata.core.datastorage.store.impl.key.compressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.NodeKeyStore;
-import org.carbondata.core.datastorage.store.compression.Compressor;
-import org.carbondata.core.datastorage.store.compression.SnappyCompression;
-
-public abstract class AbstractCompressedSingleArrayStore implements NodeKeyStore {
-
- /**
- * compressor will be used to compress the data
- */
- protected static final Compressor<byte[]> COMPRESSOR =
- SnappyCompression.SnappyByteCompression.INSTANCE;
- /**
- * size of each element
- */
- protected final int sizeOfEachElement;
- /**
- * data store which will hold the data
- */
- protected byte[] datastore;
- /**
- * total number of elements;
- */
- protected int totalNumberOfElements;
-
- public AbstractCompressedSingleArrayStore(int size, int elementSize) {
- this(size, elementSize, true);
- }
-
- public AbstractCompressedSingleArrayStore(int size, int elementSize, boolean createDataStore) {
- this.sizeOfEachElement = elementSize;
- this.totalNumberOfElements = size;
- if (createDataStore) {
- datastore = new byte[this.totalNumberOfElements * this.sizeOfEachElement];
- }
- }
-
- /**
- * This method will be used to insert key to store
- */
- @Override public void put(int index, byte[] value) {
- System.arraycopy(value, 0, datastore, ((index) * sizeOfEachElement), sizeOfEachElement);
- }
-
- /**
- * This method will be used to get the writable key array.
- * writable key array will hold below information:
- * <size of key array><key array>
- * total length will be stored in 4 bytes+ key array length for key array
- *
- * @return writable array (compressed or normal)
- */
- @Override public byte[] getWritableKeyArray() {
- // compress the data store
- byte[] compressedKeys = COMPRESSOR.compress(datastore);
- return compressedKeys;
- }
-
- /**
- * This method will be used to get the actual key array present in the
- * store .
- * Here back array will be uncompress array
- *
- * @param fileHolder file holder will be used to read the file
- * @return uncompressed keys
- * will return uncompressed key
- */
- @Override public byte[] getBackArray(FileHolder fileHolder) {
- return COMPRESSOR.unCompress(datastore);
- }
-
- /**
- * This method will be used to get the key array based on index
- *
- * @param index index in store
- * @param fileHolder file holder will be used to read the file
- * @return key
- */
- @Override public byte[] get(int index, FileHolder fileHolder) {
- // uncompress the store data
- byte[] unCompress = COMPRESSOR.unCompress(datastore);
- // create new array of size of each element
- byte[] copy = new byte[sizeOfEachElement];
- // copy array for given index
- // copy will done based on below calculation
- // eg: index is 4 and size of each key is 6 then copy from 6*4= 24th
- // index till 29th index
- System.arraycopy(unCompress, ((index) * sizeOfEachElement), copy, 0, sizeOfEachElement);
- return copy;
- }
-
- /**
- * This method will clear the store and create the new empty store
- */
- @Override public void clear() {
- datastore = new byte[this.totalNumberOfElements * this.sizeOfEachElement];
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyFileStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyFileStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyFileStore.java
deleted file mode 100644
index cd3487d..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyFileStore.java
+++ /dev/null
@@ -1,92 +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.carbondata.core.datastorage.store.impl.key.compressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-
-public class CompressedSingleArrayKeyFileStore extends AbstractCompressedSingleArrayStore {
-
- /**
- * offset, this will be used for seek position
- */
- private long offset;
-
- /**
- * fully qualified file path
- */
- private String filePath;
-
- /**
- * length to be read
- */
- private int length;
-
- public CompressedSingleArrayKeyFileStore(int size, int elementSize, long offset, String filePath,
- int length) {
- super(size, elementSize, false);
- this.offset = offset;
- this.filePath = filePath;
- this.length = length;
- }
-
- /**
- * This method will be used to get the actual keys array present in the
- * store . Here back array will be uncompress array. This method will first read
- * the data from file based on offset and length then uncompress the array
- * to get the actual array
- *
- * @param fileHolder file holder will be used to read the file
- * @return uncompressed
- * keys will return uncompressed key
- */
- @Override public byte[] getBackArray(FileHolder fileHolder) {
- if (null != fileHolder) {
- // read from file based on offset and index, fileholder will read that
- // much byte from that offset, then uncompress and return
- return COMPRESSOR.unCompress(fileHolder.readByteArray(filePath, offset, length));
- } else {
- return new byte[0];
- }
- }
-
- /**
- * This method will be used to get the key array based on index
- * This method will first read
- * the data from file based on offset and length then uncompress the array
- * to get the actual array, then get the array for index and return
- *
- * @param index index in store
- * @param fileHolder file holder will be used to read the file
- * @return key
- */
- @Override public byte[] get(int index, FileHolder fileHolder) {
- // read from file based on offset and index, fileholder will read that
- // much byte from that offset, then uncompress to get the actual array
- byte[] unCompress = COMPRESSOR.unCompress(fileHolder.readByteArray(filePath, offset, length));
- // create new array of size of each element
- byte[] copy = new byte[sizeOfEachElement];
- // copy array for given index
- // copy will done based on below calculation
- // eg: index is 4 and size of each key is 6 then copy from 6*4= 24th
- // index till 29th index
- System.arraycopy(unCompress, ((index) * sizeOfEachElement), copy, 0, sizeOfEachElement);
- return copy;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyInMemoryStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyInMemoryStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyInMemoryStore.java
deleted file mode 100644
index f2d8699..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/compressed/CompressedSingleArrayKeyInMemoryStore.java
+++ /dev/null
@@ -1,46 +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.carbondata.core.datastorage.store.impl.key.compressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-
-public class CompressedSingleArrayKeyInMemoryStore extends AbstractCompressedSingleArrayStore {
- /**
- * @param size
- * @param elementSize
- */
- public CompressedSingleArrayKeyInMemoryStore(int size, int elementSize) {
- super(size, elementSize);
- }
-
- /**
- * @param size
- * @param elementSize
- * @param offset
- * @param filePath
- * @param fileHolder
- * @param length
- */
- public CompressedSingleArrayKeyInMemoryStore(int size, int elementSize, long offset,
- String filePath, FileHolder fileHolder, int length) {
- this(size, elementSize);
- datastore = fileHolder.readByteArray(filePath, offset, length);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/AbstractSingleArrayKeyStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/AbstractSingleArrayKeyStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/AbstractSingleArrayKeyStore.java
deleted file mode 100644
index 22b9f6e..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/AbstractSingleArrayKeyStore.java
+++ /dev/null
@@ -1,107 +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.carbondata.core.datastorage.store.impl.key.uncompressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.NodeKeyStore;
-
-public abstract class AbstractSingleArrayKeyStore implements NodeKeyStore {
-
- /**
- * size of each element
- */
- protected final int sizeOfEachElement;
- /**
- * total number of elements
- */
- protected final int totalNumberOfElements;
- /**
- * data store which will hold the data
- */
- protected byte[] datastore;
-
- public AbstractSingleArrayKeyStore(int size, int elementSize) {
- this.sizeOfEachElement = elementSize;
- this.totalNumberOfElements = size;
- datastore = new byte[size * elementSize];
- }
-
- /**
- * This method will be used to insert mdkey to store
- *
- * @param index index of mdkey
- * @param value mdkey
- */
- @Override public void put(int index, byte[] value) {
- System.arraycopy(value, 0, datastore, ((index) * sizeOfEachElement), sizeOfEachElement);
- }
-
- /**
- * This method will be used to get the writable key array.
- * writable key array will hold below information:
- * <size of key array><key array>
- * total length will be stored in 4 bytes+ key array length for key array
- *
- * @return writable array
- */
- @Override public byte[] getWritableKeyArray() {
- // create and allocate size for byte buffer
- // 4 bytes for size of array(for array length) + size of array(for array)
- return datastore;
- }
-
- /**
- * This method will be used to get the actual key array present in the
- * store.
- *
- * @param fileHolder file holder will be used to read the file
- * @return uncompressed keys
- * will return uncompressed key
- */
- @Override public byte[] getBackArray(FileHolder fileHolder) {
- return datastore;
- }
-
- /**
- * This method will be used to get the key array based on index
- *
- * @param index index in store
- * @param fileHolder file holder will be used to read the file
- * @return key
- */
- @Override public byte[] get(int index, FileHolder fileHolder) {
- // create new array of size of each element
- byte[] copy = new byte[sizeOfEachElement];
-
- // copy array for given index
- // copy will done based on below calculation
- // eg: index is 4 and size of each key is 6 then copy from 6*4= 24th
- // index till 29th index
- System.arraycopy(datastore, ((index) * sizeOfEachElement), copy, 0, sizeOfEachElement);
- return copy;
- }
-
- /**
- * This method will clear the store and create the new empty store
- */
- @Override public void clear() {
- datastore = new byte[this.totalNumberOfElements * this.sizeOfEachElement];
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyFileStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyFileStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyFileStore.java
deleted file mode 100644
index 2e73484..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyFileStore.java
+++ /dev/null
@@ -1,104 +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.carbondata.core.datastorage.store.impl.key.uncompressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-
-public class SingleArrayKeyFileStore extends AbstractSingleArrayKeyStore {
- /**
- * offset, this will be used for seek position
- */
- private long offset;
-
- /**
- * fully qualified file path
- */
- private String filePath;
-
- /**
- * length to be read
- */
- private int length;
-
- /**
- * @param size
- * @param elementSize
- */
- public SingleArrayKeyFileStore(int size, int elementSize) {
- super(size, elementSize);
- }
-
- /**
- * @param size
- * @param elementSize
- * @param offset
- * @param filePath
- * @param length
- */
- public SingleArrayKeyFileStore(int size, int elementSize, long offset, String filePath,
- int length) {
- this(size, elementSize);
- this.offset = offset;
- this.filePath = filePath;
- this.length = length;
- datastore = null;
- }
-
- /**
- * This method will be used to get the actual keys array present in the
- * store. This method will read
- * the data from file based on offset and length then return the data read from file
- *
- * @param fileHolder file holder will be used to read the file
- * @return uncompressed
- * keys will return uncompressed key
- */
- @Override public byte[] getBackArray(FileHolder fileHolder) {
- if (null != fileHolder) {
- return fileHolder.readByteArray(filePath, offset, length);
- } else {
- return new byte[0];
- }
- }
-
- /**
- * This method will be used to get the key array based on index This method
- * will first read the data from file based on offset and length then get
- * the array for index and return
- *
- * @param index index in store
- * @param fileHolder file holder will be used to read the file
- * @return key
- */
- @Override public byte[] get(int index, FileHolder fileHolder) {
- // read from file based on offset and index, fileholder will read that
- // much byte from that offset,
- byte[] unCompress = fileHolder.readByteArray(filePath, offset, length);
- // create new array of size of each element
- byte[] copy = new byte[sizeOfEachElement];
- // copy array for given index
- // copy will done based on below calculation
- // eg: index is 4 and size of each key is 6 then copy from 6*4= 24th
- // index till 29th index
- System.arraycopy(unCompress, ((index) * sizeOfEachElement), copy, 0, sizeOfEachElement);
- return copy;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyInMemoryStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyInMemoryStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyInMemoryStore.java
deleted file mode 100644
index 96ab337..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/impl/key/uncompressed/SingleArrayKeyInMemoryStore.java
+++ /dev/null
@@ -1,36 +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.carbondata.core.datastorage.store.impl.key.uncompressed;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-
-public class SingleArrayKeyInMemoryStore extends AbstractSingleArrayKeyStore {
-
- public SingleArrayKeyInMemoryStore(int size, int elementSize) {
- super(size, elementSize);
- }
-
- public SingleArrayKeyInMemoryStore(int size, int elementSize, long offset, String filePath,
- FileHolder fileHolder, int length) {
- this(size, elementSize);
- datastore = fileHolder.readByteArray(filePath, offset, length);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/util/StoreFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/util/StoreFactory.java b/core/src/main/java/org/carbondata/core/datastorage/util/StoreFactory.java
deleted file mode 100644
index e8efa21..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/util/StoreFactory.java
+++ /dev/null
@@ -1,62 +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.carbondata.core.datastorage.util;
-
-import org.carbondata.core.datastorage.store.NodeMeasureDataStore;
-import org.carbondata.core.datastorage.store.compression.ValueCompressionModel;
-import org.carbondata.core.datastorage.store.impl.data.compressed.HeavyCompressedDoubleArrayDataInMemoryStore;
-import org.carbondata.core.datastorage.store.impl.data.uncompressed.DoubleArrayDataInMemoryStore;
-
-public final class StoreFactory {
- /**
- * value type.
- */
- private static StoreType valueType;
-
- static {
- valueType = StoreType.HEAVY_VALUE_COMPRESSION;
- }
-
- private StoreFactory() {
-
- }
-
- public static NodeMeasureDataStore createDataStore(ValueCompressionModel compressionModel) {
- switch (valueType) {
- case COMPRESSED_DOUBLE_ARRAY:
- return new DoubleArrayDataInMemoryStore(compressionModel);
-
- case HEAVY_VALUE_COMPRESSION:
- return new HeavyCompressedDoubleArrayDataInMemoryStore(compressionModel);
- default:
- return new HeavyCompressedDoubleArrayDataInMemoryStore(compressionModel);
- }
- }
-
- /**
- * enum defined.
- */
- public enum StoreType {
- COMPRESSED_SINGLE_ARRAY,
- COMPRESSED_DOUBLE_ARRAY,
- HEAVY_VALUE_COMPRESSION
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/keygenerator/KeyGenException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/keygenerator/KeyGenException.java b/core/src/main/java/org/carbondata/core/keygenerator/KeyGenException.java
deleted file mode 100644
index 56d5def..0000000
--- a/core/src/main/java/org/carbondata/core/keygenerator/KeyGenException.java
+++ /dev/null
@@ -1,45 +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.carbondata.core.keygenerator;
-
-/**
- * It can be thrown while generating the key.
- */
-public class KeyGenException extends Exception {
-
- private static final long serialVersionUID = 3105132151795358241L;
-
- public KeyGenException() {
- super();
- }
-
- public KeyGenException(Exception e) {
- super(e);
- }
-
- public KeyGenException(Exception e, String msg) {
- super(msg, e);
- }
-
- public KeyGenException(String msg) {
- super(msg);
- }
-
-}