dawillcox opened a new pull request #6025: [Issue 6024][pulsar_storm] Support 
alternate output streams in PulsarSpout
URL: https://github.com/apache/pulsar/pull/6025
 
 
   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the 
pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull 
request.
       Skip *component* if you are unsure about which is the best component. 
E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the 
pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from 
multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and 
this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   Fixes #6024
   
   ### Motivation
   This is all described in detail in 
https://github.com/apache/pulsar/issues/6024, but in short, an insurmountable 
obstacle to using Pulsar in our storm topology is the fact that `PulsarSpout` 
only emits to the "default" stream. In our environment, we need to emit on 
different streams based on the content of each received message. This change 
extends `PulsarSpout` to recognize a `Values` extension that specifies an 
alternate output stream, and uses that stream when given.
   
   ### Modifications
   A new `PulsarTuple` class is added. It extends `Values` and adds a method to 
return the output stream.
   
   When emitting a tuple after calling `toValues(msg)`, `PulsarSpout` checks if 
the returned `Values` is a `PulsarTuple`. If so, it emits to the designated 
stream, otherwise it emits as before.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
     - A test case was added to `PulsarSpoutTest` to verify that when 
`PulsarTuple` us used, the tuple is emitted in the specified stream.
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (yes?) Existing APIs don't change, but a new class is 
added that carries additional information.
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? JavaDocs
   

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

Reply via email to