@@ -21,7 +21,6 @@ import org.apache.spark._
2121import org .apache .spark .internal .{config , Logging }
2222import org .apache .spark .io .CompressionCodec
2323import org .apache .spark .serializer .SerializerManager
24- import org .apache .spark .shuffle .sort .BypassMergeSortShuffleHandle
2524import org .apache .spark .storage .{BlockManager , ShuffleBlockFetcherIterator }
2625import org .apache .spark .util .CompletionIterator
2726import org .apache .spark .util .collection .ExternalSorter
@@ -48,10 +47,21 @@ private[spark] class BlockStoreShuffleReader[K, C](
4847 val compressed = conf.get(config.SHUFFLE_COMPRESS )
4948 val featureEnabled = conf.get(config.SHUFFLE_FETCH_CONTINUOUS_BLOCKS_IN_BATCH )
5049 val serializerRelocatable = dep.serializer.supportsRelocationOfSerializedObjects
50+ val codecConcatenation = if (compressed) {
51+ CompressionCodec .supportsConcatenationOfSerializedStreams(CompressionCodec .createCodec(conf))
52+ } else {
53+ true
54+ }
5155
52- featureEnabled && endPartition - startPartition > 1 &&
53- serializerRelocatable && (! compressed || CompressionCodec
54- .supportsConcatenationOfSerializedStreams(CompressionCodec .createCodec(conf)))
56+ val res = featureEnabled && endPartition - startPartition > 1 &&
57+ serializerRelocatable && (! compressed || codecConcatenation)
58+ if (featureEnabled && ! res) {
59+ logWarning(" The feature tag of continuous shuffle block fetching is set to true, but " +
60+ " we can not enable the feature because other conditions are not satisfied. " +
61+ s " Shuffle compress: $compressed, serializer relocatable: $serializerRelocatable, " +
62+ s " codec concatenation: $codecConcatenation" )
63+ }
64+ res
5565 }
5666
5767 /** Read the combined key-values for this reduce task */
0 commit comments