prakharjain09 commented on a change in pull request #27539: [SPARK-30786] [CORE] Fix Block replication failure propogation issue in BlockManager URL: https://github.com/apache/spark/pull/27539#discussion_r377527331
########## File path: core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala ########## @@ -1802,3 +1839,18 @@ private object BlockManagerSuite { } } + +// BlockReplicationPolicy to prioritize BlockManagers based on hostnames +// Examples - for BM-x(host-2), BM-y(host-1), BM-z(host-3), it will prioritize them as +// BM-y(host-1), BM-x(host-2), BM-z(host-3) +class SortOnHostNameBlockReplicationPolicy + extends BlockReplicationPolicy { + override def prioritize( + blockManagerId: BlockManagerId, + peers: Seq[BlockManagerId], + peersReplicatedTo: mutable.HashSet[BlockManagerId], + blockId: BlockId, + numReplicas: Int): List[BlockManagerId] = { Review comment: done. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org