From 804e0754cd8d28f672afcc78ce28bf089fe70ce3 Mon Sep 17 00:00:00 2001
From: demo-kratia <56242907+demo-kratia@users.noreply.github.com>
Date: Sat, 12 Aug 2023 01:01:33 -0700
Subject: [PATCH 1/7] wip
---
.../dynamic-configuration-api.md | 236 +++++++++++++++++-
1 file changed, 229 insertions(+), 7 deletions(-)
diff --git a/docs/api-reference/dynamic-configuration-api.md b/docs/api-reference/dynamic-configuration-api.md
index 551c05300b8d..38b44b9f7bbf 100644
--- a/docs/api-reference/dynamic-configuration-api.md
+++ b/docs/api-reference/dynamic-configuration-api.md
@@ -25,6 +25,8 @@ sidebar_label: Dynamic configuration
This document describes the API endpoints to retrieve and manage the dynamic configurations for the [Coordinator](../configuration/index.html#overlord-dynamic-configuration) and [Overlord](../configuration/index.html#dynamic-configuration) in Apache Druid.
+In this document, `http://SERVICE_IP:SERVICE_PORT` is a placeholder for the server address of deployment and the service port. For example, on the quickstart configuration, replace `http://ROUTER_IP:ROUTER_PORT` with `http://localhost:8888`.
+
## Coordinator dynamic configuration
See [Coordinator Dynamic Configuration](../configuration/index.md#dynamic-configuration) for details.
@@ -32,19 +34,239 @@ See [Coordinator Dynamic Configuration](../configuration/index.md#dynamic-config
Note that all _interval_ URL parameters are ISO 8601 strings delimited by a `_` instead of a `/`
as in `2016-06-27_2016-06-28`.
-`GET /druid/coordinator/v1/config`
+### Get coordinator dynamic configuration
-Retrieves current coordinator dynamic configuration.
+Retrieves current Coordinator dynamic configuration. Returns a JSON object with the dynamic configuration properties and values. For information on the response properties, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
-`GET /druid/coordinator/v1/config/history?interval={interval}&count={count}`
+#### URL
-Retrieves history of changes to overlord dynamic configuration. Accepts `interval` and `count` query string parameters
-to filter by interval and limit the number of results respectively.
+GET
/druid/coordinator/v1/config
+
+#### Responses
+
+
+
+
+
+*Successfully retrieved dynamic configuration*
+
+
+
+---
+
+#### Sample request
+
+
+
+
+
+```shell
+curl 'http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config'
+```
+
+
+
+```HTTP
+GET /druid/coordinator/v1/config HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+```
+
+
+
+#### Sample response
+
+
+ Click to show sample response
+
+```json
+{
+ "millisToWaitBeforeDeleting": 900000,
+ "mergeBytesLimit": 524288000,
+ "mergeSegmentsLimit": 100,
+ "maxSegmentsToMove": 5,
+ "percentOfSegmentsToConsiderPerMove": 100.0,
+ "useBatchedSegmentSampler": true,
+ "replicantLifetime": 15,
+ "replicationThrottleLimit": 10,
+ "balancerComputeThreads": 1,
+ "emitBalancingStats": false,
+ "killDataSourceWhitelist": [],
+ "killPendingSegmentsSkipList": [],
+ "maxSegmentsInNodeLoadingQueue": 100,
+ "decommissioningNodes": [],
+ "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
+ "pauseCoordination": false,
+ "replicateAfterLoadTimeout": false,
+ "maxNonPrimaryReplicantsToLoad": 2147483647,
+ "useRoundRobinSegmentAssignment": true
+}
+```
+
+
+### Get Coordinator dynamic configuration history
+
+Retrieves the history of changes to Coordinator dynamic configuration over an interval of time. Returns an empty array if there is no history records available.
+
+#### URL
+
+GET
/druid/coordinator/v1/config/history
+
+#### Query parameters
+
+* `interval` (optional)
+ * Type: ISO 8601
+ * Limits the number of results to the specified time interval. Delimit with `/`. For example, `2023-07-13/2023-07-19`.
+
+* `count` (optional)
+ * Type: Int
+ * Limits the number of results to the last `n` entries.
+
+#### Responses
+
+
+
+
+
+*Successfully retrieved history*
+
+
+
+
+---
+
+#### Sample request
+
+The following example retrieves the dynamic configuration history between `2022-07-13` and `2024-07-19`. The response is limited to 10 entries.
+
+
+
+
+
+```shell
+curl 'http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/history?interval=2022-07-13%2F2024-07-19&count=10'
+```
+
+
+
+```HTTP
+GET /druid/coordinator/v1/config/history?interval=2022-07-13/2024-07-19&count=10 HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+```
+
+
+
+#### Sample response
+
+
+ Click to show sample response
+
+```json
+[
+ {
+ "key": "coordinator.config",
+ "type": "coordinator.config",
+ "auditInfo": {
+ "author": "console",
+ "comment": "testing config change",
+ "ip": "127.0.0.1"
+ },
+ "payload": "{\"millisToWaitBeforeDeleting\":900000,\"mergeBytesLimit\":524288000,\"mergeSegmentsLimit\":100,\"maxSegmentsToMove\":5,\"percentOfSegmentsToConsiderPerMove\":100.0,\"useBatchedSegmentSampler\":true,\"replicantLifetime\":15,\"replicationThrottleLimit\":10,\"balancerComputeThreads\":1,\"emitBalancingStats\":false,\"killDataSourceWhitelist\":[],\"killPendingSegmentsSkipList\":[],\"maxSegmentsInNodeLoadingQueue\":100,\"decommissioningNodes\":[],\"decommissioningMaxPercentOfMaxSegmentsToMove\":70,\"pauseCoordination\":false,\"replicateAfterLoadTimeout\":false,\"maxNonPrimaryReplicantsToLoad\":2147483647,\"useRoundRobinSegmentAssignment\":true}",
+ "auditTime": "2023-08-12T07:51:36.306Z"
+ }
+]
+```
+
+
+### Update Coordinator dynamic configuration
+
+Update Coordinator dynamic worker configuration. Pass the dynamic configuration spec as a JSON request body. For information on constructing a dynamic configuration spec, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
+
+#### URL
+
+POST
/druid/coordinator/v1/config
+
+#### Responses
+
+
+
+
+
+*Successfully updated dynamic configuration*
+
+
+
+---
+
+#### Sample request
+
+The following example resumes a previously suspended supervisor with specified ID `social_media`.
+
+
+
+
+
+```shell
+curl 'http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config' \
+--header 'Content-Type: application/json' \
+--data '{
+ "millisToWaitBeforeDeleting": 900000,
+ "mergeBytesLimit": 524288000,
+ "mergeSegmentsLimit": 100,
+ "maxSegmentsToMove": 5,
+ "percentOfSegmentsToConsiderPerMove": 100,
+ "useBatchedSegmentSampler": true,
+ "replicantLifetime": 15,
+ "replicationThrottleLimit": 10,
+ "balancerComputeThreads": 1,
+ "emitBalancingStats": true,
+ "killDataSourceWhitelist": [],
+ "killPendingSegmentsSkipList": [],
+ "maxSegmentsInNodeLoadingQueue": 100,
+ "decommissioningNodes": [],
+ "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
+ "pauseCoordination": false,
+ "replicateAfterLoadTimeout": false,
+ "maxNonPrimaryReplicantsToLoad": 2147483647,
+ "useRoundRobinSegmentAssignment": true
+}'
+```
+
+
+
+```HTTP
+POST /druid/coordinator/v1/config HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+Content-Type: application/json
+Content-Length: 683
+
+{
+ "millisToWaitBeforeDeleting": 900000,
+ "mergeBytesLimit": 524288000,
+ "mergeSegmentsLimit": 100,
+ "maxSegmentsToMove": 5,
+ "percentOfSegmentsToConsiderPerMove": 100,
+ "useBatchedSegmentSampler": true,
+ "replicantLifetime": 15,
+ "replicationThrottleLimit": 10,
+ "balancerComputeThreads": 1,
+ "emitBalancingStats": true,
+ "killDataSourceWhitelist": [],
+ "killPendingSegmentsSkipList": [],
+ "maxSegmentsInNodeLoadingQueue": 100,
+ "decommissioningNodes": [],
+ "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
+ "pauseCoordination": false,
+ "replicateAfterLoadTimeout": false,
+ "maxNonPrimaryReplicantsToLoad": 2147483647,
+ "useRoundRobinSegmentAssignment": true
+}
+```
-`POST /druid/coordinator/v1/config`
+
-Update overlord dynamic worker configuration.
+#### Sample response
+A successful request returns an HTTP `200 OK` message code and an empty response body.
## Overlord dynamic configuration
From 922c0dbe92995f7b8b5228f8d096d964cd5d2d05 Mon Sep 17 00:00:00 2001
From: demo-kratia <56242907+demo-kratia@users.noreply.github.com>
Date: Tue, 15 Aug 2023 14:08:51 -0700
Subject: [PATCH 2/7] wip'
---
.../dynamic-configuration-api.md | 434 +++++++++++++++---
1 file changed, 365 insertions(+), 69 deletions(-)
diff --git a/docs/api-reference/dynamic-configuration-api.md b/docs/api-reference/dynamic-configuration-api.md
index 38b44b9f7bbf..6443892cc8e6 100644
--- a/docs/api-reference/dynamic-configuration-api.md
+++ b/docs/api-reference/dynamic-configuration-api.md
@@ -29,12 +29,98 @@ In this document, `http://SERVICE_IP:SERVICE_PORT` is a placeholder for the serv
## Coordinator dynamic configuration
-See [Coordinator Dynamic Configuration](../configuration/index.md#dynamic-configuration) for details.
+The Coordinator has dynamic configurations to tune certain behavior on the fly, without requiring a service restart. For more information, see [Coordinator Dynamic Configuration](../configuration/index.md#dynamic-configuration).
-Note that all _interval_ URL parameters are ISO 8601 strings delimited by a `_` instead of a `/`
-as in `2016-06-27_2016-06-28`.
+### Update Coordinator dynamic configuration
+
+Update Coordinator dynamic worker configuration. Pass the dynamic configuration spec as a JSON request body. For information on constructing a dynamic configuration spec, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
+
+#### URL
+
+POST
/druid/coordinator/v1/config
+
+#### Responses
+
+
+
+
+
+*Successfully updated dynamic configuration*
+
+
+
+---
+
+#### Sample request
+
+
+
+
+
+```shell
+curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config" \
+--header 'Content-Type: application/json' \
+--data '{
+ "millisToWaitBeforeDeleting": 900000,
+ "mergeBytesLimit": 524288000,
+ "mergeSegmentsLimit": 100,
+ "maxSegmentsToMove": 5,
+ "percentOfSegmentsToConsiderPerMove": 100,
+ "useBatchedSegmentSampler": true,
+ "replicantLifetime": 15,
+ "replicationThrottleLimit": 10,
+ "balancerComputeThreads": 1,
+ "emitBalancingStats": true,
+ "killDataSourceWhitelist": [],
+ "killPendingSegmentsSkipList": [],
+ "maxSegmentsInNodeLoadingQueue": 100,
+ "decommissioningNodes": [],
+ "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
+ "pauseCoordination": false,
+ "replicateAfterLoadTimeout": false,
+ "maxNonPrimaryReplicantsToLoad": 2147483647,
+ "useRoundRobinSegmentAssignment": true
+}'
+```
+
+
+
+```HTTP
+POST /druid/coordinator/v1/config HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+Content-Type: application/json
+Content-Length: 683
+
+{
+ "millisToWaitBeforeDeleting": 900000,
+ "mergeBytesLimit": 524288000,
+ "mergeSegmentsLimit": 100,
+ "maxSegmentsToMove": 5,
+ "percentOfSegmentsToConsiderPerMove": 100,
+ "useBatchedSegmentSampler": true,
+ "replicantLifetime": 15,
+ "replicationThrottleLimit": 10,
+ "balancerComputeThreads": 1,
+ "emitBalancingStats": true,
+ "killDataSourceWhitelist": [],
+ "killPendingSegmentsSkipList": [],
+ "maxSegmentsInNodeLoadingQueue": 100,
+ "decommissioningNodes": [],
+ "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
+ "pauseCoordination": false,
+ "replicateAfterLoadTimeout": false,
+ "maxNonPrimaryReplicantsToLoad": 2147483647,
+ "useRoundRobinSegmentAssignment": true
+}
+```
+
+
+
+#### Sample response
-### Get coordinator dynamic configuration
+A successful request returns an HTTP `200 OK` message code and an empty response body.
+
+### Get Coordinator dynamic configuration
Retrieves current Coordinator dynamic configuration. Returns a JSON object with the dynamic configuration properties and values. For information on the response properties, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
@@ -61,7 +147,7 @@ Retrieves current Coordinator dynamic configuration. Returns a JSON object with
```shell
-curl 'http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config'
+curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config"
```
@@ -105,7 +191,7 @@ Host: http://ROUTER_IP:ROUTER_PORT
### Get Coordinator dynamic configuration history
-Retrieves the history of changes to Coordinator dynamic configuration over an interval of time. Returns an empty array if there is no history records available.
+Retrieves the history of changes to Coordinator dynamic configuration over an interval of time. Returns an empty array if there are no history records available.
#### URL
@@ -115,7 +201,7 @@ Retrieves the history of changes to Coordinator dynamic configuration over an in
* `interval` (optional)
* Type: ISO 8601
- * Limits the number of results to the specified time interval. Delimit with `/`. For example, `2023-07-13/2023-07-19`.
+ * Limits the number of results to the specified time interval. Delimited with `/`. For example, `2023-07-13/2023-07-19`.
* `count` (optional)
* Type: Int
@@ -143,7 +229,7 @@ The following example retrieves the dynamic configuration history between `2022-
```shell
-curl 'http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/history?interval=2022-07-13%2F2024-07-19&count=10'
+curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/history?interval=2022-07-13%2F2024-07-19&count=10"
```
@@ -177,13 +263,28 @@ Host: http://ROUTER_IP:ROUTER_PORT
```
-### Update Coordinator dynamic configuration
+## Overlord dynamic configuration
-Update Coordinator dynamic worker configuration. Pass the dynamic configuration spec as a JSON request body. For information on constructing a dynamic configuration spec, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
+The Overlord can be dynamically configured to specify how tasks are assigned to workers. For more information, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
+
+### Update Overlord dynamic configuration.
+
+Updates overlord dynamic worker configuration. Pass the dynamic configuration spec as a JSON request body. For information on constructing an Overlord dynamic configuration spec, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
#### URL
-POST
/druid/coordinator/v1/config
+POST
/druid/indexer/v1/worker
+
+#### Header parameters
+
+The endpoint supports a set of optional header parameters to populate the `author` and `comment` fields in the configuration history.
+
+* `X-Druid-Author` (optional)
+ * Type: String
+ * A string representing the author making the configuration change.
+* `X-Druid-Comment` (optional)
+ * Type: String
+ * A string describing the update.
#### Responses
@@ -199,66 +300,44 @@ Update Coordinator dynamic worker configuration. Pass the dynamic configuration
#### Sample request
-The following example resumes a previously suspended supervisor with specified ID `social_media`.
-
```shell
-curl 'http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config' \
+curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker" \
--header 'Content-Type: application/json' \
--data '{
- "millisToWaitBeforeDeleting": 900000,
- "mergeBytesLimit": 524288000,
- "mergeSegmentsLimit": 100,
- "maxSegmentsToMove": 5,
- "percentOfSegmentsToConsiderPerMove": 100,
- "useBatchedSegmentSampler": true,
- "replicantLifetime": 15,
- "replicationThrottleLimit": 10,
- "balancerComputeThreads": 1,
- "emitBalancingStats": true,
- "killDataSourceWhitelist": [],
- "killPendingSegmentsSkipList": [],
- "maxSegmentsInNodeLoadingQueue": 100,
- "decommissioningNodes": [],
- "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
- "pauseCoordination": false,
- "replicateAfterLoadTimeout": false,
- "maxNonPrimaryReplicantsToLoad": 2147483647,
- "useRoundRobinSegmentAssignment": true
+ "type": "default",
+ "selectStrategy": {
+ "type": "fillCapacityWithCategorySpec",
+ "workerCategorySpec": {
+ "categoryMap": {},
+ "strong": true
+ }
+ },
+ "autoScaler": null
}'
```
```HTTP
-POST /druid/coordinator/v1/config HTTP/1.1
+POST /druid/indexer/v1/worker HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
Content-Type: application/json
-Content-Length: 683
+Content-Length: 196
{
- "millisToWaitBeforeDeleting": 900000,
- "mergeBytesLimit": 524288000,
- "mergeSegmentsLimit": 100,
- "maxSegmentsToMove": 5,
- "percentOfSegmentsToConsiderPerMove": 100,
- "useBatchedSegmentSampler": true,
- "replicantLifetime": 15,
- "replicationThrottleLimit": 10,
- "balancerComputeThreads": 1,
- "emitBalancingStats": true,
- "killDataSourceWhitelist": [],
- "killPendingSegmentsSkipList": [],
- "maxSegmentsInNodeLoadingQueue": 100,
- "decommissioningNodes": [],
- "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
- "pauseCoordination": false,
- "replicateAfterLoadTimeout": false,
- "maxNonPrimaryReplicantsToLoad": 2147483647,
- "useRoundRobinSegmentAssignment": true
+ "type": "default",
+ "selectStrategy": {
+ "type": "fillCapacityWithCategorySpec",
+ "workerCategorySpec": {
+ "categoryMap": {},
+ "strong": true
+ }
+ },
+ "autoScaler": null
}
```
@@ -268,30 +347,247 @@ Content-Length: 683
A successful request returns an HTTP `200 OK` message code and an empty response body.
-## Overlord dynamic configuration
+### Get Overlord dynamic configuration
+
+Returns current Overlord dynamic configuration. Returns an empty response body if there are no current Overlord dynamic configuration.
+
+#### URL
+
+GET
/druid/indexer/v1/worker
+
+#### Responses
+
+
+
+
+
+*Successfully retrieved dynamic configuration*
+
+
+
+#### Sample request
+
+
+
+
-See [Overlord Dynamic Configuration](../configuration/index.md#overlord-dynamic-configuration) for details.
+```shell
+curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker"
+```
+
+
+
+```HTTP
+GET /druid/indexer/v1/worker HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+```
+
+
+
+#### Sample response
+
+
+ Click to show sample response
+
+```json
+{
+ "type": "default",
+ "selectStrategy": {
+ "type": "fillCapacityWithCategorySpec",
+ "workerCategorySpec": {
+ "categoryMap": {},
+ "strong": true
+ }
+ },
+ "autoScaler": null
+}
+```
+
+
+
+### Get Overlord dynamic configuration history
+
+Retrieves history of changes to Overlord dynamic configuration. Returns an empty array if there are no history records available.
+
+
+#### URL
+
+GET
/druid/indexer/v1/worker/history
+
+#### Query parameters
+
+* `interval` (optional)
+ * Type: ISO 8601
+ * Limits the number of results to the specified time interval. Delimited with `/`. For example, `2023-07-13/2023-07-19`.
+
+* `count` (optional)
+ * Type: Int
+ * Limits the number of results to the last `n` entries.
+
+#### Responses
+
+
+
+
+
+*Successfully retrieved history*
+
+
+
+---
+
+#### Sample request
+
+The following example retrieves the dynamic configuration history between `2022-07-13` and `2024-07-19`. The response is limited to 10 entries.
+
+
+
+
+
+```shell
+curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker/history?interval=2022-07-13%2F2024-07-19&count=10"
+```
+
+
+
+```HTTP
+GET /druid/indexer/v1/worker/history?interval=2022-07-13%2F2024-07-19&count=10 HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+```
+
+
+
+#### Sample response
+
+
+ Click to show sample response
+
+```json
+[
+ {
+ "key": "worker.config",
+ "type": "worker.config",
+ "auditInfo": {
+ "author": "",
+ "comment": "",
+ "ip": "127.0.0.1"
+ },
+ "payload": "{\"type\":\"default\",\"selectStrategy\":{\"type\":\"fillCapacityWithCategorySpec\",\"workerCategorySpec\":{\"categoryMap\":{},\"strong\":true}},\"autoScaler\":null}",
+ "auditTime": "2023-08-15T20:32:06.899Z"
+ }
+]
+```
+
+
+### Get an array of worker nodes in the cluster
+
+Returns an array of all the worker nodes in the cluster along with its corresponding metadata.
+
+GET
/druid/indexer/v1/workers
+
+#### Responses
+
+
+
+
+
+*Successfully retrieved worker nodes*
+
+
+
+---
+
+#### Sample request
+
+
+
+
+
+```shell
+curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/workers"
+```
+
+
+
+```HTTP
+GET /druid/indexer/v1/workers HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+```
+
+
+
+#### Sample response
+
+
+ Click to show sample response
-Note that all _interval_ URL parameters are ISO 8601 strings delimited by a `_` instead of a `/`
-as in `2016-06-27_2016-06-28`.
+```json
+[
+ {
+ "worker": {
+ "scheme": "http",
+ "host": "localhost:8091",
+ "ip": "192.168.1.4",
+ "capacity": 2,
+ "version": "0",
+ "category": "_default_worker_category"
+ },
+ "currCapacityUsed": 0,
+ "currParallelIndexCapacityUsed": 0,
+ "availabilityGroups": [],
+ "runningTasks": [],
+ "lastCompletedTaskTime": "2023-08-15T18:19:37.254Z",
+ "blacklistedUntil": null
+ }
+]
+```
+
+
+### Get scaling events
+
+Returns Overlord scaling events if auto-scaling runners are in use.
+
+#### URL
+
+GET
/druid/indexer/v1/scaling
+
+#### Responses
+
+
+
+
+
+*Successfully retrieved scaling events*
-`GET /druid/indexer/v1/worker`
+
+
+---
+
+#### Sample request
-Retrieves current overlord dynamic configuration.
+
+
+
-`GET /druid/indexer/v1/worker/history?interval={interval}&count={count}`
+```shell
+curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/scaling"
+```
-Retrieves history of changes to overlord dynamic configuration. Accepts `interval` and `count` query string parameters
-to filter by interval and limit the number of results respectively.
+
-`GET /druid/indexer/v1/workers`
+```HTTP
+GET /druid/indexer/v1/scaling HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+```
-Retrieves a list of all the worker nodes in the cluster along with its metadata.
+
-`GET /druid/indexer/v1/scaling`
+#### Sample response
-Retrieves overlord scaling events if auto-scaling runners are in use.
+
+ Click to show sample response
-`POST /druid/indexer/v1/worker`
+```json
-Update overlord dynamic worker configuration.
\ No newline at end of file
+```
+
\ No newline at end of file
From d8ff8806641e9e6ef6c46515cc220ba7d04f1897 Mon Sep 17 00:00:00 2001
From: Katya Macedo
Date: Tue, 3 Oct 2023 21:07:36 -0500
Subject: [PATCH 3/7] Update examples
---
.../dynamic-configuration-api.md | 320 ++++++++++--------
1 file changed, 170 insertions(+), 150 deletions(-)
diff --git a/docs/api-reference/dynamic-configuration-api.md b/docs/api-reference/dynamic-configuration-api.md
index 6443892cc8e6..6a77c917f723 100644
--- a/docs/api-reference/dynamic-configuration-api.md
+++ b/docs/api-reference/dynamic-configuration-api.md
@@ -23,22 +23,106 @@ sidebar_label: Dynamic configuration
~ under the License.
-->
-This document describes the API endpoints to retrieve and manage the dynamic configurations for the [Coordinator](../configuration/index.html#overlord-dynamic-configuration) and [Overlord](../configuration/index.html#dynamic-configuration) in Apache Druid.
+This document describes the API endpoints to retrieve and manage dynamic configurations for the [Coordinator](../design/coordinator.md) and [Overlord](../design/overlord.md) in Apache Druid.
-In this document, `http://SERVICE_IP:SERVICE_PORT` is a placeholder for the server address of deployment and the service port. For example, on the quickstart configuration, replace `http://ROUTER_IP:ROUTER_PORT` with `http://localhost:8888`.
+In this topic, `http://ROUTER_IP:ROUTER_PORT` is a placeholder for your Router service address and port.
+Replace it with the information for your deployment.
+For example, use `http://localhost:8888` for quickstart deployments.
## Coordinator dynamic configuration
-The Coordinator has dynamic configurations to tune certain behavior on the fly, without requiring a service restart. For more information, see [Coordinator Dynamic Configuration](../configuration/index.md#dynamic-configuration).
+The Coordinator has dynamic configurations to tune certain behavior on the fly, without requiring a service restart.
+For information on dynamic configuration spec properties, see [Coordinator dynamic configuration](../configuration/index.md#dynamic-configuration).
+
+### Get Coordinator dynamic configuration
+
+Retrieves current Coordinator dynamic configuration. Returns a JSON object with the dynamic configuration properties and values.
+
+#### URL
+
+GET
/druid/coordinator/v1/config
+
+#### Responses
+
+
+
+
+
+*Successfully retrieved dynamic configuration*
+
+
+
+---
+
+#### Sample request
+
+
+
+
+
+```shell
+curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config"
+```
+
+
+
+```HTTP
+GET /druid/coordinator/v1/config HTTP/1.1
+Host: http://ROUTER_IP:ROUTER_PORT
+```
+
+
+
+#### Sample response
+
+
+Click to show sample response
+
+```json
+{
+ "millisToWaitBeforeDeleting": 900000,
+ "mergeBytesLimit": 524288000,
+ "mergeSegmentsLimit": 100,
+ "maxSegmentsToMove": 100,
+ "replicantLifetime": 15,
+ "replicationThrottleLimit": 500,
+ "balancerComputeThreads": 1,
+ "killDataSourceWhitelist": [],
+ "killPendingSegmentsSkipList": [],
+ "maxSegmentsInNodeLoadingQueue": 500,
+ "decommissioningNodes": [],
+ "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
+ "pauseCoordination": false,
+ "replicateAfterLoadTimeout": false,
+ "maxNonPrimaryReplicantsToLoad": 2147483647,
+ "useRoundRobinSegmentAssignment": true,
+ "smartSegmentLoading": true,
+ "debugDimensions": null
+}
+```
+
+
### Update Coordinator dynamic configuration
-Update Coordinator dynamic worker configuration. Pass the dynamic configuration spec as a JSON request body. For information on constructing a dynamic configuration spec, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
+Submits a JSON-based dynamic configuration spec to the Coordinator.
+For information on dynamic configuration spec properties, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
#### URL
POST
/druid/coordinator/v1/config
+#### Header parameters
+
+The endpoint supports a set of optional header parameters to populate the `author` and `comment` fields in the configuration history.
+
+* `X-Druid-Author`
+ * Type: String
+ * A string representing the author making the configuration change.
+* `X-Druid-Comment`
+ * Type: String
+ * A string describing the update.
+
#### Responses
@@ -120,13 +204,25 @@ Content-Length: 683
A successful request returns an HTTP `200 OK` message code and an empty response body.
-### Get Coordinator dynamic configuration
+### Get Coordinator dynamic configuration history
-Retrieves current Coordinator dynamic configuration. Returns a JSON object with the dynamic configuration properties and values. For information on the response properties, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
+Retrieves the history of changes to Coordinator dynamic configuration over an interval of time. Returns an empty array if there are no history records available.
-#### URL
+#### URL
-GET
/druid/coordinator/v1/config
+GET
/druid/coordinator/v1/config/history
+
+#### Query parameters
+
+The endpoint supports a set of optional query parameters to filter results.
+
+* `interval`
+ * Type: String (ISO-8601)
+ * Limit the results to the specified time interval. Delimited with `/`. For example, `2023-07-13/2023-07-19`. You can specify the default value of `interval` by setting `druid.audit.manager.auditHistoryMillis` in Coordinator `runtime.properties`. If not specified, `interval` defaults to one week.
+
+* `count`
+ * Type: Integer
+ * Limit the number of results to the last `n` entries.
#### Responses
@@ -134,7 +230,8 @@ Retrieves current Coordinator dynamic configuration. Returns a JSON object with
-*Successfully retrieved dynamic configuration*
+*Successfully retrieved history*
+
@@ -142,18 +239,20 @@ Retrieves current Coordinator dynamic configuration. Returns a JSON object with
#### Sample request
+The following example retrieves the dynamic configuration history between `2022-07-13` and `2024-07-19`. The response is limited to 10 entries.
+
```shell
-curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config"
+curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/history?interval=2022-07-13%2F2024-07-19&count=10"
```
```HTTP
-GET /druid/coordinator/v1/config HTTP/1.1
+GET /druid/coordinator/v1/config/history?interval=2022-07-13/2024-07-19&count=10 HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
@@ -165,47 +264,36 @@ Host: http://ROUTER_IP:ROUTER_PORT
Click to show sample response
```json
-{
- "millisToWaitBeforeDeleting": 900000,
- "mergeBytesLimit": 524288000,
- "mergeSegmentsLimit": 100,
- "maxSegmentsToMove": 5,
- "percentOfSegmentsToConsiderPerMove": 100.0,
- "useBatchedSegmentSampler": true,
- "replicantLifetime": 15,
- "replicationThrottleLimit": 10,
- "balancerComputeThreads": 1,
- "emitBalancingStats": false,
- "killDataSourceWhitelist": [],
- "killPendingSegmentsSkipList": [],
- "maxSegmentsInNodeLoadingQueue": 100,
- "decommissioningNodes": [],
- "decommissioningMaxPercentOfMaxSegmentsToMove": 70,
- "pauseCoordination": false,
- "replicateAfterLoadTimeout": false,
- "maxNonPrimaryReplicantsToLoad": 2147483647,
- "useRoundRobinSegmentAssignment": true
-}
+[
+ {
+ "key": "coordinator.config",
+ "type": "coordinator.config",
+ "auditInfo": {
+ "author": "",
+ "comment": "",
+ "ip": "127.0.0.1"
+ },
+ "payload": "{\"millisToWaitBeforeDeleting\":900000,\"mergeBytesLimit\":524288000,\"mergeSegmentsLimit\":100,\"maxSegmentsToMove\":5,\"replicantLifetime\":15,\"replicationThrottleLimit\":10,\"balancerComputeThreads\":1,\"killDataSourceWhitelist\":[],\"killPendingSegmentsSkipList\":[],\"maxSegmentsInNodeLoadingQueue\":100,\"decommissioningNodes\":[],\"decommissioningMaxPercentOfMaxSegmentsToMove\":70,\"pauseCoordination\":false,\"replicateAfterLoadTimeout\":false,\"maxNonPrimaryReplicantsToLoad\":2147483647,\"useRoundRobinSegmentAssignment\":true,\"smartSegmentLoading\":true,\"debugDimensions\":null}",
+ "auditTime": "2023-10-03T20:59:51.622Z"
+ }
+]
```
-### Get Coordinator dynamic configuration history
+## Overlord dynamic configuration
-Retrieves the history of changes to Coordinator dynamic configuration over an interval of time. Returns an empty array if there are no history records available.
+The Overlord has dynamic configurations to tune how Druid assigns tasks to workers.
+For information on dynamic configuration spec properties, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
-#### URL
+### Get Overlord dynamic configuration
-GET
/druid/coordinator/v1/config/history
+Retrieves current Overlord dynamic configuration.
+Returns a JSON object with the dynamic configuration properties and values.
+Returns an empty response body if there is no current Overlord dynamic configuration.
-#### Query parameters
-
-* `interval` (optional)
- * Type: ISO 8601
- * Limits the number of results to the specified time interval. Delimited with `/`. For example, `2023-07-13/2023-07-19`.
+#### URL
-* `count` (optional)
- * Type: Int
- * Limits the number of results to the last `n` entries.
+GET
/druid/indexer/v1/worker
#### Responses
@@ -213,29 +301,24 @@ Retrieves the history of changes to Coordinator dynamic configuration over an in
-*Successfully retrieved history*
-
+*Successfully retrieved dynamic configuration*
----
-
#### Sample request
-The following example retrieves the dynamic configuration history between `2022-07-13` and `2024-07-19`. The response is limited to 10 entries.
-
```shell
-curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/history?interval=2022-07-13%2F2024-07-19&count=10"
+curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker"
```
```HTTP
-GET /druid/coordinator/v1/config/history?interval=2022-07-13/2024-07-19&count=10 HTTP/1.1
+GET /druid/indexer/v1/worker HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
@@ -247,29 +330,25 @@ Host: http://ROUTER_IP:ROUTER_PORT
Click to show sample response
```json
-[
- {
- "key": "coordinator.config",
- "type": "coordinator.config",
- "auditInfo": {
- "author": "console",
- "comment": "testing config change",
- "ip": "127.0.0.1"
- },
- "payload": "{\"millisToWaitBeforeDeleting\":900000,\"mergeBytesLimit\":524288000,\"mergeSegmentsLimit\":100,\"maxSegmentsToMove\":5,\"percentOfSegmentsToConsiderPerMove\":100.0,\"useBatchedSegmentSampler\":true,\"replicantLifetime\":15,\"replicationThrottleLimit\":10,\"balancerComputeThreads\":1,\"emitBalancingStats\":false,\"killDataSourceWhitelist\":[],\"killPendingSegmentsSkipList\":[],\"maxSegmentsInNodeLoadingQueue\":100,\"decommissioningNodes\":[],\"decommissioningMaxPercentOfMaxSegmentsToMove\":70,\"pauseCoordination\":false,\"replicateAfterLoadTimeout\":false,\"maxNonPrimaryReplicantsToLoad\":2147483647,\"useRoundRobinSegmentAssignment\":true}",
- "auditTime": "2023-08-12T07:51:36.306Z"
- }
-]
+{
+ "type": "default",
+ "selectStrategy": {
+ "type": "fillCapacityWithCategorySpec",
+ "workerCategorySpec": {
+ "categoryMap": {},
+ "strong": true
+ }
+ },
+ "autoScaler": null
+}
```
-
-## Overlord dynamic configuration
-
-The Overlord can be dynamically configured to specify how tasks are assigned to workers. For more information, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
+
-### Update Overlord dynamic configuration.
+### Update Overlord dynamic configuration
-Updates overlord dynamic worker configuration. Pass the dynamic configuration spec as a JSON request body. For information on constructing an Overlord dynamic configuration spec, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
+Submits a JSON-based dynamic configuration spec to the Overlord.
+For information on dynamic configuration spec properties, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
#### URL
@@ -277,12 +356,12 @@ Updates overlord dynamic worker configuration. Pass the dynamic configuration sp
#### Header parameters
-The endpoint supports a set of optional header parameters to populate the `author` and `comment` fields in the configuration history.
+The endpoint supports a set of optional header parameters to populate the `author` and `comment` fields in the configuration history.
-* `X-Druid-Author` (optional)
+* `X-Druid-Author`
* Type: String
* A string representing the author making the configuration change.
-* `X-Druid-Comment` (optional)
+* `X-Druid-Comment`
* Type: String
* A string describing the update.
@@ -347,82 +426,26 @@ Content-Length: 196
A successful request returns an HTTP `200 OK` message code and an empty response body.
-### Get Overlord dynamic configuration
-
-Returns current Overlord dynamic configuration. Returns an empty response body if there are no current Overlord dynamic configuration.
-
-#### URL
-
-GET
/druid/indexer/v1/worker
-
-#### Responses
-
-
-
-
-
-*Successfully retrieved dynamic configuration*
-
-
-
-#### Sample request
-
-
-
-
-
-```shell
-curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker"
-```
-
-
-
-```HTTP
-GET /druid/indexer/v1/worker HTTP/1.1
-Host: http://ROUTER_IP:ROUTER_PORT
-```
-
-
-
-#### Sample response
-
-
- Click to show sample response
-
-```json
-{
- "type": "default",
- "selectStrategy": {
- "type": "fillCapacityWithCategorySpec",
- "workerCategorySpec": {
- "categoryMap": {},
- "strong": true
- }
- },
- "autoScaler": null
-}
-```
-
-
-
### Get Overlord dynamic configuration history
-Retrieves history of changes to Overlord dynamic configuration. Returns an empty array if there are no history records available.
-
+Retrieves the history of changes to Overlord dynamic configuration over an interval of time. Returns an empty array if there are no history records available.
#### URL
GET
/druid/indexer/v1/worker/history
+
#### Query parameters
-* `interval` (optional)
- * Type: ISO 8601
- * Limits the number of results to the specified time interval. Delimited with `/`. For example, `2023-07-13/2023-07-19`.
+The endpoint supports a set of optional query parameters to filter results.
+
+* `interval`
+ * Type: String (ISO-8601)
+ * Limit the results to the specified time interval. Delimited with `/`. For example, `2023-07-13/2023-07-19`. You can specify the default value of `interval` by setting `druid.audit.manager.auditHistoryMillis` in Overlord `runtime.properties`. If not specified, `interval` defaults to one week.
-* `count` (optional)
- * Type: Int
- * Limits the number of results to the last `n` entries.
+* `count`
+ * Type: Integer
+ * Limit the number of results to the last `n` entries.
#### Responses
@@ -473,10 +496,11 @@ Host: http://ROUTER_IP:ROUTER_PORT
"ip": "127.0.0.1"
},
"payload": "{\"type\":\"default\",\"selectStrategy\":{\"type\":\"fillCapacityWithCategorySpec\",\"workerCategorySpec\":{\"categoryMap\":{},\"strong\":true}},\"autoScaler\":null}",
- "auditTime": "2023-08-15T20:32:06.899Z"
+ "auditTime": "2023-10-03T21:49:49.991Z"
}
]
```
+
### Get an array of worker nodes in the cluster
@@ -527,7 +551,7 @@ Host: http://ROUTER_IP:ROUTER_PORT
"worker": {
"scheme": "http",
"host": "localhost:8091",
- "ip": "192.168.1.4",
+ "ip": "198.51.100.0",
"capacity": 2,
"version": "0",
"category": "_default_worker_category"
@@ -536,16 +560,18 @@ Host: http://ROUTER_IP:ROUTER_PORT
"currParallelIndexCapacityUsed": 0,
"availabilityGroups": [],
"runningTasks": [],
- "lastCompletedTaskTime": "2023-08-15T18:19:37.254Z",
+ "lastCompletedTaskTime": "2023-09-29T19:13:05.505Z",
"blacklistedUntil": null
}
]
```
+
### Get scaling events
Returns Overlord scaling events if auto-scaling runners are in use.
+Returns an empty response body if there are no Overlord scaling events.
#### URL
@@ -584,10 +610,4 @@ Host: http://ROUTER_IP:ROUTER_PORT
#### Sample response
-
- Click to show sample response
-
-```json
-
-```
-
\ No newline at end of file
+A successful request returns a `200 OK` response and an array of scaling events.
\ No newline at end of file
From 958be6ce18cef3b0be35884a5d9bc7b215a7b0c9 Mon Sep 17 00:00:00 2001
From: Katya Macedo
Date: Wed, 4 Oct 2023 14:53:34 -0500
Subject: [PATCH 4/7] Trigger preview build
---
docs/api-reference/dynamic-configuration-api.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/api-reference/dynamic-configuration-api.md b/docs/api-reference/dynamic-configuration-api.md
index 6a77c917f723..a8d7339a5d72 100644
--- a/docs/api-reference/dynamic-configuration-api.md
+++ b/docs/api-reference/dynamic-configuration-api.md
@@ -23,6 +23,7 @@ sidebar_label: Dynamic configuration
~ under the License.
-->
+
This document describes the API endpoints to retrieve and manage dynamic configurations for the [Coordinator](../design/coordinator.md) and [Overlord](../design/overlord.md) in Apache Druid.
In this topic, `http://ROUTER_IP:ROUTER_PORT` is a placeholder for your Router service address and port.
From 7ec1036550eed6e70248c57976811a7c1f152e2c Mon Sep 17 00:00:00 2001
From: Katya Macedo
Date: Thu, 5 Oct 2023 10:01:08 -0500
Subject: [PATCH 5/7] Update code tabs
---
.../dynamic-configuration-api.md | 215 +++++++++++-------
1 file changed, 133 insertions(+), 82 deletions(-)
diff --git a/docs/api-reference/dynamic-configuration-api.md b/docs/api-reference/dynamic-configuration-api.md
index a8d7339a5d72..b884ca6b955c 100644
--- a/docs/api-reference/dynamic-configuration-api.md
+++ b/docs/api-reference/dynamic-configuration-api.md
@@ -3,8 +3,12 @@ id: dynamic-configuration-api
title: Dynamic configuration API
sidebar_label: Dynamic configuration
---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
+
-
-
This document describes the API endpoints to retrieve and manage dynamic configurations for the [Coordinator](../design/coordinator.md) and [Overlord](../design/overlord.md) in Apache Druid.
In this topic, `http://ROUTER_IP:ROUTER_PORT` is a placeholder for your Router service address and port.
@@ -33,11 +36,11 @@ For example, use `http://localhost:8888` for quickstart deployments.
## Coordinator dynamic configuration
The Coordinator has dynamic configurations to tune certain behavior on the fly, without requiring a service restart.
-For information on dynamic configuration spec properties, see [Coordinator dynamic configuration](../configuration/index.md#dynamic-configuration).
+For information on the supported properties, see [Coordinator dynamic configuration](../configuration/index.md#dynamic-configuration).
-### Get Coordinator dynamic configuration
+### Get dynamic configuration
-Retrieves current Coordinator dynamic configuration. Returns a JSON object with the dynamic configuration properties and values.
+Retrieves the current Coordinator dynamic configuration. Returns a JSON object with the dynamic configuration properties and values.
#### URL
@@ -45,34 +48,40 @@ Retrieves current Coordinator dynamic configuration. Returns a JSON object with
#### Responses
-
+
+
+
-
-*Successfully retrieved dynamic configuration*
+*Successfully retrieved dynamic configuration*
-
+
+
---
#### Sample request
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config"
```
-
+
+
+
```HTTP
GET /druid/coordinator/v1/config HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
-
+
+
#### Sample response
@@ -104,10 +113,10 @@ Host: http://ROUTER_IP:ROUTER_PORT
-### Update Coordinator dynamic configuration
+### Update dynamic configuration
Submits a JSON-based dynamic configuration spec to the Coordinator.
-For information on dynamic configuration spec properties, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
+For information on the supported properties, see [Dynamic configuration](../configuration/index.md#dynamic-configuration).
#### URL
@@ -115,7 +124,7 @@ For information on dynamic configuration spec properties, see [Dynamic configura
#### Header parameters
-The endpoint supports a set of optional header parameters to populate the `author` and `comment` fields in the configuration history.
+The endpoint supports a set of optional header parameters to populate the `author` and `comment` fields in the configuration history.
* `X-Druid-Author`
* Type: String
@@ -126,21 +135,24 @@ The endpoint supports a set of optional header parameters to populate the `autho
#### Responses
-
+
+
+
-
-*Successfully updated dynamic configuration*
+*Successfully updated dynamic configuration*
-
+
+
---
#### Sample request
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config" \
@@ -168,7 +180,9 @@ curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config" \
}'
```
-
+
+
+
```HTTP
POST /druid/coordinator/v1/config HTTP/1.1
@@ -199,17 +213,18 @@ Content-Length: 683
}
```
-
+
+
#### Sample response
A successful request returns an HTTP `200 OK` message code and an empty response body.
-### Get Coordinator dynamic configuration history
+### Get dynamic configuration history
Retrieves the history of changes to Coordinator dynamic configuration over an interval of time. Returns an empty array if there are no history records available.
-#### URL
+#### URL
GET
/druid/coordinator/v1/config/history
@@ -227,14 +242,16 @@ The endpoint supports a set of optional query parameters to filter results.
#### Responses
-
+
+
+
-
-*Successfully retrieved history*
+*Successfully retrieved history*
-
+
+
---
@@ -242,22 +259,26 @@ The endpoint supports a set of optional query parameters to filter results.
The following example retrieves the dynamic configuration history between `2022-07-13` and `2024-07-19`. The response is limited to 10 entries.
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/history?interval=2022-07-13%2F2024-07-19&count=10"
```
-
+
+
+
```HTTP
GET /druid/coordinator/v1/config/history?interval=2022-07-13/2024-07-19&count=10 HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
-
+
+
#### Sample response
@@ -284,46 +305,52 @@ Host: http://ROUTER_IP:ROUTER_PORT
## Overlord dynamic configuration
The Overlord has dynamic configurations to tune how Druid assigns tasks to workers.
-For information on dynamic configuration spec properties, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
+For information on the supported properties, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
-### Get Overlord dynamic configuration
+### Get dynamic configuration
-Retrieves current Overlord dynamic configuration.
+Retrieves the current Overlord dynamic configuration.
Returns a JSON object with the dynamic configuration properties and values.
Returns an empty response body if there is no current Overlord dynamic configuration.
-#### URL
+#### URL
GET
/druid/indexer/v1/worker
#### Responses
-
+
-
+
-*Successfully retrieved dynamic configuration*
-
+*Successfully retrieved dynamic configuration*
+
+
+
#### Sample request
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker"
```
-
+
+
+
```HTTP
GET /druid/indexer/v1/worker HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
-
+
+
#### Sample response
@@ -346,10 +373,10 @@ Host: http://ROUTER_IP:ROUTER_PORT
-### Update Overlord dynamic configuration
+### Update dynamic configuration
Submits a JSON-based dynamic configuration spec to the Overlord.
-For information on dynamic configuration spec properties, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
+For information on the supported properties, see [Overlord dynamic configuration](../configuration/index.md#overlord-dynamic-configuration).
#### URL
@@ -368,21 +395,24 @@ The endpoint supports a set of optional header parameters to populate the `autho
#### Responses
-
+
+
+
-
-*Successfully updated dynamic configuration*
+*Successfully updated dynamic configuration*
-
+
+
---
#### Sample request
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker" \
@@ -400,7 +430,9 @@ curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker" \
}'
```
-
+
+
+
```HTTP
POST /druid/indexer/v1/worker HTTP/1.1
@@ -421,13 +453,14 @@ Content-Length: 196
}
```
-
+
+
#### Sample response
A successful request returns an HTTP `200 OK` message code and an empty response body.
-### Get Overlord dynamic configuration history
+### Get dynamic configuration history
Retrieves the history of changes to Overlord dynamic configuration over an interval of time. Returns an empty array if there are no history records available.
@@ -450,13 +483,15 @@ The endpoint supports a set of optional query parameters to filter results.
#### Responses
-
+
-
+
-*Successfully retrieved history*
-
+*Successfully retrieved history*
+
+
+
---
@@ -464,22 +499,26 @@ The endpoint supports a set of optional query parameters to filter results.
The following example retrieves the dynamic configuration history between `2022-07-13` and `2024-07-19`. The response is limited to 10 entries.
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/worker/history?interval=2022-07-13%2F2024-07-19&count=10"
```
-
+
+
+
```HTTP
GET /druid/indexer/v1/worker/history?interval=2022-07-13%2F2024-07-19&count=10 HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
-
+
+
#### Sample response
@@ -512,34 +551,40 @@ Returns an array of all the worker nodes in the cluster along with its correspon
#### Responses
-
+
+
+
-
-*Successfully retrieved worker nodes*
+*Successfully retrieved worker nodes*
-
+
+
---
#### Sample request
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/workers"
```
-
+
+
+
```HTTP
GET /druid/indexer/v1/workers HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
-
+
+
#### Sample response
@@ -580,35 +625,41 @@ Returns an empty response body if there are no Overlord scaling events.
#### Responses
-
+
-
+
-*Successfully retrieved scaling events*
-
+*Successfully retrieved scaling events*
+
+
+
---
#### Sample request
-
+
+
+
-
```shell
curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/scaling"
```
-
+
+
+
```HTTP
GET /druid/indexer/v1/scaling HTTP/1.1
Host: http://ROUTER_IP:ROUTER_PORT
```
-
+
+
#### Sample response
-A successful request returns a `200 OK` response and an array of scaling events.
\ No newline at end of file
+A successful request returns a `200 OK` response and an array of scaling events.
From cb41b17dfcc24ac2ba040f5fc58afcc98a57b439 Mon Sep 17 00:00:00 2001
From: Katya Macedo
Date: Thu, 5 Oct 2023 11:24:30 -0500
Subject: [PATCH 6/7] Trigger preview build
---
.github/workflows/reusable-standard-its.yml | 2 +-
.../FlattenJSONBenchmarkUtilTest.java | 29 +-
.../dynamic-configuration-api.md | 8 +-
.../kubernetes-overlord-extensions/pom.xml | 1 +
...terializedViewQueryQueryToolChestTest.java | 3 +-
extensions-core/azure-extensions/pom.xml | 5 +-
extensions-core/druid-pac4j/pom.xml | 7 -
extensions-core/lookups-cached-global/pom.xml | 6 +-
.../apache/druid/msq/exec/ControllerImpl.java | 2 +-
.../org/apache/druid/msq/exec/WorkerImpl.java | 50 +-
.../msq/exec/WorkerMemoryParameters.java | 11 +-
...SegmentGeneratorFrameProcessorFactory.java | 42 +-
.../msq/kernel/FrameProcessorFactory.java | 27 +-
.../msq/kernel/ProcessorsAndChannels.java | 18 +-
.../querykit/BaseFrameProcessorFactory.java | 22 +-
.../msq/querykit/BaseLeafFrameProcessor.java | 148 +++++-
.../BaseLeafFrameProcessorFactory.java | 229 +++++----
.../BaseLeafFrameProcessorManager.java | 206 --------
...rocessor.java => BroadcastJoinHelper.java} | 179 ++-----
.../msq/querykit/ChainedProcessorManager.java | 114 -----
.../msq/querykit/InputNumberDataSource.java | 15 +-
.../querykit/SimpleSegmentMapFnProcessor.java | 75 ---
.../common/OffsetLimitFrameProcessor.java | 9 +-
.../OffsetLimitFrameProcessorFactory.java | 15 +-
.../common/SortMergeJoinFrameProcessor.java | 9 +-
.../SortMergeJoinFrameProcessorFactory.java | 10 +-
.../GroupByPostShuffleFrameProcessor.java | 7 +-
...oupByPostShuffleFrameProcessorFactory.java | 7 +-
.../GroupByPreShuffleFrameProcessor.java | 27 +-
...roupByPreShuffleFrameProcessorFactory.java | 16 +-
.../QueryResultFrameProcessorFactory.java | 10 +-
.../results/QueryResultsFrameProcessor.java | 9 +-
.../scan/ScanQueryFrameProcessor.java | 35 +-
.../scan/ScanQueryFrameProcessorFactory.java | 21 +-
.../druid/msq/util/DimensionSchemaUtils.java | 4 -
.../apache/druid/msq/exec/MSQFaultsTest.java | 26 +
.../apache/druid/msq/exec/MSQInsertTest.java | 188 --------
...Test.java => BroadcastJoinHelperTest.java} | 30 +-
.../SortMergeJoinFrameProcessorTest.java | 5 +-
.../QueryResultsFrameProcessorTest.java | 5 +-
.../scan/ScanQueryFrameProcessorTest.java | 16 +-
...a => CalciteArraysSelectQueryMSQTest.java} | 2 +-
extensions-core/protobuf-extensions/pom.xml | 1 +
indexing-hadoop/pom.xml | 13 +-
indexing-service/pom.xml | 1 +
licenses.yaml | 21 +
owasp-dependency-check-suppressions.xml | 10 -
pom.xml | 65 +--
processing/pom.xml | 12 +-
.../frame/field/DoubleArrayFieldReader.java | 62 ---
.../druid/frame/field/DoubleFieldReader.java | 74 +--
.../druid/frame/field/DoubleFieldWriter.java | 62 ++-
.../druid/frame/field/FieldReaders.java | 27 +-
.../druid/frame/field/FieldWriters.java | 53 +--
.../frame/field/FloatArrayFieldReader.java | 62 ---
.../druid/frame/field/FloatFieldReader.java | 69 +--
.../druid/frame/field/FloatFieldWriter.java | 65 +--
.../frame/field/LongArrayFieldReader.java | 62 ---
.../druid/frame/field/LongFieldReader.java | 76 +--
.../druid/frame/field/LongFieldWriter.java | 62 +--
.../frame/field/NumericArrayFieldReader.java | 59 ---
.../field/NumericArrayFieldSelector.java | 204 --------
.../frame/field/NumericArrayFieldWriter.java | 249 ----------
.../druid/frame/field/NumericFieldReader.java | 131 -----
.../druid/frame/field/NumericFieldWriter.java | 139 ------
.../field/NumericFieldWriterFactory.java | 33 --
.../frame/field/SettableFieldPointer.java | 40 --
.../frame/field/StringArrayFieldReader.java | 34 --
.../druid/frame/field/StringFieldReader.java | 7 +-
.../druid/frame/field/TransformUtils.java | 86 ----
.../processor/FrameProcessorExecutor.java | 19 +-
.../frame/processor/FrameProcessors.java | 4 +-
.../frame/processor/RunAllFullyWidget.java | 191 +++-----
.../manager/AccumulatingProcessorManager.java | 83 ----
.../manager/ProcessorAndCallback.java | 53 ---
.../processor/manager/ProcessorManager.java | 98 ----
.../processor/manager/ProcessorManagers.java | 70 ---
.../manager/SequenceProcessorManager.java | 110 -----
.../apache/druid/frame/read/FrameReader.java | 7 +-
.../read/columnar/FrameColumnReaders.java | 18 +-
...nsupportedColumnTypeFrameColumnReader.java | 57 ---
.../druid/frame/write/FrameWriterUtils.java | 46 +-
.../apache/druid/java/util/common/Unit.java | 53 ---
.../common/granularity/PeriodGranularity.java | 8 +-
.../apache/druid/query/JoinDataSource.java | 157 +++---
.../SegmentMetadataQueryQueryToolChest.java | 25 +-
.../concrete/FrameRowsAndColumns.java | 2 +-
.../segment/column/ColumnTypeFactory.java | 2 -
.../join/table/FrameBasedIndexedTable.java | 2 +-
.../nested/NestedDataComplexTypeSerde.java | 8 +-
.../org/apache/druid/common/UnitTest.java | 39 --
.../field/DoubleArrayFieldReaderTest.java | 234 ---------
.../frame/field/DoubleFieldReaderTest.java | 16 +-
.../field/FloatArrayFieldReaderTest.java | 235 ---------
.../frame/field/FloatFieldReaderTest.java | 16 +-
.../frame/field/IndexArrayFieldPointer.java | 56 ---
.../frame/field/LongArrayFieldReaderTest.java | 211 --------
.../frame/field/LongFieldReaderTest.java | 16 +-
.../frame/field/StringFieldReaderTest.java | 50 +-
.../druid/frame/field/TransformUtilsTest.java | 187 --------
.../processor/RunAllFullyWidgetTest.java | 450 ++++--------------
.../manager/SequenceProcessorManagerTest.java | 169 -------
.../druid/frame/write/FrameWriterTest.java | 36 --
.../frame/write/FrameWriterTestData.java | 65 ---
.../druid/frame/write/FrameWritersTest.java | 36 ++
.../granularity/QueryGranularityTest.java | 89 +---
.../LongConstantBufferAggregatorTest.java | 6 +-
.../LongConstantVectorAggregatorTest.java | 6 +-
...egmentMetadataQueryQueryToolChestTest.java | 38 --
.../NestedDataColumnSupplierV4Test.java | 5 -
services/pom.xml | 6 -
.../druid/sql/calcite/rel/DruidQuery.java | 11 +-
.../druid/sql/calcite/rel/Windowing.java | 4 +-
.../sql/calcite/BaseCalciteQueryTest.java | 2 +-
.../sql/calcite/CalciteArraysQueryTest.java | 21 +-
.../sql/calcite/CalciteJoinQueryTest.java | 26 +-
.../druid/sql/calcite/CalciteQueryTest.java | 194 ++++----
.../sql/calcite/CalciteWindowQueryTest.java | 2 -
.../druid/sql/calcite/QueryTestRunner.java | 15 +-
.../rule/DruidLogicalValuesRuleTest.java | 27 +-
.../calcite/tests/window/lead_lag.sqlTest | 50 --
.../calcite/tests/window/no_grouping.sqlTest | 29 --
122 files changed, 1404 insertions(+), 5385 deletions(-)
delete mode 100644 extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseLeafFrameProcessorManager.java
rename extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/{BroadcastJoinSegmentMapFnProcessor.java => BroadcastJoinHelper.java} (62%)
delete mode 100644 extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/ChainedProcessorManager.java
delete mode 100644 extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/SimpleSegmentMapFnProcessor.java
rename extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/querykit/{BroadcastJoinSegmentMapFnProcessorTest.java => BroadcastJoinHelperTest.java} (90%)
rename extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/{CalciteArraysQueryMSQTest.java => CalciteArraysSelectQueryMSQTest.java} (97%)
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/DoubleArrayFieldReader.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/FloatArrayFieldReader.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/LongArrayFieldReader.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/NumericArrayFieldReader.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/NumericArrayFieldSelector.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/NumericArrayFieldWriter.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/NumericFieldReader.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/NumericFieldWriter.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/NumericFieldWriterFactory.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/SettableFieldPointer.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/StringArrayFieldReader.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/field/TransformUtils.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/processor/manager/AccumulatingProcessorManager.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/processor/manager/ProcessorAndCallback.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/processor/manager/ProcessorManager.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/processor/manager/ProcessorManagers.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/processor/manager/SequenceProcessorManager.java
delete mode 100644 processing/src/main/java/org/apache/druid/frame/read/columnar/UnsupportedColumnTypeFrameColumnReader.java
delete mode 100644 processing/src/main/java/org/apache/druid/java/util/common/Unit.java
delete mode 100644 processing/src/test/java/org/apache/druid/common/UnitTest.java
delete mode 100644 processing/src/test/java/org/apache/druid/frame/field/DoubleArrayFieldReaderTest.java
delete mode 100644 processing/src/test/java/org/apache/druid/frame/field/FloatArrayFieldReaderTest.java
delete mode 100644 processing/src/test/java/org/apache/druid/frame/field/IndexArrayFieldPointer.java
delete mode 100644 processing/src/test/java/org/apache/druid/frame/field/LongArrayFieldReaderTest.java
delete mode 100644 processing/src/test/java/org/apache/druid/frame/field/TransformUtilsTest.java
delete mode 100644 processing/src/test/java/org/apache/druid/frame/processor/manager/SequenceProcessorManagerTest.java
delete mode 100644 sql/src/test/resources/calcite/tests/window/lead_lag.sqlTest
delete mode 100644 sql/src/test/resources/calcite/tests/window/no_grouping.sqlTest
diff --git a/.github/workflows/reusable-standard-its.yml b/.github/workflows/reusable-standard-its.yml
index d0adace22fbe..b96bb4b4c495 100644
--- a/.github/workflows/reusable-standard-its.yml
+++ b/.github/workflows/reusable-standard-its.yml
@@ -111,7 +111,7 @@ jobs:
- name: Collect service logs on failure
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
run: |
- tar cvzf ./service-logs.tgz ~/shared/logs
+ tar cvzf ./service-logs.tgz ./shared/logs
- name: Upload Druid service logs to GitHub
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
diff --git a/benchmarks/src/test/java/org/apache/druid/benchmark/FlattenJSONBenchmarkUtilTest.java b/benchmarks/src/test/java/org/apache/druid/benchmark/FlattenJSONBenchmarkUtilTest.java
index f4b79108f407..a81e07cfde1f 100644
--- a/benchmarks/src/test/java/org/apache/druid/benchmark/FlattenJSONBenchmarkUtilTest.java
+++ b/benchmarks/src/test/java/org/apache/druid/benchmark/FlattenJSONBenchmarkUtilTest.java
@@ -20,7 +20,6 @@
package org.apache.druid.benchmark;
import org.apache.druid.java.util.common.parsers.Parser;
-import org.apache.druid.utils.JvmUtils;
import org.junit.Assert;
import org.junit.Test;
@@ -65,31 +64,15 @@ public void checkEvent1(Map event)
Assert.assertEquals("129047958", event.get("e2.ad1[0]").toString());
Assert.assertEquals("1658972185", event.get("e2.ad1[1]").toString());
Assert.assertEquals("-997010830", event.get("e2.ad1[2]").toString());
-
- // Java 19 changes some floating point string representation
- // https://bugs.openjdk.org/browse/JDK-8291475
- if (JvmUtils.majorVersion() < 19) {
- Assert.assertEquals("-5.8772014847368817E18", event.get("e3.m1").toString());
- } else {
- Assert.assertEquals("-5.877201484736882E18", event.get("e3.m1").toString());
- }
-
+ Assert.assertEquals("-5.8772014847368817E18", event.get("e3.m1").toString());
Assert.assertEquals("0.4375433369079904", event.get("e3.m2").toString());
Assert.assertEquals("0.8510482953607659", event.get("e3.m3").toString());
Assert.assertEquals("-2.3832626488759337E18", event.get("e3.m4").toString());
- if (JvmUtils.majorVersion() < 19) {
- Assert.assertEquals("7.9789762132607068E18", event.get("e3.am1[0]").toString());
- Assert.assertEquals("-7.8634787235005573E18", event.get("e3.am1[1]").toString());
- Assert.assertEquals("8.7372945568982446E18", event.get("e3.am1[2]").toString());
- Assert.assertEquals("3.1928124802414899E18", event.get("e3.am1[3]").toString());
- Assert.assertEquals("-3.9806631713718011E18", event.get("e4.e4.m4").toString());
- } else {
- Assert.assertEquals("7.978976213260707E18", event.get("e3.am1[0]").toString());
- Assert.assertEquals("-7.863478723500557E18", event.get("e3.am1[1]").toString());
- Assert.assertEquals("8.737294556898245E18", event.get("e3.am1[2]").toString());
- Assert.assertEquals("3.19281248024149E18", event.get("e3.am1[3]").toString());
- Assert.assertEquals("-3.980663171371801E18", event.get("e4.e4.m4").toString());
- }
+ Assert.assertEquals("7.9789762132607068E18", event.get("e3.am1[0]").toString());
+ Assert.assertEquals("-7.8634787235005573E18", event.get("e3.am1[1]").toString());
+ Assert.assertEquals("8.7372945568982446E18", event.get("e3.am1[2]").toString());
+ Assert.assertEquals("3.1928124802414899E18", event.get("e3.am1[3]").toString());
+ Assert.assertEquals("-3.9806631713718011E18", event.get("e4.e4.m4").toString());
Assert.assertEquals("-1915243040", event.get("ae1[0].d1").toString());
Assert.assertEquals("-2020543641", event.get("ae1[1].d1").toString());
Assert.assertEquals("1414285347", event.get("ae1[2].e1.d2").toString());
diff --git a/docs/api-reference/dynamic-configuration-api.md b/docs/api-reference/dynamic-configuration-api.md
index b884ca6b955c..46baca3dd6b0 100644
--- a/docs/api-reference/dynamic-configuration-api.md
+++ b/docs/api-reference/dynamic-configuration-api.md
@@ -10,19 +10,19 @@ import TabItem from '@theme/TabItem';
~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
+ ~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
+ ~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
+ ~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
+ ~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
diff --git a/extensions-contrib/kubernetes-overlord-extensions/pom.xml b/extensions-contrib/kubernetes-overlord-extensions/pom.xml
index f231521dfa71..eacd69ed6292 100644
--- a/extensions-contrib/kubernetes-overlord-extensions/pom.xml
+++ b/extensions-contrib/kubernetes-overlord-extensions/pom.xml
@@ -214,6 +214,7 @@
org.mockito
mockito-core
+ ${mockito.version}
test
diff --git a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java
index 36c43ef475d4..3b230d706bf2 100644
--- a/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java
+++ b/extensions-contrib/materialized-view-selection/src/test/java/org/apache/druid/query/materializedview/MaterializedViewQueryQueryToolChestTest.java
@@ -45,7 +45,6 @@
import org.apache.druid.query.timeseries.TimeseriesQuery;
import org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest;
import org.apache.druid.query.timeseries.TimeseriesResultValue;
-import org.apache.druid.testing.InitializedNullHandlingTest;
import org.junit.Assert;
import org.junit.Test;
@@ -55,7 +54,7 @@
import java.util.Map;
import java.util.stream.Collectors;
-public class MaterializedViewQueryQueryToolChestTest extends InitializedNullHandlingTest
+public class MaterializedViewQueryQueryToolChestTest
{
static {
NullHandling.initializeForTests();
diff --git a/extensions-core/azure-extensions/pom.xml b/extensions-core/azure-extensions/pom.xml
index 362c9f43b6af..2e91c4bd930f 100644
--- a/extensions-core/azure-extensions/pom.xml
+++ b/extensions-core/azure-extensions/pom.xml
@@ -154,14 +154,13 @@
org.mockito
- mockito-${mockito.inline.artifact}
+ mockito-core
${mockito.version}
test
-
org.mockito
- mockito-core
+ mockito-inline
test
diff --git a/extensions-core/druid-pac4j/pom.xml b/extensions-core/druid-pac4j/pom.xml
index a8cb8b3a08bf..65bb678596d4 100644
--- a/extensions-core/druid-pac4j/pom.xml
+++ b/extensions-core/druid-pac4j/pom.xml
@@ -64,13 +64,6 @@
org.pac4j
pac4j-oidc
${pac4j.version}
-
-
-
- org.mockito
- mockito-core
-
-
diff --git a/extensions-core/lookups-cached-global/pom.xml b/extensions-core/lookups-cached-global/pom.xml
index 3aca23fc9ec6..092e8f87d96b 100644
--- a/extensions-core/lookups-cached-global/pom.xml
+++ b/extensions-core/lookups-cached-global/pom.xml
@@ -140,16 +140,14 @@
easymock
test
-
org.mockito
- mockito-core
- ${mockito.version}
+ mockito-inline
test
org.mockito
- mockito-${mockito.inline.artifact}
+ mockito-core
test
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java
index c423b959eccf..5cdd7b0ffa6e 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java
@@ -874,7 +874,7 @@ public void resultsComplete(
try {
convertedResultObject = context.jsonMapper().convertValue(
resultObject,
- queryKernel.getStageDefinition(stageId).getProcessorFactory().getResultTypeReference()
+ queryKernel.getStageDefinition(stageId).getProcessorFactory().getAccumulatedResultTypeReference()
);
}
catch (IllegalArgumentException e) {
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java
index d522c3a7f169..95f656015ac3 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java
@@ -62,8 +62,6 @@
import org.apache.druid.frame.processor.PartitionedOutputChannel;
import org.apache.druid.frame.processor.SuperSorter;
import org.apache.druid.frame.processor.SuperSorterProgressTracker;
-import org.apache.druid.frame.processor.manager.ProcessorManager;
-import org.apache.druid.frame.processor.manager.ProcessorManagers;
import org.apache.druid.frame.util.DurableStorageUtils;
import org.apache.druid.frame.write.FrameWriters;
import org.apache.druid.indexer.TaskStatus;
@@ -73,6 +71,8 @@
import org.apache.druid.java.util.common.RE;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.UOE;
+import org.apache.druid.java.util.common.guava.Sequence;
+import org.apache.druid.java.util.common.guava.Sequences;
import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.msq.counters.CounterNames;
@@ -1100,12 +1100,11 @@ private void makeInputSliceReader()
.put(ExternalInputSlice.class, new ExternalInputSliceReader(frameContext.tempDir()))
.put(InlineInputSlice.class, new InlineInputSliceReader(frameContext.segmentWrangler()))
.put(LookupInputSlice.class, new LookupInputSliceReader(frameContext.segmentWrangler()))
- .put(
- SegmentsInputSlice.class,
- new SegmentsInputSliceReader(
- frameContext.dataSegmentProvider(),
- MultiStageQueryContext.isReindex(QueryContext.of(task().getContext()))
- )
+ .put(SegmentsInputSlice.class,
+ new SegmentsInputSliceReader(
+ frameContext.dataSegmentProvider(),
+ MultiStageQueryContext.isReindex(QueryContext.of(task().getContext()))
+ )
)
.build()
);
@@ -1153,16 +1152,7 @@ private void makeShuffleOutputChannelFactory(boolean isFinalStage)
);
}
- /**
- * Use {@link FrameProcessorFactory#makeProcessors} to create {@link ProcessorsAndChannels}. Executes the
- * processors using {@link #exec} and sets the output channels in {@link #workResultAndOutputChannels}.
- *
- * @param type of {@link StageDefinition#getProcessorFactory()}
- * @param return type of {@link FrameProcessor} created by the manager
- * @param result type of {@link ProcessorManager#result()}
- * @param type of {@link WorkOrder#getExtraInfo()}
- */
- private , ProcessorReturnType, ManagerReturnType, ExtraInfoType> void makeAndRunWorkProcessors()
+ private , I, WorkerClass extends FrameProcessor, T, R> void makeAndRunWorkProcessors()
throws IOException
{
if (workResultAndOutputChannels != null) {
@@ -1173,13 +1163,13 @@ private processors =
+ final ProcessorsAndChannels processors =
processorFactory.makeProcessors(
kernel.getStageDefinition(),
kernel.getWorkOrder().getWorkerNumber(),
kernel.getWorkOrder().getInputs(),
inputSliceReader,
- (ExtraInfoType) kernel.getWorkOrder().getExtraInfo(),
+ (I) kernel.getWorkOrder().getExtraInfo(),
workOutputChannelFactory,
frameContext,
parallelism,
@@ -1187,7 +1177,7 @@ private warningPublisher.publishException(kernel.getStageDefinition().getStageNumber(), e)
);
- final ProcessorManager processorManager = processors.getProcessorManager();
+ final Sequence processorSequence = processors.processors();
final int maxOutstandingProcessors;
@@ -1200,8 +1190,10 @@ private workResultFuture = exec.runAllFully(
- processorManager,
+ final ListenableFuture workResultFuture = exec.runAllFully(
+ processorSequence,
+ processorFactory.newAccumulatedResult(),
+ processorFactory::accumulateResult,
maxOutstandingProcessors,
processorBouncer,
cancellationId
@@ -1724,13 +1716,11 @@ private ResultAndChannels> gatherResultKeyStatistics(final OutputChannels chan
final ListenableFuture clusterByStatisticsCollectorFuture =
exec.runAllFully(
- ProcessorManagers.of(processors)
- .withAccumulation(
- stageDefinition.createResultKeyStatisticsCollector(
- frameContext.memoryParameters().getPartitionStatisticsMaxRetainedBytes()
- ),
- ClusterByStatisticsCollector::addAll
- ),
+ Sequences.simple(processors),
+ stageDefinition.createResultKeyStatisticsCollector(
+ frameContext.memoryParameters().getPartitionStatisticsMaxRetainedBytes()
+ ),
+ ClusterByStatisticsCollector::addAll,
// Run all processors simultaneously. They are lightweight and this keeps things moving.
processors.size(),
Bouncer.unlimited(),
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java
index a09d0508485d..4bddb949f076 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java
@@ -32,7 +32,6 @@
import org.apache.druid.msq.input.InputSpecs;
import org.apache.druid.msq.kernel.QueryDefinition;
import org.apache.druid.msq.kernel.StageDefinition;
-import org.apache.druid.msq.querykit.BroadcastJoinSegmentMapFnProcessor;
import org.apache.druid.msq.statistics.ClusterByStatisticsCollectorImpl;
import org.apache.druid.query.lookup.LookupExtractor;
import org.apache.druid.query.lookup.LookupExtractorFactoryContainer;
@@ -131,11 +130,11 @@ public class WorkerMemoryParameters
private static final long SMALL_WORKER_CAPACITY_THRESHOLD_BYTES = 256_000_000;
/**
- * Fraction of free memory per bundle that can be used by {@link BroadcastJoinSegmentMapFnProcessor} to store broadcast
- * data on-heap. This is used to limit the total size of input frames, which we expect to expand on-heap. Expansion
- * can potentially be somewhat over 2x: for example, strings are UTF-8 in frames, but are UTF-16 on-heap, which is
- * a 2x expansion, and object and index overhead must be considered on top of that. So we use a value somewhat
- * lower than 0.5.
+ * Fraction of free memory per bundle that can be used by {@link org.apache.druid.msq.querykit.BroadcastJoinHelper}
+ * to store broadcast data on-heap. This is used to limit the total size of input frames, which we expect to
+ * expand on-heap. Expansion can potentially be somewhat over 2x: for example, strings are UTF-8 in frames, but are
+ * UTF-16 on-heap, which is a 2x expansion, and object and index overhead must be considered on top of that. So
+ * we use a value somewhat lower than 0.5.
*/
static final double BROADCAST_JOIN_MEMORY_FRACTION = 0.3;
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/SegmentGeneratorFrameProcessorFactory.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/SegmentGeneratorFrameProcessorFactory.java
index 8af4862f2185..998e04295579 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/SegmentGeneratorFrameProcessorFactory.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/SegmentGeneratorFrameProcessorFactory.java
@@ -28,7 +28,6 @@
import com.google.common.collect.Iterables;
import org.apache.druid.frame.processor.OutputChannelFactory;
import org.apache.druid.frame.processor.OutputChannels;
-import org.apache.druid.frame.processor.manager.ProcessorManagers;
import org.apache.druid.indexer.partitions.DynamicPartitionsSpec;
import org.apache.druid.indexer.partitions.PartitionsSpec;
import org.apache.druid.java.util.common.Pair;
@@ -76,7 +75,7 @@
@JsonTypeName("segmentGenerator")
public class SegmentGeneratorFrameProcessorFactory
- implements FrameProcessorFactory, List>
+ implements FrameProcessorFactory, SegmentGeneratorFrameProcessor, DataSegment, Set>
{
private final DataSchema dataSchema;
private final ColumnMappings columnMappings;
@@ -113,7 +112,7 @@ public MSQTuningConfig getTuningConfig()
}
@Override
- public ProcessorsAndChannels> makeProcessors(
+ public ProcessorsAndChannels makeProcessors(
StageDefinition stageDefinition,
int workerNumber,
List inputSlices,
@@ -152,8 +151,7 @@ public Pair apply(ReadableInput readableInput)
}
));
final SegmentGenerationProgressCounter segmentGenerationProgressCounter = counters.segmentGenerationProgress();
- final SegmentGeneratorMetricsWrapper segmentGeneratorMetricsWrapper =
- new SegmentGeneratorMetricsWrapper(segmentGenerationProgressCounter);
+ final SegmentGeneratorMetricsWrapper segmentGeneratorMetricsWrapper = new SegmentGeneratorMetricsWrapper(segmentGenerationProgressCounter);
final Sequence workers = inputSequence.map(
readableInputPair -> {
@@ -198,28 +196,32 @@ public Pair apply(ReadableInput readableInput)
}
);
- return new ProcessorsAndChannels<>(
- ProcessorManagers.of(workers)
- .withAccumulation(
- new HashSet<>(),
- (acc, segment) -> {
- if (segment != null) {
- acc.add(segment);
- }
-
- return acc;
- }
- ),
- OutputChannels.none()
- );
+ return new ProcessorsAndChannels<>(workers, OutputChannels.none());
}
@Override
- public TypeReference> getResultTypeReference()
+ public TypeReference> getAccumulatedResultTypeReference()
{
return new TypeReference>() {};
}
+ @Override
+ public Set newAccumulatedResult()
+ {
+ return new HashSet<>();
+ }
+
+ @Nullable
+ @Override
+ public Set accumulateResult(Set accumulated, DataSegment current)
+ {
+ if (current != null) {
+ accumulated.add(current);
+ }
+
+ return accumulated;
+ }
+
@Nullable
@Override
public Set mergeAccumulatedResult(Set accumulated, Set otherAccumulated)
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/FrameProcessorFactory.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/FrameProcessorFactory.java
index 87423664fbc5..4b76d8d281f1 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/FrameProcessorFactory.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/FrameProcessorFactory.java
@@ -21,8 +21,8 @@
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.core.type.TypeReference;
+import org.apache.druid.frame.processor.FrameProcessor;
import org.apache.druid.frame.processor.OutputChannelFactory;
-import org.apache.druid.frame.processor.manager.ProcessorManager;
import org.apache.druid.msq.counters.CounterTracker;
import org.apache.druid.msq.input.InputSlice;
import org.apache.druid.msq.input.InputSliceReader;
@@ -36,17 +36,18 @@
* Property of {@link StageDefinition} that describes its computation logic.
*
* Workers call {@link #makeProcessors} to generate the processors that perform computations within that worker's
- * {@link org.apache.druid.frame.processor.FrameProcessorExecutor}. Additionally, provides
- * {@link #mergeAccumulatedResult(Object, Object)} for merging results from {@link ProcessorManager#result()}.
+ * {@link org.apache.druid.frame.processor.FrameProcessorExecutor}. Additionally, provides methods for accumulating
+ * the results of the processors: {@link #newAccumulatedResult()}, {@link #accumulateResult}, and
+ * {@link #mergeAccumulatedResult}.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
-public interface FrameProcessorFactory
+public interface FrameProcessorFactory, T, R>
{
/**
* Create processors for a particular worker in a particular stage. The processors will be run on a thread pool,
* with at most "maxOutstandingProcessors" number of processors outstanding at once.
*
- * The Sequence returned by {@link ProcessorsAndChannels#getProcessorManager()} is passed directly to
+ * The Sequence returned by {@link ProcessorsAndChannels#processors()} is passed directly to
* {@link org.apache.druid.frame.processor.FrameProcessorExecutor#runAllFully}.
*
* @param stageDefinition stage definition
@@ -64,7 +65,7 @@ public interface FrameProcessorFactory
*
* @return a processor sequence, which may be computed lazily; and a list of output channels.
*/
- ProcessorsAndChannels makeProcessors(
+ ProcessorsAndChannels makeProcessors(
StageDefinition stageDefinition,
int workerNumber,
List inputSlices,
@@ -77,8 +78,18 @@ ProcessorsAndChannels makeProcessors(
Consumer warningPublisher
) throws IOException;
- @Nullable
- TypeReference getResultTypeReference();
+ TypeReference getAccumulatedResultTypeReference();
+
+ /**
+ * Produces a "blank slate" result.
+ */
+ R newAccumulatedResult();
+
+ /**
+ * Accumulates an additional result. May modify the left-hand side {@code accumulated}. Does not modify the
+ * right-hand side {@code current}.
+ */
+ R accumulateResult(R accumulated, T current);
/**
* Merges two accumulated results. May modify the left-hand side {@code accumulated}. Does not modify the right-hand
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/ProcessorsAndChannels.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/ProcessorsAndChannels.java
index a90751ea14ab..89d882d588a6 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/ProcessorsAndChannels.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/ProcessorsAndChannels.java
@@ -19,34 +19,32 @@
package org.apache.druid.msq.kernel;
+import org.apache.druid.frame.processor.FrameProcessor;
import org.apache.druid.frame.processor.OutputChannels;
-import org.apache.druid.frame.processor.manager.ProcessorManager;
+import org.apache.druid.java.util.common.guava.Sequence;
/**
* Returned from {@link FrameProcessorFactory#makeProcessors}.
*
* Includes a processor sequence and a list of output channels.
- *
- * @param return type of {@link org.apache.druid.frame.processor.FrameProcessor} from {@link #getProcessorManager()}
- * @param result type of {@link ProcessorManager#result()}
*/
-public class ProcessorsAndChannels
+public class ProcessorsAndChannels, T>
{
- private final ProcessorManager processorManager;
+ private final Sequence workers;
private final OutputChannels outputChannels;
public ProcessorsAndChannels(
- final ProcessorManager processorManager,
+ final Sequence workers,
final OutputChannels outputChannels
)
{
- this.processorManager = processorManager;
+ this.workers = workers;
this.outputChannels = outputChannels;
}
- public ProcessorManager getProcessorManager()
+ public Sequence processors()
{
- return processorManager;
+ return workers;
}
public OutputChannels getOutputChannels()
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseFrameProcessorFactory.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseFrameProcessorFactory.java
index 33f702aca0cc..576abd163159 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseFrameProcessorFactory.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/BaseFrameProcessorFactory.java
@@ -20,6 +20,7 @@
package org.apache.druid.msq.querykit;
import com.fasterxml.jackson.core.type.TypeReference;
+import org.apache.druid.frame.processor.FrameProcessor;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.msq.kernel.ExtraInfoHolder;
import org.apache.druid.msq.kernel.FrameProcessorFactory;
@@ -29,17 +30,30 @@
/**
* Basic abstract {@link FrameProcessorFactory} that yields workers that do not require extra info and that
- * ignore the return values of their processors. This base class isn't used for every worker factory, but it is used
- * for many of them.
+ * always return Longs. This base class isn't used for every worker factory, but it is used for many of them.
*/
-public abstract class BaseFrameProcessorFactory implements FrameProcessorFactory