[GitHub] [carbondata] vikramahuja1001 commented on a change in pull request #3386: [WIP] : Pre-priming cache

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

[GitHub] [carbondata] vikramahuja1001 commented on a change in pull request #3386: [WIP] : Pre-priming cache

GitBox
vikramahuja1001 commented on a change in pull request #3386: [WIP] : Pre-priming cache
URL: https://github.com/apache/carbondata/pull/3386#discussion_r326958129
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonTableCompactor.scala
 ##########
 @@ -317,6 +319,31 @@ class CarbonTableCompactor(carbonLoadModel: CarbonLoadModel,
       } else {
         LOGGER.info(s"Compaction request completed for table " +
                     s"${ carbonLoadModel.getDatabaseName }.${ carbonLoadModel.getTableName }")
+
+        // Prepriming index for compaction
+        val indexServerEnabled = CarbonProperties.getInstance().isDistributedPruningEnabled(
+          carbonLoadModel.getDatabaseName, carbonLoadModel.getTableName)
+        val prePrimingEnabled = CarbonProperties.getInstance().isIndexServerPrePrimingEnabled()
+        if (indexServerEnabled && prePrimingEnabled) {
+            val readCommittedScope = new TableStatusReadCommittedScope(AbsoluteTableIdentifier.from(
+              carbonLoadModel.getTablePath), FileFactory.getConfiguration)
+              val loadDetailsForCurrentSegment = readCommittedScope.getSegmentList
+                .find(_.getLoadName.equalsIgnoreCase(mergedLoadNumber)).get
+              val segmentToWrite: Segment = new Segment(mergedLoadNumber,
+                loadDetailsForCurrentSegment.getSegmentFile,
+                readCommittedScope, loadDetailsForCurrentSegment)
+              segmentToWrite.setReadCommittedScope(readCommittedScope)
+              LOGGER.info(s"Adding Segments to the Cache after compaction")
 
 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:
[hidden email]


With regards,
Apache Git Services