carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvram...@apache.org
Subject [1/2] incubator-carbondata git commit: Fixed random test case failure
Date Fri, 20 Jan 2017 11:20:21 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 1160b5776 -> a32632efa


Fixed random test case 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/4543de62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/4543de62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/4543de62

Branch: refs/heads/master
Commit: 4543de6220191289335946fcc2284a542e5d562c
Parents: 1160b57
Author: mohammadshahidkhan <mohdshahidkhan1987@gmail.com>
Authored: Thu Jan 19 21:23:13 2017 +0530
Committer: Venkata Ramana G <ramana.gollamudi@huawei.com>
Committed: Fri Jan 20 16:42:00 2017 +0530

----------------------------------------------------------------------
 .../datastore/AbstractBlockIndexStoreCache.java | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/4543de62/core/src/main/java/org/apache/carbondata/core/datastore/AbstractBlockIndexStoreCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastore/AbstractBlockIndexStoreCache.java
b/core/src/main/java/org/apache/carbondata/core/datastore/AbstractBlockIndexStoreCache.java
index 4eb6b7a..340f290 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastore/AbstractBlockIndexStoreCache.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastore/AbstractBlockIndexStoreCache.java
@@ -93,21 +93,21 @@ public abstract class AbstractBlockIndexStoreCache<K, V>
     long requiredMetaSize = CarbonUtil.calculateMetaSize(blockInfo);
     if (requiredMetaSize > 0) {
       tableBlock.setMemorySize(requiredMetaSize);
+      // load table blocks data
+      // getting the data file meta data of the block
+      DataFileFooter footer = CarbonUtil.readMetadatFile(blockInfo);
+      footer.setBlockInfo(new BlockInfo(blockInfo));
+      // building the block
+      tableBlock.buildIndex(Collections.singletonList(footer));
       tableBlock.incrementAccessCount();
       boolean isTableBlockAddedToLruCache = lruCache.put(lruCacheKey, tableBlock, requiredMetaSize);
-      // if column is successfully added to lru cache then only load the
-      // table blocks data
-      if (isTableBlockAddedToLruCache) {
-        // load table blocks data
-        // getting the data file meta data of the block
-        DataFileFooter footer = CarbonUtil.readMetadatFile(blockInfo);
-        footer.setBlockInfo(new BlockInfo(blockInfo));
-        // building the block
-        tableBlock.buildIndex(Collections.singletonList(footer));
-      } else {
+      if (!isTableBlockAddedToLruCache) {
         throw new IndexBuilderException(
             "Cannot load table blocks into memory. Not enough memory available");
       }
+    } else {
+      throw new IndexBuilderException(
+          "Invalid carbon data file: " + blockInfo.getFilePath());
     }
   }
 }


Mime
View raw message