You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/22 15:14:35 UTC

[GitHub] [pulsar] seeday opened a new pull request #7629: [][broker/client] Initial implementation of message filtering

seeday opened a new pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629


   <!--
   ### 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)**
   -->
   
   ### Motivation
   
   Broker-side filtering of messages can reduce the network load significantly when running certain types of highly-filtered jobs. Example usecases are flink filter-pushdown, displaying data over websocket, and other network-limited actions.
   
   So far, the list of available filters is pretty small, but this framework should make writing new ones relatively easy.
   
   ### Modifications
   
   I've modified the pulsar protocol such that clients can send a spec for filtering to the broker. The broker's Consumer class builds a filter from the arguments sent as well as the class name. I've gone with reflection because that makes for easy extension and customization of the available filters. 
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
    - the new tests in MessageFilteringTest/SimpleTypedMessageProducerConsumerTest should pass
    - all other tests should be unaffected by the changes
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API: (**yes** / no)
         - a new function is added to the consumer to allow for constructing a message filter
     - The schema: (yes / **no** / don't know)
     - The default values of configurations: (yes / **no**)
     - The wire protocol: (**yes** / no)
         - a new field was added to commandsubscribe to send info about the message filter
     - The rest endpoints: (yes / **no**)
     - The admin cli options: (yes / **no**)
     - Anything that affects deployment: (yes / **no** / don't know)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (**yes** / no)
     - If yes, how is the feature documented? (not applicable / docs / **JavaDocs** / not documented)
       - once this is in a more stable state, an entry in the actual docs is probably necessary. 
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] seeday commented on pull request #7629: [][broker/client] Initial implementation of message filtering

Posted by GitBox <gi...@apache.org>.
seeday commented on pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629#issuecomment-662516721


   Hi all. 
   
   This is my first large pulsar PR, and given the contents of it I've got quite a few questions/discussion points about the implementation (in no particular order)
   
   - my biggest worry is that the way I've done filtering (acking filtered-out messages on the broker) fails in some strange case
   - additionally, the performance of running the filter inside the jetty thread-loop might be questionable, but I feel like running it in the consumer send function would be worse (as I think that's single threaded?).
   - reflection to create the filter classes isn't pretty, but it allows for easy user extension. Is that reason enough to have it?
   - also, what kind of filters should pulsar itself be in the business of providing? I only created a few to prove out the feature, but they also cover a relatively large amount of my use-case.
   - Is there a better way to send over arguments to the filter? I used KeyValue since it was convenient, but sending serialized objects of some sort would be much nicer (and necessary for flink integration, as far as I can tell)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] merlimat commented on pull request #7629: [][broker/client] Initial implementation of message filtering

Posted by GitBox <gi...@apache.org>.
merlimat commented on pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629#issuecomment-662519789


   For changes that introduce new features or protocol changes, it's recommended to submit a PIP (design doc) for discussion to the mailing list. PTAL for examples at https://github.com/apache/pulsar/wiki


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on pull request #7629: [][broker/client] Initial implementation of message filtering

Posted by GitBox <gi...@apache.org>.
sijie commented on pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629#issuecomment-662692424


   @seeday You can put the PIP in a Google Doc or a gist and send an email to dev@ mailing list. Once the thread is started, one of the committers will take the content and add it to Pulsar wiki.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] github-actions[bot] commented on pull request #7629: [][broker/client] Initial implementation of message filtering

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629#issuecomment-1058899589


   @seeday:Thanks for your contribution. For this PR, do we need to update docs?
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] seeday closed pull request #7629: [][broker/client] Initial implementation of message filtering

Posted by GitBox <gi...@apache.org>.
seeday closed pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629


   


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] seeday commented on pull request #7629: [][broker/client] Initial implementation of message filtering

Posted by GitBox <gi...@apache.org>.
seeday commented on pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629#issuecomment-662625702


   I've drawn a PIP up but couldn't figure out how to actually contribute it. It doesn't look like you can do wiki PRs.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] seeday commented on pull request #7629: [][broker/client] Initial implementation of message filtering

Posted by GitBox <gi...@apache.org>.
seeday commented on pull request #7629:
URL: https://github.com/apache/pulsar/pull/7629#issuecomment-662523136


   > For changes that introduce new features or protocol changes, it's recommended to submit a PIP (design doc) for discussion to the mailing list. PTAL for examples at https://github.com/apache/pulsar/wiki
   
   You know, "should I open a PIP too" should have made my question list. I'll start putting one together.


----------------------------------------------------------------
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:
users@infra.apache.org