From 9bc4dbbe9df35b3d92d63bb6385c0b202294fec7 Mon Sep 17 00:00:00 2001 From: ruihongzhou Date: Wed, 26 Jun 2024 16:58:01 +0800 Subject: [PATCH 1/4] pip-365 --- pip/pip-365.md | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 pip/pip-365.md diff --git a/pip/pip-365.md b/pip/pip-365.md new file mode 100644 index 0000000000000..6727475a27336 --- /dev/null +++ b/pip/pip-365.md @@ -0,0 +1,94 @@ +# PIP-365: Add admin API to get the transactions created by a specific user + +# Background knowledge +Currently, there is no way for users to query the transactions they have created. + +# Motivation +In certain scenarios, users may need to query the 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 get the transactions +they have created. + +# Goals + +## In Scope +Add an admin API to get the transactions created by a specific user. + +## Out of Scope +None + +# High Level Design +Add an admin API to get the transactions created by a specific user. + +# Detailed Design + +## Design & Implementation Details +Add an admin API to get the 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: +``` +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: +* Mailing List voting thread: From 19b3b4f054eb73f53219f71c0257f92eed4be9dd Mon Sep 17 00:00:00 2001 From: ruihongzhou Date: Wed, 26 Jun 2024 17:10:44 +0800 Subject: [PATCH 2/4] optimize --- pip/pip-365.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pip/pip-365.md b/pip/pip-365.md index 6727475a27336..d2422c473f74e 100644 --- a/pip/pip-365.md +++ b/pip/pip-365.md @@ -1,28 +1,28 @@ -# PIP-365: Add admin API to get the transactions created by a specific user +# 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 transactions they have created. +Currently, there is no way for users to query the metadata of the transactions they have created. # Motivation -In certain scenarios, users may need to query the 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 get the transactions -they have created. +In certain scenarios, users may need to query the metadata of the 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 the transactions they have created. # Goals ## In Scope -Add an admin API to get the transactions created by a specific user. +Add an admin API to query the metadata of the transactions created by a specific user. ## Out of Scope None # High Level Design -Add an admin API to get the transactions created by a specific user. +Add an admin API to query the metadata of the transactions created by a specific user. # Detailed Design ## Design & Implementation Details -Add an admin API to get the transactions created by a specific user. +Add an admin API to query the metadata of the transactions created by a specific user. ## Public-facing Changes From 10e8ce0bcc7d3639941536604f5b7a720fafddb9 Mon Sep 17 00:00:00 2001 From: ruihongzhou Date: Wed, 26 Jun 2024 17:23:14 +0800 Subject: [PATCH 3/4] [improve][pip] PIP-365: Add an admin API to query the metadata of transactions created by a specified user --- pip/pip-365.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pip/pip-365.md b/pip/pip-365.md index d2422c473f74e..d426d14b5fddf 100644 --- a/pip/pip-365.md +++ b/pip/pip-365.md @@ -1,28 +1,28 @@ # 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 the transactions they have created. +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 the transactions they have created and possibly perform +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 the transactions they have created. +of transactions they have created. # Goals ## In Scope -Add an admin API to query the metadata of the transactions created by a specific user. +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 the transactions created by a specific user. +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 the transactions created by a specific user. +Add an admin API to query the metadata of transactions created by a specific user. ## Public-facing Changes @@ -63,7 +63,7 @@ Map getOwnedTransactions(String owner) throws Pulsa ``` Add a command: -``` +```shell pulsar-admin transactions owned-transactions --owner user ``` From b4528294d5701fef49747fd52e1c90f6b2aacecf Mon Sep 17 00:00:00 2001 From: ruihongzhou Date: Tue, 15 Oct 2024 10:41:17 +0800 Subject: [PATCH 4/4] update --- pip/pip-365.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pip/pip-365.md b/pip/pip-365.md index d426d14b5fddf..b82713514ba21 100644 --- a/pip/pip-365.md +++ b/pip/pip-365.md @@ -90,5 +90,5 @@ pulsar-admin transactions owned-transactions --owner user # General Notes # Links -* Mailing List discussion thread: +* Mailing List discussion thread: https://lists.apache.org/thread/wc4yw1m5g4zywc3c628p5zz4bdkh5x7x * Mailing List voting thread: