carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject [1/2] incubator-carbondata git commit: cleanup WriterCompressModel
Date Thu, 05 Jan 2017 09:35:22 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 2ba03e0e8 -> f463642bb


cleanup WriterCompressModel

minor fix

remove accidentally added file

fix test

fix test failure


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/ddcc9c14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/ddcc9c14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/ddcc9c14

Branch: refs/heads/master
Commit: ddcc9c14409a5fd35104f46873ad41977b874470
Parents: 2ba03e0
Author: Jihong Ma <jihongma@apache.org>
Authored: Tue Jan 3 18:22:56 2017 -0800
Committer: chenliang613 <chenliang613@apache.org>
Committed: Thu Jan 5 17:31:29 2017 +0800

----------------------------------------------------------------------
 .../store/compression/WriterCompressModel.java  | 25 +++------
 .../core/util/ValueCompressionUtil.java         |  3 --
 .../core/util/ValueCompressionUtilTest.java     | 55 ++++++--------------
 3 files changed, 24 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ddcc9c14/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/WriterCompressModel.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/WriterCompressModel.java
b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/WriterCompressModel.java
index 824076e..de7c242 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/WriterCompressModel.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/WriterCompressModel.java
@@ -23,10 +23,6 @@ import org.apache.carbondata.core.util.CompressionFinder;
 import org.apache.carbondata.core.util.ValueCompressionUtil;
 
 public class WriterCompressModel {
-  /**
-   * COMPRESSION_TYPE[] variable.
-   */
-  private ValueCompressionUtil.COMPRESSION_TYPE[] compType;
 
   /**
    * DataType[]  variable.
@@ -72,20 +68,6 @@ public class WriterCompressModel {
   private CompressionFinder[] compressionFinders;
 
   /**
-   * @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 convertedDataType
    */
   public ValueCompressionUtil.DataType[] getConvertedDataType() {
@@ -228,4 +210,11 @@ public class WriterCompressModel {
   public CompressionFinder[] getCompressionFinders() {
     return this.compressionFinders;
   }
+
+  /**
+   * @return the compType
+   */
+  public ValueCompressionUtil.COMPRESSION_TYPE getCompType(int index) {
+    return this.compressionFinders[index].getCompType();
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ddcc9c14/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
b/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
index 1b82d70..c6a2c3a 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
@@ -728,7 +728,6 @@ public final class ValueCompressionUtil {
     WriterCompressModel compressionModel = new WriterCompressModel();
     DataType[] actualType = new DataType[measureCount];
     DataType[] convertedType = new DataType[measureCount];
-    COMPRESSION_TYPE[] compType = new COMPRESSION_TYPE[measureCount];
     CompressionFinder[] compressionFinders = new CompressionFinder[measureCount];
     for (int i = 0; i < measureCount; i++) {
       CompressionFinder compresssionFinder =
@@ -737,13 +736,11 @@ public final class ValueCompressionUtil {
       compressionFinders[i] = compresssionFinder;
       actualType[i] = compresssionFinder.getActualDataType();
       convertedType[i] = compresssionFinder.getConvertedDataType();
-      compType[i] = compresssionFinder.getCompType();
     }
     compressionModel.setCompressionFinders(compressionFinders);
     compressionModel.setMaxValue(maxValue);
     compressionModel.setMantissa(mantissa);
     compressionModel.setConvertedDataType(convertedType);
-    compressionModel.setCompType(compType);
     compressionModel.setActualDataType(actualType);
     compressionModel.setMinValue(minValue);
     compressionModel.setUniqueValue(uniqueValue);

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ddcc9c14/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
b/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
index 739670c..21cf2d6 100644
--- a/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
+++ b/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
@@ -21,31 +21,10 @@ package org.apache.carbondata.core.util;
 import org.apache.carbondata.core.datastorage.store.compression.MeasureMetaDataModel;
 import org.apache.carbondata.core.datastorage.store.compression.WriterCompressModel;
 import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinByte;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinDefault;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinFloat;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinInt;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinLong;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinShort;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalByte;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal
-    .UnCompressNonDecimalDefault;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalFloat;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalInt;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalLong;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinByte;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinDefault;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinFloat;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinInt;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinLong;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinShort;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalShort;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneByte;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneDefault;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneFloat;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneInt;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneLong;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneShort;
+import org.apache.carbondata.core.datastorage.store.compression.decimal.*;
+import org.apache.carbondata.core.datastorage.store.compression.nondecimal.*;
+import org.apache.carbondata.core.datastorage.store.compression.none.*;
+
 
 import org.junit.Test;
 
@@ -587,10 +566,10 @@ public class ValueCompressionUtilTest {
   }
 
   @Test public void testToGetValueCompressionModel() {
-    Object[] maxValues = { 10l, 20l, 30l };
-    Object[] minValues = { 1l, 2l, 3l };
+    Object[] maxValues = { 10L, 20L, 30L };
+    Object[] minValues = { 1L, 2L, 3L };
     int[] decimalLength = { 0, 0, 0 };
-    Object[] uniqueValues = { 5, new Long[]{2l,4l}, 2l };
+    Object[] uniqueValues = { 5, new Long[]{2L,4L}, 2L};
     char[] types = { 'l', 'l', 'l' };
     byte[] dataTypeSelected = { 1, 2, 4 };
     MeasureMetaDataModel measureMetaDataModel =
@@ -599,11 +578,11 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE,
-        writerCompressModel.getCompType()[1]);
+        writerCompressModel.getCompType(1));
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE,
-        writerCompressModel.getCompType()[2]);
+        writerCompressModel.getCompType(2));
   }
 
   @Test public void testToGetValueCompressionModelForDefaultAggregatorType() {
@@ -619,7 +598,7 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
   }
 
   @Test public void testToGetValueCompressionModelForShortAndByte() {
@@ -635,7 +614,7 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.DELTA_DOUBLE,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
   }
 
   @Test public void testToGetValueCompressionModelForIntAndShort() {
@@ -651,7 +630,7 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.DELTA_DOUBLE,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
   }
 
   @Test public void testToGetValueCompressionModelForByteAndInt() {
@@ -667,7 +646,7 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
   }
 
   @Test public void testToGetValueCompressionModelForByteAndIntAndDecimal1() {
@@ -683,7 +662,7 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.DELTA_DOUBLE,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
   }
 
   @Test public void testToGetValueCompressionModelForByteAndIntAndDataTypeSelected0() {
@@ -699,7 +678,7 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.BIGINT,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
   }
 
   @Test public void testToGetValueCompressionModelForFloatAndDataTypeSelected1() {
@@ -715,7 +694,7 @@ public class ValueCompressionUtilTest {
     WriterCompressModel writerCompressModel =
         ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
     assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE,
-        writerCompressModel.getCompType()[0]);
+        writerCompressModel.getCompType(0));
   }
 
 }


Mime
View raw message