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:03 UTC
[18/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/columnar/BlockIndexerStorageForInt.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/BlockIndexerStorageForInt.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/BlockIndexerStorageForInt.java
deleted file mode 100644
index 66fbfbf..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/BlockIndexerStorageForInt.java
+++ /dev/null
@@ -1,226 +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.columnar;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.core.util.ByteUtil;
-
-public class BlockIndexerStorageForInt implements IndexStorage<int[]> {
- private boolean alreadySorted;
-
- private int[] dataAfterComp;
-
- private int[] indexMap;
-
- private byte[][] keyBlock;
-
- private int[] dataIndexMap;
-
- private int totalSize;
-
- public BlockIndexerStorageForInt(byte[][] keyBlock, boolean compressData, boolean isNoDictionary,
- boolean isSortRequired) {
- ColumnWithIntIndex[] columnWithIndexs = createColumnWithIndexArray(keyBlock, isNoDictionary);
- if (isSortRequired) {
- Arrays.sort(columnWithIndexs);
- }
- compressMyOwnWay(extractDataAndReturnIndexes(columnWithIndexs, keyBlock));
- if (compressData) {
- compressDataMyOwnWay(columnWithIndexs);
- }
- }
-
- /**
- * Create an object with each column array and respective index
- *
- * @return
- */
- private ColumnWithIntIndex[] createColumnWithIndexArray(byte[][] keyBlock,
- boolean isNoDictionary) {
- ColumnWithIntIndex[] columnWithIndexs;
- if (isNoDictionary) {
- columnWithIndexs = new ColumnWithIntIndexForHighCard[keyBlock.length];
- for (int i = 0; i < columnWithIndexs.length; i++) {
- columnWithIndexs[i] = new ColumnWithIntIndexForHighCard(keyBlock[i], i);
- }
-
- } else {
- columnWithIndexs = new ColumnWithIntIndex[keyBlock.length];
- for (int i = 0; i < columnWithIndexs.length; i++) {
- columnWithIndexs[i] = new ColumnWithIntIndex(keyBlock[i], i);
- }
- }
-
- return columnWithIndexs;
- }
-
- private int[] extractDataAndReturnIndexes(ColumnWithIntIndex[] columnWithIndexs,
- byte[][] keyBlock) {
- int[] indexes = new int[columnWithIndexs.length];
- for (int i = 0; i < indexes.length; i++) {
- indexes[i] = columnWithIndexs[i].getIndex();
- keyBlock[i] = columnWithIndexs[i].getColumn();
- }
- this.keyBlock = keyBlock;
- return indexes;
- }
-
- /**
- * It compresses depends up on the sequence numbers.
- * [1,2,3,4,6,8,10,11,12,13] is translated to [1,4,6,8,10,13] and [0,6]. In
- * first array the start and end of sequential numbers and second array
- * keeps the indexes of where sequential numbers starts. If there is no
- * sequential numbers then the same array it returns with empty second
- * array.
- *
- * @param indexes
- */
- public void compressMyOwnWay(int[] indexes) {
- List<Integer> list = new ArrayList<Integer>(CarbonCommonConstants.CONSTANT_SIZE_TEN);
- List<Integer> map = new ArrayList<Integer>(CarbonCommonConstants.CONSTANT_SIZE_TEN);
- int k = 0;
- int i = 1;
- for (; i < indexes.length; i++) {
- if (indexes[i] - indexes[i - 1] == 1) {
- k++;
- } else {
- if (k > 0) {
- map.add((list.size()));
- list.add(indexes[i - k - 1]);
- list.add(indexes[i - 1]);
- } else {
- list.add(indexes[i - 1]);
- }
- k = 0;
- }
- }
- if (k > 0) {
- map.add((list.size()));
- list.add(indexes[i - k - 1]);
- list.add(indexes[i - 1]);
- } else {
- list.add(indexes[i - 1]);
- }
- dataAfterComp = convertToArray(list);
- if (indexes.length == dataAfterComp.length) {
- indexMap = new int[0];
- } else {
- indexMap = convertToArray(map);
- }
- if (dataAfterComp.length == 2 && indexMap.length == 1) {
- alreadySorted = true;
- }
- }
-
- private int[] convertToArray(List<Integer> list) {
- int[] shortArray = new int[list.size()];
- for (int i = 0; i < shortArray.length; i++) {
- shortArray[i] = list.get(i);
- }
- return shortArray;
- }
-
- /**
- * @return the alreadySorted
- */
- public boolean isAlreadySorted() {
- return alreadySorted;
- }
-
- /**
- * @return the dataAfterComp
- */
- public int[] getDataAfterComp() {
- return dataAfterComp;
- }
-
- /**
- * @return the indexMap
- */
- public int[] getIndexMap() {
- return indexMap;
- }
-
- /**
- * @return the keyBlock
- */
- public byte[][] getKeyBlock() {
- return keyBlock;
- }
-
- private void compressDataMyOwnWay(ColumnWithIntIndex[] indexes) {
- byte[] prvKey = indexes[0].getColumn();
- List<ColumnWithIntIndex> list =
- new ArrayList<ColumnWithIntIndex>(CarbonCommonConstants.CONSTANT_SIZE_TEN);
- list.add(indexes[0]);
- int counter = 1;
- int start = 0;
- List<Integer> map = new ArrayList<Integer>(CarbonCommonConstants.CONSTANT_SIZE_TEN);
- for (int i = 1; i < indexes.length; i++) {
- if (ByteUtil.UnsafeComparer.INSTANCE.compareTo(prvKey, indexes[i].getColumn()) != 0) {
- prvKey = indexes[i].getColumn();
- list.add(indexes[i]);
- map.add(start);
- map.add(counter);
- start += counter;
- counter = 1;
- continue;
- }
- counter++;
- }
- map.add(start);
- map.add(counter);
- this.keyBlock = convertToKeyArray(list);
- if (indexes.length == keyBlock.length) {
- dataIndexMap = new int[0];
- } else {
- dataIndexMap = convertToArray(map);
- }
- }
-
- private byte[][] convertToKeyArray(List<ColumnWithIntIndex> list) {
- byte[][] shortArray = new byte[list.size()][];
- for (int i = 0; i < shortArray.length; i++) {
- shortArray[i] = list.get(i).getColumn();
- totalSize += shortArray[i].length;
- }
- return shortArray;
- }
-
- @Override public int[] getDataIndexMap() {
- return dataIndexMap;
- }
-
- @Override public int getTotalSize() {
- return totalSize;
- }
-
- @Override public byte[] getMin() {
- return keyBlock[0];
- }
-
- @Override public byte[] getMax() {
- return keyBlock[keyBlock.length - 1];
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/BlockIndexerStorageForNoInvertedIndex.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/BlockIndexerStorageForNoInvertedIndex.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/BlockIndexerStorageForNoInvertedIndex.java
deleted file mode 100644
index 175af66..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/BlockIndexerStorageForNoInvertedIndex.java
+++ /dev/null
@@ -1,159 +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.columnar;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.core.util.ByteUtil;
-
-public class BlockIndexerStorageForNoInvertedIndex implements IndexStorage<int[]> {
- private byte[][] keyBlock;
- private byte[][] sortedBlock;
- private int totalSize;
- private int[] dataIndexMap;
-
- public BlockIndexerStorageForNoInvertedIndex(byte[][] keyBlockInput, boolean compressData,
- boolean isNoDictionary) {
- // without invertedindex but can be RLE
- if (compressData) {
- // with RLE
- byte[] prvKey = keyBlockInput[0];
- List<byte[]> list = new ArrayList<byte[]>(CarbonCommonConstants.CONSTANT_SIZE_TEN);
- list.add(keyBlockInput[0]);
- int counter = 1;
- int start = 0;
- List<Integer> map = new ArrayList<Integer>(CarbonCommonConstants.CONSTANT_SIZE_TEN);
- int length = keyBlockInput.length;
- for(int i = 1; i < length; i++) {
- if (ByteUtil.UnsafeComparer.INSTANCE.compareTo(prvKey, keyBlockInput[i]) != 0) {
- prvKey = keyBlockInput[i];
- list.add(keyBlockInput[i]);
- map.add(start);
- map.add(counter);
- start += counter;
- counter = 1;
- continue;
- }
- counter++;
- }
- map.add(start);
- map.add(counter);
- this.keyBlock = convertToKeyArray(list);
- if (keyBlockInput.length == this.keyBlock.length) {
- dataIndexMap = new int[0];
- } else {
- dataIndexMap = convertToArray(map);
- }
- } else {
- this.keyBlock = keyBlockInput;
- dataIndexMap = new int[0];
- }
-
- this.sortedBlock = new byte[keyBlock.length][];
- System.arraycopy(keyBlock, 0, sortedBlock, 0, keyBlock.length);
- if (isNoDictionary) {
- Arrays.sort(sortedBlock, new Comparator<byte[]>() {
- @Override
- public int compare(byte[] col1, byte[] col2) {
- return ByteUtil.UnsafeComparer.INSTANCE
- .compareTo(col1, 2, col1.length - 2, col2, 2, col2.length - 2);
- }
- });
- } else {
- Arrays.sort(sortedBlock, new Comparator<byte[]>() {
- @Override
- public int compare(byte[] col1, byte[] col2) {
- return ByteUtil.UnsafeComparer.INSTANCE.compareTo(col1, col2);
- }
- });
- }
-
- }
-
- private int[] convertToArray(List<Integer> list) {
- int[] shortArray = new int[list.size()];
- for(int i = 0; i < shortArray.length; i++) {
- shortArray[i] = list.get(i);
- }
- return shortArray;
- }
-
- private byte[][] convertToKeyArray(List<byte[]> list) {
- byte[][] shortArray = new byte[list.size()][];
- for (int i = 0; i < shortArray.length; i++) {
- shortArray[i] = list.get(i);
- totalSize += shortArray[i].length;
- }
- return shortArray;
- }
-
- @Override
- public int[] getDataIndexMap() {
- return dataIndexMap;
- }
-
- @Override
- public int getTotalSize() {
- return totalSize;
- }
-
- @Override
- public boolean isAlreadySorted() {
- return true;
- }
-
- /**
- * no use
- * @return
- */
- @Override
- public int[] getDataAfterComp() {
- return new int[0];
- }
-
- /**
- * no use
- * @return
- */
- @Override
- public int[] getIndexMap() {
- return new int[0];
- }
-
- /**
- * @return the keyBlock
- */
- public byte[][] getKeyBlock() {
- return keyBlock;
- }
-
- @Override public byte[] getMin() {
- return sortedBlock[0];
- }
-
- @Override public byte[] getMax() {
- return sortedBlock[sortedBlock.length - 1];
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnGroupModel.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnGroupModel.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnGroupModel.java
deleted file mode 100644
index 26b2519..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnGroupModel.java
+++ /dev/null
@@ -1,116 +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.columnar;
-
-public class ColumnGroupModel {
-
- /**
- * number of columns in columnar block
- */
- private int[] columnSplit;
-
- /**
- * total number of columns
- */
- private int noOfColumnsStore;
-
- /**
- * whether given index is columnar or not
- * true: columnar
- * false: row block
- */
- private boolean[] columnarStore;
-
- /**
- * column groups
- * e.g
- * {{0,1,2},3,4,{5,6}}
- */
- private int[][] columnGroups;
-
- /**
- * return columnSplit
- *
- * @return
- */
- public int[] getColumnSplit() {
- return columnSplit;
- }
-
- /**
- * set columnSplit
- *
- * @param split
- */
- public void setColumnSplit(int[] split) {
- this.columnSplit = split;
- }
-
- /**
- * @return no of columnar block
- */
- public int getNoOfColumnStore() {
- return this.noOfColumnsStore;
- }
-
- /**
- * set no of columnar block
- *
- * @param noOfColumnsStore
- */
- public void setNoOfColumnStore(int noOfColumnsStore) {
- this.noOfColumnsStore = noOfColumnsStore;
- }
-
- /**
- * it's an identifier for row block or single column block
- *
- * @param columnarStore
- */
- public void setColumnarStore(boolean[] columnarStore) {
- this.columnarStore = columnarStore;
- }
-
- /**
- * set column groups
- *
- * @param columnGroups
- */
- public void setColumnGroup(int[][] columnGroups) {
- this.columnGroups = columnGroups;
- }
-
- /**
- * check if given column group is columnar
- *
- * @param colGroup
- * @return true if given block is columnar
- */
- public boolean isColumnar(int colGroup) {
- return columnarStore[colGroup];
- }
-
- /**
- * @return columngroups
- */
- public int[][] getColumnGroup() {
- return this.columnGroups;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndex.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndex.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndex.java
deleted file mode 100644
index 958eb84..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndex.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.columnar;
-
-import java.util.Arrays;
-
-import org.carbondata.core.util.ByteUtil;
-
-public class ColumnWithIntIndex implements Comparable<ColumnWithIntIndex> {
- protected byte[] column;
-
- private int index;
-
- public ColumnWithIntIndex(byte[] column, int index) {
- this.column = column;
- this.index = index;
- }
-
- public ColumnWithIntIndex() {
- }
-
- /**
- * @return the column
- */
- public byte[] getColumn() {
- return column;
- }
-
- /**
- * @param column the column to set
- */
- public void setColumn(byte[] column) {
- this.column = column;
- }
-
- /**
- * @return the index
- */
- public int getIndex() {
- return index;
- }
-
- /**
- * @param index the index to set
- */
- public void setIndex(int index) {
- this.index = index;
- }
-
- @Override public int compareTo(ColumnWithIntIndex o) {
- return ByteUtil.UnsafeComparer.INSTANCE.compareTo(column, o.column);
- }
-
- @Override public boolean equals(Object obj) {
- if(obj == null || getClass() != obj.getClass()) {
- return false;
- }
- ColumnWithIntIndex o = (ColumnWithIntIndex)obj;
- return Arrays.equals(column, o.column) && index == o.index;
- }
-
- @Override public int hashCode() {
- return Arrays.hashCode(column) + index;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndexForHighCard.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndexForHighCard.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndexForHighCard.java
deleted file mode 100644
index d2dc5e1..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnWithIntIndexForHighCard.java
+++ /dev/null
@@ -1,49 +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.columnar;
-
-import java.util.Arrays;
-
-import org.carbondata.core.util.ByteUtil.UnsafeComparer;
-
-public class ColumnWithIntIndexForHighCard extends ColumnWithIntIndex
- implements Comparable<ColumnWithIntIndex> {
-
- public ColumnWithIntIndexForHighCard(byte[] column, int index) {
- super(column, index);
- }
-
- @Override public int compareTo(ColumnWithIntIndex o) {
- return UnsafeComparer.INSTANCE
- .compareTo(column, 2, column.length - 2, o.column, 2, o.column.length - 2);
- }
-
- @Override public boolean equals(Object obj) {
- if(obj == null || getClass() != obj.getClass()) {
- return false;
- }
- ColumnWithIntIndexForHighCard o = (ColumnWithIntIndexForHighCard)obj;
- return Arrays.equals(column, o.column) && getIndex() == o.getIndex();
- }
-
- @Override public int hashCode() {
- return Arrays.hashCode(column) + getIndex();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStore.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStore.java
deleted file mode 100644
index 10821c8..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStore.java
+++ /dev/null
@@ -1,47 +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.columnar;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-
-public interface ColumnarKeyStore {
- /**
- * This method will be used to get the actual mdkeys array present in the
- * carbon store, it will read and uncomnpress the key
- *
- * @param fileHolder
- * @return mdkey
- * @noDictionaryValKeyIndexes, directkey indexes for determining the NO_DICTIONARY
- * Col inorder to process the direct surrogates data.
- */
- ColumnarKeyStoreDataHolder[] getUnCompressedKeyArray(FileHolder fileHolder, int[] blockIndex,
- boolean[] needCompressedData, int[] noDictionaryValKeyIndexes);
-
- /**
- * This method will be used to get the actual mdkeys array present in the
- * carbon store, it will read and uncomnpress the key
- *
- * @param fileHolder
- * @return mdkey
- */
- ColumnarKeyStoreDataHolder getUnCompressedKeyArray(FileHolder fileHolder, int blockIndex,
- boolean needCompressedData, int[] noDictionaryValKeyIndexes);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreDataHolder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreDataHolder.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreDataHolder.java
deleted file mode 100644
index 55c4036..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreDataHolder.java
+++ /dev/null
@@ -1,97 +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.columnar;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-public class ColumnarKeyStoreDataHolder {
- private byte[] keyblockData;
- private List<byte[]> noDictionaryValBasedKeyBlockData;
- private ColumnarKeyStoreMetadata columnarKeyStoreMetadata;
-
- public ColumnarKeyStoreDataHolder(final byte[] keyblockData,
- final ColumnarKeyStoreMetadata columnarKeyStoreMetadata) {
- this.keyblockData = keyblockData;
- this.columnarKeyStoreMetadata = columnarKeyStoreMetadata;
- }
-
- //Added constructor for holding noDictionaryValBasedKeyBlockData
- public ColumnarKeyStoreDataHolder(final List<byte[]> noDictionaryValBasedKeyBlockData,
- final ColumnarKeyStoreMetadata columnarKeyStoreMetadata) {
- this.noDictionaryValBasedKeyBlockData = noDictionaryValBasedKeyBlockData;
- this.columnarKeyStoreMetadata = columnarKeyStoreMetadata;
- }
-
- public byte[] getKeyBlockData() {
- return keyblockData;
- }
-
- /**
- * @return the columnarKeyStoreMetadata
- */
- public ColumnarKeyStoreMetadata getColumnarKeyStoreMetadata() {
- return columnarKeyStoreMetadata;
- }
-
- public void unCompress() {
- if (columnarKeyStoreMetadata.isUnCompressed()) {
- return;
- }
- this.keyblockData = UnBlockIndexer
- .uncompressData(keyblockData, columnarKeyStoreMetadata.getDataIndex(),
- columnarKeyStoreMetadata.getEachRowSize());
- columnarKeyStoreMetadata.setUnCompressed(true);
- }
-
- public int getSurrogateKey(int columnIndex) {
- byte[] actual = new byte[4];
- int startIndex;
- if (null != columnarKeyStoreMetadata.getColumnReverseIndex()) {
- startIndex =
- columnarKeyStoreMetadata.getColumnReverseIndex()[columnIndex] * columnarKeyStoreMetadata
- .getEachRowSize();
- } else {
- startIndex = columnIndex * columnarKeyStoreMetadata.getEachRowSize();
- }
- int destPos = 4 - columnarKeyStoreMetadata.getEachRowSize();
- System.arraycopy(keyblockData, startIndex, actual, destPos,
- columnarKeyStoreMetadata.getEachRowSize());
- return ByteBuffer.wrap(actual).getInt();
- }
-
- /**
- * get the byte[] for high cardinality column block
- *
- * @return List<byte[]>.
- */
- public List<byte[]> getNoDictionaryValBasedKeyBlockData() {
- return noDictionaryValBasedKeyBlockData;
- }
-
- /**
- * set the byte[] for high cardinality column block
- *
- * @param noDictionaryValBasedKeyBlockData
- */
- public void setNoDictionaryValBasedKeyBlockData(List<byte[]> noDictionaryValBasedKeyBlockData) {
- this.noDictionaryValBasedKeyBlockData = noDictionaryValBasedKeyBlockData;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreInfo.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreInfo.java
deleted file mode 100644
index 0cf0d99..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreInfo.java
+++ /dev/null
@@ -1,262 +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.columnar;
-
-import org.carbondata.core.keygenerator.mdkey.NumberCompressor;
-
-public class ColumnarKeyStoreInfo {
- private int numberOfKeys;
-
- private int[] sizeOfEachBlock;
-
- private int[] keyBlockLengths;
-
- private long[] keyBlockOffsets;
-
- private int[] keyBlockIndexLength;
-
- private long[] keyBlockIndexOffsets;
-
- private String filePath;
-
- private boolean[] isSorted;
-
- private int[] cardinality;
-
- private NumberCompressor numberCompressor;
-
- private NumberCompressor[] keyBlockUnCompressor;
-
- private ColumnGroupModel hybridStoreModel;
-
- /**
- * dataIndexMap
- */
- private int[] dataIndexMapLength;
-
- /**
- * dataIndexMap
- */
- private long[] dataIndexMapOffsets;
-
- /**
- * aggKeyBlock
- */
- private boolean[] aggKeyBlock;
-
- /**
- * @return the numberOfKeys
- */
- public int getNumberOfKeys() {
- return numberOfKeys;
- }
-
- /**
- * @param numberOfKeys the numberOfKeys to set
- */
- public void setNumberOfKeys(int numberOfKeys) {
- this.numberOfKeys = numberOfKeys;
- }
-
- /**
- * @return the sizeOfEachBlock
- */
- public int[] getSizeOfEachBlock() {
- return sizeOfEachBlock;
- }
-
- /**
- * @param sizeOfEachBlock the sizeOfEachBlock to set
- */
- public void setSizeOfEachBlock(int[] sizeOfEachBlock) {
- this.sizeOfEachBlock = sizeOfEachBlock;
- }
-
- /**
- * @return the keyBlockLengths
- */
- public int[] getKeyBlockLengths() {
- return keyBlockLengths;
- }
-
- /**
- * @param keyBlockLengths the keyBlockLengths to set
- */
- public void setKeyBlockLengths(int[] keyBlockLengths) {
- this.keyBlockLengths = keyBlockLengths;
- }
-
- /**
- * @return the keyBlockOffsets
- */
- public long[] getKeyBlockOffsets() {
- return keyBlockOffsets;
- }
-
- /**
- * @param keyBlockOffsets the keyBlockOffsets to set
- */
- public void setKeyBlockOffsets(long[] keyBlockOffsets) {
- this.keyBlockOffsets = keyBlockOffsets;
- }
-
- /**
- * @return the keyBlockIndexLength
- */
- public int[] getKeyBlockIndexLength() {
- return keyBlockIndexLength;
- }
-
- /**
- * @param keyBlockIndexLength the keyBlockIndexLength to set
- */
- public void setKeyBlockIndexLength(int[] keyBlockIndexLength) {
- this.keyBlockIndexLength = keyBlockIndexLength;
- }
-
- /**
- * @return the keyBlockIndexOffsets
- */
- public long[] getKeyBlockIndexOffsets() {
- return keyBlockIndexOffsets;
- }
-
- /**
- * @param keyBlockIndexOffsets the keyBlockIndexOffsets to set
- */
- public void setKeyBlockIndexOffsets(long[] keyBlockIndexOffsets) {
- this.keyBlockIndexOffsets = keyBlockIndexOffsets;
- }
-
- /**
- * @return the filePath
- */
- public String getFilePath() {
- return filePath;
- }
-
- /**
- * @param filePath the filePath to set
- */
- public void setFilePath(String filePath) {
- this.filePath = filePath;
- }
-
- /**
- * @return the isSorted
- */
- public boolean[] getIsSorted() {
- return isSorted;
- }
-
- /**
- * @param isSorted the isSorted to set
- */
- public void setIsSorted(boolean[] isSorted) {
- this.isSorted = isSorted;
- }
-
- /**
- * @return the numberCompressor
- */
- public NumberCompressor getNumberCompressor() {
- return numberCompressor;
- }
-
- /**
- * @param numberCompressor the numberCompressor to set
- */
- public void setNumberCompressor(NumberCompressor numberCompressor) {
- this.numberCompressor = numberCompressor;
- }
-
- /**
- * @return the dataIndexMapLength
- */
- public int[] getDataIndexMapLength() {
- return dataIndexMapLength;
- }
-
- /**
- * @param dataIndexMapLength the dataIndexMapLength to set
- */
- public void setDataIndexMapLength(int[] dataIndexMapLength) {
- this.dataIndexMapLength = dataIndexMapLength;
- }
-
- /**
- * @return the dataIndexMapOffsets
- */
- public long[] getDataIndexMapOffsets() {
- return dataIndexMapOffsets;
- }
-
- /**
- * @param dataIndexMapOffsets the dataIndexMapOffsets to set
- */
- public void setDataIndexMapOffsets(long[] dataIndexMapOffsets) {
- this.dataIndexMapOffsets = dataIndexMapOffsets;
- }
-
- /**
- * @return the aggKeyBlock
- */
- public boolean[] getAggKeyBlock() {
- return aggKeyBlock;
- }
-
- /**
- * @param aggKeyBlock the aggKeyBlock to set
- */
- public void setAggKeyBlock(boolean[] aggKeyBlock) {
- this.aggKeyBlock = aggKeyBlock;
- }
-
- /**
- * @return the keyBlockUnCompressor
- */
- public NumberCompressor[] getKeyBlockUnCompressor() {
- return keyBlockUnCompressor;
- }
-
- /**
- * @param keyBlockUnCompressor the keyBlockUnCompressor to set
- */
- public void setKeyBlockUnCompressor(NumberCompressor[] keyBlockUnCompressor) {
- this.keyBlockUnCompressor = keyBlockUnCompressor;
- }
-
- public int[] getCardinality() {
- return cardinality;
- }
-
- public void setCardinality(int[] cardinality) {
- this.cardinality = cardinality;
- }
-
- public ColumnGroupModel getHybridStoreModel() {
- return hybridStoreModel;
- }
-
- public void setHybridStoreModel(ColumnGroupModel hybridStoreModel) {
- this.hybridStoreModel = hybridStoreModel;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreMetadata.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreMetadata.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreMetadata.java
deleted file mode 100644
index 81834cb..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/ColumnarKeyStoreMetadata.java
+++ /dev/null
@@ -1,150 +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.columnar;
-
-import org.carbondata.core.keygenerator.KeyGenerator;
-import org.carbondata.core.keygenerator.factory.KeyGeneratorFactory;
-
-public class ColumnarKeyStoreMetadata {
- private boolean isSorted;
-
- private int[] columnIndex;
-
- private int[] columnReverseIndex;
-
- private int eachRowSize;
-
- private int[] dataIndex;
-
- private boolean isUnCompressed;
-
- private KeyGenerator keyGenerator;
-
- /**
- * isNoDictionaryValColumn.
- */
- private boolean isNoDictionaryValColumn;
- private boolean isRowStore;
-
- public ColumnarKeyStoreMetadata(int eachRowSize) {
- this.eachRowSize = eachRowSize;
- keyGenerator = KeyGeneratorFactory.getKeyGenerator(new int[] { eachRowSize });
- }
-
- /**
- * @return the isSorted
- */
- public boolean isSorted() {
- return isSorted;
- }
-
- /**
- * @param isSorted the isSorted to set
- */
- public void setSorted(boolean isSorted) {
- this.isSorted = isSorted;
- }
-
- /**
- * @return the columnIndex
- */
- public int[] getColumnIndex() {
- return columnIndex;
- }
-
- /**
- * @param columnIndex the columnIndex to set
- */
- public void setColumnIndex(int[] columnIndex) {
- this.columnIndex = columnIndex;
- }
-
- /**
- * @return the eachRowSize
- */
- public int getEachRowSize() {
- return eachRowSize;
- }
-
- /**
- * @return the dataIndex
- */
- public int[] getDataIndex() {
- return dataIndex;
- }
-
- /**
- * @param dataIndex the dataIndex to set
- */
- public void setDataIndex(int[] dataIndex) {
- this.dataIndex = dataIndex;
- }
-
- /**
- * @return the columnReverseIndex
- */
- public int[] getColumnReverseIndex() {
- return columnReverseIndex;
- }
-
- /**
- * @param columnReverseIndex the columnReverseIndex to set
- */
- public void setColumnReverseIndex(int[] columnReverseIndex) {
- this.columnReverseIndex = columnReverseIndex;
- }
-
- public boolean isUnCompressed() {
- return isUnCompressed;
- }
-
- public void setUnCompressed(boolean isUnCompressed) {
- this.isUnCompressed = isUnCompressed;
- }
-
- public KeyGenerator getKeyGenerator() {
- return keyGenerator;
- }
-
- public boolean isRowStore() {
- return isRowStore;
- }
-
- public void setRowStore(boolean isRowStore) {
- this.isRowStore = isRowStore;
- }
-
- /**
- * @return
- */
- public boolean isNoDictionaryValColumn() {
- return isNoDictionaryValColumn;
-
- }
-
- /**
- * @param isNoDictionaryValColumn
- */
- public void setNoDictionaryValColumn(boolean isNoDictionaryValColumn) {
- this.isNoDictionaryValColumn = isNoDictionaryValColumn;
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/IndexStorage.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/IndexStorage.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/IndexStorage.java
deleted file mode 100644
index 5e1b3f8..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/IndexStorage.java
+++ /dev/null
@@ -1,44 +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.columnar;
-
-public interface IndexStorage<T> {
- boolean isAlreadySorted();
-
- T getDataAfterComp();
-
- T getIndexMap();
-
- byte[][] getKeyBlock();
-
- T getDataIndexMap();
-
- int getTotalSize();
-
- /**
- * @return min value of block
- */
- byte[] getMin();
-
- /**
- * @return max value of block
- */
- byte[] getMax();
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/columnar/UnBlockIndexer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/UnBlockIndexer.java b/core/src/main/java/org/carbondata/core/datastorage/store/columnar/UnBlockIndexer.java
deleted file mode 100644
index a20320b..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/columnar/UnBlockIndexer.java
+++ /dev/null
@@ -1,78 +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.columnar;
-
-import java.util.Arrays;
-
-public final class UnBlockIndexer {
-
- private UnBlockIndexer() {
-
- }
-
- public static int[] uncompressIndex(int[] indexData, int[] indexMap) {
- int actualSize = indexData.length;
- for (int i = 0; i < indexMap.length; i++) {
- actualSize += indexData[indexMap[i] + 1] - indexData[indexMap[i]] - 1;
- }
- int[] indexes = new int[actualSize];
- int k = 0;
- for (int i = 0; i < indexData.length; i++) {
- int index = Arrays.binarySearch(indexMap, i);
- if (index > -1) {
- for (int j = indexData[indexMap[index]]; j <= indexData[indexMap[index] + 1]; j++) {
- indexes[k] = j;
- k++;
- }
- i++;
- } else {
- indexes[k] = indexData[i];
- k++;
- }
- }
- return indexes;
- }
-
- public static byte[] uncompressData(byte[] data, int[] index, int keyLen) {
- if (index.length < 1) {
- return data;
- }
- int numberOfCopy = 0;
- int actualSize = 0;
- int srcPos = 0;
- int destPos = 0;
- for (int i = 1; i < index.length; i += 2) {
- actualSize += index[i];
- }
- byte[] uncompressedData = new byte[actualSize * keyLen];
- int picIndex = 0;
- for (int i = 0; i < data.length; i += keyLen) {
- numberOfCopy = index[picIndex * 2 + 1];
- picIndex++;
- for (int j = 0; j < numberOfCopy; j++) {
- System.arraycopy(data, srcPos, uncompressedData, destPos, keyLen);
- destPos += keyLen;
- }
- srcPos += keyLen;
- }
- return uncompressedData;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/Compressor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/Compressor.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/Compressor.java
deleted file mode 100644
index e1db7d0..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/Compressor.java
+++ /dev/null
@@ -1,28 +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.compression;
-
-public interface Compressor<T> {
-
- byte[] compress(T input);
-
- T unCompress(byte[] input);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/MeasureMetaDataModel.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/MeasureMetaDataModel.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/MeasureMetaDataModel.java
deleted file mode 100644
index bc169b1..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/MeasureMetaDataModel.java
+++ /dev/null
@@ -1,217 +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.compression;
-
-public class MeasureMetaDataModel {
- /**
- * maxValue
- */
- private Object[] maxValue;
-
- /**
- * minValue
- */
- private Object[] minValue;
-
- /**
- * decimal
- */
- private int[] decimal;
-
- /**
- * measureCount
- */
- private int measureCount;
-
- /**
- * uniqueValue
- */
- private Object[] uniqueValue;
-
- /**
- * type
- */
- private char[] type;
-
- /**
- * dataTypeSelected
- */
- private byte[] dataTypeSelected;
-
- private Object[] minValueFactForAgg;
-
- public MeasureMetaDataModel() {
-
- }
-
- /**
- * MeasureMetaDataModel Constructor
- *
- * @param minValue
- * @param maxValue
- * @param decimal
- * @param measureCount
- * @param uniqueValue
- * @param type
- */
- public MeasureMetaDataModel(Object[] minValue, Object[] maxValue, int[] decimal, int measureCount,
- Object[] uniqueValue, char[] type, byte[] dataTypeSelected) {
- this.minValue = minValue;
- this.maxValue = maxValue;
- this.decimal = decimal;
- this.measureCount = measureCount;
- this.uniqueValue = uniqueValue;
- this.type = type;
- this.dataTypeSelected = dataTypeSelected;
- }
-
- /**
- * get Max value
- *
- * @return
- */
- public Object[] getMaxValue() {
- return maxValue;
- }
-
- /**
- * set max value
- *
- * @param maxValue
- */
- public void setMaxValue(Object[] maxValue) {
- this.maxValue = maxValue;
- }
-
- /**
- * getMinValue
- *
- * @return
- */
- public Object[] getMinValue() {
- return minValue;
- }
-
- /**
- * setMinValue
- *
- * @param minValue
- */
- public void setMinValue(Object[] minValue) {
- this.minValue = minValue;
- }
-
- /**
- * getDecimal
- *
- * @return
- */
- public int[] getDecimal() {
- return decimal;
- }
-
- /**
- * setDecimal
- *
- * @param decimal
- */
- public void setDecimal(int[] decimal) {
- this.decimal = decimal;
- }
-
- /**
- * getMeasureCount
- *
- * @return
- */
- public int getMeasureCount() {
- return measureCount;
- }
-
- /**
- * setMeasureCount
- *
- * @param measureCount
- */
- public void setMeasureCount(int measureCount) {
- this.measureCount = measureCount;
- }
-
- /**
- * getUniqueValue
- *
- * @return
- */
- public Object[] getUniqueValue() {
- return uniqueValue;
- }
-
- /**
- * setUniqueValue
- *
- * @param uniqueValue
- */
- public void setUniqueValue(Object[] uniqueValue) {
- this.uniqueValue = uniqueValue;
- }
-
- /**
- * @return the type
- */
- public char[] getType() {
- return type;
- }
-
- /**
- * @param type the type to set
- */
- public void setType(char[] type) {
- this.type = type;
- }
-
- /**
- * @return the dataTypeSelected
- */
- public byte[] getDataTypeSelected() {
- return dataTypeSelected;
- }
-
- /**
- * @param dataTypeSelected the dataTypeSelected to set
- */
- public void setDataTypeSelected(byte[] dataTypeSelected) {
- this.dataTypeSelected = dataTypeSelected;
- }
-
- /**
- * @return the minValueFactForAgg
- */
- public Object[] getMinValueFactForAgg() {
- return minValueFactForAgg;
- }
-
- /**
- * @param minValueFactForAgg the minValueFactForAgg to set
- */
- public void setMinValueFactForAgg(Object[] minValueFactForAgg) {
- this.minValueFactForAgg = minValueFactForAgg;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/SnappyCompression.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/SnappyCompression.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/SnappyCompression.java
deleted file mode 100644
index fd9a99e..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/SnappyCompression.java
+++ /dev/null
@@ -1,273 +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.compression;
-
-import java.io.IOException;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-
-import org.xerial.snappy.Snappy;
-
-public class SnappyCompression {
- /**
- * Attribute for Carbon LOGGER
- */
- private static final LogService LOGGER =
- LogServiceFactory.getLogService(SnappyCompression.class.getName());
-
- /**
- * SnappyByteCompression.
- */
- public static enum SnappyByteCompression implements Compressor<byte[]> {
- /**
- *
- */
- INSTANCE;
-
- /**
- * wrapper method for compressing byte[] unCompInput.
- */
- public byte[] compress(byte[] unCompInput) {
- try {
- return Snappy.rawCompress(unCompInput, unCompInput.length);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- return null;
- }
- }
-
- /**
- * wrapper method for unCompress byte[] compInput.
- *
- * @return byte[].
- */
- public byte[] unCompress(byte[] compInput) {
- try {
- return Snappy.uncompress(compInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- }
- return compInput;
- }
- }
-
- /**
- * enum class for SnappyDoubleCompression.
- */
- public static enum SnappyDoubleCompression implements Compressor<double[]> {
- /**
- *
- */
- INSTANCE;
-
- /**
- * wrapper method for compressing double[] unCompInput.
- */
- public byte[] compress(double[] unCompInput) {
- try {
- return Snappy.compress(unCompInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- return null;
- }
- }
-
- /**
- * wrapper method for unCompress byte[] compInput.
- *
- * @param compInput byte[].
- * @return double[].
- */
- public double[] unCompress(byte[] compInput) {
- try {
- return Snappy.uncompressDoubleArray(compInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
-
- }
-
- /**
- * enum class for SnappyShortCompression.
- *
- * @author S71955
- */
- public static enum SnappyShortCompression implements Compressor<short[]> {
- /**
- *
- */
- INSTANCE;
-
- /**
- * wrapper method for compress short[] unCompInput.
- *
- * @param unCompInput short[].
- * @return byte[].
- */
- public byte[] compress(short[] unCompInput) {
- try {
- return Snappy.compress(unCompInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- return null;
- }
- }
-
- /**
- * wrapper method for uncompressShortArray.
- *
- * @param compInput byte[].
- * @return short[].
- */
- public short[] unCompress(byte[] compInput) {
- try {
- return Snappy.uncompressShortArray(compInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
- }
-
- /**
- * enum class for SnappyIntCompression.
- */
- public static enum SnappyIntCompression implements Compressor<int[]> {
- /**
- *
- */
- INSTANCE;
-
- /**
- * wrapper method for compress int[] unCompInput.
- *
- * @param unCompInput int[].
- * @return byte[].
- */
- public byte[] compress(int[] unCompInput) {
- try {
- return Snappy.compress(unCompInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- return null;
- }
- }
-
- /**
- * wrapper method for uncompressIntArray.
- *
- * @param compInput byte[].
- * @return int[].
- */
- public int[] unCompress(byte[] compInput) {
- try {
- return Snappy.uncompressIntArray(compInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
- }
-
- /**
- * enum class for SnappyLongCompression.
- */
- public static enum SnappyLongCompression implements Compressor<long[]> {
- /**
- *
- */
- INSTANCE;
-
- /**
- * wrapper method for compress long[] unCompInput.
- *
- * @param unCompInput long[].
- * @return byte[].
- */
- public byte[] compress(long[] unCompInput) {
- try {
- return Snappy.compress(unCompInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- return null;
- }
- }
-
- /**
- * wrapper method for uncompressLongArray.
- *
- * @param compInput byte[].
- * @return long[].
- */
- public long[] unCompress(byte[] compInput) {
- try {
- return Snappy.uncompressLongArray(compInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
- }
-
- /**
- * enum class for SnappyFloatCompression.
- */
-
- public static enum SnappyFloatCompression implements Compressor<float[]> {
- /**
- *
- */
- INSTANCE;
-
- /**
- * wrapper method for compress float[] unCompInput.
- *
- * @param unCompInput float[].
- * @return byte[].
- */
- public byte[] compress(float[] unCompInput) {
- try {
- return Snappy.compress(unCompInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- return null;
- }
- }
-
- /**
- * wrapper method for uncompressFloatArray.
- *
- * @param compInput byte[].
- * @return float[].
- */
- public float[] unCompress(byte[] compInput) {
- try {
- return Snappy.uncompressFloatArray(compInput);
- } catch (IOException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressionModel.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressionModel.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressionModel.java
deleted file mode 100644
index 83cb001..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressionModel.java
+++ /dev/null
@@ -1,236 +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.compression;
-
-import org.carbondata.core.util.ValueCompressionUtil;
-
-public class ValueCompressionModel {
- /**
- * COMPRESSION_TYPE[] variable.
- */
- private ValueCompressionUtil.COMPRESSION_TYPE[] compType;
-
- /**
- * DataType[] variable.
- */
- private ValueCompressionUtil.DataType[] changedDataType;
- /**
- * DataType[] variable.
- */
- private ValueCompressionUtil.DataType[] actualDataType;
-
- /**
- * maxValue
- */
- private Object[] maxValue;
- /**
- * minValue.
- */
- private Object[] minValue;
-
- private Object[] minValueFactForAgg;
-
- /**
- * uniqueValue
- */
- private Object[] uniqueValue;
- /**
- * decimal.
- */
- private int[] decimal;
-
- /**
- * aggType
- */
- private char[] type;
-
- /**
- * dataTypeSelected
- */
- private byte[] dataTypeSelected;
- /**
- * unCompressValues.
- */
- private ValueCompressonHolder.UnCompressValue[] unCompressValues;
-
- /**
- * @return the compType
- */
- public ValueCompressionUtil.COMPRESSION_TYPE[] getCompType() {
- return compType;
- }
-
- /**
- * @param compType the compType to set
- */
- public void setCompType(ValueCompressionUtil.COMPRESSION_TYPE[] compType) {
- this.compType = compType;
- }
-
- /**
- * @return the changedDataType
- */
- public ValueCompressionUtil.DataType[] getChangedDataType() {
- return changedDataType;
- }
-
- /**
- * @param changedDataType the changedDataType to set
- */
- public void setChangedDataType(ValueCompressionUtil.DataType[] changedDataType) {
- this.changedDataType = changedDataType;
- }
-
- /**
- * @return the actualDataType
- */
- public ValueCompressionUtil.DataType[] getActualDataType() {
- return actualDataType;
- }
-
- /**
- * @param actualDataType
- */
- public void setActualDataType(ValueCompressionUtil.DataType[] actualDataType) {
- this.actualDataType = actualDataType;
- }
-
- /**
- * @return the maxValue
- */
- public Object[] getMaxValue() {
- return maxValue;
- }
-
- /**
- * @param maxValue the maxValue to set
- */
- public void setMaxValue(Object[] maxValue) {
- this.maxValue = maxValue;
- }
-
- /**
- * @return the decimal
- */
- public int[] getDecimal() {
- return decimal;
- }
-
- /**
- * @param decimal the decimal to set
- */
- public void setDecimal(int[] decimal) {
- this.decimal = decimal;
- }
-
- /**
- * getUnCompressValues().
- *
- * @return the unCompressValues
- */
- public ValueCompressonHolder.UnCompressValue[] getUnCompressValues() {
- return unCompressValues;
- }
-
- /**
- * @param unCompressValues the unCompressValues to set
- */
- public void setUnCompressValues(ValueCompressonHolder.UnCompressValue[] unCompressValues) {
- this.unCompressValues = unCompressValues;
- }
-
- /**
- * getMinValue
- *
- * @return
- */
- public Object[] getMinValue() {
- return minValue;
- }
-
- /**
- * setMinValue.
- *
- * @param minValue
- */
- public void setMinValue(Object[] minValue) {
- this.minValue = minValue;
- }
-
- /**
- * @return the aggType
- */
- public char[] getType() {
- return type;
- }
-
- /**
- * @param type the type to set
- */
- public void setType(char[] type) {
- this.type = type;
- }
-
- /**
- * @return the dataTypeSelected
- */
- public byte[] getDataTypeSelected() {
- return dataTypeSelected;
- }
-
- /**
- * @param dataTypeSelected the dataTypeSelected to set
- */
- public void setDataTypeSelected(byte[] dataTypeSelected) {
- this.dataTypeSelected = dataTypeSelected;
- }
-
- /**
- * getUniqueValue
- *
- * @return
- */
- public Object[] getUniqueValue() {
- return uniqueValue;
- }
-
- /**
- * setUniqueValue
- *
- * @param uniqueValue
- */
- public void setUniqueValue(Object[] uniqueValue) {
- this.uniqueValue = uniqueValue;
- }
-
- /**
- * @return the minValueFactForAgg
- */
- public Object[] getMinValueFactForAgg() {
- return minValueFactForAgg;
- }
-
- /**
- * @param minValueFactForAgg the minValueFactForAgg to set
- */
- public void setMinValueFactForAgg(Object[] minValueFactForAgg) {
- this.minValueFactForAgg = minValueFactForAgg;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressonHolder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressonHolder.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressonHolder.java
deleted file mode 100644
index 89bf334..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/ValueCompressonHolder.java
+++ /dev/null
@@ -1,135 +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.compression;
-
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.util.ValueCompressionUtil.DataType;
-
-/**
- * ValueCompressonHolder class.
- */
-public final class ValueCompressonHolder {
-
- /**
- * byteCompressor.
- */
- private static Compressor<byte[]> byteCompressor =
- SnappyCompression.SnappyByteCompression.INSTANCE;
-
- /**
- * shortCompressor.
- */
- private static Compressor<short[]> shortCompressor =
- SnappyCompression.SnappyShortCompression.INSTANCE;
-
- /**
- * intCompressor.
- */
- private static Compressor<int[]> intCompressor = SnappyCompression.SnappyIntCompression.INSTANCE;
-
- /**
- * longCompressor.
- */
- private static Compressor<long[]> longCompressor =
- SnappyCompression.SnappyLongCompression.INSTANCE;
-
- /**
- * floatCompressor
- */
- private static Compressor<float[]> floatCompressor =
- SnappyCompression.SnappyFloatCompression.INSTANCE;
- /**
- * doubleCompressor.
- */
- private static Compressor<double[]> doubleCompressor =
- SnappyCompression.SnappyDoubleCompression.INSTANCE;
-
- private ValueCompressonHolder() {
-
- }
-
- /**
- * @param dataType
- * @param value
- * @param data
- */
- public static void unCompress(DataType dataType, UnCompressValue value, byte[] data) {
- switch (dataType) {
- case DATA_BYTE:
-
- value.setValue(byteCompressor.unCompress(data));
- break;
-
- case DATA_SHORT:
-
- value.setValue(shortCompressor.unCompress(data));
- break;
-
- case DATA_INT:
-
- value.setValue(intCompressor.unCompress(data));
- break;
-
- case DATA_LONG:
- case DATA_BIGINT:
-
- value.setValue(longCompressor.unCompress(data));
- break;
-
- case DATA_FLOAT:
-
- value.setValue(floatCompressor.unCompress(data));
- break;
- default:
-
- value.setValue(doubleCompressor.unCompress(data));
- break;
-
- }
- }
-
- /**
- * interface for UnCompressValue<T>.
- *
- * @param <T>
- */
-
- public interface UnCompressValue<T> extends Cloneable {
- // Object getValue(int index, int decimal, double maxValue);
-
- void setValue(T value);
-
- void setValueInBytes(byte[] value);
-
- UnCompressValue<T> getNew();
-
- UnCompressValue compress();
-
- UnCompressValue uncompress(DataType dataType);
-
- byte[] getBackArrayData();
-
- UnCompressValue getCompressorObject();
-
- CarbonReadDataHolder getValues(int decimal, Object maxValue);
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressByteArray.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressByteArray.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressByteArray.java
deleted file mode 100644
index 34de084..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressByteArray.java
+++ /dev/null
@@ -1,137 +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.compression.type;
-
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.core.datastorage.store.compression.Compressor;
-import org.carbondata.core.datastorage.store.compression.SnappyCompression;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.util.DataTypeUtil;
-import org.carbondata.core.util.ValueCompressionUtil;
-
-public class UnCompressByteArray implements ValueCompressonHolder.UnCompressValue<byte[]> {
- /**
- * Attribute for Carbon LOGGER
- */
- private static final LogService LOGGER =
- LogServiceFactory.getLogService(UnCompressMaxMinByte.class.getName());
- /**
- * byteCompressor.
- */
- private static Compressor<byte[]> byteCompressor =
- SnappyCompression.SnappyByteCompression.INSTANCE;
- private ByteArrayType arrayType;
- /**
- * value.
- */
- private byte[] value;
-
- public UnCompressByteArray(ByteArrayType type) {
- if (type == ByteArrayType.BYTE_ARRAY) {
- arrayType = ByteArrayType.BYTE_ARRAY;
- } else {
- arrayType = ByteArrayType.BIG_DECIMAL;
- }
-
- }
-
- @Override public void setValue(byte[] value) {
- this.value = value;
-
- }
-
- @Override public void setValueInBytes(byte[] value) {
- this.value = value;
-
- }
-
- @Override public ValueCompressonHolder.UnCompressValue<byte[]> getNew() {
- try {
- return (ValueCompressonHolder.UnCompressValue) clone();
- } catch (CloneNotSupportedException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
-
- @Override public ValueCompressonHolder.UnCompressValue compress() {
- UnCompressByteArray byte1 = new UnCompressByteArray(arrayType);
- byte1.setValue(byteCompressor.compress(value));
- return byte1;
- }
-
- @Override
- public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dataType) {
- ValueCompressonHolder.UnCompressValue byte1 = new UnCompressByteArray(arrayType);
- byte1.setValue(byteCompressor.unCompress(value));
- return byte1;
- }
-
- @Override public byte[] getBackArrayData() {
- return this.value;
- }
-
- @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
- return new UnCompressByteArray(arrayType);
- }
-
- @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
- List<byte[]> valsList = new ArrayList<byte[]>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
- ByteBuffer buffer = ByteBuffer.wrap(value);
- buffer.rewind();
- int length = 0;
- byte[] actualValue = null;
- //CHECKSTYLE:OFF Approval No:Approval-367
- while (buffer.hasRemaining()) {//CHECKSTYLE:ON
- length = buffer.getInt();
- actualValue = new byte[length];
- buffer.get(actualValue);
- valsList.add(actualValue);
-
- }
- CarbonReadDataHolder holder = new CarbonReadDataHolder();
- byte[][] value = new byte[valsList.size()][];
- valsList.toArray(value);
- if (arrayType == ByteArrayType.BIG_DECIMAL) {
- BigDecimal[] bigDecimalValues = new BigDecimal[value.length];
- for (int i = 0; i < value.length; i++) {
- bigDecimalValues[i] = DataTypeUtil.byteToBigDecimal(value[i]);
- }
- holder.setReadableBigDecimalValues(bigDecimalValues);
- return holder;
- }
- holder.setReadableByteValues(value);
- return holder;
- }
-
- public static enum ByteArrayType {
- BYTE_ARRAY,
- BIG_DECIMAL
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressDefaultLong.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressDefaultLong.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressDefaultLong.java
deleted file mode 100644
index 6404027..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressDefaultLong.java
+++ /dev/null
@@ -1,51 +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.compression.type;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-
-public class UnCompressDefaultLong extends UnCompressNoneLong {
-
- private static final LogService LOGGER =
- LogServiceFactory.getLogService(UnCompressDefaultLong.class.getName());
-
- public ValueCompressonHolder.UnCompressValue getNew() {
- try {
- return (ValueCompressonHolder.UnCompressValue) clone();
- } catch (CloneNotSupportedException clnNotSupportedExc) {
- LOGGER.error(clnNotSupportedExc,
- clnNotSupportedExc.getMessage());
- }
- return null;
- }
-
- @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
- CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
- long[] vals = new long[value.length];
- for (int i = 0; i < vals.length; i++) {
- vals[i] = value[i];
- }
- dataHolder.setReadableLongValues(vals);
- return dataHolder;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByte.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByte.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByte.java
deleted file mode 100644
index 9f2db9f..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByte.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.compression.type;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-import org.carbondata.core.datastorage.store.compression.Compressor;
-import org.carbondata.core.datastorage.store.compression.SnappyCompression;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.util.ValueCompressionUtil;
-import org.carbondata.core.util.ValueCompressionUtil.DataType;
-
-public class UnCompressMaxMinByte implements UnCompressValue<byte[]> {
-
- /**
- * Attribute for Carbon LOGGER
- */
- private static final LogService LOGGER =
- LogServiceFactory.getLogService(UnCompressMaxMinByte.class.getName());
- /**
- * byteCompressor.
- */
- private static Compressor<byte[]> byteCompressor =
- SnappyCompression.SnappyByteCompression.INSTANCE;
- /**
- * value.
- */
- protected byte[] value;
-
- //TODO SIMIAN
-
- @Override public void setValue(byte[] value) {
- this.value = value;
-
- }
-
- @Override public UnCompressValue getNew() {
- try {
- return (UnCompressValue) clone();
- } catch (CloneNotSupportedException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
-
- @Override public UnCompressValue compress() {
-
- UnCompressMaxMinByte byte1 = new UnCompressMaxMinByte();
- byte1.setValue(byteCompressor.compress(value));
- return byte1;
- }
-
- @Override public UnCompressValue uncompress(DataType dataType) {
- UnCompressValue byte1 = ValueCompressionUtil.unCompressMaxMin(dataType, dataType);
- ValueCompressonHolder.unCompress(dataType, byte1, value);
- return byte1;
- }
-
- @Override public byte[] getBackArrayData() {
- return value;
- }
-
- @Override public void setValueInBytes(byte[] value) {
- this.value = value;
- }
-
- /**
- * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
- */
- @Override public UnCompressValue getCompressorObject() {
- return new UnCompressMaxMinByte();
- }
-
- @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
- double maxValue = (double) maxValueObject;
- double[] vals = new double[value.length];
- CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
- for (int i = 0; i < vals.length; i++) {
- if (value[i] == 0) {
- vals[i] = maxValue;
- } else {
- vals[i] = maxValue - value[i];
- }
- }
- dataHolder.setReadableDoubleValues(vals);
- return dataHolder;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByteForLong.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByteForLong.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByteForLong.java
deleted file mode 100644
index c97f8be..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinByteForLong.java
+++ /dev/null
@@ -1,78 +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.compression.type;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-import org.carbondata.core.datastorage.store.compression.Compressor;
-import org.carbondata.core.datastorage.store.compression.SnappyCompression;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.util.ValueCompressionUtil;
-
-public class UnCompressMaxMinByteForLong extends UnCompressMaxMinByte {
-
- private static final LogService LOGGER =
- LogServiceFactory.getLogService(UnCompressMaxMinByteForLong.class.getName());
- private static Compressor<byte[]> byteCompressor =
- SnappyCompression.SnappyByteCompression.INSTANCE;
-
- @Override public ValueCompressonHolder.UnCompressValue getNew() {
- try {
- return (ValueCompressonHolder.UnCompressValue) clone();
- } catch (CloneNotSupportedException e) {
- LOGGER.error(e, e.getMessage());
- }
- return null;
- }
-
- @Override public ValueCompressonHolder.UnCompressValue compress() {
-
- UnCompressMaxMinByteForLong byte1 = new UnCompressMaxMinByteForLong();
- byte1.setValue(byteCompressor.compress(value));
- return byte1;
- }
-
- @Override
- public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dataType) {
- ValueCompressonHolder.UnCompressValue byte1 =
- ValueCompressionUtil.unCompressMaxMin(dataType, dataType);
- ValueCompressonHolder.unCompress(dataType, byte1, value);
- return byte1;
- }
-
- @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
- return new UnCompressMaxMinByteForLong();
- }
-
- @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
- long maxValue = (long) maxValueObject;
- long[] vals = new long[value.length];
- CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
- for (int i = 0; i < vals.length; i++) {
- if (value[i] == 0) {
- vals[i] = maxValue;
- } else {
- vals[i] = maxValue - value[i];
- }
- }
- dataHolder.setReadableLongValues(vals);
- return dataHolder;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinDefault.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinDefault.java b/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinDefault.java
deleted file mode 100644
index 5713541..0000000
--- a/core/src/main/java/org/carbondata/core/datastorage/store/compression/type/UnCompressMaxMinDefault.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.compression.type;
-
-import java.nio.ByteBuffer;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-import org.carbondata.core.datastorage.store.compression.Compressor;
-import org.carbondata.core.datastorage.store.compression.SnappyCompression;
-import org.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.carbondata.core.util.ValueCompressionUtil;
-import org.carbondata.core.util.ValueCompressionUtil.DataType;
-
-public class UnCompressMaxMinDefault implements ValueCompressonHolder.UnCompressValue<double[]> {
-
- /**
- * Attribute for Carbon LOGGER
- */
- private static final LogService LOGGER =
- LogServiceFactory.getLogService(UnCompressMaxMinDefault.class.getName());
-
- /**
- * doubleCompressor.
- */
- private static Compressor<double[]> doubleCompressor =
- SnappyCompression.SnappyDoubleCompression.INSTANCE;
- /**
- * value.
- */
- private double[] value;
-
- @Override public void setValue(double[] value) {
- this.value = (double[]) value;
-
- }
-
- @Override public ValueCompressonHolder.UnCompressValue getNew() {
- try {
- return (ValueCompressonHolder.UnCompressValue) clone();
- } catch (CloneNotSupportedException ex5) {
- LOGGER.error(ex5, ex5.getMessage());
- }
- return null;
- }
-
- @Override public ValueCompressonHolder.UnCompressValue compress() {
- UnCompressMaxMinByte byte1 = new UnCompressMaxMinByte();
- byte1.setValue(doubleCompressor.compress(value));
- return byte1;
- }
-
- @Override public ValueCompressonHolder.UnCompressValue uncompress(DataType dataType) {
- return null;
- }
-
- @Override public byte[] getBackArrayData() {
- return ValueCompressionUtil.convertToBytes(value);
- }
-
- @Override public void setValueInBytes(byte[] value) {
- ByteBuffer buffer = ByteBuffer.wrap(value);
- this.value = ValueCompressionUtil.convertToDoubleArray(buffer, value.length);
- }
-
- /**
- * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
- */
- @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
- return new UnCompressMaxMinByte();
- }
-
- //TODO SIMIAN
- @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
- double maxValue = (double) maxValueObject;
- double[] vals = new double[value.length];
- CarbonReadDataHolder dataHolderInfoObj = new CarbonReadDataHolder();
- for (int i = 0; i < vals.length; i++) {
- if (value[i] == 0) {
- vals[i] = maxValue;
- } else {
- vals[i] = maxValue - value[i];
- }
-
- }
- dataHolderInfoObj.setReadableDoubleValues(vals);
- return dataHolderInfoObj;
- }
-
-}