From 4e8ca13a73ccd176976576570c5f2e5f66428def Mon Sep 17 00:00:00 2001 From: HuanliMeng <48120384+Huanli-Meng@users.noreply.github.com> Date: Fri, 4 Dec 2020 09:27:02 +0800 Subject: [PATCH] [Doc]--update message TTL for namespace contents (#8747) Fixes #1735 ### Motivation Codes for message TTL for namespace is updated. Therefore, update the docs accordingly. ### Modifications Update the following docs: - Admin API for Namespace - Cookbook: Message retention and expiry - reference: pulsar-admin Affected releases: - master - 2.6.2 --- site2/docs/admin-api-namespaces.md | 28 +++++++++++++++++++ site2/docs/cookbooks-retention-expiry.md | 21 ++++++++++++++ site2/docs/reference-pulsar-admin.md | 12 +++++++- .../version-2.6.2/admin-api-namespaces.md | 27 ++++++++++++++++++ .../cookbooks-retention-expiry.md | 21 ++++++++++++++ .../version-2.6.2/reference-pulsar-admin.md | 11 +++++++- 6 files changed, 118 insertions(+), 2 deletions(-) diff --git a/site2/docs/admin-api-namespaces.md b/site2/docs/admin-api-namespaces.md index 89291883728cd..78b57e30319cb 100644 --- a/site2/docs/admin-api-namespaces.md +++ b/site2/docs/admin-api-namespaces.md @@ -436,6 +436,34 @@ admin.namespaces().getNamespaceMessageTTL(namespace) ``` +#### Remove message-ttl + +Remove a message TTL of the configured namespace. + + + + +``` +$ pulsar-admin namespaces remove-message-ttl test-tenant/ns1 +``` + +``` +100 +``` + + + +``` +{@inject: endpoint|DELETE|/admin/v2/namespaces/{tenant}/{namespace}/messageTTL|operation/removeNamespaceMessageTTL} +``` + + + +```java +admin.namespaces().removeNamespaceMessageTTL(namespace) +``` + + #### Split bundle Each namespace bundle can contain multiple topics and each bundle can be served by only one broker. diff --git a/site2/docs/cookbooks-retention-expiry.md b/site2/docs/cookbooks-retention-expiry.md index 0b15a9f7d4ac9..b515f9f10562b 100644 --- a/site2/docs/cookbooks-retention-expiry.md +++ b/site2/docs/cookbooks-retention-expiry.md @@ -315,3 +315,24 @@ $ pulsar-admin namespaces get-message-ttl my-tenant/my-ns admin.namespaces().getNamespaceMessageTTL(namespace) ``` +### Remove the TTL configuration for a namespace + +#### pulsar-admin + +Use the [`remove-message-ttl`](reference-pulsar-admin.md#pulsar-admin-namespaces-remove-message-ttl) subcommand and specify a namespace. + +##### Example + +```shell +$ pulsar-admin namespaces remove-message-ttl my-tenant/my-ns +``` + +#### REST API + +{@inject: endpoint|DELETE|/admin/v2/namespaces/:tenant/:namespace/messageTTL|operation/removeNamespaceMessageTTL} + +#### Java + +```java +admin.namespaces().removeNamespaceMessageTTL(namespace) +``` \ No newline at end of file diff --git a/site2/docs/reference-pulsar-admin.md b/site2/docs/reference-pulsar-admin.md index 8a75c22c836fe..1198a322e8b8a 100644 --- a/site2/docs/reference-pulsar-admin.md +++ b/site2/docs/reference-pulsar-admin.md @@ -848,6 +848,7 @@ Subcommands * `set-persistence` * `get-message-ttl` * `set-message-ttl` +* `remove-message-ttl` * `get-anti-affinity-group` * `set-anti-affinity-group` * `get-anti-affinity-namespaces` @@ -1166,7 +1167,16 @@ $ pulsar-admin namespaces set-message-ttl tenant/namespace options Options |Flag|Description|Default| |----|---|---| -|`-ttl`, `--messageTTL`|Message TTL in seconds|0| +|`-ttl`, `--messageTTL`|Message TTL in seconds|3600s| + +### `remove-message-ttl` +Remove the message TTL for a namespace. + +Usage +```bash +$ pulsar-admin namespaces remove-message-ttl tenant/namespace +``` + ### `get-anti-affinity-group` Get Anti-affinity group name for a namespace diff --git a/site2/website/versioned_docs/version-2.6.2/admin-api-namespaces.md b/site2/website/versioned_docs/version-2.6.2/admin-api-namespaces.md index 1cbc98909cb5b..e4c7a68eba710 100644 --- a/site2/website/versioned_docs/version-2.6.2/admin-api-namespaces.md +++ b/site2/website/versioned_docs/version-2.6.2/admin-api-namespaces.md @@ -415,6 +415,33 @@ $ pulsar-admin namespaces get-message-ttl test-tenant/ns1 admin.namespaces().getNamespaceMessageTTL(namespace) ``` +#### Remove message-ttl + +Remove a message TTL of the configured namespace. + + + + +``` +$ pulsar-admin namespaces remove-message-ttl test-tenant/ns1 +``` + +``` +100 +``` + + + +``` +{@inject: endpoint|DELETE|/admin/v2/namespaces/{tenant}/{namespace}/messageTTL|operation/removeNamespaceMessageTTL} +``` + + + +```java +admin.namespaces().removeNamespaceMessageTTL(namespace) +``` + #### split bundle diff --git a/site2/website/versioned_docs/version-2.6.2/cookbooks-retention-expiry.md b/site2/website/versioned_docs/version-2.6.2/cookbooks-retention-expiry.md index 5d3a5d1a7af94..8097bada6d880 100644 --- a/site2/website/versioned_docs/version-2.6.2/cookbooks-retention-expiry.md +++ b/site2/website/versioned_docs/version-2.6.2/cookbooks-retention-expiry.md @@ -289,3 +289,24 @@ $ pulsar-admin namespaces get-message-ttl my-tenant/my-ns admin.namespaces().getNamespaceMessageTTL(namespace) ``` +### Remove the TTL configuration for a namespace + +#### pulsar-admin + +Use the [`remove-message-ttl`](reference-pulsar-admin.md#pulsar-admin-namespaces-remove-message-ttl) subcommand and specify a namespace. + +##### Example + +```shell +$ pulsar-admin namespaces remove-message-ttl my-tenant/my-ns +``` + +#### REST API + +{@inject: endpoint|DELETE|/admin/v2/namespaces/:tenant/:namespace/messageTTL|operation/removeNamespaceMessageTTL} + +#### Java + +```java +admin.namespaces().removeNamespaceMessageTTL(namespace) +``` \ No newline at end of file diff --git a/site2/website/versioned_docs/version-2.6.2/reference-pulsar-admin.md b/site2/website/versioned_docs/version-2.6.2/reference-pulsar-admin.md index d872e6d67ad0d..4334db7f199f5 100644 --- a/site2/website/versioned_docs/version-2.6.2/reference-pulsar-admin.md +++ b/site2/website/versioned_docs/version-2.6.2/reference-pulsar-admin.md @@ -846,6 +846,7 @@ Subcommands * `set-persistence` * `get-message-ttl` * `set-message-ttl` +* `remove-message-ttl` * `get-anti-affinity-group` * `set-anti-affinity-group` * `get-anti-affinity-namespaces` @@ -1164,7 +1165,15 @@ $ pulsar-admin namespaces set-message-ttl tenant/namespace options Options |Flag|Description|Default| |----|---|---| -|`-ttl`, `--messageTTL`|Message TTL in seconds|0| +|`-ttl`, `--messageTTL`|Message TTL in seconds|3600s| + +### `remove-message-ttl` +Remove the message TTL for a namespace. + +Usage +```bash +$ pulsar-admin namespaces remove-message-ttl tenant/namespace +``` ### `get-anti-affinity-group` Get Anti-affinity group name for a namespace