Skip to content

Commit

Permalink
docs: fix codetabs
Browse files Browse the repository at this point in the history
  • Loading branch information
317brian committed Nov 20, 2023
1 parent 7cde406 commit ab1f89d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions docs/development/extensions-core/kafka-supervisor-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ sidebar_label: "Apache Kafka operations"
description: "Reference topic for running and maintaining Apache Kafka supervisors"
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -149,17 +152,19 @@ twice, resulting in missing or duplicate data.
The following example shows how to reset offsets for a kafka supervisor with the name `social_media`. Let's say the supervisor is reading
from two kafka topics `ads_media_foo` and `ads_media_bar` and has the stored offsets: `{"ads_media_foo:0": 0, "ads_media_foo:1": 10, "ads_media_bar:0": 20, "ads_media_bar:1": 40}`.

<!--DOCUSAURUS_CODE_TABS-->
<Tabs>

<TabItem value="1" label="cURL">

<!--cURL-->

```shell
curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/resetOffsets"
--header 'Content-Type: application/json'
--data-raw '{"type":"kafka","partitions":{"type":"end","stream":"ads_media_foo|ads_media_bar","partitionOffsetMap":{"ads_media_foo:0": 3, "ads_media_bar:1": 12}}}'
```

<!--HTTP-->
</TabItem>
<TabItem value="2" label="HTTP">

```HTTP
POST /druid/indexer/v1/supervisor/social_media/resetOffsets HTTP/1.1
Expand All @@ -178,10 +183,12 @@ Content-Type: application/json
}
}
```

The above operation will reset offsets for `ads_media_foo` partition 0 and `ads_media_bar` partition 1 to offsets 3 and 12 respectively. After a successful reset,
when the supervisor's tasks restart, they will resume reading from `{"ads_media_foo:0": 3, "ads_media_foo:1": 10, "ads_media_bar:0": 20, "ads_media_bar:1": 12}`.

<!--END_DOCUSAURUS_CODE_TABS-->
</TabItem>
</Tabs>

#### Sample response

Expand Down

0 comments on commit ab1f89d

Please sign in to comment.