[GitHub] [carbondata] jackylk commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] jackylk commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server

GitBox
jackylk commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server
URL: https://github.com/apache/carbondata/pull/3177#discussion_r277923076
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala
 ##########
 @@ -153,14 +153,20 @@ case class CarbonShowCacheCommand(tableIdentifier: Option[TableIdentifier],
     OperationListenerBus.getInstance.fireEvent(showTableCacheEvent, operationContext)
 
     // Get all Index files for the specified table in cache
-    val indexFilesInCache: List[String] = allIndexFiles.filter {
-      indexFile =>
-        cache.get(indexFile) != null
+    val (indexFilesLength, size) = if (CarbonProperties.getInstance()
+        .isDistributedPruningEnabled(carbonTable.getDatabaseName, carbonTable.getTableName)) {
+      getTableCache(carbonTable.getTableUniqueName)
+    } else {
+      val indexFilesInCache: List[String] = allIndexFiles.filter {
+        indexFile =>
+          cache.get(indexFile) != null
+      }
+      val sizeOfIndexFilesInCache: Long = indexFilesInCache.map {
+        indexFile =>
+          cache.get(indexFile).getMemorySize
+      }.sum
 
 Review comment:
   make line 160 to 167 more succinct

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services