Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIP-365: Add an admin API to query the metadata of transactions created by a specified user. #22982

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions pip/pip-365.md
Original file line number Diff line number Diff line change
@@ -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<Map<String, TransactionMetadata>> 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<String, TransactionMetadata> getOwnedTransactionsByCoordinatorId(Integer coordinatorId,
String owner) throws PulsarAdminException;

/**
* Get owned transactions.
* @param owner the owner
* @return the metadata of slow transactions.
*/
CompletableFuture<Map<String, TransactionMetadata>> getOwnedTransactionsAsync(String owner);

/**
* Get owned transactions.
* @param owner the owner
* @return the metadata of slow transactions.
*/
Map<String, TransactionMetadata> 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: