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:26 UTC
[41/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/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalDefault.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalDefault.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalDefault.java
new file mode 100644
index 0000000..9146705
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalDefault.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNonDecimalDefault
+ implements ValueCompressonHolder.UnCompressValue<double[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalDefault.class.getName());
+ /**
+ * doubleCompressor.
+ */
+ private static Compressor<double[]> doubleCompressor =
+ SnappyCompression.SnappyDoubleCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private double[] value;
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException cnse1) {
+ LOGGER.error(cnse1, cnse1.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+ UnCompressNonDecimalByte byte1 = new UnCompressNonDecimalByte();
+ byte1.setValue(doubleCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+ @Override public void setValue(double[] value) {
+ this.value = value;
+
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToDoubleArray(buffer, value.length);
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double[] dblVals = new double[value.length];
+ for (int i = 0; i < dblVals.length; i++) {
+ dblVals[i] = value[i] / Math.pow(10, decimal);
+ }
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ dataHolder.setReadableDoubleValues(dblVals);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalFloat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalFloat.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalFloat.java
new file mode 100644
index 0000000..487e943
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalFloat.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+
+public class UnCompressNonDecimalFloat implements ValueCompressonHolder.UnCompressValue<float[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalFloat.class.getName());
+ /**
+ * floatCompressor
+ */
+ private static Compressor<float[]> floatCompressor =
+ SnappyCompression.SnappyFloatCompression.INSTANCE;
+ /**
+ * value.
+ */
+
+ private float[] value;
+
+ @Override public void setValue(float[] value) {
+ this.value = value;
+
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException cnsexception) {
+ LOGGER
+ .error(cnsexception, cnsexception.getMessage());
+ }
+ return null;
+ }
+
+ public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+ UnCompressNonDecimalByte byte1 = new UnCompressNonDecimalByte();
+ byte1.setValue(floatCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override
+ public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dataType) {
+ return null;
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToFloatArray(buffer, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double[] vals = new double[value.length];
+ for (int m = 0; m < vals.length; m++) {
+ vals[m] = value[m] / Math.pow(10, decimal);
+ }
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalInt.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalInt.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalInt.java
new file mode 100644
index 0000000..0e0c2b9
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalInt.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNonDecimalInt implements UnCompressValue<int[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalInt.class.getName());
+ /**
+ * intCompressor.
+ */
+ private static Compressor<int[]> intCompressor = SnappyCompression.SnappyIntCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private int[] value;
+
+ @Override public void setValue(int[] value) {
+ this.value = (int[]) value;
+
+ }
+
+ @Override public UnCompressValue getNew() {
+ try {
+ return (UnCompressValue) clone();
+ } catch (CloneNotSupportedException csne1) {
+ LOGGER.error(csne1, csne1.getMessage());
+ }
+ return null;
+ }
+
+ @Override public UnCompressValue compress() {
+ UnCompressNonDecimalByte byte1 = new UnCompressNonDecimalByte();
+ byte1.setValue(intCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public void setValueInBytes(byte[] bytesArr) {
+ ByteBuffer buffer = ByteBuffer.wrap(bytesArr);
+ this.value = ValueCompressionUtil.convertToIntArray(buffer, bytesArr.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double[] vals = new double[value.length];
+ for (int k = 0; k < vals.length; k++) {
+ vals[k] = value[k] / Math.pow(10, decimal);
+ }
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+ @Override public UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalLong.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalLong.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalLong.java
new file mode 100644
index 0000000..3fb817e
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalLong.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNonDecimalLong implements UnCompressValue<long[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalLong.class.getName());
+
+ /**
+ * longCompressor.
+ */
+ private static Compressor<long[]> longCompressor =
+ SnappyCompression.SnappyLongCompression.INSTANCE;
+
+ /**
+ * value.
+ */
+ private long[] value;
+
+ @Override public void setValue(long[] value) {
+ this.value = value;
+ }
+
+ @Override public UnCompressValue compress() {
+ UnCompressNonDecimalByte byte1 = new UnCompressNonDecimalByte();
+ byte1.setValue(longCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override public UnCompressValue getNew() {
+ try {
+ return (UnCompressValue) clone();
+ } catch (CloneNotSupportedException e) {
+ LOGGER.error(e, e.getMessage());
+ }
+ return null;
+ }
+
+ @Override public UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public void setValueInBytes(byte[] bytes) {
+ ByteBuffer buffer = ByteBuffer.wrap(bytes);
+ this.value = ValueCompressionUtil.convertToLongArray(buffer, bytes.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double[] vals = new double[value.length];
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i] / Math.pow(10, decimal);
+ }
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinByte.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinByte.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinByte.java
new file mode 100644
index 0000000..1533679
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinByte.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNonDecimalMaxMinByte
+ implements ValueCompressonHolder.UnCompressValue<byte[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalMaxMinByte.class.getName());
+ /**
+ * byteCompressor.
+ */
+ private static Compressor<byte[]> byteCompressor =
+ SnappyCompression.SnappyByteCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private byte[] value;
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException cloneNotSupportedException) {
+ LOGGER.error(cloneNotSupportedException,
+ cloneNotSupportedException.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+ UnCompressNonDecimalMaxMinByte byte1 = new UnCompressNonDecimalMaxMinByte();
+ byte1.setValue(byteCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue uncompress(DataType dataType) {
+ ValueCompressonHolder.UnCompressValue byte1 =
+ ValueCompressionUtil.unCompressNonDecimalMaxMin(dataType, dataType);
+ ValueCompressonHolder.unCompress(dataType, byte1, value);
+ return byte1;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return value;
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalMaxMinByte();
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ this.value = value;
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimalVal, Object maxValueObject) {
+ double maxValue = (double) maxValueObject;
+ double[] vals = new double[value.length];
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i] / Math.pow(10, decimalVal);
+
+ if (value[i] == 0) {
+ vals[i] = maxValue;
+ } else {
+ vals[i] = (maxValue - value[i]) / Math.pow(10, decimalVal);
+ }
+
+ }
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+ @Override public void setValue(byte[] value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinDefault.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinDefault.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinDefault.java
new file mode 100644
index 0000000..ccb765a
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinDefault.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNonDecimalMaxMinDefault implements UnCompressValue<double[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalMaxMinDefault.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 UnCompressValue getNew() {
+ try {
+ return (UnCompressValue) clone();
+ } catch (CloneNotSupportedException exce) {
+ LOGGER.error(exce, exce.getMessage());
+ }
+ return null;
+ }
+
+ @Override public UnCompressValue compress() {
+ UnCompressNonDecimalMaxMinByte byte1 = new UnCompressNonDecimalMaxMinByte();
+ byte1.setValue(doubleCompressor.compress(value));
+ return byte1;
+ }
+
+ @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 UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalMaxMinByte();
+ }
+
+ @Override public UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double maxVal = (double) maxValueObject;
+ double[] vals = new double[value.length];
+ CarbonReadDataHolder holder = new CarbonReadDataHolder();
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i] / Math.pow(10, decimal);
+
+ if (value[i] == 0) {
+ vals[i] = maxVal;
+ } else {
+ vals[i] = (maxVal - value[i]) / Math.pow(10, decimal);
+ }
+
+ }
+ holder.setReadableDoubleValues(vals);
+ return holder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinFloat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinFloat.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinFloat.java
new file mode 100644
index 0000000..16bf101
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinFloat.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+
+public class UnCompressNonDecimalMaxMinFloat
+ implements ValueCompressonHolder.UnCompressValue<float[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalMaxMinFloat.class.getName());
+ /**
+ * floatCompressor
+ */
+ private static Compressor<float[]> floatCompressor =
+ SnappyCompression.SnappyFloatCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private float[] value;
+
+ @Override public void setValue(float[] value) {
+ this.value = value;
+
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException exc1) {
+ LOGGER.error(exc1, exc1.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+
+ UnCompressNonDecimalMaxMinByte byte1 = new UnCompressNonDecimalMaxMinByte();
+ byte1.setValue(floatCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override
+ public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dataType) {
+ return null;
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToFloatArray(buffer, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalMaxMinByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double maxValue = (double) maxValueObject;
+ double[] vals = new double[value.length];
+ CarbonReadDataHolder holder = new CarbonReadDataHolder();
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i] / Math.pow(10, decimal);
+
+ if (value[i] == 0) {
+ vals[i] = maxValue;
+ } else {
+ vals[i] = (maxValue - value[i]) / Math.pow(10, decimal);
+ }
+ }
+ holder.setReadableDoubleValues(vals);
+ return holder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinInt.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinInt.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinInt.java
new file mode 100644
index 0000000..c0ab9c0
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinInt.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNonDecimalMaxMinInt implements UnCompressValue<int[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalMaxMinInt.class.getName());
+ /**
+ * intCompressor.
+ */
+ private static Compressor<int[]> intCompressor = SnappyCompression.SnappyIntCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private int[] value;
+
+ @Override public void setValue(int[] value) {
+ this.value = value;
+
+ }
+
+ @Override public UnCompressValue getNew() {
+ try {
+ return (UnCompressValue) clone();
+ } catch (CloneNotSupportedException ex1) {
+ LOGGER.error(ex1, ex1.getMessage());
+ }
+ return null;
+ }
+
+ @Override public UnCompressValue compress() {
+
+ UnCompressNonDecimalMaxMinByte byte1 = new UnCompressNonDecimalMaxMinByte();
+ byte1.setValue(intCompressor.compress(value));
+ return byte1;
+
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToIntArray(buffer, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalMaxMinByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double maxValue = (double) maxValueObject;
+ double[] vals = new double[value.length];
+ CarbonReadDataHolder dataHolderInfo = new CarbonReadDataHolder();
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i] / Math.pow(10, decimal);
+
+ if (value[i] == 0) {
+ vals[i] = maxValue;
+ } else {
+ vals[i] = (maxValue - value[i]) / Math.pow(10, decimal);
+ }
+
+ }
+ dataHolderInfo.setReadableDoubleValues(vals);
+ return dataHolderInfo;
+ }
+
+ @Override public UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinLong.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinLong.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinLong.java
new file mode 100644
index 0000000..d8ed560
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinLong.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+
+public class UnCompressNonDecimalMaxMinLong
+ implements ValueCompressonHolder.UnCompressValue<long[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalMaxMinLong.class.getName());
+
+ /**
+ * longCompressor.
+ */
+ private static Compressor<long[]> longCompressor =
+ SnappyCompression.SnappyLongCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private long[] value;
+
+ @Override public void setValue(long[] value) {
+ this.value = value;
+
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException exc) {
+ LOGGER.error(exc, exc.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+
+ UnCompressNonDecimalMaxMinByte uNonDecByte = new UnCompressNonDecimalMaxMinByte();
+ uNonDecByte.setValue(longCompressor.compress(value));
+ return uNonDecByte;
+ }
+
+ @Override
+ public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dataType) {
+ return null;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buff = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToLongArray(buff, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalMaxMinByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double maxValue = (double) maxValueObject;
+ double[] vals = new double[value.length];
+ CarbonReadDataHolder carbonDataHolder = new CarbonReadDataHolder();
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i] / Math.pow(10, decimal);
+
+ if (value[i] == 0) {
+ vals[i] = maxValue;
+ } else {
+ vals[i] = (maxValue - value[i]) / Math.pow(10, decimal);
+ }
+
+ }
+ carbonDataHolder.setReadableDoubleValues(vals);
+ return carbonDataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinShort.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinShort.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinShort.java
new file mode 100644
index 0000000..f110560
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalMaxMinShort.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+
+public class UnCompressNonDecimalMaxMinShort
+ implements ValueCompressonHolder.UnCompressValue<short[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalMaxMinShort.class.getName());
+ /**
+ * shortCompressor.
+ */
+ private static Compressor<short[]> shortCompressor =
+ SnappyCompression.SnappyShortCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private short[] value;
+
+ @Override public void setValue(short[] value) {
+ this.value = value;
+
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException exception5) {
+ LOGGER.error(exception5, exception5.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+ UnCompressNonDecimalMaxMinByte byte1 = new UnCompressNonDecimalMaxMinByte();
+ byte1.setValue(shortCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue uncompress(
+ ValueCompressionUtil.DataType dataTypeVal) {
+ return null;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToShortArray(buffer, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalMaxMinByte();
+ }
+
+ @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++) {
+ vals[i] = value[i] / Math.pow(10, decimal);
+
+ if (value[i] == 0) {
+ vals[i] = maxValue;
+ } else {
+ vals[i] = (maxValue - value[i]) / Math.pow(10, decimal);
+ }
+
+ }
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalShort.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalShort.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalShort.java
new file mode 100644
index 0000000..852fd12
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNonDecimalShort.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+
+public class UnCompressNonDecimalShort implements ValueCompressonHolder.UnCompressValue<short[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNonDecimalShort.class.getName());
+ /**
+ * shortCompressor.
+ */
+ private static Compressor<short[]> shortCompressor =
+ SnappyCompression.SnappyShortCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private short[] value;
+
+ @Override public void setValue(short[] value) {
+ this.value = value;
+
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException exception1) {
+ LOGGER.error(exception1, exception1.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+ UnCompressNonDecimalByte byte1 = new UnCompressNonDecimalByte();
+ byte1.setValue(shortCompressor.compress(value));
+ return byte1;
+ }
+
+ @Override
+ public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dataType) {
+ return null;
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToShortArray(buffer, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNonDecimalByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ double[] vals = new double[value.length];
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i] / Math.pow(10, decimal);
+ }
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneByte.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneByte.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneByte.java
new file mode 100644
index 0000000..d689f93
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneByte.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNoneByte implements UnCompressValue<byte[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNoneByte.class.getName());
+
+ /**
+ * byteCompressor.
+ */
+ private static Compressor<byte[]> byteCompressor =
+ SnappyCompression.SnappyByteCompression.INSTANCE;
+
+ /**
+ * value.
+ */
+ private byte[] value;
+
+ @Override public UnCompressValue getNew() {
+ try {
+ return (UnCompressValue) clone();
+ } catch (CloneNotSupportedException e) {
+ LOGGER.error(e, e.getMessage());
+ }
+ return null;
+ }
+
+ @Override public void setValue(byte[] value) {
+ this.value = value;
+ }
+
+ @Override public UnCompressValue uncompress(DataType dataType) {
+ UnCompressValue byte1 = ValueCompressionUtil.unCompressNone(dataType, dataType);
+ ValueCompressonHolder.unCompress(dataType, byte1, value);
+ return byte1;
+ }
+
+ @Override public UnCompressValue compress() {
+ UnCompressNoneByte byte1 = new UnCompressNoneByte();
+ byte1.setValue(byteCompressor.compress(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 UnCompressNoneByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ CarbonReadDataHolder dataHldr = new CarbonReadDataHolder();
+ double[] vals = new double[value.length];
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i];
+ }
+ dataHldr.setReadableDoubleValues(vals);
+ return dataHldr;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneDefault.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneDefault.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneDefault.java
new file mode 100644
index 0000000..c1395b4
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneDefault.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNoneDefault implements UnCompressValue<double[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNoneDefault.class.getName());
+ /**
+ * doubleCompressor.
+ */
+ private static Compressor<double[]> doubleCompressor =
+ SnappyCompression.SnappyDoubleCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private double[] value;
+
+ @Override public void setValue(double[] value) {
+ this.value = value;
+
+ }
+
+ @Override public UnCompressValue getNew() {
+ try {
+ return (UnCompressValue) clone();
+ } catch (CloneNotSupportedException exception1) {
+ LOGGER.error(exception1, exception1.getMessage());
+ }
+ return null;
+ }
+
+ @Override public UnCompressValue compress() {
+ UnCompressNoneByte byte1 = new UnCompressNoneByte();
+ byte1.setValue(doubleCompressor.compress(value));
+
+ return byte1;
+ }
+
+ @Override public UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public UnCompressValue getCompressorObject() {
+ return new UnCompressNoneByte();
+ }
+
+ @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);
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ dataHolder.setReadableDoubleValues(value);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneFloat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneFloat.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneFloat.java
new file mode 100644
index 0000000..103b1c9
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneFloat.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+
+public class UnCompressNoneFloat implements ValueCompressonHolder.UnCompressValue<float[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNoneFloat.class.getName());
+ /**
+ * floatCompressor
+ */
+ private static Compressor<float[]> floatCompressor =
+ SnappyCompression.SnappyFloatCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private float[] value;
+
+ @Override public void setValue(float[] value) {
+ this.value = 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() {
+ UnCompressNoneByte byte1 = new UnCompressNoneByte();
+ byte1.setValue(floatCompressor.compress(value));
+
+ return byte1;
+
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToFloatArray(buffer, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNoneByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ double[] vals = new double[value.length];
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i];
+ }
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+ @Override
+ public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dataType) {
+ return null;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneInt.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneInt.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneInt.java
new file mode 100644
index 0000000..ca5593d
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneInt.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNoneInt implements ValueCompressonHolder.UnCompressValue<int[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNoneInt.class.getName());
+ /**
+ * intCompressor.
+ */
+ private static Compressor<int[]> intCompressor = SnappyCompression.SnappyIntCompression.INSTANCE;
+ /**
+ * value.
+ */
+ private int[] value;
+
+ @Override public void setValue(int[] value) {
+ this.value = value;
+
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException exc) {
+ LOGGER.error(exc, exc.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+ UnCompressNoneByte byte1 = new UnCompressNoneByte();
+ byte1.setValue(intCompressor.compress(value));
+
+ return byte1;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ this.value = ValueCompressionUtil.convertToIntArray(buffer, value.length);
+
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNoneByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ CarbonReadDataHolder dataHolderInfoObj = new CarbonReadDataHolder();
+ double[] vals = new double[value.length];
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i];
+ }
+
+ dataHolderInfoObj.setReadableDoubleValues(vals);
+ return dataHolderInfoObj;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneLong.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneLong.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneLong.java
new file mode 100644
index 0000000..47220c5
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneLong.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+
+public class UnCompressNoneLong implements ValueCompressonHolder.UnCompressValue<long[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNoneLong.class.getName());
+ /**
+ * longCompressor.
+ */
+ private static Compressor<long[]> longCompressor =
+ SnappyCompression.SnappyLongCompression.INSTANCE;
+ /**
+ * value.
+ */
+ protected long[] value;
+
+ @Override public void setValue(long[] value) {
+ this.value = value;
+
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException clnNotSupportedExc) {
+ LOGGER.error(clnNotSupportedExc,
+ clnNotSupportedExc.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+ UnCompressNoneByte byte1 = new UnCompressNoneByte();
+ byte1.setValue(longCompressor.compress(value));
+ return byte1;
+
+ }
+
+ @Override
+ public ValueCompressonHolder.UnCompressValue uncompress(ValueCompressionUtil.DataType dType) {
+ return null;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(value);
+ }
+
+ @Override public void setValueInBytes(byte[] byteValue) {
+ ByteBuffer buffer = ByteBuffer.wrap(byteValue);
+ this.value = ValueCompressionUtil.convertToLongArray(buffer, byteValue.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNoneByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ double[] vals = new double[value.length];
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = value[i];
+ }
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneShort.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneShort.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneShort.java
new file mode 100644
index 0000000..ed41ca5
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressNoneShort.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.SnappyCompression;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class UnCompressNoneShort implements ValueCompressonHolder.UnCompressValue<short[]> {
+ /**
+ * Attribute for Carbon LOGGER
+ */
+ private static final LogService LOGGER =
+ LogServiceFactory.getLogService(UnCompressNoneShort.class.getName());
+
+ /**
+ * shortCompressor.
+ */
+ private static Compressor<short[]> shortCompressor =
+ SnappyCompression.SnappyShortCompression.INSTANCE;
+
+ /**
+ * value.
+ */
+ private short[] shortValue;
+
+ @Override public void setValue(short[] shortValue) {
+ this.shortValue = shortValue;
+
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue getNew() {
+ try {
+ return (ValueCompressonHolder.UnCompressValue) clone();
+ } catch (CloneNotSupportedException cns1) {
+ LOGGER.error(cns1, cns1.getMessage());
+ }
+ return null;
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue compress() {
+
+ UnCompressNoneByte byte1 = new UnCompressNoneByte();
+ byte1.setValue(shortCompressor.compress(shortValue));
+
+ return byte1;
+
+ }
+
+ @Override public ValueCompressonHolder.UnCompressValue uncompress(DataType dataType) {
+ return null;
+ }
+
+ @Override public byte[] getBackArrayData() {
+ return ValueCompressionUtil.convertToBytes(shortValue);
+ }
+
+ @Override public void setValueInBytes(byte[] value) {
+ ByteBuffer buffer = ByteBuffer.wrap(value);
+ shortValue = ValueCompressionUtil.convertToShortArray(buffer, value.length);
+ }
+
+ /**
+ * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
+ */
+ @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
+ return new UnCompressNoneByte();
+ }
+
+ @Override public CarbonReadDataHolder getValues(int decimal, Object maxValueObject) {
+ CarbonReadDataHolder dataHolder = new CarbonReadDataHolder();
+ double[] vals = new double[shortValue.length];
+ for (int i = 0; i < vals.length; i++) {
+ vals[i] = shortValue[i];
+ }
+ dataHolder.setReadableDoubleValues(vals);
+ return dataHolder;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java
new file mode 100644
index 0000000..79507ce
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.dataholder;
+
+import java.math.BigDecimal;
+
+public class CarbonReadDataHolder {
+
+ /**
+ * doubleValues
+ */
+ private double[] doubleValues;
+
+ /**
+ * longValues
+ */
+ private long[] longValues;
+
+ /**
+ * bigDecimalValues
+ */
+ private BigDecimal[] bigDecimalValues;
+
+ /**
+ * byteValues
+ */
+ private byte[][] byteValues;
+
+ /**
+ * @return the doubleValues
+ */
+ public double[] getReadableDoubleValues() {
+ return doubleValues;
+ }
+
+ /**
+ * @param doubleValues the doubleValues to set
+ */
+ public void setReadableDoubleValues(double[] doubleValues) {
+ this.doubleValues = doubleValues;
+ }
+
+ /**
+ * @return the byteValues
+ */
+ public byte[][] getReadableByteArrayValues() {
+ return byteValues;
+ }
+
+ /**
+ * @param longValues the longValues to set
+ */
+ public void setReadableLongValues(long[] longValues) {
+ this.longValues = longValues;
+ }
+
+ /**
+ * @param longValues the bigDecimalValues to set
+ */
+ public void setReadableBigDecimalValues(BigDecimal[] bigDecimalValues) {
+ this.bigDecimalValues = bigDecimalValues;
+ }
+
+ /**
+ * @param byteValues the byteValues to set
+ */
+ public void setReadableByteValues(byte[][] byteValues) {
+ this.byteValues = byteValues;
+ }
+
+ /**
+ * below method will be used to get the double value by index
+ *
+ * @param index
+ * @return double values
+ */
+ public double getReadableDoubleValueByIndex(int index) {
+ return this.doubleValues[index];
+ }
+
+ public long getReadableLongValueByIndex(int index) {
+ return this.longValues[index];
+ }
+
+ public BigDecimal getReadableBigDecimalValueByIndex(int index) {
+ return this.bigDecimalValues[index];
+ }
+
+ /**
+ * below method will be used to get the readable byte array value by index
+ *
+ * @param index
+ * @return byte array value
+ */
+ public byte[] getReadableByteArrayValueByIndex(int index) {
+ return this.byteValues[index];
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/cd6a4ff3/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonWriteDataHolder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonWriteDataHolder.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonWriteDataHolder.java
new file mode 100644
index 0000000..951857e
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonWriteDataHolder.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.dataholder;
+
+public class CarbonWriteDataHolder {
+ /**
+ * doubleValues
+ */
+ private double[] doubleValues;
+
+ /**
+ * longValues
+ */
+ private long[] longValues;
+
+ /**
+ * byteValues
+ */
+ private byte[][] byteValues;
+
+ /**
+ * byteValues
+ */
+ private byte[][][] columnByteValues;
+
+ /**
+ * size
+ */
+ private int size;
+
+ /**
+ * totalSize
+ */
+ private int totalSize;
+
+ /**
+ * Method to initialise double array
+ *
+ * @param size
+ */
+ public void initialiseDoubleValues(int size) {
+ if (size < 1) {
+ throw new IllegalArgumentException("Invalid array size");
+ }
+ doubleValues = new double[size];
+ }
+
+ public void reset() {
+ size = 0;
+ totalSize = 0;
+ }
+
+ /**
+ * Method to initialise double array
+ *
+ * @param size
+ */
+ public void initialiseByteArrayValues(int size) {
+ if (size < 1) {
+ throw new IllegalArgumentException("Invalid array size");
+ }
+
+ byteValues = new byte[size][];
+ columnByteValues = new byte[size][][];
+ }
+
+ /**
+ * Method to initialise long array
+ *
+ * @param size
+ */
+ public void initialiseLongValues(int size) {
+ if (size < 1) {
+ throw new IllegalArgumentException("Invalid array size");
+ }
+ longValues = new long[size];
+ }
+
+ /**
+ * set double value by index
+ *
+ * @param index
+ * @param value
+ */
+ public void setWritableDoubleValueByIndex(int index, Object value) {
+ doubleValues[index] = (Double) value;
+ size++;
+ }
+
+ /**
+ * set double value by index
+ *
+ * @param index
+ * @param value
+ */
+ public void setWritableLongValueByIndex(int index, Object value) {
+ longValues[index] = (Long) value;
+ size++;
+ }
+
+ /**
+ * set byte array value by index
+ *
+ * @param index
+ * @param value
+ */
+ public void setWritableByteArrayValueByIndex(int index, byte[] value) {
+ byteValues[index] = value;
+ size++;
+ if (null != value) totalSize += value.length;
+ }
+
+ /**
+ * set byte array value by index
+ */
+ public void setWritableByteArrayValueByIndex(int index, int mdKeyIndex, Object[] columnData) {
+ int l = 0;
+ columnByteValues[index] = new byte[columnData.length - (mdKeyIndex + 1)][];
+ for (int i = mdKeyIndex + 1; i < columnData.length; i++) {
+ columnByteValues[index][l++] = (byte[]) columnData[i];
+ }
+ }
+
+ /**
+ * Get Writable Double Values
+ */
+ public double[] getWritableDoubleValues() {
+ if (size < doubleValues.length) {
+ double[] temp = new double[size];
+ System.arraycopy(doubleValues, 0, temp, 0, size);
+ doubleValues = temp;
+ }
+ return doubleValues;
+ }
+
+ /**
+ * Get writable byte array values
+ */
+ public byte[] getWritableByteArrayValues() {
+ byte[] temp = new byte[totalSize];
+ int startIndexToCopy = 0;
+ for (int i = 0; i < size; i++) {
+ System.arraycopy(byteValues[i], 0, temp, startIndexToCopy, byteValues[i].length);
+ startIndexToCopy += byteValues[i].length;
+ }
+ return temp;
+ }
+
+ public byte[][] getByteArrayValues() {
+ if (size < byteValues.length) {
+ byte[][] temp = new byte[size][];
+ System.arraycopy(byteValues, 0, temp, 0, size);
+ byteValues = temp;
+ }
+ return byteValues;
+ }
+
+ /**
+ * Get Writable Double Values
+ *
+ * @return
+ */
+ public long[] getWritableLongValues() {
+ if (size < longValues.length) {
+ long[] temp = new long[size];
+ System.arraycopy(longValues, 0, temp, 0, size);
+ longValues = temp;
+ }
+ return longValues;
+ }
+}