hachikuji opened a new pull request #10616:
URL: https://github.com/apache/kafka/pull/10616


   This patch adds `Admin` support for the `listTransactions` API, which was 
added by 
[KIP-664](https://cwiki.apache.org/confluence/display/KAFKA/KIP-664%3A+Provide+tooling+to+detect+and+abort+hanging+transactions).
 Similar to `listConsumerGroups`, the new `listTransactions` API is intended to 
be sent to all brokers. This did not fit very well with the new 
`AdminApiDriver` that was used for the other KIP-664 APIs, so I had to refactor 
a bit. The way I ultimately handled it is to treat the brokerId as the key that 
needs to be mapped. Unlike with the other cases, the set of brokerIds is not 
known ahead of time and has to be discovered through a `Metadata` lookup (just 
as with `listConsumerGroups`). Because the future associated with 
`ListTransactionsResult` is more complex, I ended up externalizing future 
completion in a new `AdminApiFuture` object which is passed to `AdminApiDriver` 
during construction.
   
   One minor change that is also worth calling out is the removal of 
`AdminApiHandler.Keys`. This was previously used to indicate the sets of 
statically and dynamically mapped keys. Instead, I now handle this with a new 
`StaticBrokerStrategy`. The static scope is indicated by returning an 
`ApiRequestScope` object which has a specific destination broker set.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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


Reply via email to