Skip to content

Commit

Permalink
Update pip-398.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nodece authored Dec 25, 2024
1 parent 556bae2 commit 73a4da4
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions pip/pip-398.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,36 +55,36 @@ The priority for the subscription replication configuration is as follows:
```java
public class Policies {
@SuppressWarnings("checkstyle:MemberName")
public Boolean replicate_subscriptions_state;
public Boolean replicate_subscription_state;
}
```
2. Add the management methods to the `org.apache.pulsar.client.admin.Namespaces` interface:
```java
public interface Namespaces {
void setReplicateSubscriptionsState(String namespace, Boolean enabled) throws PulsarAdminException;
CompletableFuture<Void> setReplicateSubscriptionsStateAsync(String namespace, Boolean enabled);
Boolean getReplicateSubscriptionsState(String namespace) throws PulsarAdminException;
CompletableFuture<Boolean> getReplicateSubscriptionsStateAsync(String namespace);
void setReplicateSubscriptionState(String namespace, Boolean enabled) throws PulsarAdminException;
CompletableFuture<Void> setReplicateSubscriptionStateAsync(String namespace, Boolean enabled);
Boolean getReplicateSubscriptionState(String namespace) throws PulsarAdminException;
CompletableFuture<Boolean> getReplicateSubscriptionStateAsync(String namespace);
}
```
3. Implement the management methods in the `org.apache.pulsar.client.admin.internal.NamespacesImpl` class.

### Topic level

1. Add the field `Boolean replicateSubscriptionsState` to the `org.apache.pulsar.common.policies.data.TopicPolicies`
1. Add the field `Boolean replicateSubscriptionState` to the `org.apache.pulsar.common.policies.data.TopicPolicies`
class to enable subscription replication at the topic level:
```java
public class TopicPolicies {
public Boolean replicateSubscriptionsState;
public Boolean replicateSubscriptionState;
}
```
2. Add the management methods to the `org.apache.pulsar.client.admin.TopicPolicies` interface:
```java
public interface TopicPolicies {
void setReplicateSubscriptionsState(String topic, Boolean enabled) throws PulsarAdminException;
CompletableFuture<Void> setReplicateSubscriptionsStateAsync(String topic, Boolean enabled);
Boolean getReplicateSubscriptionsState(String topic, boolean applied) throws PulsarAdminException;
CompletableFuture<Boolean> getReplicateSubscriptionsStateAsync(String topic, boolean applied);
void setReplicateSubscriptionState(String topic, Boolean enabled) throws PulsarAdminException;
CompletableFuture<Void> setReplicateSubscriptionStateAsync(String topic, Boolean enabled);
Boolean getReplicateSubscriptionState(String topic, boolean applied) throws PulsarAdminException;
CompletableFuture<Boolean> getReplicateSubscriptionStateAsync(String topic, boolean applied);
}
```
3. Implement the management methods in the `org.apache.pulsar.client.admin.internal.TopicPoliciesImpl` class.
Expand All @@ -110,15 +110,15 @@ subscription replication configuration for the special subscription, and equals

##### Namespace level

- `/{tenant}/{namespace}/replicateSubscriptionsState`: enable/disable/remove the subscription replication on the
- `/{tenant}/{namespace}/replicateSubscriptionState`: enable/disable/remove the subscription replication on the
namespace level.
- Method: `POST`
- Content-Type: `application/json`
- Body:
- true
- false
- null
- `GET /{tenant}/{namespace}/replicateSubscriptionsState` to get subscription replication configuration on the namespace
- `GET /{tenant}/{namespace}/replicateSubscriptionState` to get subscription replication configuration on the namespace
level.
- Method: `GET`
- Response:
Expand All @@ -128,15 +128,15 @@ subscription replication configuration for the special subscription, and equals

##### Topic level

- `/{tenant}/{namespace}/{topic}/replicateSubscriptionsState`: enable/disable/remove the subscription replication on the
- `/{tenant}/{namespace}/{topic}/replicateSubscriptionState`: enable/disable/remove the subscription replication on the
topic level.
- Method: `POST`
- Content-Type: `application/json`
- Body:
- true
- false
- null
- `/{tenant}/{namespace}/{topic}/replicateSubscriptionsState` to get subscription replication configuration on the topic
- `/{tenant}/{namespace}/{topic}/replicateSubscriptionState` to get subscription replication configuration on the topic
level.
- Method: `GET`
- Parameters:
Expand All @@ -153,20 +153,20 @@ subscription replication configuration for the special subscription, and equals

#### Namespace level

- `pulsar-admin namespaces set-replicate-subscriptions-state <tenant>/<namespace> --enabled true/false` to
- `pulsar-admin namespaces set-replicate-subscription-state <tenant>/<namespace> --enabled true/false` to
enable/disable the subscription replication on the namespace level.
- `pulsar-admin namespaces get-replicate-subscriptions-state <tenant>/<namespace>` to get the subscription
- `pulsar-admin namespaces get-replicate-subscription-state <tenant>/<namespace>` to get the subscription
replication configuration on the namespace level.
- `pulsar-admin namespaces remove-replicate-subscriptions-state <tenant>/<namespace>` to remove the subscription
- `pulsar-admin namespaces remove-replicate-subscription-state <tenant>/<namespace>` to remove the subscription
replication configuration on the namespace level.

#### Topic level

- `pulsar-admin topicPolicies set-replicate-subscriptions-state <tenant>/<namespace>/<topic> --enabled true/false`
- `pulsar-admin topicPolicies set-replicate-subscription-state <tenant>/<namespace>/<topic> --enabled true/false`
to enable/disable the subscription replication on the topic level.
- `pulsar-admin topicPolicies get-replicate-subscriptions-state <tenant>/<namespace>/<topic>` to get the
- `pulsar-admin topicPolicies get-replicate-subscription-state <tenant>/<namespace>/<topic>` to get the
subscription replication configuration on the topic level.
- `pulsar-admin topicPolicies remove-replicate-subscriptions-state <tenant>/<namespace>/<topic>` to remove the
- `pulsar-admin topicPolicies remove-replicate-subscription-state <tenant>/<namespace>/<topic>` to remove the
subscription replication configuration on the topic level.

# Security Considerations
Expand Down

0 comments on commit 73a4da4

Please sign in to comment.