akashrn5 commented on a change in pull request #3386: [WIP] : Pre-priming cache
URL:
https://github.com/apache/carbondata/pull/3386#discussion_r326518380
##########
File path: integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
##########
@@ -591,6 +592,44 @@ object CarbonDataRDDFactory {
s"${ carbonLoadModel.getDatabaseName }.${ carbonLoadModel.getTableName }")
}
+ // code to handle Pre-Priming cache for loading
+ 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), hadoopConf)
+ if (carbonLoadModel.getSegmentId != null) {
+ val loadDetailsForCurrentSegment = readCommittedScope.getSegmentList
+ .find(_.getLoadName.equalsIgnoreCase(carbonLoadModel.getSegmentId)).get
+ val segmentToWrite: Segment = new Segment(carbonLoadModel.getSegmentId,
+ loadDetailsForCurrentSegment.getSegmentFile,
+ readCommittedScope, loadDetailsForCurrentSegment)
+ val invalidsegment: List[Nothing] = List()
+
+ if (carbonTable.isChildDataMap || carbonTable.isChildTable) {
+ LOGGER.info("Loading Child in cache")
+ }
+ else {
+ LOGGER.info("Loading main table in cache")
+ }
+
+ val IndexServerLoadEvent: IndexServerLoadEvent =
+ new IndexServerLoadEvent(
+ sqlContext.sparkSession,
+ carbonTable,
+ segmentToWrite,
+ invalidsegment
+ )
+ OperationListenerBus.getInstance().fireEvent(IndexServerLoadEvent, operationContext)
+ if (carbonLoadModel.getParentTablePath != null) {
+ LOGGER.info("Child Table has been loaded in the cache")
Review comment:
same as above
----------------------------------------------------------------
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