[ 
https://issues.apache.org/jira/browse/STORM-1221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15018545#comment-15018545
 ] 

ASF GitHub Bot commented on STORM-1221:
---------------------------------------

Github user hmcl commented on a diff in the pull request:

    https://github.com/apache/storm/pull/895#discussion_r45504842
  
    --- Diff: storm-core/src/jvm/storm/trident/TridentTopology.java ---
    @@ -127,7 +128,21 @@ public Stream newStream(String txId, 
IPartitionedTridentSpout spout) {
         public Stream newStream(String txId, IOpaquePartitionedTridentSpout 
spout) {
             return newStream(txId, new 
OpaquePartitionedTridentSpoutExecutor(spout));
         }
    -    
    +
    +    public Stream newStream(String txId, ITridentDataSource dataSource) {
    +        if (dataSource instanceof IBatchSpout) {
    +            return newStream(txId, (IBatchSpout) dataSource);
    +        } else if (dataSource instanceof ITridentSpout) {
    +            return newStream(txId, (ITridentSpout) dataSource);
    +        } else if (dataSource instanceof IPartitionedTridentSpout) {
    +            return newStream(txId, (IPartitionedTridentSpout) dataSource);
    +        } else if (dataSource instanceof IOpaquePartitionedTridentSpout) {
    +            return newStream(txId, (IOpaquePartitionedTridentSpout) 
dataSource);
    +        } else {
    +            throw new UnsupportedOperationException();
    --- End diff --
    
    Perhaps you could add a meaningful message here. Something like 
"unsupported stream"



> Create a common interface for all Trident spout
> -----------------------------------------------
>
>                 Key: STORM-1221
>                 URL: https://issues.apache.org/jira/browse/STORM-1221
>             Project: Apache Storm
>          Issue Type: Bug
>            Reporter: Haohui Mai
>            Assignee: Haohui Mai
>
> Currently {{IBatchSpout}}, {{IOpaquePartitionSpout}}}, {{ITridentSpout}} and 
> {{IPartitionedSpout}} are all top-level interfaces. The lowest common 
> ancestor of their parent interface is {{Serializable}}. There is no clear, 
> single interface in Trident to mark these class are spouts / data sources. 
> The abstraction is beneficial when components on top of Trident (e.g. 
> StormSQL) need a notion of data source.
> This jira proposes to tags all the spouts above with a common marker 
> interface.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to