mirror of https://github.com/apache/druid.git
docs: fix code tabs (#15403)
This commit is contained in:
parent
5ccd79d62b
commit
dfc52994d4
|
@ -3,8 +3,12 @@ id: automatic-compaction-api
|
|||
title: Automatic compaction API
|
||||
sidebar_label: Automatic compaction
|
||||
---
|
||||
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
|
||||
~ distributed with this work for additional information
|
||||
|
@ -43,13 +47,15 @@ Note that this endpoint returns an HTTP `200 OK` message code even if the dataso
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="1" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully submitted auto compaction configuration*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
#### Sample request
|
||||
|
@ -64,9 +70,10 @@ In this example:
|
|||
* `type` is set to `index_parallel`, meaning that parallel indexing is used.
|
||||
* `segmentGranularity` is set to `DAY`, meaning that each compacted segment is a day of data.
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="2" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction"\
|
||||
|
@ -86,7 +93,9 @@ curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction"\
|
|||
}'
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="3" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
POST /druid/coordinator/v1/config/compaction HTTP/1.1
|
||||
|
@ -109,7 +118,8 @@ Content-Length: 281
|
|||
}
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
@ -126,39 +136,47 @@ Removes the automatic compaction configuration for a datasource. This updates th
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="4" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully deleted automatic compaction configuration*
|
||||
|
||||
<!--404 NOT FOUND-->
|
||||
</TabItem>
|
||||
<TabItem value="5" label="404 NOT FOUND">
|
||||
|
||||
|
||||
*Datasource does not have automatic compaction or invalid datasource name*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
|
||||
#### Sample request
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="6" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl --request DELETE "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/wikipedia_hour"
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="7" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
DELETE /druid/coordinator/v1/config/compaction/wikipedia_hour HTTP/1.1
|
||||
Host: http://ROUTER_IP:ROUTER_PORT
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
@ -189,38 +207,46 @@ To limit the maximum number of compaction tasks, use the optional query paramete
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="8" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully updated compaction configuration*
|
||||
|
||||
<!--404 NOT FOUND-->
|
||||
</TabItem>
|
||||
<TabItem value="9" label="404 NOT FOUND">
|
||||
|
||||
|
||||
*Invalid `max` value*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
#### Sample request
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="10" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/taskslots?ratio=0.2&max=250000"
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="11" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
POST /druid/coordinator/v1/config/compaction/taskslots?ratio=0.2&max=250000 HTTP/1.1
|
||||
Host: http://ROUTER_IP:ROUTER_PORT
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
@ -240,34 +266,40 @@ You can use this endpoint to retrieve `compactionTaskSlotRatio` and `maxCompacti
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="12" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully retrieved automatic compaction configurations*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
#### Sample request
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="13" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction"
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="14" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
GET /druid/coordinator/v1/config/compaction HTTP/1.1
|
||||
Host: http://ROUTER_IP:ROUTER_PORT
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
@ -383,17 +415,21 @@ Retrieves the automatic compaction configuration for a datasource.
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="15" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully retrieved configuration for datasource*
|
||||
|
||||
<!--404 NOT FOUND-->
|
||||
</TabItem>
|
||||
<TabItem value="16" label="404 NOT FOUND">
|
||||
|
||||
|
||||
*Invalid datasource or datasource does not have automatic compaction enabled*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
|
@ -401,22 +437,26 @@ Retrieves the automatic compaction configuration for a datasource.
|
|||
|
||||
The following example retrieves the automatic compaction configuration for datasource `wikipedia_hour`.
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="17" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/wikipedia_hour"
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="18" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
GET /druid/coordinator/v1/config/compaction/wikipedia_hour HTTP/1.1
|
||||
Host: http://ROUTER_IP:ROUTER_PORT
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
@ -495,38 +535,46 @@ The response contains a list of objects with the following keys:
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="19" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully retrieved configuration history*
|
||||
|
||||
<!--400 BAD REQUEST-->
|
||||
</TabItem>
|
||||
<TabItem value="20" label="400 BAD REQUEST">
|
||||
|
||||
|
||||
*Invalid `count` value*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
#### Sample request
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="21" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/wikipedia_hour/history"
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="22" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
GET /druid/coordinator/v1/config/compaction/wikipedia_hour/history HTTP/1.1
|
||||
Host: http://ROUTER_IP:ROUTER_PORT
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
@ -644,17 +692,21 @@ Returns the total size of segments awaiting compaction for a given datasource. R
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="23" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully retrieved segment size awaiting compaction*
|
||||
|
||||
<!--404 NOT FOUND-->
|
||||
</TabItem>
|
||||
<TabItem value="24" label="404 NOT FOUND">
|
||||
|
||||
|
||||
*Unknown datasource name or datasource does not have automatic compaction enabled*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
|
@ -662,22 +714,26 @@ Returns the total size of segments awaiting compaction for a given datasource. R
|
|||
|
||||
The following example retrieves the remaining segments to be compacted for datasource `wikipedia_hour`.
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="25" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/compaction/progress?dataSource=wikipedia_hour"
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="26" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
GET /druid/coordinator/v1/compaction/progress?dataSource=wikipedia_hour HTTP/1.1
|
||||
Host: http://ROUTER_IP:ROUTER_PORT
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
@ -720,33 +776,39 @@ The `latestStatus` object has the following properties:
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="27" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully retrieved `latestStatus` object*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
#### Sample request
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="28" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/compaction/status"
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="29" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
GET /druid/coordinator/v1/compaction/status HTTP/1.1
|
||||
Host: http://ROUTER_IP:ROUTER_PORT
|
||||
```
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
|
|
@ -6,9 +6,7 @@ sidebar_label: 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
|
||||
~ distributed with this work for additional information
|
||||
|
@ -3144,17 +3142,21 @@ Use this endpoint to selectively reset offsets for partitions without resetting
|
|||
|
||||
#### Responses
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="1" label="200 SUCCESS">
|
||||
|
||||
<!--200 SUCCESS-->
|
||||
|
||||
*Successfully reset offsets*
|
||||
|
||||
<!--404 NOT FOUND-->
|
||||
</TabItem>
|
||||
<TabItem value="2" label="404 NOT FOUND">
|
||||
|
||||
|
||||
*Invalid supervisor ID*
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
#### Reset Offsets Metadata
|
||||
|
@ -3181,9 +3183,10 @@ The following table defines the fields within the `partitions` object in the res
|
|||
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 a kafka topic `ads_media_stream` and has the stored offsets: `{"0": 0, "1": 10, "2": 20, "3": 40}`.
|
||||
|
||||
<!--DOCUSAURUS_CODE_TABS-->
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="3" label="cURL">
|
||||
|
||||
<!--cURL-->
|
||||
|
||||
```shell
|
||||
curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/resetOffsets"
|
||||
|
@ -3191,7 +3194,9 @@ curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/so
|
|||
--data-raw '{"type":"kafka","partitions":{"type":"end","stream":"ads_media_stream","partitionOffsetMap":{"0":100, "2": 650}}}'
|
||||
```
|
||||
|
||||
<!--HTTP-->
|
||||
</TabItem>
|
||||
<TabItem value="4" label="HTTP">
|
||||
|
||||
|
||||
```HTTP
|
||||
POST /druid/indexer/v1/supervisor/social_media/resetOffsets HTTP/1.1
|
||||
|
@ -3214,7 +3219,8 @@ Content-Type: application/json
|
|||
The above operation will reset offsets only for partitions 0 and 2 to 100 and 650 respectively. After a successful reset,
|
||||
when the supervisor's tasks restart, they will resume reading from `{"0": 100, "1": 10, "2": 650, "3": 40}`.
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
#### Sample response
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -149,9 +152,10 @@ 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"
|
||||
|
@ -159,7 +163,8 @@ curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/so
|
|||
--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
|
||||
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue