[
https://issues.apache.org/jira/browse/CASSANDRA-15505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022172#comment-17022172
]
Alex Petrov commented on CASSANDRA-15505:
-----------------------------------------
[~yifanc] [~dcapwell] thank you for feedback. Sorry for reworking the patch yet
again; having two reviewers often brings many new ideas to the table, and this
time it was particularly useful, so I had to implement the changes you two have
suggested.
I've implemented a new version, which incorporates most of your comments (with
an exception of David's suggestion to use Instance instead of Int). A short
list of changes:
* 1 filter per matching condition
* allow executing a part of matcher on the instance. This means that you'll
be able to reconstruct `Message` on the instance and perform any necessary
checks. Since anything that gets into this matcher would have to be
serializable, you won't be able to use things like accumulators, countdown
latches, atomic longs, etc, since they'll simply be copied. So for the matchers
you execute on the node, you have to use two matchers: {{Matcher<T> onInstance,
Function<T, Boolean> onMain}}. This means you'll run the first part of the
matcher on the instance, and the second one, with results of execution on the
instance transferred to host class loader.
* switch from Verb to int (once again, in a longer-term effort to make APIs
not depending on Cassandra internals)
* rolled back changes to {{matches/permit}} after David's suggestion to avoid
confusion
* added some more tests (including negative ones, and ones for {{off}})
* added {{pass}} alongside with {{drop}}, to allow passthrough filters that
can be used for intercept purposes withouot filtering messages out.
> Add message interceptors to in-jvm dtests
> -----------------------------------------
>
> Key: CASSANDRA-15505
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15505
> Project: Cassandra
> Issue Type: New Feature
> Components: Test/dtest
> Reporter: Alex Petrov
> Assignee: Alex Petrov
> Priority: Normal
> Labels: pull-request-available
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> Currently we only have means to filter messages in in-jvm tests. We need a
> facility to intercept and modify the messages between nodes for testing
> purposes.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]