kunal642 commented on a change in pull request #3678: [WIP]: index server
concurrency fix
URL: https://github.com/apache/carbondata/pull/3678#discussion_r398328476
##########
File path:
integration/spark/src/main/scala/org/apache/carbondata/indexserver/DistributedCountRDD.scala
##########
@@ -96,20 +99,78 @@ class DistributedCountRDD(@transient ss: SparkSession,
dataMapFormat: Distributa
new DistributedPruneRDD(ss, dataMapFormat).partitions
}
- private def generateFuture(split: Seq[InputSplit])
+ private def generateFuture(split: Seq[InputSplit], globalQueue:
SegmentProcessor)
(implicit executionContext: ExecutionContext) = {
Future {
- val segments = split.map { inputSplit =>
+
+ var segmentsWorkStatus = split.map { inputSplit =>
val distributable =
inputSplit.asInstanceOf[DataMapDistributableWrapper]
distributable.getDistributable.getSegment
.setReadCommittedScope(dataMapFormat.getReadCommittedScope)
- distributable.getDistributable.getSegment
+
+ val processedSegments =
globalQueue.ifProcessSegment(distributable.getDistributable
+ .getSegment.getSegmentNo, dataMapFormat.getCarbonTable.getTableId)
+
+ val segmentWorkStatusList = new
SegmentWorkStatus(distributable.getDistributable
+ .getSegment, !processedSegments)
+
+ // if ifprocesssegment = true, iswaiting = false
+ val processedSegmentsList =
globalQueue.processSegment(segmentWorkStatusList,
+ dataMapFormat.getCarbonTable.getTableId)
+ segmentWorkStatusList
+ }
+
+ val queueSize = globalQueue.queueSize()
+ val getGlobalworkQueue = globalQueue.getGlobalWorkQueue
Review comment:
Please remove all unused variables like this
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services