Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions site2/docs/admin-api-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,30 @@ admin.topics().getLastMessage(topic);

<!--END_DOCUSAURUS_CODE_TABS-->

### Get backlog size

You can get the backlog size of a single partition topic or a non-partitioned topic with a given message ID (in bytes).

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->
```shell
$ pulsar-admin topics get-backlog-size \
-m 1:1 \
persistent://test-tenant/ns1/tp1-partition-0 \
```

<!--REST API-->
{@inject: endpoint|PUT|/admin/v2/:schema/:tenant/:namespace/:topic/backlogSize|operation/getBacklogSizeByMessageId?version=[[pulsar:version_number]]}

<!--Java-->
```java
String topic = "persistent://my-tenant/my-namespace/my-topic";
MessageId messageId = MessageId.earliest;
admin.topics().getBacklogSizeByMessageId(topic, messageId);
```

<!--END_DOCUSAURUS_CODE_TABS-->

## Manage non-partitioned topics
You can use Pulsar [admin API](admin-api-overview.md) to create, delete and check status of non-partitioned topics.

Expand Down Expand Up @@ -1210,11 +1234,11 @@ admin.topics().delete(topic);
<!--END_DOCUSAURUS_CODE_TABS-->

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->
```shell
$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2
```
Expand All @@ -1224,7 +1248,7 @@ persistent://tenant/namespace/topic2

<!--Java-->
```java
admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);
Comment thread
BewareMyPower marked this conversation as resolved.
```

<!--END_DOCUSAURUS_CODE_TABS-->
Expand Down Expand Up @@ -1368,29 +1392,6 @@ admin.topics().getInternalStats(topic);

<!--END_DOCUSAURUS_CODE_TABS-->

### Get backlog size

You can get backlog size of a single topic partition or a nonpartitioned topic given a message ID (in bytes).

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->
```shell
$ pulsar-admin topics get-backlog-size \
-m 1:1 \
persistent://test-tenant/ns1/tp1-partition-0 \
```

<!--REST API-->
{@inject: endpoint|PUT|/admin/v2/:schema/:tenant/:namespace/:topic/backlogSize|operation/getBacklogSizeByMessageId?version=[[pulsar:version_number]]}

<!--Java-->
```java
String topic = "persistent://my-tenant/my-namespace/my-topic";
MessageId messageId = MessageId.earliest;
admin.topics().getBacklogSizeByMessageId(topic, messageId);
```

<!--END_DOCUSAURUS_CODE_TABS-->

## Publish to partitioned topics

Expand Down
79 changes: 40 additions & 39 deletions site2/website-next/docs/admin-api-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,43 @@ admin.topics().getLastMessage(topic);

</Tabs>

### Get backlog size

You can get the backlog size of a single partition topic or a non-partitioned topic with a given message ID (in bytes).

<Tabs
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">

```shell

$ pulsar-admin topics get-backlog-size \
-m 1:1 \
persistent://test-tenant/ns1/tp1-partition-0 \

```

</TabItem>
<TabItem value="REST API">

{@inject: endpoint|PUT|/admin/v2/:schema/:tenant/:namespace/:topic/backlogSize|operation/getBacklogSizeByMessageId?version=@pulsar:version_number@}

</TabItem>
<TabItem value="Java">

```java

String topic = "persistent://my-tenant/my-namespace/my-topic";
MessageId messageId = MessageId.earliest;
admin.topics().getBacklogSizeByMessageId(topic, messageId);

```

</TabItem>

</Tabs>

## Manage non-partitioned topics
You can use Pulsar [admin API](admin-api-overview) to create, delete and check status of non-partitioned topics.

Expand Down Expand Up @@ -1568,15 +1605,15 @@ admin.topics().delete(topic);
</Tabs>

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<Tabs
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">

```shell

$ pulsar-admin topics list tenant/namespace
$ pulsar-admin list-partitioned-topics list tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2

Expand All @@ -1592,7 +1629,7 @@ persistent://tenant/namespace/topic2

```java

admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);

```

Expand Down Expand Up @@ -1769,42 +1806,6 @@ admin.topics().getInternalStats(topic);

</Tabs>

### Get backlog size

You can get backlog size of a single topic partition or a nonpartitioned topic given a message ID (in bytes).

<Tabs
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">

```shell

$ pulsar-admin topics get-backlog-size \
-m 1:1 \
persistent://test-tenant/ns1/tp1-partition-0 \

```

</TabItem>
<TabItem value="REST API">

{@inject: endpoint|PUT|/admin/v2/:schema/:tenant/:namespace/:topic/backlogSize|operation/getBacklogSizeByMessageId?version=@pulsar:version_number@}

</TabItem>
<TabItem value="Java">

```java

String topic = "persistent://my-tenant/my-namespace/my-topic";
MessageId messageId = MessageId.earliest;
admin.topics().getBacklogSizeByMessageId(topic, messageId);

```

</TabItem>

</Tabs>

## Publish to partitioned topics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,7 @@ admin.topics().delete(topic);
</Tabs>

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<Tabs
defaultValue="pulsar-admin"
values={[
Expand All @@ -1719,7 +1719,7 @@ You can get the list of topics under a given namespace in the following ways.

```shell

$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2

Expand All @@ -1735,7 +1735,7 @@ persistent://tenant/namespace/topic2

```java

admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,15 +1310,15 @@ admin.topics().delete(topic);
</Tabs>

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<Tabs
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">

```shell

$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2

Expand All @@ -1334,7 +1334,7 @@ persistent://tenant/namespace/topic2

```java

admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,15 +1310,15 @@ admin.topics().delete(topic);
</Tabs>

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<Tabs
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">

```shell

$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2

Expand All @@ -1334,7 +1334,7 @@ persistent://tenant/namespace/topic2

```java

admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,15 +1310,15 @@ admin.topics().delete(topic);
</Tabs>

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<Tabs
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">

```shell

$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2

Expand All @@ -1334,7 +1334,7 @@ persistent://tenant/namespace/topic2

```java

admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1340,15 +1340,15 @@ admin.topics().delete(topic);
</Tabs>

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<Tabs
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">

```shell

$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2

Expand All @@ -1364,7 +1364,7 @@ persistent://tenant/namespace/topic2

```java

admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,11 +943,11 @@ admin.topics().delete(topic);
<!--END_DOCUSAURUS_CODE_TABS-->

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->
```shell
$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2
```
Expand All @@ -957,7 +957,7 @@ persistent://tenant/namespace/topic2

<!--Java-->
```java
admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);
```

<!--END_DOCUSAURUS_CODE_TABS-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,11 +943,11 @@ admin.topics().delete(topic);
<!--END_DOCUSAURUS_CODE_TABS-->

### List
You can get the list of topics under a given namespace in the following ways.
You can get the list of partitioned topics under a given namespace in the following ways.
<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->
```shell
$ pulsar-admin topics list tenant/namespace
$ pulsar-admin topics list-partitioned-topics tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2
```
Expand All @@ -957,7 +957,7 @@ persistent://tenant/namespace/topic2

<!--Java-->
```java
admin.topics().getList(namespace);
admin.topics().getPartitionedTopicList(namespace);
```

<!--END_DOCUSAURUS_CODE_TABS-->
Expand Down
Loading