GitHub user tdas opened a pull request:

    https://github.com/apache/spark/pull/13996

    [SPARK-12177] Refactored some API in Kafka 0.10 to make public API simpler

    ## What changes were proposed in this pull request?
    
    This refactoring make the public API simpler. Current version has the 
following problems
    1. Too many separate **public** classes for different location and consumer 
strategies. 
    
    2. Each strategy has a separate `apply` and `create` methods for Scala and 
Java. 
    
    3. ConsumerStrategy is interface, cannot add methods with breaking 
compatibility in the future.
    
    To fix these, I have refactored the classes. Now `LocationStrategy` has 
static methods to create the appropriate strategy. E.g.
    ```
    LocationStrategy.PreferBrokers()   // returns an LocationStrategy object, 
same API in scala and java
    ```
    Similarly,
    ```
    ConsumerStrategy.Subscribe(topics, params)  // same API in scala and java
    ```
    
    1+2. This allows all the strategy classes to be hidden from public, less 
surface for incompatibility in the future. And same APIs for Java and Scala.
    3. In addition, both strategies have been implemented as abstract class in 
Java.
    
    
    ## How was this patch tested?
    Modified unit tests.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tdas/spark SPARK-12177-2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13996.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13996
    
----
commit 39a26f39fa0ec1924e178b42b94ea33e8ce7155f
Author: Tathagata Das <[email protected]>
Date:   2016-06-30T11:18:58Z

    Refactored

----


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