Huanli-Meng commented on a change in pull request #8388:
URL: https://github.com/apache/pulsar/pull/8388#discussion_r513353321
##########
File path: site2/docs/admin-api-non-partitioned-topics.md
##########
@@ -1,159 +1,5 @@
---
id: admin-api-non-partitioned-topics
title: Managing non-partitioned topics
-sidebar_label: Non-Partitioned topics
----
-
-
-You can use Pulsar's [admin API](admin-api-overview.md) to create and manage
non-partitioned topics.
-
-In all of the instructions and commands below, the topic name structure is:
-
-```shell
-persistent://tenant/namespace/topic
-```
-
-## Non-Partitioned topics resources
-
-### Create
-
-Non-partitioned topics in Pulsar must be explicitly created. When creating a
new non-partitioned topic you
-need to provide a name for the topic.
-
-> #### Note
->
-> By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data.
->
-> To disable this feature, set `brokerDeleteInactiveTopicsEnabled` to `false`.
->
-> To change the frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
->
-> For more information about these two parameters, see
[here](reference-configuration.md#broker).
-
-#### pulsar-admin
-
-You can create non-partitioned topics using the
[`create`](reference-pulsar-admin.md#create-3)
-command and specifying the topic name as an argument.
-Here's an example:
-
-```shell
-$ bin/pulsar-admin topics create \
- persistent://my-tenant/my-namespace/my-topic
-```
-
-> #### Note
->
-> It's only allowed to create non partitioned topic of name contains suffix
'-partition-' followed by numeric value like
-> 'xyz-topic-partition-10', if there's already a partitioned topic with same
name, in this case 'xyz-topic', and has
-> number of partition larger then that numeric value in this case 11(partition
index is start from 0). Else creation of such topic will fail.
-
-#### REST API
-
-{@inject:
endpoint|PUT|/admin/v2/persistent/:tenant/:namespace/:topic|operation/createNonPartitionedTopic}
-
-#### Java
-
-```java
-String topicName = "persistent://my-tenant/my-namespace/my-topic";
-admin.topics().createNonPartitionedTopic(topicName);
-```
-
-### Delete
-
-#### pulsar-admin
-
-Non-partitioned topics can be deleted using the
-[`delete`](reference-pulsar-admin.md#delete-4) command, specifying the topic
by name:
-
-```shell
-$ bin/pulsar-admin topics delete \
- persistent://my-tenant/my-namespace/my-topic
-```
-
-#### REST API
-
-{@inject:
endpoint|DELETE|/admin/v2/persistent/:tenant/:namespace/:topic|operation/deleteTopic}
-
-#### Java
-
-```java
-admin.topics().delete(persistentTopic);
-```
-
-### List
-
-It provides a list of topics existing under a given namespace.
-
-#### pulsar-admin
-
-```shell
-$ pulsar-admin topics list tenant/namespace
-persistent://tenant/namespace/topic1
-persistent://tenant/namespace/topic2
-```
-
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace|operation/getList}
-
-#### Java
-
-```java
-admin.topics().getList(namespace);
-```
-
-### Stats
-
-It shows current statistics of a given topic. Here's an example payload:
-
-The following stats are available:
-
-|Stat|Description|
-|----|-----------|
-|msgRateIn|The sum of all local and replication publishers’ publish rates in
messages per second|
-|msgThroughputIn|Same as msgRateIn but in bytes per second instead of messages
per second|
-|msgRateOut|The sum of all local and replication consumers’ dispatch rates in
messages per second|
-|msgThroughputOut|Same as msgRateOut but in bytes per second instead of
messages per second|
-|averageMsgSize|Average message size, in bytes, from this publisher within the
last interval|
-|storageSize|The sum of the ledgers’ storage size for this topic|
-|publishers|The list of all local publishers into the topic. There can be
anywhere from zero to thousands.|
-|producerId|Internal identifier for this producer on this topic|
-|producerName|Internal identifier for this producer, generated by the client
library|
-|address|IP address and source port for the connection of this producer|
-|connectedSince|Timestamp this producer was created or last reconnected|
-|subscriptions|The list of all local subscriptions to the topic|
-|my-subscription|The name of this subscription (client defined)|
-|msgBacklog|The count of messages in backlog for this subscription|
-|msgBacklogNoDelayed|The count of messages in backlog without delayed messages
for this subscription|
-|type|This subscription type|
-|msgRateExpired|The rate at which messages were discarded instead of
dispatched from this subscription due to TTL|
-|consumers|The list of connected consumers for this subscription|
-|consumerName|Internal identifier for this consumer, generated by the client
library|
-|availablePermits|The number of messages this consumer has space for in the
client library’s listen queue. A value of 0 means the client library’s queue is
full and receive() isn’t being called. A nonzero value means this consumer is
ready to be dispatched messages.|
-|replication|This section gives the stats for cross-colo replication of this
topic|
-|replicationBacklog|The outbound replication backlog in messages|
-|connected|Whether the outbound replicator is connected|
-|replicationDelayInSeconds|How long the oldest message has been waiting to be
sent through the connection, if connected is true|
-|inboundConnection|The IP and port of the broker in the remote cluster’s
publisher connection to this broker|
-|inboundConnectedSince|The TCP connection being used to publish messages to
the remote cluster. If there are no local publishers connected, this connection
is automatically closed after a minute.|
-
-#### pulsar-admin
-
-The stats for the topic and its connected producers and consumers can be
fetched by using the
-[`stats`](reference-pulsar-admin.md#stats) command, specifying the topic by
name:
-
-```shell
-$ pulsar-admin topics stats \
- persistent://test-tenant/namespace/topic \
- --get-precise-backlog
-```
-
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace/:topic/stats|operation/getStats}
-
-#### Java
-
-```java
-admin.topics().getStats(persistentTopic, false /* is precise backlog */);
-```
+sidebar_label: Topics2
Review comment:
```suggestion
sidebar_label: Topics 2
```
##########
File path: site2/docs/admin-api-partitioned-topics.md
##########
@@ -1,109 +1,82 @@
---
id: admin-api-partitioned-topics
title: Managing partitioned topics
-sidebar_label: Partitioned topics
+sidebar_label: Topics1
---
-
-You can use Pulsar's [admin API](admin-api-overview.md) to create and manage
partitioned topics.
-
-In all of the instructions and commands below, the topic name structure is:
-
-```shell
-persistent://tenant/namespace/topic
-```
-
-## Partitioned topics resources
+## Manage partitioned topics
+You can use Pulsar [admin API](admin-api-overview.md) to create, update,
delete and check status of partitioned topics.
### Create
-Partitioned topics in Pulsar must be explicitly created. When creating a new
partitioned topic you
-need to provide a name for the topic as well as the desired number of
partitions.
-
-> #### Note
->
-> By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data.
->
-> To disable this feature, set `brokerDeleteInactiveTopicsEnabled` to `false`.
->
-> To change the frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
->
-> For more information about these two parameters, see
[here](reference-configuration.md#broker).
+Partitioned topics must be explicitly created. When creating a new partitioned
topic, you need to provide a name and the number of partitions for the topic.
-#### pulsar-admin
+By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data. To disable this
feature, set `brokerDeleteInactiveTopicsEnabled` to `false`. To change the
frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
Review comment:
```suggestion
By default, 60 seconds after creation, topics are considered inactive and
deleted automatically to avoid generating trash data. To disable this feature,
set `brokerDeleteInactiveTopicsEnabled` to `false`. To change the frequency of
checking inactive topics, set `brokerDeleteInactiveTopicsFrequencySeconds` as
required.
```
##########
File path: site2/docs/admin-api-partitioned-topics.md
##########
@@ -1,109 +1,82 @@
---
id: admin-api-partitioned-topics
title: Managing partitioned topics
-sidebar_label: Partitioned topics
+sidebar_label: Topics1
---
-
-You can use Pulsar's [admin API](admin-api-overview.md) to create and manage
partitioned topics.
-
-In all of the instructions and commands below, the topic name structure is:
-
-```shell
-persistent://tenant/namespace/topic
-```
-
-## Partitioned topics resources
+## Manage partitioned topics
+You can use Pulsar [admin API](admin-api-overview.md) to create, update,
delete and check status of partitioned topics.
### Create
-Partitioned topics in Pulsar must be explicitly created. When creating a new
partitioned topic you
-need to provide a name for the topic as well as the desired number of
partitions.
-
-> #### Note
->
-> By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data.
->
-> To disable this feature, set `brokerDeleteInactiveTopicsEnabled` to `false`.
->
-> To change the frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
->
-> For more information about these two parameters, see
[here](reference-configuration.md#broker).
+Partitioned topics must be explicitly created. When creating a new partitioned
topic, you need to provide a name and the number of partitions for the topic.
-#### pulsar-admin
+By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data. To disable this
feature, set `brokerDeleteInactiveTopicsEnabled` to `false`. To change the
frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
-You can create partitioned topics using the
[`create-partitioned-topic`](reference-pulsar-admin.md#create-partitioned-topic)
-command and specifying the topic name as an argument and the number of
partitions using the `-p` or `--partitions` flag.
+For more information about the two parameters, see
[here](reference-configuration.md#broker).
-Here's an example:
+You can create partitioned topics in the following ways.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
+When you create partitioned topics with the
[`create-partitioned-topic`](reference-pulsar-admin.md#create-partitioned-topic)
+command, you need to specify the topic name as an argument and the number of
partitions using the `-p` or `--partitions` flag.
```shell
$ bin/pulsar-admin topics create-partitioned-topic \
persistent://my-tenant/my-namespace/my-topic \
--partitions 4
```
-> #### Note
->
-> If there already exists a non-partitioned topic with the suffix
'-partition-' followed by numeric value like
-> 'xyz-topic-partition-10', then you can not create a partitioned topic with
name 'xyz-topic' as the partitions
-> of the partitioned topic could override the existing non partitioned topic.
You have to delete that non
-> partitioned topic first then create the partitioned topic.
-
-#### REST API
+> **Note**
+> If a non-partitioned topic with the suffix '-partition-' followed by numeric
value like 'xyz-topic-partition-10', then you can not create a partitioned
topic with name 'xyz-topic', because the partitions of the partitioned topic
could override the existing non-partitioned topic. To create such partitioned
topic, you have to delete that non-partitioned topic first.
Review comment:
```suggestion
> If a non-partitioned topic with the suffix '-partition-' followed by a
numeric value like 'xyz-topic-partition-10', you can not create a partitioned
topic with name 'xyz-topic', because the partitions of the partitioned topic
could override the existing non-partitioned topic. To create such partitioned
topic, you have to delete that non-partitioned topic first.
```
##########
File path: site2/docs/admin-api-partitioned-topics.md
##########
@@ -1,109 +1,82 @@
---
id: admin-api-partitioned-topics
title: Managing partitioned topics
-sidebar_label: Partitioned topics
+sidebar_label: Topics1
---
-
-You can use Pulsar's [admin API](admin-api-overview.md) to create and manage
partitioned topics.
-
-In all of the instructions and commands below, the topic name structure is:
-
-```shell
-persistent://tenant/namespace/topic
-```
-
-## Partitioned topics resources
+## Manage partitioned topics
+You can use Pulsar [admin API](admin-api-overview.md) to create, update,
delete and check status of partitioned topics.
### Create
-Partitioned topics in Pulsar must be explicitly created. When creating a new
partitioned topic you
-need to provide a name for the topic as well as the desired number of
partitions.
-
-> #### Note
->
-> By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data.
->
-> To disable this feature, set `brokerDeleteInactiveTopicsEnabled` to `false`.
->
-> To change the frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
->
-> For more information about these two parameters, see
[here](reference-configuration.md#broker).
+Partitioned topics must be explicitly created. When creating a new partitioned
topic, you need to provide a name and the number of partitions for the topic.
-#### pulsar-admin
+By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data. To disable this
feature, set `brokerDeleteInactiveTopicsEnabled` to `false`. To change the
frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
-You can create partitioned topics using the
[`create-partitioned-topic`](reference-pulsar-admin.md#create-partitioned-topic)
-command and specifying the topic name as an argument and the number of
partitions using the `-p` or `--partitions` flag.
+For more information about the two parameters, see
[here](reference-configuration.md#broker).
-Here's an example:
+You can create partitioned topics in the following ways.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
+When you create partitioned topics with the
[`create-partitioned-topic`](reference-pulsar-admin.md#create-partitioned-topic)
+command, you need to specify the topic name as an argument and the number of
partitions using the `-p` or `--partitions` flag.
```shell
$ bin/pulsar-admin topics create-partitioned-topic \
persistent://my-tenant/my-namespace/my-topic \
--partitions 4
```
-> #### Note
->
-> If there already exists a non-partitioned topic with the suffix
'-partition-' followed by numeric value like
-> 'xyz-topic-partition-10', then you can not create a partitioned topic with
name 'xyz-topic' as the partitions
-> of the partitioned topic could override the existing non partitioned topic.
You have to delete that non
-> partitioned topic first then create the partitioned topic.
-
-#### REST API
+> **Note**
+> If a non-partitioned topic with the suffix '-partition-' followed by numeric
value like 'xyz-topic-partition-10', then you can not create a partitioned
topic with name 'xyz-topic', because the partitions of the partitioned topic
could override the existing non-partitioned topic. To create such partitioned
topic, you have to delete that non-partitioned topic first.
-{@inject:
endpoint|PUT|/admin/v2/persistent/:tenant/:namespace/:topic/partitions|operation/createPartitionedTopic}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|PUT|/admin/v2/topics/:tenant/:namespace/:topic/partitions|operation/createPartitionedTopic}
+<!--Java-->
```java
String topicName = "persistent://my-tenant/my-namespace/my-topic";
int numPartitions = 4;
-admin.persistentTopics().createPartitionedTopic(topicName, numPartitions);
+admin.topics().createPartitionedTopic(topicName, numPartitions);
```
-### Create missed partitions
+<!--END_DOCUSAURUS_CODE_TABS-->
-Try to create partitions for partitioned topic. The partitions of partition
topic have to be created,
-can be used by repair partitions when topic auto creation is disabled
-
-#### pulsar-admin
+### Create missed partitions
-You can create missed partitions using the
[`create-missed-partitions`](reference-pulsar-admin.md#create-missed-partitions)
-command and specifying the topic name as an argument.
+When topic auto creation is disabled, and you have a partitioned topic without
any partitions, you can use the
[`create-missed-partitions`](reference-pulsar-admin.md#create-missed-partitions)
command to create partitions for the topic.
Review comment:
when topics cannot be automatically created? or when auto-creation
operation is disabled?
##########
File path: site2/docs/admin-api-partitioned-topics.md
##########
@@ -1,109 +1,82 @@
---
id: admin-api-partitioned-topics
title: Managing partitioned topics
-sidebar_label: Partitioned topics
+sidebar_label: Topics1
---
-
-You can use Pulsar's [admin API](admin-api-overview.md) to create and manage
partitioned topics.
-
-In all of the instructions and commands below, the topic name structure is:
-
-```shell
-persistent://tenant/namespace/topic
-```
-
-## Partitioned topics resources
+## Manage partitioned topics
+You can use Pulsar [admin API](admin-api-overview.md) to create, update,
delete and check status of partitioned topics.
### Create
-Partitioned topics in Pulsar must be explicitly created. When creating a new
partitioned topic you
-need to provide a name for the topic as well as the desired number of
partitions.
-
-> #### Note
->
-> By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data.
->
-> To disable this feature, set `brokerDeleteInactiveTopicsEnabled` to `false`.
->
-> To change the frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
->
-> For more information about these two parameters, see
[here](reference-configuration.md#broker).
+Partitioned topics must be explicitly created. When creating a new partitioned
topic, you need to provide a name and the number of partitions for the topic.
-#### pulsar-admin
+By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data. To disable this
feature, set `brokerDeleteInactiveTopicsEnabled` to `false`. To change the
frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
-You can create partitioned topics using the
[`create-partitioned-topic`](reference-pulsar-admin.md#create-partitioned-topic)
-command and specifying the topic name as an argument and the number of
partitions using the `-p` or `--partitions` flag.
+For more information about the two parameters, see
[here](reference-configuration.md#broker).
-Here's an example:
+You can create partitioned topics in the following ways.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
+When you create partitioned topics with the
[`create-partitioned-topic`](reference-pulsar-admin.md#create-partitioned-topic)
+command, you need to specify the topic name as an argument and the number of
partitions using the `-p` or `--partitions` flag.
```shell
$ bin/pulsar-admin topics create-partitioned-topic \
persistent://my-tenant/my-namespace/my-topic \
--partitions 4
```
-> #### Note
->
-> If there already exists a non-partitioned topic with the suffix
'-partition-' followed by numeric value like
-> 'xyz-topic-partition-10', then you can not create a partitioned topic with
name 'xyz-topic' as the partitions
-> of the partitioned topic could override the existing non partitioned topic.
You have to delete that non
-> partitioned topic first then create the partitioned topic.
-
-#### REST API
+> **Note**
+> If a non-partitioned topic with the suffix '-partition-' followed by numeric
value like 'xyz-topic-partition-10', then you can not create a partitioned
topic with name 'xyz-topic', because the partitions of the partitioned topic
could override the existing non-partitioned topic. To create such partitioned
topic, you have to delete that non-partitioned topic first.
-{@inject:
endpoint|PUT|/admin/v2/persistent/:tenant/:namespace/:topic/partitions|operation/createPartitionedTopic}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|PUT|/admin/v2/topics/:tenant/:namespace/:topic/partitions|operation/createPartitionedTopic}
+<!--Java-->
```java
String topicName = "persistent://my-tenant/my-namespace/my-topic";
int numPartitions = 4;
-admin.persistentTopics().createPartitionedTopic(topicName, numPartitions);
+admin.topics().createPartitionedTopic(topicName, numPartitions);
```
-### Create missed partitions
+<!--END_DOCUSAURUS_CODE_TABS-->
-Try to create partitions for partitioned topic. The partitions of partition
topic have to be created,
-can be used by repair partitions when topic auto creation is disabled
-
-#### pulsar-admin
+### Create missed partitions
-You can create missed partitions using the
[`create-missed-partitions`](reference-pulsar-admin.md#create-missed-partitions)
-command and specifying the topic name as an argument.
+When topic auto creation is disabled, and you have a partitioned topic without
any partitions, you can use the
[`create-missed-partitions`](reference-pulsar-admin.md#create-missed-partitions)
command to create partitions for the topic.
-Here's an example:
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
+You can create missed partitions with the
[`create-missed-partitions`](reference-pulsar-admin.md#create-missed-partitions)
command and specify the topic name as an argument.
```shell
$ bin/pulsar-admin topics create-missed-partitions \
persistent://my-tenant/my-namespace/my-topic \
```
-#### REST API
-
-{@inject:
endpoint|POST|/admin/v2/persistent/:tenant/:namespace/:topic|operation/createMissedPartitions}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|POST|/admin/v2/topics/:tenant/:namespace/:topic|operation/createMissedPartitions}
+<!--Java-->
```java
String topicName = "persistent://my-tenant/my-namespace/my-topic";
-admin.persistentTopics().createMissedPartitions(topicName);
+admin.topics().createMissedPartitions(topicName);
```
+<!--END_DOCUSAURUS_CODE_TABS-->
+
### Get metadata
-Partitioned topics have metadata associated with them that you can fetch as a
JSON object.
-The following metadata fields are currently available:
+Partitioned topics are associated with metadata, you can view it as a JSON
object. The following metadata field is available.
-Field | Meaning
+Field | Description
:-----|:-------
-`partitions` | The number of partitions into which the topic is divided
+`partitions` | The number of partitions into which the topic is divided.
-#### pulsar-admin
-
-You can see the number of partitions in a partitioned topic using the
-[`get-partitioned-topic-metadata`](reference-pulsar-admin.md#get-partitioned-topic-metadata)
-subcommand. Here's an example:
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
+You can view the number of partitions in a partitioned topic with the
[`get-partitioned-topic-metadata`](reference-pulsar-admin.md#get-partitioned-topic-metadata)
subcommand.
Review comment:
```suggestion
You can check the number of partitions in a partitioned topic with the
[`get-partitioned-topic-metadata`](reference-pulsar-admin.md#get-partitioned-topic-metadata)
subcommand.
```
##########
File path: site2/docs/admin-api-non-partitioned-topics.md
##########
@@ -1,159 +1,5 @@
---
id: admin-api-non-partitioned-topics
title: Managing non-partitioned topics
-sidebar_label: Non-Partitioned topics
----
-
-
-You can use Pulsar's [admin API](admin-api-overview.md) to create and manage
non-partitioned topics.
-
-In all of the instructions and commands below, the topic name structure is:
-
-```shell
-persistent://tenant/namespace/topic
-```
-
-## Non-Partitioned topics resources
-
-### Create
-
-Non-partitioned topics in Pulsar must be explicitly created. When creating a
new non-partitioned topic you
-need to provide a name for the topic.
-
-> #### Note
->
-> By default, after 60 seconds of creation, topics are considered inactive and
deleted automatically to prevent from generating trash data.
->
-> To disable this feature, set `brokerDeleteInactiveTopicsEnabled` to `false`.
->
-> To change the frequency of checking inactive topics, set
`brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
->
-> For more information about these two parameters, see
[here](reference-configuration.md#broker).
-
-#### pulsar-admin
-
-You can create non-partitioned topics using the
[`create`](reference-pulsar-admin.md#create-3)
-command and specifying the topic name as an argument.
-Here's an example:
-
-```shell
-$ bin/pulsar-admin topics create \
- persistent://my-tenant/my-namespace/my-topic
-```
-
-> #### Note
->
-> It's only allowed to create non partitioned topic of name contains suffix
'-partition-' followed by numeric value like
-> 'xyz-topic-partition-10', if there's already a partitioned topic with same
name, in this case 'xyz-topic', and has
-> number of partition larger then that numeric value in this case 11(partition
index is start from 0). Else creation of such topic will fail.
-
-#### REST API
-
-{@inject:
endpoint|PUT|/admin/v2/persistent/:tenant/:namespace/:topic|operation/createNonPartitionedTopic}
-
-#### Java
-
-```java
-String topicName = "persistent://my-tenant/my-namespace/my-topic";
-admin.topics().createNonPartitionedTopic(topicName);
-```
-
-### Delete
-
-#### pulsar-admin
-
-Non-partitioned topics can be deleted using the
-[`delete`](reference-pulsar-admin.md#delete-4) command, specifying the topic
by name:
-
-```shell
-$ bin/pulsar-admin topics delete \
- persistent://my-tenant/my-namespace/my-topic
-```
-
-#### REST API
-
-{@inject:
endpoint|DELETE|/admin/v2/persistent/:tenant/:namespace/:topic|operation/deleteTopic}
-
-#### Java
-
-```java
-admin.topics().delete(persistentTopic);
-```
-
-### List
-
-It provides a list of topics existing under a given namespace.
-
-#### pulsar-admin
-
-```shell
-$ pulsar-admin topics list tenant/namespace
-persistent://tenant/namespace/topic1
-persistent://tenant/namespace/topic2
-```
-
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace|operation/getList}
-
-#### Java
-
-```java
-admin.topics().getList(namespace);
-```
-
-### Stats
-
-It shows current statistics of a given topic. Here's an example payload:
-
-The following stats are available:
-
-|Stat|Description|
-|----|-----------|
-|msgRateIn|The sum of all local and replication publishers’ publish rates in
messages per second|
-|msgThroughputIn|Same as msgRateIn but in bytes per second instead of messages
per second|
-|msgRateOut|The sum of all local and replication consumers’ dispatch rates in
messages per second|
-|msgThroughputOut|Same as msgRateOut but in bytes per second instead of
messages per second|
-|averageMsgSize|Average message size, in bytes, from this publisher within the
last interval|
-|storageSize|The sum of the ledgers’ storage size for this topic|
-|publishers|The list of all local publishers into the topic. There can be
anywhere from zero to thousands.|
-|producerId|Internal identifier for this producer on this topic|
-|producerName|Internal identifier for this producer, generated by the client
library|
-|address|IP address and source port for the connection of this producer|
-|connectedSince|Timestamp this producer was created or last reconnected|
-|subscriptions|The list of all local subscriptions to the topic|
-|my-subscription|The name of this subscription (client defined)|
-|msgBacklog|The count of messages in backlog for this subscription|
-|msgBacklogNoDelayed|The count of messages in backlog without delayed messages
for this subscription|
-|type|This subscription type|
-|msgRateExpired|The rate at which messages were discarded instead of
dispatched from this subscription due to TTL|
-|consumers|The list of connected consumers for this subscription|
-|consumerName|Internal identifier for this consumer, generated by the client
library|
-|availablePermits|The number of messages this consumer has space for in the
client library’s listen queue. A value of 0 means the client library’s queue is
full and receive() isn’t being called. A nonzero value means this consumer is
ready to be dispatched messages.|
-|replication|This section gives the stats for cross-colo replication of this
topic|
-|replicationBacklog|The outbound replication backlog in messages|
-|connected|Whether the outbound replicator is connected|
-|replicationDelayInSeconds|How long the oldest message has been waiting to be
sent through the connection, if connected is true|
-|inboundConnection|The IP and port of the broker in the remote cluster’s
publisher connection to this broker|
-|inboundConnectedSince|The TCP connection being used to publish messages to
the remote cluster. If there are no local publishers connected, this connection
is automatically closed after a minute.|
-
-#### pulsar-admin
-
-The stats for the topic and its connected producers and consumers can be
fetched by using the
-[`stats`](reference-pulsar-admin.md#stats) command, specifying the topic by
name:
-
-```shell
-$ pulsar-admin topics stats \
- persistent://test-tenant/namespace/topic \
- --get-precise-backlog
-```
-
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace/:topic/stats|operation/getStats}
-
-#### Java
-
-```java
-admin.topics().getStats(persistentTopic, false /* is precise backlog */);
-```
+sidebar_label: Topics2
Review comment:
I don't think topics 2 is a good sidebar title. Could you please help
refine the title?
##########
File path: site2/docs/admin-api-partitioned-topics.md
##########
@@ -113,210 +86,162 @@ $ pulsar-admin topics get-partitioned-topic-metadata \
}
```
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace/:topic/partitions|operation/getPartitionedMetadata}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|GET|/admin/v2/topics/:tenant/:namespace/:topic/partitions|operation/getPartitionedMetadata}
+<!--Java-->
```java
String topicName = "persistent://my-tenant/my-namespace/my-topic";
-admin.persistentTopics().getPartitionedTopicMetadata(topicName);
+admin.topics().getPartitionedTopicMetadata(topicName);
```
-### Update
+<!--END_DOCUSAURUS_CODE_TABS-->
-You can update the number of partitions on an existing partitioned topic
-*if* the topic is non-global. To update, the new number of partitions must be
greater
-than the existing number.
-
-Decrementing the number of partitions would deleting the topic, which is not
supported in Pulsar.
+### Update
-Already created partitioned producers and consumers will automatically find
the newly created partitions.
+You can update the number of partitions for an existing partitioned topic *if*
the topic is non-global. However, you can only add the partition number.
Decrementing the number of partitions would delete the topic, which is not
supported in Pulsar.
-#### pulsar-admin
+Producers and consumers can find the newly created partitions automatically.
-Partitioned topics can be updated using the
-[`update-partitioned-topic`](reference-pulsar-admin.md#update-partitioned-topic)
command.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
+You can update partitioned topics with the
[`update-partitioned-topic`](reference-pulsar-admin.md#update-partitioned-topic)
command.
```shell
$ pulsar-admin topics update-partitioned-topic \
persistent://my-tenant/my-namespace/my-topic \
--partitions 8
```
-#### REST API
-
-{@inject:
endpoint|POST|/admin/v2/persistent/:tenant/:cluster/:namespace/:destination/partitions|operation/updatePartitionedTopic}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|POST|/admin/v2/topics/:tenant/:cluster/:namespace/:destination/partitions|operation/updatePartitionedTopic}
+<!--Java-->
```java
-admin.persistentTopics().updatePartitionedTopic(persistentTopic,
numPartitions);
+admin.topics().updatePartitionedTopic(topic, numPartitions);
```
-### Delete
+<!--END_DOCUSAURUS_CODE_TABS-->
-#### pulsar-admin
-
-Partitioned topics can be deleted using the
-[`delete-partitioned-topic`](reference-pulsar-admin.md#delete-partitioned-topic)
command, specifying the topic by name:
+### Delete
+You can delete partitioned topics with the
[`delete-partitioned-topic`](reference-pulsar-admin.md#delete-partitioned-topic)
command, REST API and Java.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
```shell
$ bin/pulsar-admin topics delete-partitioned-topic \
persistent://my-tenant/my-namespace/my-topic
```
-#### REST API
-
-{@inject:
endpoint|DELETE|/admin/v2/persistent/:topic/:namespace/:destination/partitions|operation/deletePartitionedTopic}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|DELETE|/admin/v2/topics/:topic/:namespace/:destination/partitions|operation/deletePartitionedTopic}
+<!--Java-->
```java
-admin.persistentTopics().delete(persistentTopic);
+admin.topics().delete(topic);
```
-### List
-
-It provides a list of persistent topics existing under a given namespace.
-
-#### pulsar-admin
+<!--END_DOCUSAURUS_CODE_TABS-->
+### List
+You can get the list of topics under a given namespace in the following ways.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
```shell
$ pulsar-admin topics list tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2
```
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace|operation/getPartitionedTopicList}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|GET|/admin/v2/topics/:tenant/:namespace|operation/getPartitionedTopicList}
+<!--Java-->
```java
-admin.persistentTopics().getList(namespace);
+admin.topics().getList(namespace);
```
+<!--END_DOCUSAURUS_CODE_TABS-->
+
### Stats
-It shows the current statistics of a given partitioned topic. Here is an
example payload:
+You can view the current statistics of a given partitioned topic. The
following is an example. For description of each stats, refer to [get
stats](#get-stats).
```json
{
- "msgRateIn": 4641.528542257553,
- "msgThroughputIn": 44663039.74947473,
- "msgRateOut": 0,
- "msgThroughputOut": 0,
- "averageMsgSize": 1232439.816728665,
- "storageSize": 135532389160,
- "publishers": [
- {
- "msgRateIn": 57.855383881403576,
- "msgThroughputIn": 558994.7078932219,
- "averageMsgSize": 613135,
- "producerId": 0,
- "producerName": null,
- "address": null,
- "connectedSince": null
- }
- ],
- "subscriptions": {
- "my-topic_subscription": {
- "msgRateOut": 0,
- "msgThroughputOut": 0,
- "msgBacklog": 116632,
- "type": null,
- "msgRateExpired": 36.98245516804671,
- "consumers": []
+ "msgRateIn" : 999.992947159793,
+ "msgThroughputIn" : 1070918.4635439808,
+ "msgRateOut" : 0.0,
+ "msgThroughputOut" : 0.0,
+ "bytesInCounter" : 270318763,
+ "msgInCounter" : 252489,
+ "bytesOutCounter" : 0,
+ "msgOutCounter" : 0,
+ "averageMsgSize" : 1070.926056966454,
+ "msgChunkPublished" : false,
+ "storageSize" : 270316646,
+ "backlogSize" : 200921133,
+ "publishers" : [ {
+ "msgRateIn" : 999.992947159793,
+ "msgThroughputIn" : 1070918.4635439808,
+ "averageMsgSize" : 1070.3333333333333,
+ "chunkedMessageRate" : 0.0,
+ "producerId" : 0
+ } ],
+ "subscriptions" : {
+ "test" : {
+ "msgRateOut" : 0.0,
+ "msgThroughputOut" : 0.0,
+ "bytesOutCounter" : 0,
+ "msgOutCounter" : 0,
+ "msgRateRedeliver" : 0.0,
+ "chuckedMessageRate" : 0,
+ "msgBacklog" : 144318,
+ "msgBacklogNoDelayed" : 144318,
+ "blockedSubscriptionOnUnackedMsgs" : false,
+ "msgDelayed" : 0,
+ "unackedMessages" : 0,
+ "msgRateExpired" : 0.0,
+ "lastExpireTimestamp" : 0,
+ "lastConsumedFlowTimestamp" : 0,
+ "lastConsumedTimestamp" : 0,
+ "lastAckedTimestamp" : 0,
+ "consumers" : [ ],
+ "isDurable" : true,
+ "isReplicated" : false
}
},
- "replication": {}
+ "replication" : { },
+ "metadata" : {
+ "partitions" : 3
+ },
+ "partitions" : { }
}
```
-The following stats are available:
-
-|Stat|Description|
-|----|-----------|
-|msgRateIn|The sum of all local and replication publishers’ publish rates in
messages per second|
-|msgThroughputIn|Same as msgRateIn but in bytes per second instead of messages
per second|
-|msgRateOut|The sum of all local and replication consumers’ dispatch rates in
messages per second|
-|msgThroughputOut|Same as msgRateOut but in bytes per second instead of
messages per second|
-|averageMsgSize|Average message size, in bytes, from this publisher within the
last interval|
-|storageSize|The sum of the ledgers’ storage size for this topic|
-|publishers|The list of all local publishers into the topic. There can be
anywhere from zero to thousands.|
-|producerId|Internal identifier for this producer on this topic|
-|producerName|Internal identifier for this producer, generated by the client
library|
-|address|IP address and source port for the connection of this producer|
-|connectedSince|Timestamp this producer was created or last reconnected|
-|subscriptions|The list of all local subscriptions to the topic|
-|my-subscription|The name of this subscription (client defined)|
-|msgBacklog|The count of messages in backlog for this subscription|
-|msgBacklogNoDelayed|The count of messages in backlog without delayed messages
for this subscription|
-|type|This subscription type|
-|msgRateExpired|The rate at which messages were discarded instead of
dispatched from this subscription due to TTL|
-|consumers|The list of connected consumers for this subscription|
-|consumerName|Internal identifier for this consumer, generated by the client
library|
-|availablePermits|The number of messages this consumer has space for in the
client library’s listen queue. A value of 0 means the client library’s queue is
full and receive() isn’t being called. A nonzero value means this consumer is
ready to be dispatched messages.|
-|replication|This section gives the stats for cross-colo replication of this
topic|
-|replicationBacklog|The outbound replication backlog in messages|
-|connected|Whether the outbound replicator is connected|
-|replicationDelayInSeconds|How long the oldest message has been waiting to be
sent through the connection, if connected is true|
-|inboundConnection|The IP and port of the broker in the remote cluster’s
publisher connection to this broker|
-|inboundConnectedSince|The TCP connection being used to publish messages to
the remote cluster. If there are no local publishers connected, this connection
is automatically closed after a minute.|
-
-#### pulsar-admin
-
-The stats for the partitioned topic and its connected producers and consumers
can be fetched by using the
-[`partitioned-stats`](reference-pulsar-admin.md#partitioned-stats) command,
specifying the topic by name:
+You can view the current statistics of a given partitioned topic and its
connected producers and consumers in the following ways.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
```shell
$ pulsar-admin topics partitioned-stats \
persistent://test-tenant/namespace/topic \
--per-partition
```
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace/:topic/partitioned-stats|operation/getPartitionedStats}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|GET|/admin/v2/topics/:tenant/:namespace/:topic/partitioned-stats|operation/getPartitionedStats}
+<!--Java-->
```java
-admin.topics().getPartitionedStats(persistentTopic, true /* per partition */,
false /* is precise backlog */);
+admin.topics().getPartitionedStats(topic, true /* per partition */, false /*
is precise backlog */);
```
-### Internal stats
+<!--END_DOCUSAURUS_CODE_TABS-->
-It shows detailed statistics of a topic.
-
-|Stat|Description|
-|----|-----------|
-|entriesAddedCounter|Messages published since this broker loaded this topic|
-|numberOfEntries|Total number of messages being tracked|
-|totalSize|Total storage size in bytes of all messages|
-|currentLedgerEntries|Count of messages written to the ledger currently open
for writing|
-|currentLedgerSize|Size in bytes of messages written to ledger currently open
for writing|
-|lastLedgerCreatedTimestamp|Time when last ledger was created|
-|lastLedgerCreationFailureTimestamp|time when last ledger was failed|
-|waitingCursorsCount|How many cursors are caught up and waiting for a new
message to be published|
-|pendingAddEntriesCount|How many messages have (asynchronous) write requests
we are waiting on completion|
-|lastConfirmedEntry|The ledgerid:entryid of the last message successfully
written. If the entryid is -1, then the ledger has been opened or is currently
being opened but has no entries written yet.|
-|state|The state of the cursor ledger. Open means we have a cursor ledger for
saving updates of the markDeletePosition.|
-|ledgers|The ordered list of all ledgers for this topic holding its messages|
-|cursors|The list of all cursors on this topic. There will be one for every
subscription you saw in the topic stats.|
-|markDeletePosition|The ack position: the last message the subscriber
acknowledged receiving|
-|readPosition|The latest position of subscriber for reading message|
-|waitingReadOp|This is true when the subscription has read the latest message
published to the topic and is waiting on new messages to be published.|
-|pendingReadOps|The counter for how many outstanding read requests to the
BookKeepers we have in progress|
-|messagesConsumedCounter|Number of messages this cursor has acked since this
broker loaded this topic|
-|cursorLedger|The ledger being used to persistently store the current
markDeletePosition|
-|cursorLedgerLastEntry|The last entryid used to persistently store the current
markDeletePosition|
-|individuallyDeletedMessages|If Acks are being done out of order, shows the
ranges of messages Acked between the markDeletePosition and the read-position|
-|lastLedgerSwitchTimestamp|The last time the cursor ledger was rolled over|
+### Internal stats
+You can view the detailed statistics of a topic. The following is an example.
For description of each stats, refer to [get internal
stats](#get-internal-stats).
Review comment:
```suggestion
You can check the detailed statistics of a topic. The following is an
example. For description of each stats, refer to [get internal
stats](#get-internal-stats).
```
same comments for the following, please check through the whole doc updates.
##########
File path: site2/docs/admin-api-partitioned-topics.md
##########
@@ -113,210 +86,162 @@ $ pulsar-admin topics get-partitioned-topic-metadata \
}
```
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace/:topic/partitions|operation/getPartitionedMetadata}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|GET|/admin/v2/topics/:tenant/:namespace/:topic/partitions|operation/getPartitionedMetadata}
+<!--Java-->
```java
String topicName = "persistent://my-tenant/my-namespace/my-topic";
-admin.persistentTopics().getPartitionedTopicMetadata(topicName);
+admin.topics().getPartitionedTopicMetadata(topicName);
```
-### Update
+<!--END_DOCUSAURUS_CODE_TABS-->
-You can update the number of partitions on an existing partitioned topic
-*if* the topic is non-global. To update, the new number of partitions must be
greater
-than the existing number.
-
-Decrementing the number of partitions would deleting the topic, which is not
supported in Pulsar.
+### Update
-Already created partitioned producers and consumers will automatically find
the newly created partitions.
+You can update the number of partitions for an existing partitioned topic *if*
the topic is non-global. However, you can only add the partition number.
Decrementing the number of partitions would delete the topic, which is not
supported in Pulsar.
-#### pulsar-admin
+Producers and consumers can find the newly created partitions automatically.
-Partitioned topics can be updated using the
-[`update-partitioned-topic`](reference-pulsar-admin.md#update-partitioned-topic)
command.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
+You can update partitioned topics with the
[`update-partitioned-topic`](reference-pulsar-admin.md#update-partitioned-topic)
command.
```shell
$ pulsar-admin topics update-partitioned-topic \
persistent://my-tenant/my-namespace/my-topic \
--partitions 8
```
-#### REST API
-
-{@inject:
endpoint|POST|/admin/v2/persistent/:tenant/:cluster/:namespace/:destination/partitions|operation/updatePartitionedTopic}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|POST|/admin/v2/topics/:tenant/:cluster/:namespace/:destination/partitions|operation/updatePartitionedTopic}
+<!--Java-->
```java
-admin.persistentTopics().updatePartitionedTopic(persistentTopic,
numPartitions);
+admin.topics().updatePartitionedTopic(topic, numPartitions);
```
-### Delete
+<!--END_DOCUSAURUS_CODE_TABS-->
-#### pulsar-admin
-
-Partitioned topics can be deleted using the
-[`delete-partitioned-topic`](reference-pulsar-admin.md#delete-partitioned-topic)
command, specifying the topic by name:
+### Delete
+You can delete partitioned topics with the
[`delete-partitioned-topic`](reference-pulsar-admin.md#delete-partitioned-topic)
command, REST API and Java.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
```shell
$ bin/pulsar-admin topics delete-partitioned-topic \
persistent://my-tenant/my-namespace/my-topic
```
-#### REST API
-
-{@inject:
endpoint|DELETE|/admin/v2/persistent/:topic/:namespace/:destination/partitions|operation/deletePartitionedTopic}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|DELETE|/admin/v2/topics/:topic/:namespace/:destination/partitions|operation/deletePartitionedTopic}
+<!--Java-->
```java
-admin.persistentTopics().delete(persistentTopic);
+admin.topics().delete(topic);
```
-### List
-
-It provides a list of persistent topics existing under a given namespace.
-
-#### pulsar-admin
+<!--END_DOCUSAURUS_CODE_TABS-->
+### List
+You can get the list of topics under a given namespace in the following ways.
+<!--DOCUSAURUS_CODE_TABS-->
+<!--pulsar-admin-->
```shell
$ pulsar-admin topics list tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2
```
-#### REST API
-
-{@inject:
endpoint|GET|/admin/v2/persistent/:tenant/:namespace|operation/getPartitionedTopicList}
-
-#### Java
+<!--REST API-->
+{@inject:
endpoint|GET|/admin/v2/topics/:tenant/:namespace|operation/getPartitionedTopicList}
+<!--Java-->
```java
-admin.persistentTopics().getList(namespace);
+admin.topics().getList(namespace);
```
+<!--END_DOCUSAURUS_CODE_TABS-->
+
### Stats
-It shows the current statistics of a given partitioned topic. Here is an
example payload:
+You can view the current statistics of a given partitioned topic. The
following is an example. For description of each stats, refer to [get
stats](#get-stats).
Review comment:
```suggestion
You can check the current statistics of a given partitioned topic. The
following is an example. For description of each stats, refer to [get
stats](#get-stats).
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]