4444import org .apache .spark .serializer .SerializationStream ;
4545import org .apache .spark .serializer .Serializer ;
4646import org .apache .spark .serializer .SerializerInstance ;
47- import org .apache .spark .shuffle .IndexShuffleBlockManager ;
47+ import org .apache .spark .shuffle .IndexShuffleBlockResolver ;
4848import org .apache .spark .shuffle .ShuffleMemoryManager ;
4949import org .apache .spark .shuffle .ShuffleWriter ;
5050import org .apache .spark .storage .BlockManager ;
@@ -59,7 +59,7 @@ public class UnsafeShuffleWriter<K, V> extends ShuffleWriter<K, V> {
5959 private static final ClassTag <Object > OBJECT_CLASS_TAG = ClassTag$ .MODULE$ .Object ();
6060
6161 private final BlockManager blockManager ;
62- private final IndexShuffleBlockManager shuffleBlockManager ;
62+ private final IndexShuffleBlockResolver shuffleBlockResolver ;
6363 private final TaskMemoryManager memoryManager ;
6464 private final ShuffleMemoryManager shuffleMemoryManager ;
6565 private final SerializerInstance serializer ;
@@ -87,15 +87,15 @@ public class UnsafeShuffleWriter<K, V> extends ShuffleWriter<K, V> {
8787
8888 public UnsafeShuffleWriter (
8989 BlockManager blockManager ,
90- IndexShuffleBlockManager shuffleBlockManager ,
90+ IndexShuffleBlockResolver shuffleBlockResolver ,
9191 TaskMemoryManager memoryManager ,
9292 ShuffleMemoryManager shuffleMemoryManager ,
9393 UnsafeShuffleHandle <K , V > handle ,
9494 int mapId ,
9595 TaskContext taskContext ,
9696 SparkConf sparkConf ) {
9797 this .blockManager = blockManager ;
98- this .shuffleBlockManager = shuffleBlockManager ;
98+ this .shuffleBlockResolver = shuffleBlockResolver ;
9999 this .memoryManager = memoryManager ;
100100 this .shuffleMemoryManager = shuffleMemoryManager ;
101101 this .mapId = mapId ;
@@ -162,7 +162,7 @@ void closeAndWriteOutput() throws IOException {
162162 }
163163 }
164164 }
165- shuffleBlockManager .writeIndexFile (shuffleId , mapId , partitionLengths );
165+ shuffleBlockResolver .writeIndexFile (shuffleId , mapId , partitionLengths );
166166 mapStatus = MapStatus$ .MODULE$ .apply (blockManager .shuffleServerId (), partitionLengths );
167167 }
168168
@@ -192,7 +192,7 @@ void forceSorterToSpill() throws IOException {
192192 }
193193
194194 private long [] mergeSpills (SpillInfo [] spills ) throws IOException {
195- final File outputFile = shuffleBlockManager .getDataFile (shuffleId , mapId );
195+ final File outputFile = shuffleBlockResolver .getDataFile (shuffleId , mapId );
196196 try {
197197 if (spills .length == 0 ) {
198198 new FileOutputStream (outputFile ).close (); // Create an empty file
@@ -323,7 +323,7 @@ public Option<MapStatus> stop(boolean success) {
323323 return Option .apply (mapStatus );
324324 } else {
325325 // The map task failed, so delete our output data.
326- shuffleBlockManager .removeDataByMap (shuffleId , mapId );
326+ shuffleBlockResolver .removeDataByMap (shuffleId , mapId );
327327 return Option .apply (null );
328328 }
329329 }
0 commit comments