Skip to content

Commit

Permalink
[Doc]--update message TTL for namespace contents (apache#8747)
Browse files Browse the repository at this point in the history
Fixes apache#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
  • Loading branch information
Huanli-Meng authored Dec 4, 2020
1 parent ac0c6e4 commit 4e8ca13
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 2 deletions.
28 changes: 28 additions & 0 deletions site2/docs/admin-api-namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,34 @@ admin.namespaces().getNamespaceMessageTTL(namespace)
```
<!--END_DOCUSAURUS_CODE_TABS-->

#### Remove message-ttl

Remove a message TTL of the configured namespace.

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->

```
$ pulsar-admin namespaces remove-message-ttl test-tenant/ns1
```

```
100
```

<!--REST API-->

```
{@inject: endpoint|DELETE|/admin/v2/namespaces/{tenant}/{namespace}/messageTTL|operation/removeNamespaceMessageTTL}
```

<!--Java-->

```java
admin.namespaces().removeNamespaceMessageTTL(namespace)
```
<!--END_DOCUSAURUS_CODE_TABS-->

#### Split bundle

Each namespace bundle can contain multiple topics and each bundle can be served by only one broker.
Expand Down
21 changes: 21 additions & 0 deletions site2/docs/cookbooks-retention-expiry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
12 changes: 11 additions & 1 deletion site2/docs/reference-pulsar-admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions site2/website/versioned_docs/version-2.6.2/admin-api-namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->

```
$ pulsar-admin namespaces remove-message-ttl test-tenant/ns1
```

```
100
```

<!--REST API-->

```
{@inject: endpoint|DELETE|/admin/v2/namespaces/{tenant}/{namespace}/messageTTL|operation/removeNamespaceMessageTTL}
```

<!--Java-->

```java
admin.namespaces().removeNamespaceMessageTTL(namespace)
```
<!--END_DOCUSAURUS_CODE_TABS-->

#### split bundle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4e8ca13

Please sign in to comment.