Github user tdas commented on the pull request:

    https://github.com/apache/spark/pull/2940#issuecomment-60877622
  
    I mentioned this in the earlier in the original thread. This is a tradeoff 
between generality and type checking. I want the code in 
ReceiverSupervisorImpl, and ReceivedBlockInfo to be agnostic to the 
implementation of the ReceivedBlockHandler that is in use. Otherwise no point 
of making this a pluggable interface, where we could plug in implementation 
like CassandraBasedBlockHandler in future. 
    
    To achieve that these classes have to be agnostic to the exact return type 
of the ReceivedBlockHandler. In which case there are three options as far as I 
think.
    1.  Refer to the handler as ReceivedBlockHandler[Any]
    2. Refer to the handler as ReceivedBlockHandler[_]
    3. Give the return type a trait name (say ReceivedBlockHandlerStoreResult) 
and refer to the handler as 
ReceivedBlockHandler[ReceivedBlockHandlerStoreResult]
    
    I dont see much advantage in 2 over 1. I thought of 3 as an option. But it 
gets weird for the default BlockManagerBasedBlockHandler, as it always returns 
None, and so does not really need the type. But 3 will force a dummy type (that 
extends ReceivedBlockHandlerStoreResult) to be defined. 
    
    Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to