Skip to content

Commit

Permalink
added segments for prepriming in case of update success
Browse files Browse the repository at this point in the history
  • Loading branch information
vikramahuja1001 committed Dec 18, 2019
1 parent fdcfcbf commit 2a375d0
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -459,20 +459,26 @@ object CarbonDataRDDFactory {
if (resultSize == 0) {
return null
}
if (CarbonUpdateUtil.updateTableMetadataStatus(
if (!CarbonUpdateUtil.updateTableMetadataStatus(
segmentDetails,
carbonTable,
updateModel.get.updatedTimeStamp + "",
true,
new util.ArrayList[Segment](0),
new util.ArrayList[Segment](segmentFiles), "")) {
} else {
LOGGER.error("Data update failed due to failure in table status updation.")
updateModel.get.executorErrors.errorMsg = errorMessage
updateModel.get.executorErrors.failureCauses = FailureCauses
.STATUS_FILE_UPDATION_FAILURE
return null
}
// code to handle Pre-Priming cache for update command
if (!segmentFiles.isEmpty) {
val segmentsToPrePrime = segmentFiles.asScala.map(iterator => iterator.getSegmentNo).toSeq
DistributedRDDUtils
.triggerPrepriming(sqlContext.sparkSession, carbonTable, segmentsToPrePrime,
operationContext, hadoopConf, segmentsToPrePrime.toList)
}
}
return null
}
Expand Down

0 comments on commit 2a375d0

Please sign in to comment.