cloud-fan commented on a change in pull request #26040: [SPARK-9853][Core]
Optimize shuffle fetch of continuous partition IDs
URL: https://github.com/apache/spark/pull/26040#discussion_r335493323
##########
File path:
core/src/main/scala/org/apache/spark/shuffle/BlockStoreShuffleReader.scala
##########
@@ -35,11 +35,35 @@ private[spark] class BlockStoreShuffleReader[K, C](
readMetrics: ShuffleReadMetricsReporter,
serializerManager: SerializerManager = SparkEnv.get.serializerManager,
blockManager: BlockManager = SparkEnv.get.blockManager,
- mapOutputTracker: MapOutputTracker = SparkEnv.get.mapOutputTracker)
+ mapOutputTracker: MapOutputTracker = SparkEnv.get.mapOutputTracker,
+ fetchMultiPartitions: Boolean)
extends ShuffleReader[K, C] with Logging {
private val dep = handle.dependency
+ private def fetchContinuousBlocksInBatch: Boolean = {
+ val conf = SparkEnv.get.conf
+ val compressed = conf.get(config.SHUFFLE_COMPRESS)
+ val featureEnabled = TaskContext.get().getLocalProperty(
+
BlockStoreShuffleReader.FETCH_CONTINUOUS_SHUFFLE_BLOCKS_IN_BATCH_ENABLED_KEY)
== "true"
+ val serializerRelocatable =
dep.serializer.supportsRelocationOfSerializedObjects
+ val codecConcatenation = if (compressed) {
+
CompressionCodec.supportsConcatenationOfSerializedStreams(CompressionCodec.createCodec(conf))
+ } else {
+ true
+ }
+
+ val res = featureEnabled && fetchMultiPartitions &&
+ serializerRelocatable && (!compressed || codecConcatenation)
+ if (featureEnabled && !res) {
+ logDebug("The feature tag of continuous shuffle block fetching is set to
true, but " +
Review comment:
e.g. the code can be
```
val shouldBatchFetch = fetchMultiPartitions && context.getLocalProperties...
...
val doBatchFetch = ...
if (shouldBatchFetch && !doBatchFetch) ...
```
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]