carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject carbondata git commit: Remove unnecessary mdk computation code
Date Sat, 16 Dec 2017 15:17:23 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 363731c62 -> 40c7e8ee8


Remove unnecessary mdk computation code

Remove unnecessary mdk computation code

This closes #1673


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

Branch: refs/heads/master
Commit: 40c7e8ee89e4fb136752c33662e2798691f29f5a
Parents: 363731c
Author: Manhua <kevinjmh@qq.com>
Authored: Sat Dec 16 11:34:07 2017 +0800
Committer: chenliang613 <chenliang613@huawei.com>
Committed: Sat Dec 16 23:17:10 2017 +0800

----------------------------------------------------------------------
 .../core/datastore/page/key/TablePageKey.java         | 14 +++++---------
 .../carbondata/core/util/CarbonMetadataUtilTest.java  |  2 +-
 .../apache/carbondata/processing/store/TablePage.java |  3 +--
 3 files changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/40c7e8ee/core/src/main/java/org/apache/carbondata/core/datastore/page/key/TablePageKey.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastore/page/key/TablePageKey.java
b/core/src/main/java/org/apache/carbondata/core/datastore/page/key/TablePageKey.java
index f8a10ca..244d8fc 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastore/page/key/TablePageKey.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastore/page/key/TablePageKey.java
@@ -23,8 +23,6 @@ import org.apache.carbondata.core.constants.CarbonCommonConstants;
 import org.apache.carbondata.core.datastore.block.SegmentProperties;
 import org.apache.carbondata.core.datastore.row.CarbonRow;
 import org.apache.carbondata.core.datastore.row.WriteStepRowUtil;
-import org.apache.carbondata.core.keygenerator.KeyGenException;
-import org.apache.carbondata.core.keygenerator.KeyGenerator;
 import org.apache.carbondata.core.util.NonDictionaryUtil;
 
 public class TablePageKey {
@@ -50,30 +48,28 @@ public class TablePageKey {
   // endkey for no dictionary columns after packing into one column
   private byte[] packedNoDictEndKey;
 
-  private KeyGenerator mdkGenerator;
   private SegmentProperties segmentProperties;
   private boolean hasNoDictionary;
 
-  public TablePageKey(int pageSize, KeyGenerator mdkGenerator, SegmentProperties segmentProperties,
-      boolean hasNoDictionary) {
+  public TablePageKey(int pageSize, SegmentProperties segmentProperties,
+                      boolean hasNoDictionary) {
     this.pageSize = pageSize;
-    this.mdkGenerator = mdkGenerator;
     this.segmentProperties = segmentProperties;
     this.hasNoDictionary = hasNoDictionary;
   }
 
   /** update all keys based on the input row */
-  public void update(int rowId, CarbonRow row, byte[] mdk) throws KeyGenException {
+  public void update(int rowId, CarbonRow row, byte[] mdk) {
     if (hasNoDictionary) {
       currentNoDictionaryKey = WriteStepRowUtil.getNoDictAndComplexDimension(row);
     }
     if (rowId == 0) {
-      startKey = WriteStepRowUtil.getMdk(row, mdkGenerator);
+      startKey = mdk;
       noDictStartKey = currentNoDictionaryKey;
     }
     noDictEndKey = currentNoDictionaryKey;
     if (rowId == pageSize - 1) {
-      endKey = WriteStepRowUtil.getMdk(row, mdkGenerator);
+      endKey = mdk;
       finalizeKeys();
     }
   }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/40c7e8ee/core/src/test/java/org/apache/carbondata/core/util/CarbonMetadataUtilTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/carbondata/core/util/CarbonMetadataUtilTest.java
b/core/src/test/java/org/apache/carbondata/core/util/CarbonMetadataUtilTest.java
index 4cf3d11..28cfcf2 100644
--- a/core/src/test/java/org/apache/carbondata/core/util/CarbonMetadataUtilTest.java
+++ b/core/src/test/java/org/apache/carbondata/core/util/CarbonMetadataUtilTest.java
@@ -209,7 +209,7 @@ public class CarbonMetadataUtilTest {
       }
     };
 
-    TablePageKey key = new TablePageKey(3, null, segmentProperties, false);
+    TablePageKey key = new TablePageKey(3, segmentProperties, false);
     EncodedTablePage encodedTablePage = EncodedTablePage.newInstance(3, new EncodedColumnPage[0],
new EncodedColumnPage[0],
         key);
 

http://git-wip-us.apache.org/repos/asf/carbondata/blob/40c7e8ee/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
----------------------------------------------------------------------
diff --git a/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
b/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
index 6a9aba1..ff33823 100644
--- a/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
+++ b/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
@@ -124,8 +124,7 @@ public class TablePage {
       measurePages[i] = page;
     }
     boolean hasNoDictionary = noDictDimensionPages.length > 0;
-    this.key = new TablePageKey(pageSize, model.getMDKeyGenerator(), model.getSegmentProperties(),
-        hasNoDictionary);
+    this.key = new TablePageKey(pageSize, model.getSegmentProperties(), hasNoDictionary);
 
     // for complex type, `complexIndexMap` is used in multithread (in multiple Producer),
     // we need to clone the index map to make it thread safe


Mime
View raw message