holdenk commented on a change in pull request #28370:
URL: https://github.com/apache/spark/pull/28370#discussion_r419598466
##########
File path:
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -299,6 +310,39 @@ class BlockManagerMasterEndpoint(
blockManagerIdByExecutor.get(execId).foreach(removeBlockManager)
}
+ /**
+ * Decommission the given Seq of blockmanagers
+ * - Adds these block managers to decommissioningBlockManagerSet Set
+ * - Sends the DecommissionBlockManager message to each of the
[[BlockManagerSlaveEndpoint]]
+ */
+ def decommissionBlockManagers(blockManagerIds: Seq[BlockManagerId]):
Future[Seq[Unit]] = {
+ val newBlockManagersToDecommission =
blockManagerIds.toSet.diff(decommissioningBlockManagerSet)
+ val futures = newBlockManagersToDecommission.map { blockManagerId =>
+ decommissioningBlockManagerSet.add(blockManagerId)
+ val info = blockManagerInfo(blockManagerId)
+ info.slaveEndpoint.ask[Unit](DecommissionBlockManager)
+ }
+ Future.sequence{ futures.toSeq }
+ }
+
+ /**
+ * Returns a Seq of ReplicateBlock for each RDD block stored by given
blockManagerId
+ * @param blockManagerId - block manager id for which ReplicateBlock info is
needed
+ * @return Seq of ReplicateBlock
+ */
+ private def getReplicateInfoForRDDBlocks(blockManagerId: BlockManagerId):
Seq[ReplicateBlock] = {
+ val info = blockManagerInfo(blockManagerId)
+
+ val rddBlocks = info.blocks.keySet().asScala.filter(_.isRDD)
+ rddBlocks.map { blockId =>
+ val currentBlockLocations = blockLocations.get(blockId)
+ val maxReplicas = currentBlockLocations.size + 1
+ val remainingLocations = currentBlockLocations.toSeq.filter(bm => bm !=
blockManagerId)
+ val replicateMsg = ReplicateBlock(blockId, remainingLocations,
maxReplicas)
Review comment:
Currently the logic exists inside of blockReplicationPolicy so that
would be the place to explore that.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]