You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/03/14 03:47:42 UTC

[GitHub] [carbondata] NamanRastogi commented on a change in pull request #3146: [WIP] Added PreAgg Event Listener for ShowCacheCommmand

NamanRastogi commented on a change in pull request #3146: [WIP]  Added PreAgg Event Listener for ShowCacheCommmand
URL: https://github.com/apache/carbondata/pull/3146#discussion_r265411151
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonDropCacheCommand.scala
 ##########
 @@ -63,41 +63,32 @@ case class CarbonDropCacheCommand(tableIdentifier: TableIdentifier, internalCall
       val dictIds = carbonTable.getAllDimensions.asScala.filter(_.isGlobalDictionaryEncoding)
         .map(_.getColumnId).toArray
 
-      // Remove elements from cache
-      val keysToRemove = ListBuffer[String]()
-      val cacheIterator = cache.getCacheMap.entrySet().iterator()
-      while (cacheIterator.hasNext) {
-        val entry = cacheIterator.next()
-        val cache = entry.getValue
-
-        if (cache.isInstanceOf[BlockletDataMapIndexWrapper]) {
-          // index
-          val indexPath = entry.getKey.replace(CarbonCommonConstants.WINDOWS_FILE_SEPARATOR,
-            CarbonCommonConstants.FILE_SEPARATOR)
-          if (indexPath.startsWith(tablePath)) {
-            keysToRemove += entry.getKey
-          }
-        } else if (cache.isInstanceOf[BloomCacheKeyValue.CacheValue]) {
-          // bloom datamap
-          val shardPath = entry.getKey.replace(CarbonCommonConstants.WINDOWS_FILE_SEPARATOR,
-            CarbonCommonConstants.FILE_SEPARATOR)
-          if (shardPath.contains(tablePath)) {
-            keysToRemove += entry.getKey
-          }
-        } else if (cache.isInstanceOf[AbstractColumnDictionaryInfo]) {
-          // dictionary
-          val dictId = dictIds.find(id => entry.getKey.startsWith(id))
-          if (dictId.isDefined) {
-            keysToRemove += entry.getKey
-          }
+      def checkIfValid(key: String, cacheable: Cacheable): Boolean = {
 
 Review comment:
   Done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services