diff --git a/pip/pip-365.md b/pip/pip-365.md new file mode 100644 index 0000000000000..b82713514ba21 --- /dev/null +++ b/pip/pip-365.md @@ -0,0 +1,94 @@ +# PIP-365: Add an admin API to query the metadata of transactions created by a specified user. + +# Background knowledge +Currently, there is no way for users to query the metadata of transactions they have created. + +# Motivation +In certain scenarios, users may need to query the metadata of transactions they have created and possibly perform +actions such as aborting the transaction. Therefore, we need to add an admin API to allow users to query the metadata +of transactions they have created. + +# Goals + +## In Scope +Add an admin API to query the metadata of transactions created by a specific user. + +## Out of Scope +None + +# High Level Design +Add an admin API to query the metadata of transactions created by a specific user. + +# Detailed Design + +## Design & Implementation Details +Add an admin API to query the metadata of transactions created by a specific user. + +## Public-facing Changes + +### Public API +Add new APIs: +```java +/** + * Get owned transactions by coordinator id. + * @param coordinatorId the coordinator id + * @param owner the owner + * @return the metadata of slow transactions. + */ +CompletableFuture> getOwnedTransactionsByCoordinatorIdAsync(Integer coordinatorId, + String owner); + +/** + * Get owned transactions by coordinator id. + * @param coordinatorId the coordinator id + * @param owner the owner + * @return the metadata of slow transactions. + */ +Map getOwnedTransactionsByCoordinatorId(Integer coordinatorId, + String owner) throws PulsarAdminException; + +/** + * Get owned transactions. + * @param owner the owner + * @return the metadata of slow transactions. + */ +CompletableFuture> getOwnedTransactionsAsync(String owner); + +/** + * Get owned transactions. + * @param owner the owner + * @return the metadata of slow transactions. + */ +Map getOwnedTransactions(String owner) throws PulsarAdminException; +``` + +Add a command: +```shell +pulsar-admin transactions owned-transactions --owner user +``` + +### Binary protocol + +### Configuration + +### CLI + +### Metrics + +# Monitoring + +# Security Considerations + +# Backward & Forward Compatibility + +## Revert + +## Upgrade + +# Alternatives + +# General Notes + +# Links +* Mailing List discussion thread: https://lists.apache.org/thread/wc4yw1m5g4zywc3c628p5zz4bdkh5x7x +* Mailing List voting thread: