Skip to content

Commit df9d98f

Browse files
committed
Code review comments fixed
1 parent f48bce9 commit df9d98f

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

core/src/main/scala/org/apache/spark/storage/BlockManagerMasterActor.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ class BlockManagerMasterActor(val isLocal: Boolean, conf: SparkConf, listenerBus
190190
blockManagerIdByExecutor -= blockManagerId.executorId
191191

192192
// Remove it from blockManagerInfo and remove all the blocks.
193-
blockManagerInfo.remove(blockManagerId)
194-
193+
blockManagerInfo.remove(blockManagerId)
195194
val iterator = info.blocks.keySet.iterator
196195
while (iterator.hasNext) {
197196
val blockId = iterator.next
@@ -202,7 +201,7 @@ class BlockManagerMasterActor(val isLocal: Boolean, conf: SparkConf, listenerBus
202201
}
203202
}
204203
listenerBus.post(SparkListenerBlockManagerRemoved(System.currentTimeMillis(), blockManagerId))
205-
logInfo("removed " + blockManagerId)
204+
logInfo(s"Removing block manager $blockManagerId")
206205
}
207206

208207
private def expireDeadHosts() {
@@ -328,10 +327,10 @@ class BlockManagerMasterActor(val isLocal: Boolean, conf: SparkConf, listenerBus
328327

329328
if (!blockManagerInfo.contains(id)) {
330329
blockManagerIdByExecutor.get(id.executorId) match {
331-
case Some(manager) =>
332-
// A block manager of the same executor already exists so remove it (assumed dead).
330+
case Some(oldId) =>
331+
// already exists so remove it (assumed dead).
333332
logError("Got two different block manager registrations on same executor - "
334-
+ " will remove, new Id " + id + ", orig id - " + manager)
333+
+ " will remove, new Id %s, orig id - %s".format(id, oldId))
335334
removeExecutor(id.executorId)
336335
case None =>
337336
}
@@ -340,8 +339,8 @@ class BlockManagerMasterActor(val isLocal: Boolean, conf: SparkConf, listenerBus
340339

341340
blockManagerIdByExecutor(id.executorId) = id
342341

343-
blockManagerInfo(id) = new BlockManagerInfo(id, System.currentTimeMillis(),
344-
maxMemSize, slaveActor)
342+
blockManagerInfo(id) = new BlockManagerInfo(
343+
id, System.currentTimeMillis(), maxMemSize, slaveActor)
345344
}
346345
listenerBus.post(SparkListenerBlockManagerAdded(time, id, maxMemSize))
347346
}

0 commit comments

Comments
 (0)