You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ra...@apache.org on 2018/11/21 18:00:16 UTC

[49/50] [abbrv] carbondata git commit: [CARBONDATA-3104] Removed unnecessary configuration in BlockletDataMapIndexWrapper

[CARBONDATA-3104] Removed unnecessary configuration in BlockletDataMapIndexWrapper

1. Removed unnecessary configration in BlockletDataMapIndexWrapper
2. Removed misleading log in CarbonDropTableCommand

This closes #2921


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

Branch: refs/heads/branch-1.5
Commit: 415635e689735ad4909fe6d37184758bdb1fb4db
Parents: 2e0153b
Author: Naman Rastogi <na...@gmail.com>
Authored: Wed Nov 14 19:54:59 2018 +0530
Committer: ravipesala <ra...@gmail.com>
Committed: Wed Nov 21 22:43:46 2018 +0530

----------------------------------------------------------------------
 .../core/indexstore/BlockletDataMapIndexStore.java      |  6 ++----
 .../core/indexstore/BlockletDataMapIndexWrapper.java    | 12 +-----------
 .../blockletindex/TestBlockletDataMapFactory.java       |  3 +--
 .../command/table/CarbonDropTableCommand.scala          |  3 ++-
 4 files changed, 6 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/415635e6/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexStore.java b/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexStore.java
index c534f35..0f64086 100644
--- a/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexStore.java
+++ b/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexStore.java
@@ -116,8 +116,7 @@ public class BlockletDataMapIndexStore
                   identifierWrapper.getConfiguration());
           dataMaps.add(blockletDataMap);
           blockletDataMapIndexWrapper =
-              new BlockletDataMapIndexWrapper(identifier.getSegmentId(), dataMaps,
-                  identifierWrapper.getConfiguration());
+              new BlockletDataMapIndexWrapper(identifier.getSegmentId(), dataMaps);
         } else {
           // if the identifier is a merge file then collect the index files and load the datamaps
           List<TableBlockIndexUniqueIdentifier> tableBlockIndexUniqueIdentifiers =
@@ -138,8 +137,7 @@ public class BlockletDataMapIndexStore
             }
           }
           blockletDataMapIndexWrapper =
-              new BlockletDataMapIndexWrapper(identifier.getSegmentId(), dataMaps,
-                  identifierWrapper.getConfiguration());
+              new BlockletDataMapIndexWrapper(identifier.getSegmentId(), dataMaps);
         }
         if (identifierWrapper.isAddTableBlockToUnsafeAndLRUCache()) {
           lruCache.put(identifier.getUniqueTableSegmentIdentifier(), blockletDataMapIndexWrapper,

http://git-wip-us.apache.org/repos/asf/carbondata/blob/415635e6/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexWrapper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexWrapper.java b/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexWrapper.java
index 33d69aa..65f45f2 100644
--- a/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexWrapper.java
+++ b/core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexWrapper.java
@@ -24,8 +24,6 @@ import org.apache.carbondata.core.cache.Cacheable;
 import org.apache.carbondata.core.datamap.dev.DataMap;
 import org.apache.carbondata.core.indexstore.blockletindex.BlockDataMap;
 
-import org.apache.hadoop.conf.Configuration;
-
 /**
  * A cacheable wrapper of datamaps
  */
@@ -37,14 +35,10 @@ public class BlockletDataMapIndexWrapper implements Cacheable, Serializable {
 
   private String segmentId;
 
-  private transient Configuration configuration;
-
   // size of the wrapper. basically the total size of the datamaps this wrapper is holding
   private long wrapperSize;
 
-  public BlockletDataMapIndexWrapper(String segmentId,List<BlockDataMap> dataMaps, Configuration
-      configuration) {
-    this.configuration = configuration;
+  public BlockletDataMapIndexWrapper(String segmentId,List<BlockDataMap> dataMaps) {
     this.dataMaps = dataMaps;
     this.wrapperSize = 0L;
     this.segmentId = segmentId;
@@ -79,8 +73,4 @@ public class BlockletDataMapIndexWrapper implements Cacheable, Serializable {
   public String getSegmentId() {
     return segmentId;
   }
-
-  public Configuration getConfiguration() {
-    return configuration;
-  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/carbondata/blob/415635e6/core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletDataMapFactory.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletDataMapFactory.java b/core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletDataMapFactory.java
index 34dca0b..0f314b8 100644
--- a/core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletDataMapFactory.java
+++ b/core/src/test/java/org/apache/carbondata/core/indexstore/blockletindex/TestBlockletDataMapFactory.java
@@ -105,8 +105,7 @@ public class TestBlockletDataMapFactory {
             BlockletDataMapIndexWrapper.class);
     method.setAccessible(true);
     method.invoke(blockletDataMapFactory, tableBlockIndexUniqueIdentifierWrapper,
-        new BlockletDataMapIndexWrapper(tableBlockIndexUniqueIdentifier.getSegmentId(), dataMaps,
-            tableBlockIndexUniqueIdentifierWrapper.getConfiguration()));
+        new BlockletDataMapIndexWrapper(tableBlockIndexUniqueIdentifier.getSegmentId(), dataMaps));
     BlockletDataMapIndexWrapper result = cache.getIfPresent(tableBlockIndexUniqueIdentifierWrapper);
     assert null != result;
   }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/415635e6/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
index 34d9b75..0505a75 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
@@ -143,9 +143,10 @@ case class CarbonDropTableCommand(
       OperationListenerBus.getInstance.fireEvent(dropTablePostEvent, operationContext)
     } catch {
       case ex: NoSuchTableException =>
-        LOGGER.error(ex.getLocalizedMessage, ex)
         if (!ifExistsSet) {
           throw ex
+        } else {
+          LOGGER.info("Masking error: " + ex.getLocalizedMessage)
         }
       case ex: ConcurrentOperationException =>
         LOGGER.error(ex.getLocalizedMessage, ex)