This is an automated email from the ASF dual-hosted git repository. sijie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push: new 7115014 [Issue 5142][docs] Remove non-partitioned topic info from partitioned topic docs (#5143) 7115014 is described below commit 711501409223a0ba13e9b4e1387556533c80a623 Author: Raman Gupta <rocketra...@gmail.com> AuthorDate: Mon Sep 16 06:55:00 2019 -0400 [Issue 5142][docs] Remove non-partitioned topic info from partitioned topic docs (#5143) Fixes #5142 ### Motivation Docs are confusing. ### Modifications Edited out the incorrect section in the docs. Moved section into its documentation page, with additional related docs. --- site2/docs/admin-api-non-partitioned-topics.md | 97 ++++++++++++++++++++++++++ site2/docs/admin-api-partitioned-topics.md | 37 ---------- site2/website/sidebars.json | 1 + 3 files changed, 98 insertions(+), 37 deletions(-) diff --git a/site2/docs/admin-api-non-partitioned-topics.md b/site2/docs/admin-api-non-partitioned-topics.md new file mode 100644 index 0000000..a59a68a --- /dev/null +++ b/site2/docs/admin-api-non-partitioned-topics.md @@ -0,0 +1,97 @@ +--- +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 +``` + +#### 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); +``` diff --git a/site2/docs/admin-api-partitioned-topics.md b/site2/docs/admin-api-partitioned-topics.md index bab4eb4..ab3d9cd 100644 --- a/site2/docs/admin-api-partitioned-topics.md +++ b/site2/docs/admin-api-partitioned-topics.md @@ -54,43 +54,6 @@ int numPartitions = 4; admin.persistentTopics().createPartitionedTopic(topicName, numPartitions); ``` -## Nonpartitioned topics resources - -### Create - -Nonpartitioned topics in Pulsar must be explicitly created if allowAutoTopicCreation or createIfMissing is disabled. -When creating a non-partitioned topic, you need to provide a topic name. - -> #### 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) -command and specifying the topic name as an argument. This is an example command: - -```shell -$ bin/pulsar-admin topics create persistent://my-tenant/my-namespace/my-topic -``` - -#### 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); -``` - ### Get metadata Partitioned topics have metadata associated with them that you can fetch as a JSON object. diff --git a/site2/website/sidebars.json b/site2/website/sidebars.json index 120724c..05e60a6 100644 --- a/site2/website/sidebars.json +++ b/site2/website/sidebars.json @@ -98,6 +98,7 @@ "admin-api-persistent-topics", "admin-api-non-persistent-topics", "admin-api-partitioned-topics", + "admin-api-non-partitioned-topics", "admin-api-schemas" ], "Adaptors": [