Ngone51 commented on a change in pull request #27539: [SPARK-30786] [BLOCK 
MANAGER] Fix Block replication failure propogation issue in BlockManager
URL: https://github.com/apache/spark/pull/27539#discussion_r377515247
 
 

 ##########
 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:
   nit: style.

----------------------------------------------------------------
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

Reply via email to