@@ -71,13 +71,18 @@ private[spark] class MapOutputTrackerMasterActor(tracker: MapOutputTrackerMaster
71
71
* (driver and worker) use different HashMap to store its metadata.
72
72
*/
73
73
private [spark] abstract class MapOutputTracker (conf : SparkConf ) extends Logging {
74
-
75
74
private val timeout = AkkaUtils .askTimeout(conf)
76
75
77
- /** Set to the MapOutputTrackerActor living on the driver */
76
+ /** Set to the MapOutputTrackerActor living on the driver. */
78
77
var trackerActor : ActorRef = _
79
78
80
- /** This HashMap needs to have different storage behavior for driver and worker */
79
+ /**
80
+ * This HashMap has different behavior for the master and the workers.
81
+ *
82
+ * On the master, it serves as the source of map outputs recorded from ShuffleMapTasks.
83
+ * On the workers, it simply serves as a cache, in which a miss triggers a fetch from the
84
+ * master's corresponding HashMap.
85
+ */
81
86
protected val mapStatuses : Map [Int , Array [MapStatus ]]
82
87
83
88
/**
@@ -87,7 +92,7 @@ private[spark] abstract class MapOutputTracker(conf: SparkConf) extends Logging
87
92
protected var epoch : Long = 0
88
93
protected val epochLock = new AnyRef
89
94
90
- /** Remembers which map output locations are currently being fetched on a worker */
95
+ /** Remembers which map output locations are currently being fetched on a worker. */
91
96
private val fetching = new HashSet [Int ]
92
97
93
98
/**
@@ -173,7 +178,7 @@ private[spark] abstract class MapOutputTracker(conf: SparkConf) extends Logging
173
178
}
174
179
}
175
180
176
- /** Called to get current epoch number */
181
+ /** Called to get current epoch number. */
177
182
def getEpoch : Long = {
178
183
epochLock.synchronized {
179
184
return epoch
@@ -195,16 +200,13 @@ private[spark] abstract class MapOutputTracker(conf: SparkConf) extends Logging
195
200
}
196
201
}
197
202
198
- /** Unregister shuffle data */
203
+ /** Unregister shuffle data. */
199
204
def unregisterShuffle (shuffleId : Int ) {
200
205
mapStatuses.remove(shuffleId)
201
206
}
202
207
203
- def stop () {
204
- sendTracker(StopMapOutputTracker )
205
- mapStatuses.clear()
206
- trackerActor = null
207
- }
208
+ /** Stop the tracker. */
209
+ def stop () { }
208
210
}
209
211
210
212
/**
@@ -219,7 +221,7 @@ private[spark] class MapOutputTrackerMaster(conf: SparkConf)
219
221
220
222
/**
221
223
* Timestamp based HashMap for storing mapStatuses and cached serialized statuses in the master,
222
- * so that statuses are dropped only by explicit deregistering or by TTL-based cleaning (if set).
224
+ * so that statuses are dropped only by explicit de-registering or by TTL-based cleaning (if set).
223
225
* Other than these two scenarios, nothing should be dropped from this HashMap.
224
226
*/
225
227
protected val mapStatuses = new TimeStampedHashMap [Int , Array [MapStatus ]]()
@@ -314,7 +316,9 @@ private[spark] class MapOutputTrackerMaster(conf: SparkConf)
314
316
}
315
317
316
318
override def stop () {
317
- super .stop()
319
+ sendTracker(StopMapOutputTracker )
320
+ mapStatuses.clear()
321
+ trackerActor = null
318
322
metadataCleaner.cancel()
319
323
cachedSerializedStatuses.clear()
320
324
}
0 commit comments