attilapiros commented on a change in pull request #32114:
URL: https://github.com/apache/spark/pull/32114#discussion_r612362334



##########
File path: 
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -510,14 +514,20 @@ class BlockManagerMasterEndpoint(
   }
 
   /**
-   * Returns the BlockManagerId with topology information populated, if 
available.
+   * Returns an option of BlockManagerId. If topology information is 
available, it populated inside
+   * BlockManagerId. If the BlockManager belongs to a recently removed 
executor, None is returned.
    */
   private def register(
       idWithoutTopologyInfo: BlockManagerId,
       localDirs: Array[String],
       maxOnHeapMemSize: Long,
       maxOffHeapMemSize: Long,
-      storageEndpoint: RpcEndpointRef): BlockManagerId = {
+      storageEndpoint: RpcEndpointRef): Option[BlockManagerId] = {
+    if 
(Option(recentlyRemovedExecutors.getIfPresent(idWithoutTopologyInfo.executorId)).isDefined)
 {

Review comment:
       Nit: for just checking the object is null you do not need to build an 
Option (Option is good when when you pass the object to another method to 
emphasize it can be null). 




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

Reply via email to