Supervisor API

This topic describes the API endpoints to manage and monitor supervisors for Apache Druid. The topic uses the Apache Kafka term offset to refer to the identifier for records in a partition. If you are using Amazon Kinesis, the equivalent is sequence number.

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.

Supervisor information

The following table lists the properties of a supervisor object:

PropertyTypeDescription
idStringUnique identifier.
stateStringGeneric state of the supervisor. Available states:UNHEALTHY_SUPERVISOR, UNHEALTHY_TASKS, PENDING, RUNNING, SUSPENDED, STOPPING. See Supervisor reference for more information.
detailedStateStringDetailed state of the supervisor. This property contains a more descriptive, implementation-specific state that may provide more insight into the supervisor’s activities than the state property. See Apache Kafka ingestion and Amazon Kinesis ingestion for supervisor-specific states.
healthyBooleanSupervisor health indicator.
specObjectContainer object for the supervisor configuration.
suspendedBooleanIndicates whether the supervisor is in a suspended state.

Get an array of active supervisor IDs

Returns an array of strings representing the names of active supervisors. If there are no active supervisors, it returns an empty array.

URL

GET /druid/indexer/v1/supervisor

Responses

  • 200 SUCCESS

Successfully retrieved array of active supervisor IDs


Sample request

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor"
  1. GET /druid/indexer/v1/supervisor HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. [
  2. "wikipedia_stream",
  3. "social_media"
  4. ]

Get an array of active supervisor objects

Retrieves an array of active supervisor objects. If there are no active supervisors, it returns an empty array. For reference on the supervisor object properties, see the preceding table.

URL

GET /druid/indexer/v1/supervisor?full

Responses

  • 200 SUCCESS

Successfully retrieved supervisor objects


Sample request

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor?full=null"
  1. GET /druid/indexer/v1/supervisor?full=null HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. [
  2. {
  3. "id": "wikipedia_stream",
  4. "state": "RUNNING",
  5. "detailedState": "CONNECTING_TO_STREAM",
  6. "healthy": true,
  7. "spec": {
  8. "type": "kafka",
  9. "spec": {
  10. "dataSchema": {
  11. "dataSource": "wikipedia_stream",
  12. "timestampSpec": {
  13. "column": "__time",
  14. "format": "iso",
  15. "missingValue": null
  16. },
  17. "dimensionsSpec": {
  18. "dimensions": [
  19. {
  20. "type": "string",
  21. "name": "username",
  22. "multiValueHandling": "SORTED_ARRAY",
  23. "createBitmapIndex": true
  24. },
  25. {
  26. "type": "string",
  27. "name": "post_title",
  28. "multiValueHandling": "SORTED_ARRAY",
  29. "createBitmapIndex": true
  30. },
  31. {
  32. "type": "long",
  33. "name": "views",
  34. "multiValueHandling": "SORTED_ARRAY",
  35. "createBitmapIndex": false
  36. },
  37. {
  38. "type": "long",
  39. "name": "upvotes",
  40. "multiValueHandling": "SORTED_ARRAY",
  41. "createBitmapIndex": false
  42. },
  43. {
  44. "type": "long",
  45. "name": "comments",
  46. "multiValueHandling": "SORTED_ARRAY",
  47. "createBitmapIndex": false
  48. },
  49. {
  50. "type": "string",
  51. "name": "edited",
  52. "multiValueHandling": "SORTED_ARRAY",
  53. "createBitmapIndex": true
  54. }
  55. ],
  56. "dimensionExclusions": [
  57. "__time"
  58. ],
  59. "includeAllDimensions": false,
  60. "useSchemaDiscovery": false
  61. },
  62. "metricsSpec": [],
  63. "granularitySpec": {
  64. "type": "uniform",
  65. "segmentGranularity": "HOUR",
  66. "queryGranularity": {
  67. "type": "none"
  68. },
  69. "rollup": false,
  70. "intervals": []
  71. },
  72. "transformSpec": {
  73. "filter": null,
  74. "transforms": []
  75. }
  76. },
  77. "ioConfig": {
  78. "topic": "social_media",
  79. "inputFormat": {
  80. "type": "json"
  81. },
  82. "replicas": 1,
  83. "taskCount": 1,
  84. "taskDuration": "PT3600S",
  85. "consumerProperties": {
  86. "bootstrap.servers": "localhost:9042"
  87. },
  88. "autoScalerConfig": null,
  89. "pollTimeout": 100,
  90. "startDelay": "PT5S",
  91. "period": "PT30S",
  92. "useEarliestOffset": true,
  93. "completionTimeout": "PT1800S",
  94. "lateMessageRejectionPeriod": null,
  95. "earlyMessageRejectionPeriod": null,
  96. "lateMessageRejectionStartDateTime": null,
  97. "configOverrides": null,
  98. "idleConfig": null,
  99. "stream": "social_media",
  100. "useEarliestSequenceNumber": true
  101. },
  102. "tuningConfig": {
  103. "type": "kafka",
  104. "appendableIndexSpec": {
  105. "type": "onheap",
  106. "preserveExistingMetrics": false
  107. },
  108. "maxRowsInMemory": 150000,
  109. "maxBytesInMemory": 0,
  110. "skipBytesInMemoryOverheadCheck": false,
  111. "maxRowsPerSegment": 5000000,
  112. "maxTotalRows": null,
  113. "intermediatePersistPeriod": "PT10M",
  114. "maxPendingPersists": 0,
  115. "indexSpec": {
  116. "bitmap": {
  117. "type": "roaring"
  118. },
  119. "dimensionCompression": "lz4",
  120. "stringDictionaryEncoding": {
  121. "type": "utf8"
  122. },
  123. "metricCompression": "lz4",
  124. "longEncoding": "longs"
  125. },
  126. "indexSpecForIntermediatePersists": {
  127. "bitmap": {
  128. "type": "roaring"
  129. },
  130. "dimensionCompression": "lz4",
  131. "stringDictionaryEncoding": {
  132. "type": "utf8"
  133. },
  134. "metricCompression": "lz4",
  135. "longEncoding": "longs"
  136. },
  137. "reportParseExceptions": false,
  138. "handoffConditionTimeout": 0,
  139. "resetOffsetAutomatically": false,
  140. "segmentWriteOutMediumFactory": null,
  141. "workerThreads": null,
  142. "chatRetries": 8,
  143. "httpTimeout": "PT10S",
  144. "shutdownTimeout": "PT80S",
  145. "offsetFetchPeriod": "PT30S",
  146. "intermediateHandoffPeriod": "P2147483647D",
  147. "logParseExceptions": false,
  148. "maxParseExceptions": 2147483647,
  149. "maxSavedParseExceptions": 0,
  150. "skipSequenceNumberAvailabilityCheck": false,
  151. "repartitionTransitionDuration": "PT120S"
  152. }
  153. },
  154. "dataSchema": {
  155. "dataSource": "wikipedia_stream",
  156. "timestampSpec": {
  157. "column": "__time",
  158. "format": "iso",
  159. "missingValue": null
  160. },
  161. "dimensionsSpec": {
  162. "dimensions": [
  163. {
  164. "type": "string",
  165. "name": "username",
  166. "multiValueHandling": "SORTED_ARRAY",
  167. "createBitmapIndex": true
  168. },
  169. {
  170. "type": "string",
  171. "name": "post_title",
  172. "multiValueHandling": "SORTED_ARRAY",
  173. "createBitmapIndex": true
  174. },
  175. {
  176. "type": "long",
  177. "name": "views",
  178. "multiValueHandling": "SORTED_ARRAY",
  179. "createBitmapIndex": false
  180. },
  181. {
  182. "type": "long",
  183. "name": "upvotes",
  184. "multiValueHandling": "SORTED_ARRAY",
  185. "createBitmapIndex": false
  186. },
  187. {
  188. "type": "long",
  189. "name": "comments",
  190. "multiValueHandling": "SORTED_ARRAY",
  191. "createBitmapIndex": false
  192. },
  193. {
  194. "type": "string",
  195. "name": "edited",
  196. "multiValueHandling": "SORTED_ARRAY",
  197. "createBitmapIndex": true
  198. }
  199. ],
  200. "dimensionExclusions": [
  201. "__time"
  202. ],
  203. "includeAllDimensions": false,
  204. "useSchemaDiscovery": false
  205. },
  206. "metricsSpec": [],
  207. "granularitySpec": {
  208. "type": "uniform",
  209. "segmentGranularity": "HOUR",
  210. "queryGranularity": {
  211. "type": "none"
  212. },
  213. "rollup": false,
  214. "intervals": []
  215. },
  216. "transformSpec": {
  217. "filter": null,
  218. "transforms": []
  219. }
  220. },
  221. "tuningConfig": {
  222. "type": "kafka",
  223. "appendableIndexSpec": {
  224. "type": "onheap",
  225. "preserveExistingMetrics": false
  226. },
  227. "maxRowsInMemory": 150000,
  228. "maxBytesInMemory": 0,
  229. "skipBytesInMemoryOverheadCheck": false,
  230. "maxRowsPerSegment": 5000000,
  231. "maxTotalRows": null,
  232. "intermediatePersistPeriod": "PT10M",
  233. "maxPendingPersists": 0,
  234. "indexSpec": {
  235. "bitmap": {
  236. "type": "roaring"
  237. },
  238. "dimensionCompression": "lz4",
  239. "stringDictionaryEncoding": {
  240. "type": "utf8"
  241. },
  242. "metricCompression": "lz4",
  243. "longEncoding": "longs"
  244. },
  245. "indexSpecForIntermediatePersists": {
  246. "bitmap": {
  247. "type": "roaring"
  248. },
  249. "dimensionCompression": "lz4",
  250. "stringDictionaryEncoding": {
  251. "type": "utf8"
  252. },
  253. "metricCompression": "lz4",
  254. "longEncoding": "longs"
  255. },
  256. "reportParseExceptions": false,
  257. "handoffConditionTimeout": 0,
  258. "resetOffsetAutomatically": false,
  259. "segmentWriteOutMediumFactory": null,
  260. "workerThreads": null,
  261. "chatRetries": 8,
  262. "httpTimeout": "PT10S",
  263. "shutdownTimeout": "PT80S",
  264. "offsetFetchPeriod": "PT30S",
  265. "intermediateHandoffPeriod": "P2147483647D",
  266. "logParseExceptions": false,
  267. "maxParseExceptions": 2147483647,
  268. "maxSavedParseExceptions": 0,
  269. "skipSequenceNumberAvailabilityCheck": false,
  270. "repartitionTransitionDuration": "PT120S"
  271. },
  272. "ioConfig": {
  273. "topic": "social_media",
  274. "inputFormat": {
  275. "type": "json"
  276. },
  277. "replicas": 1,
  278. "taskCount": 1,
  279. "taskDuration": "PT3600S",
  280. "consumerProperties": {
  281. "bootstrap.servers": "localhost:9042"
  282. },
  283. "autoScalerConfig": null,
  284. "pollTimeout": 100,
  285. "startDelay": "PT5S",
  286. "period": "PT30S",
  287. "useEarliestOffset": true,
  288. "completionTimeout": "PT1800S",
  289. "lateMessageRejectionPeriod": null,
  290. "earlyMessageRejectionPeriod": null,
  291. "lateMessageRejectionStartDateTime": null,
  292. "configOverrides": null,
  293. "idleConfig": null,
  294. "stream": "social_media",
  295. "useEarliestSequenceNumber": true
  296. },
  297. "context": null,
  298. "suspended": false
  299. },
  300. "suspended": false
  301. },
  302. {
  303. "id": "social_media",
  304. "state": "RUNNING",
  305. "detailedState": "RUNNING",
  306. "healthy": true,
  307. "spec": {
  308. "type": "kafka",
  309. "spec": {
  310. "dataSchema": {
  311. "dataSource": "social_media",
  312. "timestampSpec": {
  313. "column": "__time",
  314. "format": "iso",
  315. "missingValue": null
  316. },
  317. "dimensionsSpec": {
  318. "dimensions": [
  319. {
  320. "type": "string",
  321. "name": "username",
  322. "multiValueHandling": "SORTED_ARRAY",
  323. "createBitmapIndex": true
  324. },
  325. {
  326. "type": "string",
  327. "name": "post_title",
  328. "multiValueHandling": "SORTED_ARRAY",
  329. "createBitmapIndex": true
  330. },
  331. {
  332. "type": "long",
  333. "name": "views",
  334. "multiValueHandling": "SORTED_ARRAY",
  335. "createBitmapIndex": false
  336. },
  337. {
  338. "type": "long",
  339. "name": "upvotes",
  340. "multiValueHandling": "SORTED_ARRAY",
  341. "createBitmapIndex": false
  342. },
  343. {
  344. "type": "long",
  345. "name": "comments",
  346. "multiValueHandling": "SORTED_ARRAY",
  347. "createBitmapIndex": false
  348. },
  349. {
  350. "type": "string",
  351. "name": "edited",
  352. "multiValueHandling": "SORTED_ARRAY",
  353. "createBitmapIndex": true
  354. }
  355. ],
  356. "dimensionExclusions": [
  357. "__time"
  358. ],
  359. "includeAllDimensions": false,
  360. "useSchemaDiscovery": false
  361. },
  362. "metricsSpec": [],
  363. "granularitySpec": {
  364. "type": "uniform",
  365. "segmentGranularity": "HOUR",
  366. "queryGranularity": {
  367. "type": "none"
  368. },
  369. "rollup": false,
  370. "intervals": []
  371. },
  372. "transformSpec": {
  373. "filter": null,
  374. "transforms": []
  375. }
  376. },
  377. "ioConfig": {
  378. "topic": "social_media",
  379. "inputFormat": {
  380. "type": "json"
  381. },
  382. "replicas": 1,
  383. "taskCount": 1,
  384. "taskDuration": "PT3600S",
  385. "consumerProperties": {
  386. "bootstrap.servers": "localhost:9094"
  387. },
  388. "autoScalerConfig": null,
  389. "pollTimeout": 100,
  390. "startDelay": "PT5S",
  391. "period": "PT30S",
  392. "useEarliestOffset": true,
  393. "completionTimeout": "PT1800S",
  394. "lateMessageRejectionPeriod": null,
  395. "earlyMessageRejectionPeriod": null,
  396. "lateMessageRejectionStartDateTime": null,
  397. "configOverrides": null,
  398. "idleConfig": null,
  399. "stream": "social_media",
  400. "useEarliestSequenceNumber": true
  401. },
  402. "tuningConfig": {
  403. "type": "kafka",
  404. "appendableIndexSpec": {
  405. "type": "onheap",
  406. "preserveExistingMetrics": false
  407. },
  408. "maxRowsInMemory": 150000,
  409. "maxBytesInMemory": 0,
  410. "skipBytesInMemoryOverheadCheck": false,
  411. "maxRowsPerSegment": 5000000,
  412. "maxTotalRows": null,
  413. "intermediatePersistPeriod": "PT10M",
  414. "maxPendingPersists": 0,
  415. "indexSpec": {
  416. "bitmap": {
  417. "type": "roaring"
  418. },
  419. "dimensionCompression": "lz4",
  420. "stringDictionaryEncoding": {
  421. "type": "utf8"
  422. },
  423. "metricCompression": "lz4",
  424. "longEncoding": "longs"
  425. },
  426. "indexSpecForIntermediatePersists": {
  427. "bitmap": {
  428. "type": "roaring"
  429. },
  430. "dimensionCompression": "lz4",
  431. "stringDictionaryEncoding": {
  432. "type": "utf8"
  433. },
  434. "metricCompression": "lz4",
  435. "longEncoding": "longs"
  436. },
  437. "reportParseExceptions": false,
  438. "handoffConditionTimeout": 0,
  439. "resetOffsetAutomatically": false,
  440. "segmentWriteOutMediumFactory": null,
  441. "workerThreads": null,
  442. "chatRetries": 8,
  443. "httpTimeout": "PT10S",
  444. "shutdownTimeout": "PT80S",
  445. "offsetFetchPeriod": "PT30S",
  446. "intermediateHandoffPeriod": "P2147483647D",
  447. "logParseExceptions": false,
  448. "maxParseExceptions": 2147483647,
  449. "maxSavedParseExceptions": 0,
  450. "skipSequenceNumberAvailabilityCheck": false,
  451. "repartitionTransitionDuration": "PT120S"
  452. }
  453. },
  454. "dataSchema": {
  455. "dataSource": "social_media",
  456. "timestampSpec": {
  457. "column": "__time",
  458. "format": "iso",
  459. "missingValue": null
  460. },
  461. "dimensionsSpec": {
  462. "dimensions": [
  463. {
  464. "type": "string",
  465. "name": "username",
  466. "multiValueHandling": "SORTED_ARRAY",
  467. "createBitmapIndex": true
  468. },
  469. {
  470. "type": "string",
  471. "name": "post_title",
  472. "multiValueHandling": "SORTED_ARRAY",
  473. "createBitmapIndex": true
  474. },
  475. {
  476. "type": "long",
  477. "name": "views",
  478. "multiValueHandling": "SORTED_ARRAY",
  479. "createBitmapIndex": false
  480. },
  481. {
  482. "type": "long",
  483. "name": "upvotes",
  484. "multiValueHandling": "SORTED_ARRAY",
  485. "createBitmapIndex": false
  486. },
  487. {
  488. "type": "long",
  489. "name": "comments",
  490. "multiValueHandling": "SORTED_ARRAY",
  491. "createBitmapIndex": false
  492. },
  493. {
  494. "type": "string",
  495. "name": "edited",
  496. "multiValueHandling": "SORTED_ARRAY",
  497. "createBitmapIndex": true
  498. }
  499. ],
  500. "dimensionExclusions": [
  501. "__time"
  502. ],
  503. "includeAllDimensions": false,
  504. "useSchemaDiscovery": false
  505. },
  506. "metricsSpec": [],
  507. "granularitySpec": {
  508. "type": "uniform",
  509. "segmentGranularity": "HOUR",
  510. "queryGranularity": {
  511. "type": "none"
  512. },
  513. "rollup": false,
  514. "intervals": []
  515. },
  516. "transformSpec": {
  517. "filter": null,
  518. "transforms": []
  519. }
  520. },
  521. "tuningConfig": {
  522. "type": "kafka",
  523. "appendableIndexSpec": {
  524. "type": "onheap",
  525. "preserveExistingMetrics": false
  526. },
  527. "maxRowsInMemory": 150000,
  528. "maxBytesInMemory": 0,
  529. "skipBytesInMemoryOverheadCheck": false,
  530. "maxRowsPerSegment": 5000000,
  531. "maxTotalRows": null,
  532. "intermediatePersistPeriod": "PT10M",
  533. "maxPendingPersists": 0,
  534. "indexSpec": {
  535. "bitmap": {
  536. "type": "roaring"
  537. },
  538. "dimensionCompression": "lz4",
  539. "stringDictionaryEncoding": {
  540. "type": "utf8"
  541. },
  542. "metricCompression": "lz4",
  543. "longEncoding": "longs"
  544. },
  545. "indexSpecForIntermediatePersists": {
  546. "bitmap": {
  547. "type": "roaring"
  548. },
  549. "dimensionCompression": "lz4",
  550. "stringDictionaryEncoding": {
  551. "type": "utf8"
  552. },
  553. "metricCompression": "lz4",
  554. "longEncoding": "longs"
  555. },
  556. "reportParseExceptions": false,
  557. "handoffConditionTimeout": 0,
  558. "resetOffsetAutomatically": false,
  559. "segmentWriteOutMediumFactory": null,
  560. "workerThreads": null,
  561. "chatRetries": 8,
  562. "httpTimeout": "PT10S",
  563. "shutdownTimeout": "PT80S",
  564. "offsetFetchPeriod": "PT30S",
  565. "intermediateHandoffPeriod": "P2147483647D",
  566. "logParseExceptions": false,
  567. "maxParseExceptions": 2147483647,
  568. "maxSavedParseExceptions": 0,
  569. "skipSequenceNumberAvailabilityCheck": false,
  570. "repartitionTransitionDuration": "PT120S"
  571. },
  572. "ioConfig": {
  573. "topic": "social_media",
  574. "inputFormat": {
  575. "type": "json"
  576. },
  577. "replicas": 1,
  578. "taskCount": 1,
  579. "taskDuration": "PT3600S",
  580. "consumerProperties": {
  581. "bootstrap.servers": "localhost:9094"
  582. },
  583. "autoScalerConfig": null,
  584. "pollTimeout": 100,
  585. "startDelay": "PT5S",
  586. "period": "PT30S",
  587. "useEarliestOffset": true,
  588. "completionTimeout": "PT1800S",
  589. "lateMessageRejectionPeriod": null,
  590. "earlyMessageRejectionPeriod": null,
  591. "lateMessageRejectionStartDateTime": null,
  592. "configOverrides": null,
  593. "idleConfig": null,
  594. "stream": "social_media",
  595. "useEarliestSequenceNumber": true
  596. },
  597. "context": null,
  598. "suspended": false
  599. },
  600. "suspended": false
  601. }
  602. ]

Get an array of supervisor states

Retrieves an array of objects representing active supervisors and their current state. If there are no active supervisors, it returns an empty array. For reference on the supervisor object properties, see the preceding table.

URL

GET /druid/indexer/v1/supervisor?state=true

Responses

  • 200 SUCCESS

Successfully retrieved supervisor state objects


Sample request

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor?state=true"
  1. GET /druid/indexer/v1/supervisor?state=true HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. [
  2. {
  3. "id": "wikipedia_stream",
  4. "state": "UNHEALTHY_SUPERVISOR",
  5. "detailedState": "UNABLE_TO_CONNECT_TO_STREAM",
  6. "healthy": false,
  7. "suspended": false
  8. },
  9. {
  10. "id": "social_media",
  11. "state": "RUNNING",
  12. "detailedState": "RUNNING",
  13. "healthy": true,
  14. "suspended": false
  15. }
  16. ]

Get supervisor specification

Retrieves the specification for a single supervisor. The returned specification includes the dataSchema, ioConfig, and tuningConfig objects.

URL

GET /druid/indexer/v1/supervisor/{supervisorId}

Responses

  • 200 SUCCESS
  • 404 NOT FOUND

Successfully retrieved supervisor spec

Invalid supervisor ID


Sample request

The following example shows how to retrieve the specification of a supervisor with the name wikipedia_stream.

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/wikipedia_stream"
  1. GET /druid/indexer/v1/supervisor/wikipedia_stream HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "type": "kafka",
  3. "spec": {
  4. "dataSchema": {
  5. "dataSource": "social_media",
  6. "timestampSpec": {
  7. "column": "__time",
  8. "format": "iso",
  9. "missingValue": null
  10. },
  11. "dimensionsSpec": {
  12. "dimensions": [
  13. {
  14. "type": "string",
  15. "name": "username",
  16. "multiValueHandling": "SORTED_ARRAY",
  17. "createBitmapIndex": true
  18. },
  19. {
  20. "type": "string",
  21. "name": "post_title",
  22. "multiValueHandling": "SORTED_ARRAY",
  23. "createBitmapIndex": true
  24. },
  25. {
  26. "type": "long",
  27. "name": "views",
  28. "multiValueHandling": "SORTED_ARRAY",
  29. "createBitmapIndex": false
  30. },
  31. {
  32. "type": "long",
  33. "name": "upvotes",
  34. "multiValueHandling": "SORTED_ARRAY",
  35. "createBitmapIndex": false
  36. },
  37. {
  38. "type": "long",
  39. "name": "comments",
  40. "multiValueHandling": "SORTED_ARRAY",
  41. "createBitmapIndex": false
  42. },
  43. {
  44. "type": "string",
  45. "name": "edited",
  46. "multiValueHandling": "SORTED_ARRAY",
  47. "createBitmapIndex": true
  48. }
  49. ],
  50. "dimensionExclusions": [
  51. "__time"
  52. ],
  53. "includeAllDimensions": false,
  54. "useSchemaDiscovery": false
  55. },
  56. "metricsSpec": [],
  57. "granularitySpec": {
  58. "type": "uniform",
  59. "segmentGranularity": "HOUR",
  60. "queryGranularity": {
  61. "type": "none"
  62. },
  63. "rollup": false,
  64. "intervals": []
  65. },
  66. "transformSpec": {
  67. "filter": null,
  68. "transforms": []
  69. }
  70. },
  71. "ioConfig": {
  72. "topic": "social_media",
  73. "inputFormat": {
  74. "type": "json"
  75. },
  76. "replicas": 1,
  77. "taskCount": 1,
  78. "taskDuration": "PT3600S",
  79. "consumerProperties": {
  80. "bootstrap.servers": "localhost:9094"
  81. },
  82. "autoScalerConfig": null,
  83. "pollTimeout": 100,
  84. "startDelay": "PT5S",
  85. "period": "PT30S",
  86. "useEarliestOffset": true,
  87. "completionTimeout": "PT1800S",
  88. "lateMessageRejectionPeriod": null,
  89. "earlyMessageRejectionPeriod": null,
  90. "lateMessageRejectionStartDateTime": null,
  91. "configOverrides": null,
  92. "idleConfig": null,
  93. "stream": "social_media",
  94. "useEarliestSequenceNumber": true
  95. },
  96. "tuningConfig": {
  97. "type": "kafka",
  98. "appendableIndexSpec": {
  99. "type": "onheap",
  100. "preserveExistingMetrics": false
  101. },
  102. "maxRowsInMemory": 150000,
  103. "maxBytesInMemory": 0,
  104. "skipBytesInMemoryOverheadCheck": false,
  105. "maxRowsPerSegment": 5000000,
  106. "maxTotalRows": null,
  107. "intermediatePersistPeriod": "PT10M",
  108. "maxPendingPersists": 0,
  109. "indexSpec": {
  110. "bitmap": {
  111. "type": "roaring"
  112. },
  113. "dimensionCompression": "lz4",
  114. "stringDictionaryEncoding": {
  115. "type": "utf8"
  116. },
  117. "metricCompression": "lz4",
  118. "longEncoding": "longs"
  119. },
  120. "indexSpecForIntermediatePersists": {
  121. "bitmap": {
  122. "type": "roaring"
  123. },
  124. "dimensionCompression": "lz4",
  125. "stringDictionaryEncoding": {
  126. "type": "utf8"
  127. },
  128. "metricCompression": "lz4",
  129. "longEncoding": "longs"
  130. },
  131. "reportParseExceptions": false,
  132. "handoffConditionTimeout": 0,
  133. "resetOffsetAutomatically": false,
  134. "segmentWriteOutMediumFactory": null,
  135. "workerThreads": null,
  136. "chatRetries": 8,
  137. "httpTimeout": "PT10S",
  138. "shutdownTimeout": "PT80S",
  139. "offsetFetchPeriod": "PT30S",
  140. "intermediateHandoffPeriod": "P2147483647D",
  141. "logParseExceptions": false,
  142. "maxParseExceptions": 2147483647,
  143. "maxSavedParseExceptions": 0,
  144. "skipSequenceNumberAvailabilityCheck": false,
  145. "repartitionTransitionDuration": "PT120S"
  146. }
  147. },
  148. "dataSchema": {
  149. "dataSource": "social_media",
  150. "timestampSpec": {
  151. "column": "__time",
  152. "format": "iso",
  153. "missingValue": null
  154. },
  155. "dimensionsSpec": {
  156. "dimensions": [
  157. {
  158. "type": "string",
  159. "name": "username",
  160. "multiValueHandling": "SORTED_ARRAY",
  161. "createBitmapIndex": true
  162. },
  163. {
  164. "type": "string",
  165. "name": "post_title",
  166. "multiValueHandling": "SORTED_ARRAY",
  167. "createBitmapIndex": true
  168. },
  169. {
  170. "type": "long",
  171. "name": "views",
  172. "multiValueHandling": "SORTED_ARRAY",
  173. "createBitmapIndex": false
  174. },
  175. {
  176. "type": "long",
  177. "name": "upvotes",
  178. "multiValueHandling": "SORTED_ARRAY",
  179. "createBitmapIndex": false
  180. },
  181. {
  182. "type": "long",
  183. "name": "comments",
  184. "multiValueHandling": "SORTED_ARRAY",
  185. "createBitmapIndex": false
  186. },
  187. {
  188. "type": "string",
  189. "name": "edited",
  190. "multiValueHandling": "SORTED_ARRAY",
  191. "createBitmapIndex": true
  192. }
  193. ],
  194. "dimensionExclusions": [
  195. "__time"
  196. ],
  197. "includeAllDimensions": false,
  198. "useSchemaDiscovery": false
  199. },
  200. "metricsSpec": [],
  201. "granularitySpec": {
  202. "type": "uniform",
  203. "segmentGranularity": "HOUR",
  204. "queryGranularity": {
  205. "type": "none"
  206. },
  207. "rollup": false,
  208. "intervals": []
  209. },
  210. "transformSpec": {
  211. "filter": null,
  212. "transforms": []
  213. }
  214. },
  215. "tuningConfig": {
  216. "type": "kafka",
  217. "appendableIndexSpec": {
  218. "type": "onheap",
  219. "preserveExistingMetrics": false
  220. },
  221. "maxRowsInMemory": 150000,
  222. "maxBytesInMemory": 0,
  223. "skipBytesInMemoryOverheadCheck": false,
  224. "maxRowsPerSegment": 5000000,
  225. "maxTotalRows": null,
  226. "intermediatePersistPeriod": "PT10M",
  227. "maxPendingPersists": 0,
  228. "indexSpec": {
  229. "bitmap": {
  230. "type": "roaring"
  231. },
  232. "dimensionCompression": "lz4",
  233. "stringDictionaryEncoding": {
  234. "type": "utf8"
  235. },
  236. "metricCompression": "lz4",
  237. "longEncoding": "longs"
  238. },
  239. "indexSpecForIntermediatePersists": {
  240. "bitmap": {
  241. "type": "roaring"
  242. },
  243. "dimensionCompression": "lz4",
  244. "stringDictionaryEncoding": {
  245. "type": "utf8"
  246. },
  247. "metricCompression": "lz4",
  248. "longEncoding": "longs"
  249. },
  250. "reportParseExceptions": false,
  251. "handoffConditionTimeout": 0,
  252. "resetOffsetAutomatically": false,
  253. "segmentWriteOutMediumFactory": null,
  254. "workerThreads": null,
  255. "chatRetries": 8,
  256. "httpTimeout": "PT10S",
  257. "shutdownTimeout": "PT80S",
  258. "offsetFetchPeriod": "PT30S",
  259. "intermediateHandoffPeriod": "P2147483647D",
  260. "logParseExceptions": false,
  261. "maxParseExceptions": 2147483647,
  262. "maxSavedParseExceptions": 0,
  263. "skipSequenceNumberAvailabilityCheck": false,
  264. "repartitionTransitionDuration": "PT120S"
  265. },
  266. "ioConfig": {
  267. "topic": "social_media",
  268. "inputFormat": {
  269. "type": "json"
  270. },
  271. "replicas": 1,
  272. "taskCount": 1,
  273. "taskDuration": "PT3600S",
  274. "consumerProperties": {
  275. "bootstrap.servers": "localhost:9094"
  276. },
  277. "autoScalerConfig": null,
  278. "pollTimeout": 100,
  279. "startDelay": "PT5S",
  280. "period": "PT30S",
  281. "useEarliestOffset": true,
  282. "completionTimeout": "PT1800S",
  283. "lateMessageRejectionPeriod": null,
  284. "earlyMessageRejectionPeriod": null,
  285. "lateMessageRejectionStartDateTime": null,
  286. "configOverrides": null,
  287. "idleConfig": null,
  288. "stream": "social_media",
  289. "useEarliestSequenceNumber": true
  290. },
  291. "context": null,
  292. "suspended": false
  293. }

Get supervisor status

Retrieves the current status report for a single supervisor. The report contains the state of the supervisor tasks and an array of recently thrown exceptions.

For additional information about the status report, see Supervisor reference.

URL

GET /druid/indexer/v1/supervisor/{supervisorId}/status

Responses

  • 200 SUCCESS
  • 404 NOT FOUND

Successfully retrieved supervisor status

Invalid supervisor ID


Sample request

The following example shows how to retrieve the status of a supervisor with the name social_media.

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/status"
  1. GET /druid/indexer/v1/supervisor/social_media/status HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "id": "social_media",
  3. "generationTime": "2023-07-05T23:24:43.934Z",
  4. "payload": {
  5. "dataSource": "social_media",
  6. "stream": "social_media",
  7. "partitions": 1,
  8. "replicas": 1,
  9. "durationSeconds": 3600,
  10. "activeTasks": [
  11. {
  12. "id": "index_kafka_social_media_ab72ae4127c591c_flcbhdlh",
  13. "startingOffsets": {
  14. "0": 3176381
  15. },
  16. "startTime": "2023-07-05T23:21:39.321Z",
  17. "remainingSeconds": 3415,
  18. "type": "ACTIVE",
  19. "currentOffsets": {
  20. "0": 3296632
  21. },
  22. "lag": {
  23. "0": 3
  24. }
  25. }
  26. ],
  27. "publishingTasks": [],
  28. "latestOffsets": {
  29. "0": 3296635
  30. },
  31. "minimumLag": {
  32. "0": 3
  33. },
  34. "aggregateLag": 3,
  35. "offsetsLastUpdated": "2023-07-05T23:24:30.212Z",
  36. "suspended": false,
  37. "healthy": true,
  38. "state": "RUNNING",
  39. "detailedState": "RUNNING",
  40. "recentErrors": []
  41. }
  42. }

Get supervisor health

Retrieves the current health report for a single supervisor. The health of a supervisor is determined by the supervisor’s state (as returned by the /status endpoint) and the druid.supervisor.* Overlord configuration thresholds.

URL

GET /druid/indexer/v1/supervisor/{supervisorId}/health

Responses

  • 200 SUCCESS
  • 404 NOT FOUND
  • 503 SERVICE UNAVAILABLE

Supervisor is healthy

Invalid supervisor ID

Supervisor is unhealthy


Sample request

The following example shows how to retrieve the health report for a supervisor with the name social_media.

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/health"
  1. GET /druid/indexer/v1/supervisor/social_media/health HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "healthy": false
  3. }

Get supervisor ingestion stats

Returns a snapshot of the current ingestion row counters for each task being managed by the supervisor, along with moving averages for the row counters. See Row stats for more information.

URL

GET /druid/indexer/v1/supervisor/{supervisorId}/stats

Responses

  • 200 SUCCESS
  • 404 NOT FOUND

Successfully retrieved supervisor stats

Invalid supervisor ID


Sample request

The following example shows how to retrieve the current ingestion row counters for a supervisor with the name custom_data.

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/custom_data/stats"
  1. GET /druid/indexer/v1/supervisor/custom_data/stats HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "0": {
  3. "index_kafka_custom_data_881d621078f6b7c_ccplchbi": {
  4. "movingAverages": {
  5. "buildSegments": {
  6. "5m": {
  7. "processed": 53.401225142603316,
  8. "processedBytes": 5226.400757148808,
  9. "unparseable": 0.0,
  10. "thrownAway": 0.0,
  11. "processedWithError": 0.0
  12. },
  13. "15m": {
  14. "processed": 56.92994990102502,
  15. "processedBytes": 5571.772059828217,
  16. "unparseable": 0.0,
  17. "thrownAway": 0.0,
  18. "processedWithError": 0.0
  19. },
  20. "1m": {
  21. "processed": 37.134921285556636,
  22. "processedBytes": 3634.2766230628677,
  23. "unparseable": 0.0,
  24. "thrownAway": 0.0,
  25. "processedWithError": 0.0
  26. }
  27. }
  28. },
  29. "totals": {
  30. "buildSegments": {
  31. "processed": 665,
  32. "processedBytes": 65079,
  33. "processedWithError": 0,
  34. "thrownAway": 0,
  35. "unparseable": 0
  36. }
  37. }
  38. }
  39. }
  40. }

Audit history

An audit history provides a comprehensive log of events, including supervisor configuration, creation, suspension, and modification history.

Get audit history for all supervisors

Retrieves an audit history of specs for all supervisors.

URL

GET /druid/indexer/v1/supervisor/history

Responses

  • 200 SUCCESS

Successfully retrieved audit history


Sample request

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/history"
  1. GET /druid/indexer/v1/supervisor/history HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "social_media": [
  3. {
  4. "spec": {
  5. "type": "kafka",
  6. "spec": {
  7. "dataSchema": {
  8. "dataSource": "social_media",
  9. "timestampSpec": {
  10. "column": "__time",
  11. "format": "iso",
  12. "missingValue": null
  13. },
  14. "dimensionsSpec": {
  15. "dimensions": [
  16. {
  17. "type": "string",
  18. "name": "username",
  19. "multiValueHandling": "SORTED_ARRAY",
  20. "createBitmapIndex": true
  21. },
  22. {
  23. "type": "string",
  24. "name": "post_title",
  25. "multiValueHandling": "SORTED_ARRAY",
  26. "createBitmapIndex": true
  27. },
  28. {
  29. "type": "long",
  30. "name": "views",
  31. "multiValueHandling": "SORTED_ARRAY",
  32. "createBitmapIndex": false
  33. },
  34. {
  35. "type": "long",
  36. "name": "upvotes",
  37. "multiValueHandling": "SORTED_ARRAY",
  38. "createBitmapIndex": false
  39. },
  40. {
  41. "type": "long",
  42. "name": "comments",
  43. "multiValueHandling": "SORTED_ARRAY",
  44. "createBitmapIndex": false
  45. },
  46. {
  47. "type": "string",
  48. "name": "edited",
  49. "multiValueHandling": "SORTED_ARRAY",
  50. "createBitmapIndex": true
  51. }
  52. ],
  53. "dimensionExclusions": [
  54. "__time"
  55. ],
  56. "includeAllDimensions": false,
  57. "useSchemaDiscovery": false
  58. },
  59. "metricsSpec": [],
  60. "granularitySpec": {
  61. "type": "uniform",
  62. "segmentGranularity": "HOUR",
  63. "queryGranularity": {
  64. "type": "none"
  65. },
  66. "rollup": false,
  67. "intervals": []
  68. },
  69. "transformSpec": {
  70. "filter": null,
  71. "transforms": []
  72. }
  73. },
  74. "ioConfig": {
  75. "topic": "social_media",
  76. "inputFormat": {
  77. "type": "json"
  78. },
  79. "replicas": 1,
  80. "taskCount": 1,
  81. "taskDuration": "PT3600S",
  82. "consumerProperties": {
  83. "bootstrap.servers": "localhost:9094"
  84. },
  85. "autoScalerConfig": null,
  86. "pollTimeout": 100,
  87. "startDelay": "PT5S",
  88. "period": "PT30S",
  89. "useEarliestOffset": true,
  90. "completionTimeout": "PT1800S",
  91. "lateMessageRejectionPeriod": null,
  92. "earlyMessageRejectionPeriod": null,
  93. "lateMessageRejectionStartDateTime": null,
  94. "configOverrides": null,
  95. "idleConfig": null,
  96. "stream": "social_media",
  97. "useEarliestSequenceNumber": true
  98. },
  99. "tuningConfig": {
  100. "type": "kafka",
  101. "appendableIndexSpec": {
  102. "type": "onheap",
  103. "preserveExistingMetrics": false
  104. },
  105. "maxRowsInMemory": 150000,
  106. "maxBytesInMemory": 0,
  107. "skipBytesInMemoryOverheadCheck": false,
  108. "maxRowsPerSegment": 5000000,
  109. "maxTotalRows": null,
  110. "intermediatePersistPeriod": "PT10M",
  111. "maxPendingPersists": 0,
  112. "indexSpec": {
  113. "bitmap": {
  114. "type": "roaring"
  115. },
  116. "dimensionCompression": "lz4",
  117. "stringDictionaryEncoding": {
  118. "type": "utf8"
  119. },
  120. "metricCompression": "lz4",
  121. "longEncoding": "longs"
  122. },
  123. "indexSpecForIntermediatePersists": {
  124. "bitmap": {
  125. "type": "roaring"
  126. },
  127. "dimensionCompression": "lz4",
  128. "stringDictionaryEncoding": {
  129. "type": "utf8"
  130. },
  131. "metricCompression": "lz4",
  132. "longEncoding": "longs"
  133. },
  134. "reportParseExceptions": false,
  135. "handoffConditionTimeout": 0,
  136. "resetOffsetAutomatically": false,
  137. "segmentWriteOutMediumFactory": null,
  138. "workerThreads": null,
  139. "chatRetries": 8,
  140. "httpTimeout": "PT10S",
  141. "shutdownTimeout": "PT80S",
  142. "offsetFetchPeriod": "PT30S",
  143. "intermediateHandoffPeriod": "P2147483647D",
  144. "logParseExceptions": false,
  145. "maxParseExceptions": 2147483647,
  146. "maxSavedParseExceptions": 0,
  147. "skipSequenceNumberAvailabilityCheck": false,
  148. "repartitionTransitionDuration": "PT120S"
  149. }
  150. },
  151. "dataSchema": {
  152. "dataSource": "social_media",
  153. "timestampSpec": {
  154. "column": "__time",
  155. "format": "iso",
  156. "missingValue": null
  157. },
  158. "dimensionsSpec": {
  159. "dimensions": [
  160. {
  161. "type": "string",
  162. "name": "username",
  163. "multiValueHandling": "SORTED_ARRAY",
  164. "createBitmapIndex": true
  165. },
  166. {
  167. "type": "string",
  168. "name": "post_title",
  169. "multiValueHandling": "SORTED_ARRAY",
  170. "createBitmapIndex": true
  171. },
  172. {
  173. "type": "long",
  174. "name": "views",
  175. "multiValueHandling": "SORTED_ARRAY",
  176. "createBitmapIndex": false
  177. },
  178. {
  179. "type": "long",
  180. "name": "upvotes",
  181. "multiValueHandling": "SORTED_ARRAY",
  182. "createBitmapIndex": false
  183. },
  184. {
  185. "type": "long",
  186. "name": "comments",
  187. "multiValueHandling": "SORTED_ARRAY",
  188. "createBitmapIndex": false
  189. },
  190. {
  191. "type": "string",
  192. "name": "edited",
  193. "multiValueHandling": "SORTED_ARRAY",
  194. "createBitmapIndex": true
  195. }
  196. ],
  197. "dimensionExclusions": [
  198. "__time"
  199. ],
  200. "includeAllDimensions": false,
  201. "useSchemaDiscovery": false
  202. },
  203. "metricsSpec": [],
  204. "granularitySpec": {
  205. "type": "uniform",
  206. "segmentGranularity": "HOUR",
  207. "queryGranularity": {
  208. "type": "none"
  209. },
  210. "rollup": false,
  211. "intervals": []
  212. },
  213. "transformSpec": {
  214. "filter": null,
  215. "transforms": []
  216. }
  217. },
  218. "tuningConfig": {
  219. "type": "kafka",
  220. "appendableIndexSpec": {
  221. "type": "onheap",
  222. "preserveExistingMetrics": false
  223. },
  224. "maxRowsInMemory": 150000,
  225. "maxBytesInMemory": 0,
  226. "skipBytesInMemoryOverheadCheck": false,
  227. "maxRowsPerSegment": 5000000,
  228. "maxTotalRows": null,
  229. "intermediatePersistPeriod": "PT10M",
  230. "maxPendingPersists": 0,
  231. "indexSpec": {
  232. "bitmap": {
  233. "type": "roaring"
  234. },
  235. "dimensionCompression": "lz4",
  236. "stringDictionaryEncoding": {
  237. "type": "utf8"
  238. },
  239. "metricCompression": "lz4",
  240. "longEncoding": "longs"
  241. },
  242. "indexSpecForIntermediatePersists": {
  243. "bitmap": {
  244. "type": "roaring"
  245. },
  246. "dimensionCompression": "lz4",
  247. "stringDictionaryEncoding": {
  248. "type": "utf8"
  249. },
  250. "metricCompression": "lz4",
  251. "longEncoding": "longs"
  252. },
  253. "reportParseExceptions": false,
  254. "handoffConditionTimeout": 0,
  255. "resetOffsetAutomatically": false,
  256. "segmentWriteOutMediumFactory": null,
  257. "workerThreads": null,
  258. "chatRetries": 8,
  259. "httpTimeout": "PT10S",
  260. "shutdownTimeout": "PT80S",
  261. "offsetFetchPeriod": "PT30S",
  262. "intermediateHandoffPeriod": "P2147483647D",
  263. "logParseExceptions": false,
  264. "maxParseExceptions": 2147483647,
  265. "maxSavedParseExceptions": 0,
  266. "skipSequenceNumberAvailabilityCheck": false,
  267. "repartitionTransitionDuration": "PT120S"
  268. },
  269. "ioConfig": {
  270. "topic": "social_media",
  271. "inputFormat": {
  272. "type": "json"
  273. },
  274. "replicas": 1,
  275. "taskCount": 1,
  276. "taskDuration": "PT3600S",
  277. "consumerProperties": {
  278. "bootstrap.servers": "localhost:9094"
  279. },
  280. "autoScalerConfig": null,
  281. "pollTimeout": 100,
  282. "startDelay": "PT5S",
  283. "period": "PT30S",
  284. "useEarliestOffset": true,
  285. "completionTimeout": "PT1800S",
  286. "lateMessageRejectionPeriod": null,
  287. "earlyMessageRejectionPeriod": null,
  288. "lateMessageRejectionStartDateTime": null,
  289. "configOverrides": null,
  290. "idleConfig": null,
  291. "stream": "social_media",
  292. "useEarliestSequenceNumber": true
  293. },
  294. "context": null,
  295. "suspended": false
  296. },
  297. "version": "2023-07-03T18:51:02.970Z"
  298. }
  299. ]
  300. }

Get audit history for a specific supervisor

Retrieves an audit history of specs for a single supervisor.

URL

GET /druid/indexer/v1/supervisor/{supervisorId}/history

Responses

  • 200 SUCCESS
  • 404 NOT FOUND

Successfully retrieved supervisor audit history

Invalid supervisor ID


Sample request

The following example shows how to retrieve the audit history of a supervisor with the name wikipedia_stream.

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/wikipedia_stream/history"
  1. GET /druid/indexer/v1/supervisor/wikipedia_stream/history HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. [
  2. {
  3. "spec": {
  4. "type": "kafka",
  5. "spec": {
  6. "dataSchema": {
  7. "dataSource": "wikipedia_stream",
  8. "timestampSpec": {
  9. "column": "__time",
  10. "format": "iso",
  11. "missingValue": null
  12. },
  13. "dimensionsSpec": {
  14. "dimensions": [
  15. {
  16. "type": "string",
  17. "name": "username",
  18. "multiValueHandling": "SORTED_ARRAY",
  19. "createBitmapIndex": true
  20. },
  21. {
  22. "type": "string",
  23. "name": "post_title",
  24. "multiValueHandling": "SORTED_ARRAY",
  25. "createBitmapIndex": true
  26. },
  27. {
  28. "type": "long",
  29. "name": "views",
  30. "multiValueHandling": "SORTED_ARRAY",
  31. "createBitmapIndex": false
  32. },
  33. {
  34. "type": "long",
  35. "name": "upvotes",
  36. "multiValueHandling": "SORTED_ARRAY",
  37. "createBitmapIndex": false
  38. },
  39. {
  40. "type": "long",
  41. "name": "comments",
  42. "multiValueHandling": "SORTED_ARRAY",
  43. "createBitmapIndex": false
  44. },
  45. {
  46. "type": "string",
  47. "name": "edited",
  48. "multiValueHandling": "SORTED_ARRAY",
  49. "createBitmapIndex": true
  50. }
  51. ],
  52. "dimensionExclusions": [
  53. "__time"
  54. ],
  55. "includeAllDimensions": false,
  56. "useSchemaDiscovery": false
  57. },
  58. "metricsSpec": [],
  59. "granularitySpec": {
  60. "type": "uniform",
  61. "segmentGranularity": "HOUR",
  62. "queryGranularity": {
  63. "type": "none"
  64. },
  65. "rollup": false,
  66. "intervals": []
  67. },
  68. "transformSpec": {
  69. "filter": null,
  70. "transforms": []
  71. }
  72. },
  73. "ioConfig": {
  74. "topic": "social_media",
  75. "inputFormat": {
  76. "type": "json"
  77. },
  78. "replicas": 1,
  79. "taskCount": 1,
  80. "taskDuration": "PT3600S",
  81. "consumerProperties": {
  82. "bootstrap.servers": "localhost:9042"
  83. },
  84. "autoScalerConfig": null,
  85. "pollTimeout": 100,
  86. "startDelay": "PT5S",
  87. "period": "PT30S",
  88. "useEarliestOffset": true,
  89. "completionTimeout": "PT1800S",
  90. "lateMessageRejectionPeriod": null,
  91. "earlyMessageRejectionPeriod": null,
  92. "lateMessageRejectionStartDateTime": null,
  93. "configOverrides": null,
  94. "idleConfig": null,
  95. "stream": "social_media",
  96. "useEarliestSequenceNumber": true
  97. },
  98. "tuningConfig": {
  99. "type": "kafka",
  100. "appendableIndexSpec": {
  101. "type": "onheap",
  102. "preserveExistingMetrics": false
  103. },
  104. "maxRowsInMemory": 150000,
  105. "maxBytesInMemory": 0,
  106. "skipBytesInMemoryOverheadCheck": false,
  107. "maxRowsPerSegment": 5000000,
  108. "maxTotalRows": null,
  109. "intermediatePersistPeriod": "PT10M",
  110. "maxPendingPersists": 0,
  111. "indexSpec": {
  112. "bitmap": {
  113. "type": "roaring"
  114. },
  115. "dimensionCompression": "lz4",
  116. "stringDictionaryEncoding": {
  117. "type": "utf8"
  118. },
  119. "metricCompression": "lz4",
  120. "longEncoding": "longs"
  121. },
  122. "indexSpecForIntermediatePersists": {
  123. "bitmap": {
  124. "type": "roaring"
  125. },
  126. "dimensionCompression": "lz4",
  127. "stringDictionaryEncoding": {
  128. "type": "utf8"
  129. },
  130. "metricCompression": "lz4",
  131. "longEncoding": "longs"
  132. },
  133. "reportParseExceptions": false,
  134. "handoffConditionTimeout": 0,
  135. "resetOffsetAutomatically": false,
  136. "segmentWriteOutMediumFactory": null,
  137. "workerThreads": null,
  138. "chatRetries": 8,
  139. "httpTimeout": "PT10S",
  140. "shutdownTimeout": "PT80S",
  141. "offsetFetchPeriod": "PT30S",
  142. "intermediateHandoffPeriod": "P2147483647D",
  143. "logParseExceptions": false,
  144. "maxParseExceptions": 2147483647,
  145. "maxSavedParseExceptions": 0,
  146. "skipSequenceNumberAvailabilityCheck": false,
  147. "repartitionTransitionDuration": "PT120S"
  148. }
  149. },
  150. "dataSchema": {
  151. "dataSource": "wikipedia_stream",
  152. "timestampSpec": {
  153. "column": "__time",
  154. "format": "iso",
  155. "missingValue": null
  156. },
  157. "dimensionsSpec": {
  158. "dimensions": [
  159. {
  160. "type": "string",
  161. "name": "username",
  162. "multiValueHandling": "SORTED_ARRAY",
  163. "createBitmapIndex": true
  164. },
  165. {
  166. "type": "string",
  167. "name": "post_title",
  168. "multiValueHandling": "SORTED_ARRAY",
  169. "createBitmapIndex": true
  170. },
  171. {
  172. "type": "long",
  173. "name": "views",
  174. "multiValueHandling": "SORTED_ARRAY",
  175. "createBitmapIndex": false
  176. },
  177. {
  178. "type": "long",
  179. "name": "upvotes",
  180. "multiValueHandling": "SORTED_ARRAY",
  181. "createBitmapIndex": false
  182. },
  183. {
  184. "type": "long",
  185. "name": "comments",
  186. "multiValueHandling": "SORTED_ARRAY",
  187. "createBitmapIndex": false
  188. },
  189. {
  190. "type": "string",
  191. "name": "edited",
  192. "multiValueHandling": "SORTED_ARRAY",
  193. "createBitmapIndex": true
  194. }
  195. ],
  196. "dimensionExclusions": [
  197. "__time"
  198. ],
  199. "includeAllDimensions": false,
  200. "useSchemaDiscovery": false
  201. },
  202. "metricsSpec": [],
  203. "granularitySpec": {
  204. "type": "uniform",
  205. "segmentGranularity": "HOUR",
  206. "queryGranularity": {
  207. "type": "none"
  208. },
  209. "rollup": false,
  210. "intervals": []
  211. },
  212. "transformSpec": {
  213. "filter": null,
  214. "transforms": []
  215. }
  216. },
  217. "tuningConfig": {
  218. "type": "kafka",
  219. "appendableIndexSpec": {
  220. "type": "onheap",
  221. "preserveExistingMetrics": false
  222. },
  223. "maxRowsInMemory": 150000,
  224. "maxBytesInMemory": 0,
  225. "skipBytesInMemoryOverheadCheck": false,
  226. "maxRowsPerSegment": 5000000,
  227. "maxTotalRows": null,
  228. "intermediatePersistPeriod": "PT10M",
  229. "maxPendingPersists": 0,
  230. "indexSpec": {
  231. "bitmap": {
  232. "type": "roaring"
  233. },
  234. "dimensionCompression": "lz4",
  235. "stringDictionaryEncoding": {
  236. "type": "utf8"
  237. },
  238. "metricCompression": "lz4",
  239. "longEncoding": "longs"
  240. },
  241. "indexSpecForIntermediatePersists": {
  242. "bitmap": {
  243. "type": "roaring"
  244. },
  245. "dimensionCompression": "lz4",
  246. "stringDictionaryEncoding": {
  247. "type": "utf8"
  248. },
  249. "metricCompression": "lz4",
  250. "longEncoding": "longs"
  251. },
  252. "reportParseExceptions": false,
  253. "handoffConditionTimeout": 0,
  254. "resetOffsetAutomatically": false,
  255. "segmentWriteOutMediumFactory": null,
  256. "workerThreads": null,
  257. "chatRetries": 8,
  258. "httpTimeout": "PT10S",
  259. "shutdownTimeout": "PT80S",
  260. "offsetFetchPeriod": "PT30S",
  261. "intermediateHandoffPeriod": "P2147483647D",
  262. "logParseExceptions": false,
  263. "maxParseExceptions": 2147483647,
  264. "maxSavedParseExceptions": 0,
  265. "skipSequenceNumberAvailabilityCheck": false,
  266. "repartitionTransitionDuration": "PT120S"
  267. },
  268. "ioConfig": {
  269. "topic": "social_media",
  270. "inputFormat": {
  271. "type": "json"
  272. },
  273. "replicas": 1,
  274. "taskCount": 1,
  275. "taskDuration": "PT3600S",
  276. "consumerProperties": {
  277. "bootstrap.servers": "localhost:9042"
  278. },
  279. "autoScalerConfig": null,
  280. "pollTimeout": 100,
  281. "startDelay": "PT5S",
  282. "period": "PT30S",
  283. "useEarliestOffset": true,
  284. "completionTimeout": "PT1800S",
  285. "lateMessageRejectionPeriod": null,
  286. "earlyMessageRejectionPeriod": null,
  287. "lateMessageRejectionStartDateTime": null,
  288. "configOverrides": null,
  289. "idleConfig": null,
  290. "stream": "social_media",
  291. "useEarliestSequenceNumber": true
  292. },
  293. "context": null,
  294. "suspended": false
  295. },
  296. "version": "2023-07-05T20:59:16.872Z"
  297. }
  298. ]

Manage supervisors

Create or update a supervisor

Creates a new supervisor spec or updates an existing one with new configuration and schema information. When updating a supervisor spec, the datasource must remain the same as the previous supervisor.

You can define a supervisor spec for Apache Kafka or Amazon Kinesis streaming ingestion methods.

The following table lists the properties of a supervisor spec:

PropertyTypeDescriptionRequired
typeStringThe supervisor type. One ofkafka or kinesis.Yes
specObjectThe container object for the supervisor configuration.Yes
ioConfigObjectThe I/O configuration object to define the connection and I/O-related settings for the supervisor and indexing task.Yes
dataSchemaObjectThe schema for the indexing task to use during ingestion. See dataSchema for more information.Yes
tuningConfigObjectThe tuning configuration object to define performance-related settings for the supervisor and indexing tasks.No

When you call this endpoint on an existing supervisor, the running supervisor signals its tasks to stop reading and begin publishing, exiting itself. Druid then uses the provided configuration from the request body to create a new supervisor. Druid submits a new schema while retaining existing publishing tasks and starts new tasks at the previous task offsets. This way, you can apply configuration changes without a pause in ingestion.

URL

POST /druid/indexer/v1/supervisor

Responses

  • 200 SUCCESS
  • 415 UNSUPPORTED MEDIA TYPE

Successfully created a new supervisor or updated an existing supervisor

Request body content type is not in JSON format


Sample request

The following example uses JSON input format to create a supervisor spec for Kafka with a social_media datasource and social_media topic.

  • cURL
  • HTTP
  1. curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor" \
  2. --header 'Content-Type: application/json' \
  3. --data '{
  4. "type": "kafka",
  5. "spec": {
  6. "ioConfig": {
  7. "type": "kafka",
  8. "consumerProperties": {
  9. "bootstrap.servers": "localhost:9094"
  10. },
  11. "topic": "social_media",
  12. "inputFormat": {
  13. "type": "json"
  14. },
  15. "useEarliestOffset": true
  16. },
  17. "tuningConfig": {
  18. "type": "kafka"
  19. },
  20. "dataSchema": {
  21. "dataSource": "social_media",
  22. "timestampSpec": {
  23. "column": "__time",
  24. "format": "iso"
  25. },
  26. "dimensionsSpec": {
  27. "dimensions": [
  28. "username",
  29. "post_title",
  30. {
  31. "type": "long",
  32. "name": "views"
  33. },
  34. {
  35. "type": "long",
  36. "name": "upvotes"
  37. },
  38. {
  39. "type": "long",
  40. "name": "comments"
  41. },
  42. "edited"
  43. ]
  44. },
  45. "granularitySpec": {
  46. "queryGranularity": "none",
  47. "rollup": false,
  48. "segmentGranularity": "hour"
  49. }
  50. }
  51. }
  52. }'
  1. POST /druid/indexer/v1/supervisor HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT
  3. Content-Type: application/json
  4. Content-Length: 1359
  5. {
  6. "type": "kafka",
  7. "spec": {
  8. "ioConfig": {
  9. "type": "kafka",
  10. "consumerProperties": {
  11. "bootstrap.servers": "localhost:9094"
  12. },
  13. "topic": "social_media",
  14. "inputFormat": {
  15. "type": "json"
  16. },
  17. "useEarliestOffset": true
  18. },
  19. "tuningConfig": {
  20. "type": "kafka"
  21. },
  22. "dataSchema": {
  23. "dataSource": "social_media",
  24. "timestampSpec": {
  25. "column": "__time",
  26. "format": "iso"
  27. },
  28. "dimensionsSpec": {
  29. "dimensions": [
  30. "username",
  31. "post_title",
  32. {
  33. "type": "long",
  34. "name": "views"
  35. },
  36. {
  37. "type": "long",
  38. "name": "upvotes"
  39. },
  40. {
  41. "type": "long",
  42. "name": "comments"
  43. },
  44. "edited"
  45. ]
  46. },
  47. "granularitySpec": {
  48. "queryGranularity": "none",
  49. "rollup": false,
  50. "segmentGranularity": "hour"
  51. }
  52. }
  53. }
  54. }

Sample response

View the response

  1. {
  2. "id": "social_media"
  3. }

Suspend a running supervisor

Suspends a single running supervisor. Returns the updated supervisor spec, where the suspended property is set to true. The suspended supervisor continues to emit logs and metrics. Indexing tasks remain suspended until you resume the supervisor.

URL

POST /druid/indexer/v1/supervisor/{supervisorId}/suspend

Responses

  • 200 SUCCESS
  • 400 BAD REQUEST
  • 404 NOT FOUND

Successfully shut down supervisor

Supervisor already suspended

Invalid supervisor ID


Sample request

The following example shows how to suspend a running supervisor with the name social_media.

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/suspend"
  1. POST /druid/indexer/v1/supervisor/social_media/suspend HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "type": "kafka",
  3. "spec": {
  4. "dataSchema": {
  5. "dataSource": "social_media",
  6. "timestampSpec": {
  7. "column": "__time",
  8. "format": "iso",
  9. "missingValue": null
  10. },
  11. "dimensionsSpec": {
  12. "dimensions": [
  13. {
  14. "type": "string",
  15. "name": "username",
  16. "multiValueHandling": "SORTED_ARRAY",
  17. "createBitmapIndex": true
  18. },
  19. {
  20. "type": "string",
  21. "name": "post_title",
  22. "multiValueHandling": "SORTED_ARRAY",
  23. "createBitmapIndex": true
  24. },
  25. {
  26. "type": "long",
  27. "name": "views",
  28. "multiValueHandling": "SORTED_ARRAY",
  29. "createBitmapIndex": false
  30. },
  31. {
  32. "type": "long",
  33. "name": "upvotes",
  34. "multiValueHandling": "SORTED_ARRAY",
  35. "createBitmapIndex": false
  36. },
  37. {
  38. "type": "long",
  39. "name": "comments",
  40. "multiValueHandling": "SORTED_ARRAY",
  41. "createBitmapIndex": false
  42. },
  43. {
  44. "type": "string",
  45. "name": "edited",
  46. "multiValueHandling": "SORTED_ARRAY",
  47. "createBitmapIndex": true
  48. }
  49. ],
  50. "dimensionExclusions": [
  51. "__time"
  52. ],
  53. "includeAllDimensions": false,
  54. "useSchemaDiscovery": false
  55. },
  56. "metricsSpec": [],
  57. "granularitySpec": {
  58. "type": "uniform",
  59. "segmentGranularity": "HOUR",
  60. "queryGranularity": {
  61. "type": "none"
  62. },
  63. "rollup": false,
  64. "intervals": []
  65. },
  66. "transformSpec": {
  67. "filter": null,
  68. "transforms": []
  69. }
  70. },
  71. "ioConfig": {
  72. "topic": "social_media",
  73. "inputFormat": {
  74. "type": "json"
  75. },
  76. "replicas": 1,
  77. "taskCount": 1,
  78. "taskDuration": "PT3600S",
  79. "consumerProperties": {
  80. "bootstrap.servers": "localhost:9094"
  81. },
  82. "autoScalerConfig": null,
  83. "pollTimeout": 100,
  84. "startDelay": "PT5S",
  85. "period": "PT30S",
  86. "useEarliestOffset": true,
  87. "completionTimeout": "PT1800S",
  88. "lateMessageRejectionPeriod": null,
  89. "earlyMessageRejectionPeriod": null,
  90. "lateMessageRejectionStartDateTime": null,
  91. "configOverrides": null,
  92. "idleConfig": null,
  93. "stream": "social_media",
  94. "useEarliestSequenceNumber": true
  95. },
  96. "tuningConfig": {
  97. "type": "kafka",
  98. "appendableIndexSpec": {
  99. "type": "onheap",
  100. "preserveExistingMetrics": false
  101. },
  102. "maxRowsInMemory": 150000,
  103. "maxBytesInMemory": 0,
  104. "skipBytesInMemoryOverheadCheck": false,
  105. "maxRowsPerSegment": 5000000,
  106. "maxTotalRows": null,
  107. "intermediatePersistPeriod": "PT10M",
  108. "maxPendingPersists": 0,
  109. "indexSpec": {
  110. "bitmap": {
  111. "type": "roaring"
  112. },
  113. "dimensionCompression": "lz4",
  114. "stringDictionaryEncoding": {
  115. "type": "utf8"
  116. },
  117. "metricCompression": "lz4",
  118. "longEncoding": "longs"
  119. },
  120. "indexSpecForIntermediatePersists": {
  121. "bitmap": {
  122. "type": "roaring"
  123. },
  124. "dimensionCompression": "lz4",
  125. "stringDictionaryEncoding": {
  126. "type": "utf8"
  127. },
  128. "metricCompression": "lz4",
  129. "longEncoding": "longs"
  130. },
  131. "reportParseExceptions": false,
  132. "handoffConditionTimeout": 0,
  133. "resetOffsetAutomatically": false,
  134. "segmentWriteOutMediumFactory": null,
  135. "workerThreads": null,
  136. "chatRetries": 8,
  137. "httpTimeout": "PT10S",
  138. "shutdownTimeout": "PT80S",
  139. "offsetFetchPeriod": "PT30S",
  140. "intermediateHandoffPeriod": "P2147483647D",
  141. "logParseExceptions": false,
  142. "maxParseExceptions": 2147483647,
  143. "maxSavedParseExceptions": 0,
  144. "skipSequenceNumberAvailabilityCheck": false,
  145. "repartitionTransitionDuration": "PT120S"
  146. }
  147. },
  148. "dataSchema": {
  149. "dataSource": "social_media",
  150. "timestampSpec": {
  151. "column": "__time",
  152. "format": "iso",
  153. "missingValue": null
  154. },
  155. "dimensionsSpec": {
  156. "dimensions": [
  157. {
  158. "type": "string",
  159. "name": "username",
  160. "multiValueHandling": "SORTED_ARRAY",
  161. "createBitmapIndex": true
  162. },
  163. {
  164. "type": "string",
  165. "name": "post_title",
  166. "multiValueHandling": "SORTED_ARRAY",
  167. "createBitmapIndex": true
  168. },
  169. {
  170. "type": "long",
  171. "name": "views",
  172. "multiValueHandling": "SORTED_ARRAY",
  173. "createBitmapIndex": false
  174. },
  175. {
  176. "type": "long",
  177. "name": "upvotes",
  178. "multiValueHandling": "SORTED_ARRAY",
  179. "createBitmapIndex": false
  180. },
  181. {
  182. "type": "long",
  183. "name": "comments",
  184. "multiValueHandling": "SORTED_ARRAY",
  185. "createBitmapIndex": false
  186. },
  187. {
  188. "type": "string",
  189. "name": "edited",
  190. "multiValueHandling": "SORTED_ARRAY",
  191. "createBitmapIndex": true
  192. }
  193. ],
  194. "dimensionExclusions": [
  195. "__time"
  196. ],
  197. "includeAllDimensions": false,
  198. "useSchemaDiscovery": false
  199. },
  200. "metricsSpec": [],
  201. "granularitySpec": {
  202. "type": "uniform",
  203. "segmentGranularity": "HOUR",
  204. "queryGranularity": {
  205. "type": "none"
  206. },
  207. "rollup": false,
  208. "intervals": []
  209. },
  210. "transformSpec": {
  211. "filter": null,
  212. "transforms": []
  213. }
  214. },
  215. "tuningConfig": {
  216. "type": "kafka",
  217. "appendableIndexSpec": {
  218. "type": "onheap",
  219. "preserveExistingMetrics": false
  220. },
  221. "maxRowsInMemory": 150000,
  222. "maxBytesInMemory": 0,
  223. "skipBytesInMemoryOverheadCheck": false,
  224. "maxRowsPerSegment": 5000000,
  225. "maxTotalRows": null,
  226. "intermediatePersistPeriod": "PT10M",
  227. "maxPendingPersists": 0,
  228. "indexSpec": {
  229. "bitmap": {
  230. "type": "roaring"
  231. },
  232. "dimensionCompression": "lz4",
  233. "stringDictionaryEncoding": {
  234. "type": "utf8"
  235. },
  236. "metricCompression": "lz4",
  237. "longEncoding": "longs"
  238. },
  239. "indexSpecForIntermediatePersists": {
  240. "bitmap": {
  241. "type": "roaring"
  242. },
  243. "dimensionCompression": "lz4",
  244. "stringDictionaryEncoding": {
  245. "type": "utf8"
  246. },
  247. "metricCompression": "lz4",
  248. "longEncoding": "longs"
  249. },
  250. "reportParseExceptions": false,
  251. "handoffConditionTimeout": 0,
  252. "resetOffsetAutomatically": false,
  253. "segmentWriteOutMediumFactory": null,
  254. "workerThreads": null,
  255. "chatRetries": 8,
  256. "httpTimeout": "PT10S",
  257. "shutdownTimeout": "PT80S",
  258. "offsetFetchPeriod": "PT30S",
  259. "intermediateHandoffPeriod": "P2147483647D",
  260. "logParseExceptions": false,
  261. "maxParseExceptions": 2147483647,
  262. "maxSavedParseExceptions": 0,
  263. "skipSequenceNumberAvailabilityCheck": false,
  264. "repartitionTransitionDuration": "PT120S"
  265. },
  266. "ioConfig": {
  267. "topic": "social_media",
  268. "inputFormat": {
  269. "type": "json"
  270. },
  271. "replicas": 1,
  272. "taskCount": 1,
  273. "taskDuration": "PT3600S",
  274. "consumerProperties": {
  275. "bootstrap.servers": "localhost:9094"
  276. },
  277. "autoScalerConfig": null,
  278. "pollTimeout": 100,
  279. "startDelay": "PT5S",
  280. "period": "PT30S",
  281. "useEarliestOffset": true,
  282. "completionTimeout": "PT1800S",
  283. "lateMessageRejectionPeriod": null,
  284. "earlyMessageRejectionPeriod": null,
  285. "lateMessageRejectionStartDateTime": null,
  286. "configOverrides": null,
  287. "idleConfig": null,
  288. "stream": "social_media",
  289. "useEarliestSequenceNumber": true
  290. },
  291. "context": null,
  292. "suspended": true
  293. }

Suspend all supervisors

Suspends all supervisors. Note that this endpoint returns an HTTP 200 Success code message even if there are no supervisors or running supervisors to suspend.

URL

POST /druid/indexer/v1/supervisor/suspendAll

Responses

  • 200 SUCCESS

Successfully suspended all supervisors


Sample request

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/suspendAll"
  1. POST /druid/indexer/v1/supervisor/suspendAll HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "status": "success"
  3. }

Resume a supervisor

Resumes indexing tasks for a supervisor. Returns an updated supervisor spec with the suspended property set to false.

URL

POST /druid/indexer/v1/supervisor/{supervisorId}/resume

Responses

  • 200 SUCCESS
  • 400 BAD REQUEST
  • 404 NOT FOUND

Successfully resumed supervisor

Supervisor already running

Invalid supervisor ID


Sample request

The following example resumes a previously suspended supervisor with name social_media.

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/resume"
  1. POST /druid/indexer/v1/supervisor/social_media/resume HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "type": "kafka",
  3. "spec": {
  4. "dataSchema": {
  5. "dataSource": "social_media",
  6. "timestampSpec": {
  7. "column": "__time",
  8. "format": "iso",
  9. "missingValue": null
  10. },
  11. "dimensionsSpec": {
  12. "dimensions": [
  13. {
  14. "type": "string",
  15. "name": "username",
  16. "multiValueHandling": "SORTED_ARRAY",
  17. "createBitmapIndex": true
  18. },
  19. {
  20. "type": "string",
  21. "name": "post_title",
  22. "multiValueHandling": "SORTED_ARRAY",
  23. "createBitmapIndex": true
  24. },
  25. {
  26. "type": "long",
  27. "name": "views",
  28. "multiValueHandling": "SORTED_ARRAY",
  29. "createBitmapIndex": false
  30. },
  31. {
  32. "type": "long",
  33. "name": "upvotes",
  34. "multiValueHandling": "SORTED_ARRAY",
  35. "createBitmapIndex": false
  36. },
  37. {
  38. "type": "long",
  39. "name": "comments",
  40. "multiValueHandling": "SORTED_ARRAY",
  41. "createBitmapIndex": false
  42. },
  43. {
  44. "type": "string",
  45. "name": "edited",
  46. "multiValueHandling": "SORTED_ARRAY",
  47. "createBitmapIndex": true
  48. }
  49. ],
  50. "dimensionExclusions": [
  51. "__time"
  52. ],
  53. "includeAllDimensions": false,
  54. "useSchemaDiscovery": false
  55. },
  56. "metricsSpec": [],
  57. "granularitySpec": {
  58. "type": "uniform",
  59. "segmentGranularity": "HOUR",
  60. "queryGranularity": {
  61. "type": "none"
  62. },
  63. "rollup": false,
  64. "intervals": []
  65. },
  66. "transformSpec": {
  67. "filter": null,
  68. "transforms": []
  69. }
  70. },
  71. "ioConfig": {
  72. "topic": "social_media",
  73. "inputFormat": {
  74. "type": "json"
  75. },
  76. "replicas": 1,
  77. "taskCount": 1,
  78. "taskDuration": "PT3600S",
  79. "consumerProperties": {
  80. "bootstrap.servers": "localhost:9094"
  81. },
  82. "autoScalerConfig": null,
  83. "pollTimeout": 100,
  84. "startDelay": "PT5S",
  85. "period": "PT30S",
  86. "useEarliestOffset": true,
  87. "completionTimeout": "PT1800S",
  88. "lateMessageRejectionPeriod": null,
  89. "earlyMessageRejectionPeriod": null,
  90. "lateMessageRejectionStartDateTime": null,
  91. "configOverrides": null,
  92. "idleConfig": null,
  93. "stream": "social_media",
  94. "useEarliestSequenceNumber": true
  95. },
  96. "tuningConfig": {
  97. "type": "kafka",
  98. "appendableIndexSpec": {
  99. "type": "onheap",
  100. "preserveExistingMetrics": false
  101. },
  102. "maxRowsInMemory": 150000,
  103. "maxBytesInMemory": 0,
  104. "skipBytesInMemoryOverheadCheck": false,
  105. "maxRowsPerSegment": 5000000,
  106. "maxTotalRows": null,
  107. "intermediatePersistPeriod": "PT10M",
  108. "maxPendingPersists": 0,
  109. "indexSpec": {
  110. "bitmap": {
  111. "type": "roaring"
  112. },
  113. "dimensionCompression": "lz4",
  114. "stringDictionaryEncoding": {
  115. "type": "utf8"
  116. },
  117. "metricCompression": "lz4",
  118. "longEncoding": "longs"
  119. },
  120. "indexSpecForIntermediatePersists": {
  121. "bitmap": {
  122. "type": "roaring"
  123. },
  124. "dimensionCompression": "lz4",
  125. "stringDictionaryEncoding": {
  126. "type": "utf8"
  127. },
  128. "metricCompression": "lz4",
  129. "longEncoding": "longs"
  130. },
  131. "reportParseExceptions": false,
  132. "handoffConditionTimeout": 0,
  133. "resetOffsetAutomatically": false,
  134. "segmentWriteOutMediumFactory": null,
  135. "workerThreads": null,
  136. "chatRetries": 8,
  137. "httpTimeout": "PT10S",
  138. "shutdownTimeout": "PT80S",
  139. "offsetFetchPeriod": "PT30S",
  140. "intermediateHandoffPeriod": "P2147483647D",
  141. "logParseExceptions": false,
  142. "maxParseExceptions": 2147483647,
  143. "maxSavedParseExceptions": 0,
  144. "skipSequenceNumberAvailabilityCheck": false,
  145. "repartitionTransitionDuration": "PT120S"
  146. }
  147. },
  148. "dataSchema": {
  149. "dataSource": "social_media",
  150. "timestampSpec": {
  151. "column": "__time",
  152. "format": "iso",
  153. "missingValue": null
  154. },
  155. "dimensionsSpec": {
  156. "dimensions": [
  157. {
  158. "type": "string",
  159. "name": "username",
  160. "multiValueHandling": "SORTED_ARRAY",
  161. "createBitmapIndex": true
  162. },
  163. {
  164. "type": "string",
  165. "name": "post_title",
  166. "multiValueHandling": "SORTED_ARRAY",
  167. "createBitmapIndex": true
  168. },
  169. {
  170. "type": "long",
  171. "name": "views",
  172. "multiValueHandling": "SORTED_ARRAY",
  173. "createBitmapIndex": false
  174. },
  175. {
  176. "type": "long",
  177. "name": "upvotes",
  178. "multiValueHandling": "SORTED_ARRAY",
  179. "createBitmapIndex": false
  180. },
  181. {
  182. "type": "long",
  183. "name": "comments",
  184. "multiValueHandling": "SORTED_ARRAY",
  185. "createBitmapIndex": false
  186. },
  187. {
  188. "type": "string",
  189. "name": "edited",
  190. "multiValueHandling": "SORTED_ARRAY",
  191. "createBitmapIndex": true
  192. }
  193. ],
  194. "dimensionExclusions": [
  195. "__time"
  196. ],
  197. "includeAllDimensions": false,
  198. "useSchemaDiscovery": false
  199. },
  200. "metricsSpec": [],
  201. "granularitySpec": {
  202. "type": "uniform",
  203. "segmentGranularity": "HOUR",
  204. "queryGranularity": {
  205. "type": "none"
  206. },
  207. "rollup": false,
  208. "intervals": []
  209. },
  210. "transformSpec": {
  211. "filter": null,
  212. "transforms": []
  213. }
  214. },
  215. "tuningConfig": {
  216. "type": "kafka",
  217. "appendableIndexSpec": {
  218. "type": "onheap",
  219. "preserveExistingMetrics": false
  220. },
  221. "maxRowsInMemory": 150000,
  222. "maxBytesInMemory": 0,
  223. "skipBytesInMemoryOverheadCheck": false,
  224. "maxRowsPerSegment": 5000000,
  225. "maxTotalRows": null,
  226. "intermediatePersistPeriod": "PT10M",
  227. "maxPendingPersists": 0,
  228. "indexSpec": {
  229. "bitmap": {
  230. "type": "roaring"
  231. },
  232. "dimensionCompression": "lz4",
  233. "stringDictionaryEncoding": {
  234. "type": "utf8"
  235. },
  236. "metricCompression": "lz4",
  237. "longEncoding": "longs"
  238. },
  239. "indexSpecForIntermediatePersists": {
  240. "bitmap": {
  241. "type": "roaring"
  242. },
  243. "dimensionCompression": "lz4",
  244. "stringDictionaryEncoding": {
  245. "type": "utf8"
  246. },
  247. "metricCompression": "lz4",
  248. "longEncoding": "longs"
  249. },
  250. "reportParseExceptions": false,
  251. "handoffConditionTimeout": 0,
  252. "resetOffsetAutomatically": false,
  253. "segmentWriteOutMediumFactory": null,
  254. "workerThreads": null,
  255. "chatRetries": 8,
  256. "httpTimeout": "PT10S",
  257. "shutdownTimeout": "PT80S",
  258. "offsetFetchPeriod": "PT30S",
  259. "intermediateHandoffPeriod": "P2147483647D",
  260. "logParseExceptions": false,
  261. "maxParseExceptions": 2147483647,
  262. "maxSavedParseExceptions": 0,
  263. "skipSequenceNumberAvailabilityCheck": false,
  264. "repartitionTransitionDuration": "PT120S"
  265. },
  266. "ioConfig": {
  267. "topic": "social_media",
  268. "inputFormat": {
  269. "type": "json"
  270. },
  271. "replicas": 1,
  272. "taskCount": 1,
  273. "taskDuration": "PT3600S",
  274. "consumerProperties": {
  275. "bootstrap.servers": "localhost:9094"
  276. },
  277. "autoScalerConfig": null,
  278. "pollTimeout": 100,
  279. "startDelay": "PT5S",
  280. "period": "PT30S",
  281. "useEarliestOffset": true,
  282. "completionTimeout": "PT1800S",
  283. "lateMessageRejectionPeriod": null,
  284. "earlyMessageRejectionPeriod": null,
  285. "lateMessageRejectionStartDateTime": null,
  286. "configOverrides": null,
  287. "idleConfig": null,
  288. "stream": "social_media",
  289. "useEarliestSequenceNumber": true
  290. },
  291. "context": null,
  292. "suspended": false
  293. }

Resume all supervisors

Resumes all supervisors. Note that this endpoint returns an HTTP 200 Success code even if there are no supervisors or suspended supervisors to resume.

URL

POST /druid/indexer/v1/supervisor/resumeAll

Responses

  • 200 SUCCESS

Successfully resumed all supervisors


Sample request

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/resumeAll"
  1. POST /druid/indexer/v1/supervisor/resumeAll HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "status": "success"
  3. }

Reset a supervisor

The supervisor must be running for this endpoint to be available.

Resets the specified supervisor. This endpoint clears supervisor metadata, prompting the supervisor to resume data reading. The supervisor restarts from the earliest or latest available position, depending on the value of the useEarliestOffset property. After clearing all stored offsets, the supervisor kills and recreates active tasks, so that tasks begin reading from valid positions.

Use this endpoint to recover from a stopped state due to missing offsets. Use this endpoint with caution as it may result in skipped messages and lead to data loss or duplicate data.

The indexing service keeps track of the latest persisted offsets to provide exactly-once ingestion guarantees across tasks. Subsequent tasks must start reading from where the previous task completed for Druid to accept the generated segments. If the messages at the expected starting offsets are no longer available, the supervisor refuses to start and in-flight tasks fail. Possible causes for missing messages include the message retention period elapsing or the topic being removed and re-created. Use the reset endpoint to recover from this condition.

URL

POST /druid/indexer/v1/supervisor/{supervisorId}/reset

Responses

  • 200 SUCCESS
  • 404 NOT FOUND

Successfully reset supervisor

Invalid supervisor ID


Sample request

The following example shows how to reset a supervisor with the name social_media.

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/reset"
  1. POST /druid/indexer/v1/supervisor/social_media/reset HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "id": "social_media"
  3. }

Reset offsets for a supervisor

The supervisor must be running for this endpoint to be available.

Resets the specified offsets for partitions without resetting the entire set.

This endpoint clears only the stored offsets, prompting the supervisor to resume reading data from the specified offsets. If there are no stored offsets, the specified offsets are set in the metadata store.

After resetting stored offsets, the supervisor kills and recreates any active tasks pertaining to the specified partitions, so that tasks begin reading specified offsets. For partitions that are not specified in this operation, the supervisor resumes from the last stored offset.

Use this endpoint with caution. It can cause skipped messages, leading to data loss or duplicate data.

URL

POST /druid/indexer/v1/supervisor/{supervisorId}/resetOffsets

Responses

  • 200 SUCCESS
  • 404 NOT FOUND

Successfully reset offsets

Invalid supervisor ID


Reset Offsets Metadata

This section presents the structure and details of the reset offsets metadata payload.

FieldTypeDescriptionRequired
typeStringThe type of reset offsets metadata payload. It must match the supervisor’s type. Possible values: kafka or kinesis.Yes
partitionsObjectAn object representing the reset metadata. See below for details.Yes

Partitions

The following table defines the fields within the partitions object in the reset offsets metadata payload.

FieldTypeDescriptionRequired
typeStringMust be set as end. Indicates the end sequence numbers for the reset offsets.Yes
streamStringThe stream to be reset. It must be a valid stream consumed by the supervisor.Yes
partitionOffsetMapObjectA map of partitions to corresponding offsets for the stream to be reset.Yes

Sample request

The following example shows how to reset offsets for a Kafka supervisor with the name social_media. For example, the supervisor is reading from a Kafka topic ads_media_stream and has the stored offsets: {"0": 0, "1": 10, "2": 20, "3": 40}.

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/resetOffsets"
  2. --header 'Content-Type: application/json'
  3. --data-raw '{"type":"kafka","partitions":{"type":"end","stream":"ads_media_stream","partitionOffsetMap":{"0":100, "2": 650}}}'
  1. POST /druid/indexer/v1/supervisor/social_media/resetOffsets HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT
  3. Content-Type: application/json
  4. {
  5. "type": "kafka",
  6. "partitions": {
  7. "type": "end",
  8. "stream": "ads_media_stream",
  9. "partitionOffsetMap": {
  10. "0": 100,
  11. "2": 650
  12. }
  13. }
  14. }

The example operation resets offsets only for partitions 0 and 2 to 100 and 650 respectively. After a successful reset, when the supervisor’s tasks restart, they resume reading from {"0": 100, "1": 10, "2": 650, "3": 40}.

Sample response

View the response

  1. {
  2. "id": "social_media"
  3. }

Terminate a supervisor

Terminates a supervisor and its associated indexing tasks, triggering the publishing of their segments. When you terminate a supervisor, Druid places a tombstone marker in the metadata store to prevent reloading on restart.

The terminated supervisor still exists in the metadata store and its history can be retrieved.

URL

POST /druid/indexer/v1/supervisor/{supervisorId}/terminate

Responses

  • 200 SUCCESS
  • 404 NOT FOUND

Successfully terminated a supervisor

Invalid supervisor ID or supervisor not running


Sample request

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/terminate"
  1. POST /druid/indexer/v1/supervisor/social_media/terminate HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "id": "social_media"
  3. }

Terminate all supervisors

Terminates all supervisors. Terminated supervisors still exist in the metadata store and their history can be retrieved. Note that this endpoint returns an HTTP 200 Success code even if there are no supervisors or running supervisors to terminate.

URL

POST /druid/indexer/v1/supervisor/terminateAll

Responses

  • 200 SUCCESS

Successfully terminated all supervisors


Sample request

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/terminateAll"
  1. POST /druid/indexer/v1/supervisor/terminateAll HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT

Sample response

View the response

  1. {
  2. "status": "success"
  3. }

Handoff task groups for a supervisor early

Trigger handoff for specified task groups of a supervisor early. This is a best effort API and makes no guarantees of handoff execution

URL

POST /druid/indexer/v1/supervisor/{supervisorId}/taskGroups/handoff

Sample request

The following example shows how to handoff task groups for a supervisor with the name social_media and has the task groups: 1,2,3.

  • cURL
  • HTTP
  1. curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/taskGroups/handoff"
  2. --header 'Content-Type: application/json'
  3. --data-raw '{"taskGroupIds": [1, 2, 3]}'
  1. POST /druid/indexer/v1/supervisor/social_media/taskGroups/handoff HTTP/1.1
  2. Host: http://ROUTER_IP:ROUTER_PORT
  3. Content-Type: application/json
  4. {
  5. "taskGroupIds": [1, 2, 3],
  6. }

Sample response

View the response

(empty response)

Shut down a supervisor

Shuts down a supervisor. This endpoint is deprecated and will be removed in future releases. Use the equivalent terminate endpoint instead.

URL

POST /druid/indexer/v1/supervisor/{supervisorId}/shutdown