blob: 034a280ec64626bbff80c53603afdd330191ca4b [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2946],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>k});var n=a(67294);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?i(Object(a),!0).forEach((function(t){o(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function r(e,t){if(null==e)return{};var a,n,o=function(e,t){if(null==e)return{};var a,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||(o[a]=e[a]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}var s=n.createContext({}),u=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var a=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,p=r(e,["components","mdxType","originalType","parentName"]),c=u(a),d=o,k=c["".concat(s,".").concat(d)]||c[d]||m[d]||i;return a?n.createElement(k,l(l({ref:t},p),{},{components:a})):n.createElement(k,l({ref:t},p))}));function k(e,t){var a=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=a.length,l=new Array(i);l[0]=d;var r={};for(var s in t)hasOwnProperty.call(t,s)&&(r[s]=t[s]);r.originalType=e,r[c]="string"==typeof e?e:o,l[1]=r;for(var u=2;u<i;u++)l[u]=a[u];return n.createElement.apply(null,l)}return n.createElement.apply(null,a)}d.displayName="MDXCreateElement"},13219:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>k,frontMatter:()=>r,metadata:()=>u,toc:()=>c});var n=a(87462),o=a(63366),i=(a(67294),a(3905)),l=["components"],r={id:"automatic-compaction-api",title:"Automatic compaction API",sidebar_label:"Automatic compaction"},s=void 0,u={unversionedId:"api-reference/automatic-compaction-api",id:"api-reference/automatic-compaction-api",title:"Automatic compaction API",description:"\x3c!--",source:"@site/docs/28.0.1/api-reference/automatic-compaction-api.md",sourceDirName:"api-reference",slug:"/api-reference/automatic-compaction-api",permalink:"/docs/28.0.1/api-reference/automatic-compaction-api",draft:!1,tags:[],version:"current",frontMatter:{id:"automatic-compaction-api",title:"Automatic compaction API",sidebar_label:"Automatic compaction"},sidebar:"docs",previous:{title:"Data management",permalink:"/docs/28.0.1/api-reference/data-management-api"},next:{title:"Lookups",permalink:"/docs/28.0.1/api-reference/lookups-api"}},p={},c=[{value:"Manage automatic compaction",id:"manage-automatic-compaction",level:2},{value:"Create or update automatic compaction configuration",id:"create-or-update-automatic-compaction-configuration",level:3},{value:"URL",id:"url",level:4},{value:"Responses",id:"responses",level:4},{value:"Sample request",id:"sample-request",level:4},{value:"Sample response",id:"sample-response",level:4},{value:"Remove automatic compaction configuration",id:"remove-automatic-compaction-configuration",level:3},{value:"URL",id:"url-1",level:4},{value:"Responses",id:"responses-1",level:4},{value:"Sample request",id:"sample-request-1",level:4},{value:"Sample response",id:"sample-response-1",level:4},{value:"Update capacity for compaction tasks",id:"update-capacity-for-compaction-tasks",level:3},{value:"URL",id:"url-2",level:4},{value:"Query parameters",id:"query-parameters",level:4},{value:"Responses",id:"responses-2",level:4},{value:"Sample request",id:"sample-request-2",level:4},{value:"Sample response",id:"sample-response-2",level:4},{value:"View automatic compaction configuration",id:"view-automatic-compaction-configuration",level:2},{value:"Get all automatic compaction configurations",id:"get-all-automatic-compaction-configurations",level:3},{value:"URL",id:"url-3",level:4},{value:"Responses",id:"responses-3",level:4},{value:"Sample request",id:"sample-request-3",level:4},{value:"Sample response",id:"sample-response-3",level:4},{value:"Get automatic compaction configuration",id:"get-automatic-compaction-configuration",level:3},{value:"URL",id:"url-4",level:4},{value:"Responses",id:"responses-4",level:4},{value:"Sample request",id:"sample-request-4",level:4},{value:"Sample response",id:"sample-response-4",level:4},{value:"Get automatic compaction configuration history",id:"get-automatic-compaction-configuration-history",level:3},{value:"URL",id:"url-5",level:4},{value:"Query parameters",id:"query-parameters-1",level:4},{value:"Responses",id:"responses-5",level:4},{value:"Sample request",id:"sample-request-5",level:4},{value:"Sample response",id:"sample-response-5",level:4},{value:"View automatic compaction status",id:"view-automatic-compaction-status",level:2},{value:"Get segments awaiting compaction",id:"get-segments-awaiting-compaction",level:3},{value:"URL",id:"url-6",level:4},{value:"Query parameter",id:"query-parameter",level:4},{value:"Responses",id:"responses-6",level:4},{value:"Sample request",id:"sample-request-6",level:4},{value:"Sample response",id:"sample-response-6",level:4},{value:"Get compaction status and statistics",id:"get-compaction-status-and-statistics",level:3},{value:"URL",id:"url-7",level:4},{value:"Query parameters",id:"query-parameters-2",level:4},{value:"Responses",id:"responses-7",level:4},{value:"Sample request",id:"sample-request-7",level:4},{value:"Sample response",id:"sample-response-7",level:4}],m={toc:c},d="wrapper";function k(e){var t=e.components,a=(0,o.Z)(e,l);return(0,i.kt)(d,(0,n.Z)({},m,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"This topic describes the status and configuration API endpoints for ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.1/data-management/automatic-compaction"},"automatic compaction")," in Apache Druid. You can configure automatic compaction in the Druid web console or API. "),(0,i.kt)("p",null,"In this topic, ",(0,i.kt)("inlineCode",{parentName:"p"},"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 ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:8888")," for quickstart deployments."),(0,i.kt)("h2",{id:"manage-automatic-compaction"},"Manage automatic compaction"),(0,i.kt)("h3",{id:"create-or-update-automatic-compaction-configuration"},"Create or update automatic compaction configuration"),(0,i.kt)("p",null,"Creates or updates the automatic compaction configuration for a datasource. Pass the automatic compaction as a JSON object in the request body."),(0,i.kt)("p",null,"The automatic compaction configuration requires only the ",(0,i.kt)("inlineCode",{parentName:"p"},"dataSource")," property. Druid fills all other properties with default values if not specified. See ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.1/configuration/#automatic-compaction-dynamic-configuration"},"Automatic compaction dynamic configuration")," for configuration details."),(0,i.kt)("p",null,"Note that this endpoint returns an HTTP ",(0,i.kt)("inlineCode",{parentName:"p"},"200 OK")," message code even if the datasource name does not exist."),(0,i.kt)("h4",{id:"url"},"URL"),(0,i.kt)("code",{class:"postAPI"},"POST")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/config/compaction"),(0,i.kt)("h4",{id:"responses"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully submitted auto compaction configuration")," "),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request"},"Sample request"),(0,i.kt)("p",null,"The following example creates an automatic compaction configuration for the datasource ",(0,i.kt)("inlineCode",{parentName:"p"},"wikipedia_hour"),", which was ingested with ",(0,i.kt)("inlineCode",{parentName:"p"},"HOUR")," segment granularity. This automatic compaction configuration performs compaction on ",(0,i.kt)("inlineCode",{parentName:"p"},"wikipedia_hour"),", resulting in compacted segments that represent a day interval of data. "),(0,i.kt)("p",null,"In this example: "),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"wikipedia_hour")," is a datasource with ",(0,i.kt)("inlineCode",{parentName:"li"},"HOUR")," segment granularity."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"skipOffsetFromLatest")," is set to ",(0,i.kt)("inlineCode",{parentName:"li"},"PT0S"),", meaning that no data is skipped. "),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"partitionsSpec")," is set to the default ",(0,i.kt)("inlineCode",{parentName:"li"},"dynamic"),", allowing Druid to dynamically determine the optimal partitioning strategy."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"type")," is set to ",(0,i.kt)("inlineCode",{parentName:"li"},"index_parallel"),", meaning that parallel indexing is used."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"segmentGranularity")," is set to ",(0,i.kt)("inlineCode",{parentName:"li"},"DAY"),", meaning that each compacted segment is a day of data.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction"\\\n--header \'Content-Type: application/json\' \\\n--data \'{\n "dataSource": "wikipedia_hour",\n "skipOffsetFromLatest": "PT0S",\n "tuningConfig": {\n "partitionsSpec": {\n "type": "dynamic"\n },\n "type": "index_parallel"\n },\n "granularitySpec": {\n "segmentGranularity": "DAY"\n }\n}\'\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},'POST /druid/coordinator/v1/config/compaction HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\nContent-Type: application/json\nContent-Length: 281\n\n{\n "dataSource": "wikipedia_hour",\n "skipOffsetFromLatest": "PT0S",\n "tuningConfig": {\n "partitionsSpec": {\n "type": "dynamic"\n },\n "type": "index_parallel"\n },\n "granularitySpec": {\n "segmentGranularity": "DAY"\n }\n}\n')),(0,i.kt)("h4",{id:"sample-response"},"Sample response"),(0,i.kt)("p",null,"A successful request returns an HTTP ",(0,i.kt)("inlineCode",{parentName:"p"},"200 OK")," message code and an empty response body."),(0,i.kt)("h3",{id:"remove-automatic-compaction-configuration"},"Remove automatic compaction configuration"),(0,i.kt)("p",null,'Removes the automatic compaction configuration for a datasource. This updates the compaction status of the datasource to "Not enabled." '),(0,i.kt)("h4",{id:"url-1"},"URL"),(0,i.kt)("code",{class:"deleteAPI"},"DELETE")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/config/compaction/:dataSource"),(0,i.kt)("h4",{id:"responses-1"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully deleted automatic compaction configuration")," "),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Datasource does not have automatic compaction or invalid datasource name")," "),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request-1"},"Sample request"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl --request DELETE "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/wikipedia_hour"\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},"DELETE /druid/coordinator/v1/config/compaction/wikipedia_hour HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\n")),(0,i.kt)("h4",{id:"sample-response-1"},"Sample response"),(0,i.kt)("p",null,"A successful request returns an HTTP ",(0,i.kt)("inlineCode",{parentName:"p"},"200 OK")," message code and an empty response body."),(0,i.kt)("h3",{id:"update-capacity-for-compaction-tasks"},"Update capacity for compaction tasks"),(0,i.kt)("p",null,"Updates the capacity for compaction tasks. The minimum number of compaction tasks is 1 and the maximum is 2147483647. "),(0,i.kt)("p",null,"Note that while the max compaction tasks can theoretically be set to 2147483647, the practical limit is determined by the available cluster capacity and is capped at 10% of the cluster's total capacity. "),(0,i.kt)("h4",{id:"url-2"},"URL"),(0,i.kt)("code",{class:"postAPI"},"POST")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/config/compaction/taskslots"),(0,i.kt)("h4",{id:"query-parameters"},"Query parameters"),(0,i.kt)("p",null,"To limit the maximum number of compaction tasks, use the optional query parameters ",(0,i.kt)("inlineCode",{parentName:"p"},"ratio")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"max"),":"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ratio")," (optional)",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Type: Float"),(0,i.kt)("li",{parentName:"ul"},"Default: 0.1"),(0,i.kt)("li",{parentName:"ul"},"Limits the ratio of the total task slots to compaction task slots."))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"max")," (optional)",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Type: Int"),(0,i.kt)("li",{parentName:"ul"},"Default: 2147483647"),(0,i.kt)("li",{parentName:"ul"},"Limits the maximum number of task slots for compaction tasks.")))),(0,i.kt)("h4",{id:"responses-2"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully updated compaction configuration")," "),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Invalid ",(0,i.kt)("inlineCode",{parentName:"em"},"max")," value")," "),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request-2"},"Sample request"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/taskslots?ratio=0.2&max=250000"\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},"POST /druid/coordinator/v1/config/compaction/taskslots?ratio=0.2&max=250000 HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\n")),(0,i.kt)("h4",{id:"sample-response-2"},"Sample response"),(0,i.kt)("p",null,"A successful request returns an HTTP ",(0,i.kt)("inlineCode",{parentName:"p"},"200 OK")," message code and an empty response body."),(0,i.kt)("h2",{id:"view-automatic-compaction-configuration"},"View automatic compaction configuration"),(0,i.kt)("h3",{id:"get-all-automatic-compaction-configurations"},"Get all automatic compaction configurations"),(0,i.kt)("p",null,"Retrieves all automatic compaction configurations. Returns a ",(0,i.kt)("inlineCode",{parentName:"p"},"compactionConfigs")," object containing the active automatic compaction configurations of all datasources."),(0,i.kt)("p",null,"You can use this endpoint to retrieve ",(0,i.kt)("inlineCode",{parentName:"p"},"compactionTaskSlotRatio")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"maxCompactionTaskSlots")," values for managing resource allocation of compaction tasks."),(0,i.kt)("h4",{id:"url-3"},"URL"),(0,i.kt)("code",{class:"getAPI"},"GET")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/config/compaction"),(0,i.kt)("h4",{id:"responses-3"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully retrieved automatic compaction configurations")," "),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request-3"},"Sample request"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction"\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},"GET /druid/coordinator/v1/config/compaction HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\n")),(0,i.kt)("h4",{id:"sample-response-3"},"Sample response"),(0,i.kt)("details",null,(0,i.kt)("summary",null,"Click to show sample response"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{\n "compactionConfigs": [\n {\n "dataSource": "wikipedia_hour",\n "taskPriority": 25,\n "inputSegmentSizeBytes": 100000000000000,\n "maxRowsPerSegment": null,\n "skipOffsetFromLatest": "PT0S",\n "tuningConfig": {\n "maxRowsInMemory": null,\n "appendableIndexSpec": null,\n "maxBytesInMemory": null,\n "maxTotalRows": null,\n "splitHintSpec": null,\n "partitionsSpec": {\n "type": "dynamic",\n "maxRowsPerSegment": 5000000,\n "maxTotalRows": null\n },\n "indexSpec": null,\n "indexSpecForIntermediatePersists": null,\n "maxPendingPersists": null,\n "pushTimeout": null,\n "segmentWriteOutMediumFactory": null,\n "maxNumConcurrentSubTasks": null,\n "maxRetry": null,\n "taskStatusCheckPeriodMs": null,\n "chatHandlerTimeout": null,\n "chatHandlerNumRetries": null,\n "maxNumSegmentsToMerge": null,\n "totalNumMergeTasks": null,\n "maxColumnsToMerge": null,\n "type": "index_parallel",\n "forceGuaranteedRollup": false\n },\n "granularitySpec": {\n "segmentGranularity": "DAY",\n "queryGranularity": null,\n "rollup": null\n },\n "dimensionsSpec": null,\n "metricsSpec": null,\n "transformSpec": null,\n "ioConfig": null,\n "taskContext": null\n },\n {\n "dataSource": "wikipedia",\n "taskPriority": 25,\n "inputSegmentSizeBytes": 100000000000000,\n "maxRowsPerSegment": null,\n "skipOffsetFromLatest": "PT0S",\n "tuningConfig": {\n "maxRowsInMemory": null,\n "appendableIndexSpec": null,\n "maxBytesInMemory": null,\n "maxTotalRows": null,\n "splitHintSpec": null,\n "partitionsSpec": {\n "type": "dynamic",\n "maxRowsPerSegment": 5000000,\n "maxTotalRows": null\n },\n "indexSpec": null,\n "indexSpecForIntermediatePersists": null,\n "maxPendingPersists": null,\n "pushTimeout": null,\n "segmentWriteOutMediumFactory": null,\n "maxNumConcurrentSubTasks": null,\n "maxRetry": null,\n "taskStatusCheckPeriodMs": null,\n "chatHandlerTimeout": null,\n "chatHandlerNumRetries": null,\n "maxNumSegmentsToMerge": null,\n "totalNumMergeTasks": null,\n "maxColumnsToMerge": null,\n "type": "index_parallel",\n "forceGuaranteedRollup": false\n },\n "granularitySpec": {\n "segmentGranularity": "DAY",\n "queryGranularity": null,\n "rollup": null\n },\n "dimensionsSpec": null,\n "metricsSpec": null,\n "transformSpec": null,\n "ioConfig": null,\n "taskContext": null\n }\n ],\n "compactionTaskSlotRatio": 0.1,\n "maxCompactionTaskSlots": 2147483647,\n "useAutoScaleSlots": false\n}\n'))),(0,i.kt)("h3",{id:"get-automatic-compaction-configuration"},"Get automatic compaction configuration"),(0,i.kt)("p",null,"Retrieves the automatic compaction configuration for a datasource."),(0,i.kt)("h4",{id:"url-4"},"URL"),(0,i.kt)("code",{class:"getAPI"},"GET")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/config/compaction/:dataSource"),(0,i.kt)("h4",{id:"responses-4"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully retrieved configuration for datasource")," "),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Invalid datasource or datasource does not have automatic compaction enabled")),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request-4"},"Sample request"),(0,i.kt)("p",null,"The following example retrieves the automatic compaction configuration for datasource ",(0,i.kt)("inlineCode",{parentName:"p"},"wikipedia_hour"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/wikipedia_hour"\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},"GET /druid/coordinator/v1/config/compaction/wikipedia_hour HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\n")),(0,i.kt)("h4",{id:"sample-response-4"},"Sample response"),(0,i.kt)("details",null,(0,i.kt)("summary",null,"Click to show sample response"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{\n "dataSource": "wikipedia_hour",\n "taskPriority": 25,\n "inputSegmentSizeBytes": 100000000000000,\n "maxRowsPerSegment": null,\n "skipOffsetFromLatest": "PT0S",\n "tuningConfig": {\n "maxRowsInMemory": null,\n "appendableIndexSpec": null,\n "maxBytesInMemory": null,\n "maxTotalRows": null,\n "splitHintSpec": null,\n "partitionsSpec": {\n "type": "dynamic",\n "maxRowsPerSegment": 5000000,\n "maxTotalRows": null\n },\n "indexSpec": null,\n "indexSpecForIntermediatePersists": null,\n "maxPendingPersists": null,\n "pushTimeout": null,\n "segmentWriteOutMediumFactory": null,\n "maxNumConcurrentSubTasks": null,\n "maxRetry": null,\n "taskStatusCheckPeriodMs": null,\n "chatHandlerTimeout": null,\n "chatHandlerNumRetries": null,\n "maxNumSegmentsToMerge": null,\n "totalNumMergeTasks": null,\n "maxColumnsToMerge": null,\n "type": "index_parallel",\n "forceGuaranteedRollup": false\n },\n "granularitySpec": {\n "segmentGranularity": "DAY",\n "queryGranularity": null,\n "rollup": null\n },\n "dimensionsSpec": null,\n "metricsSpec": null,\n "transformSpec": null,\n "ioConfig": null,\n "taskContext": null\n}\n'))),(0,i.kt)("h3",{id:"get-automatic-compaction-configuration-history"},"Get automatic compaction configuration history"),(0,i.kt)("p",null,"Retrieves the history of the automatic compaction configuration for a datasource. Returns an empty list if the datasource does not exist or there is no compaction history for the datasource."),(0,i.kt)("p",null,"The response contains a list of objects with the following keys:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"globalConfig"),": A JSON object containing automatic compaction configuration that applies to the entire cluster. "),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"compactionConfig"),": A JSON object containing the automatic compaction configuration for the datasource."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"auditInfo"),": A JSON object containing information about the change made, such as ",(0,i.kt)("inlineCode",{parentName:"li"},"author"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"comment")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"ip"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"auditTime"),": The date and time when the change was made.")),(0,i.kt)("h4",{id:"url-5"},"URL"),(0,i.kt)("code",{class:"getAPI"},"GET")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/config/compaction/:dataSource/history"),(0,i.kt)("h4",{id:"query-parameters-1"},"Query parameters"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"interval")," (optional)",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Type: ISO-8601"),(0,i.kt)("li",{parentName:"ul"},"Limits the results within a specified interval. Use ",(0,i.kt)("inlineCode",{parentName:"li"},"/")," as the delimiter for the interval string. "))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"count")," (optional)",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Type: Int"),(0,i.kt)("li",{parentName:"ul"},"Limits the number of results.")))),(0,i.kt)("h4",{id:"responses-5"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully retrieved configuration history")," "),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Invalid ",(0,i.kt)("inlineCode",{parentName:"em"},"count")," value")," "),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request-5"},"Sample request"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/config/compaction/wikipedia_hour/history"\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},"GET /druid/coordinator/v1/config/compaction/wikipedia_hour/history HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\n")),(0,i.kt)("h4",{id:"sample-response-5"},"Sample response"),(0,i.kt)("details",null,(0,i.kt)("summary",null,"Click to show sample response"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'[\n {\n "globalConfig": {\n "compactionTaskSlotRatio": 0.1,\n "maxCompactionTaskSlots": 2147483647,\n "useAutoScaleSlots": false\n },\n "compactionConfig": {\n "dataSource": "wikipedia_hour",\n "taskPriority": 25,\n "inputSegmentSizeBytes": 100000000000000,\n "maxRowsPerSegment": null,\n "skipOffsetFromLatest": "P1D",\n "tuningConfig": null,\n "granularitySpec": {\n "segmentGranularity": "DAY",\n "queryGranularity": null,\n "rollup": null\n },\n "dimensionsSpec": null,\n "metricsSpec": null,\n "transformSpec": null,\n "ioConfig": null,\n "taskContext": null\n },\n "auditInfo": {\n "author": "",\n "comment": "",\n "ip": "127.0.0.1"\n },\n "auditTime": "2023-07-31T18:15:19.302Z"\n },\n {\n "globalConfig": {\n "compactionTaskSlotRatio": 0.1,\n "maxCompactionTaskSlots": 2147483647,\n "useAutoScaleSlots": false\n },\n "compactionConfig": {\n "dataSource": "wikipedia_hour",\n "taskPriority": 25,\n "inputSegmentSizeBytes": 100000000000000,\n "maxRowsPerSegment": null,\n "skipOffsetFromLatest": "PT0S",\n "tuningConfig": {\n "maxRowsInMemory": null,\n "appendableIndexSpec": null,\n "maxBytesInMemory": null,\n "maxTotalRows": null,\n "splitHintSpec": null,\n "partitionsSpec": {\n "type": "dynamic",\n "maxRowsPerSegment": 5000000,\n "maxTotalRows": null\n },\n "indexSpec": null,\n "indexSpecForIntermediatePersists": null,\n "maxPendingPersists": null,\n "pushTimeout": null,\n "segmentWriteOutMediumFactory": null,\n "maxNumConcurrentSubTasks": null,\n "maxRetry": null,\n "taskStatusCheckPeriodMs": null,\n "chatHandlerTimeout": null,\n "chatHandlerNumRetries": null,\n "maxNumSegmentsToMerge": null,\n "totalNumMergeTasks": null,\n "maxColumnsToMerge": null,\n "type": "index_parallel",\n "forceGuaranteedRollup": false\n },\n "granularitySpec": {\n "segmentGranularity": "DAY",\n "queryGranularity": null,\n "rollup": null\n },\n "dimensionsSpec": null,\n "metricsSpec": null,\n "transformSpec": null,\n "ioConfig": null,\n "taskContext": null\n },\n "auditInfo": {\n "author": "",\n "comment": "",\n "ip": "127.0.0.1"\n },\n "auditTime": "2023-07-31T18:16:16.362Z"\n }\n]\n'))),(0,i.kt)("h2",{id:"view-automatic-compaction-status"},"View automatic compaction status"),(0,i.kt)("h3",{id:"get-segments-awaiting-compaction"},"Get segments awaiting compaction"),(0,i.kt)("p",null,"Returns the total size of segments awaiting compaction for a given datasource. Returns a 404 response if a datasource does not have automatic compaction enabled."),(0,i.kt)("h4",{id:"url-6"},"URL"),(0,i.kt)("code",{class:"getAPI"},"GET")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/compaction/progress?dataSource=:dataSource"),(0,i.kt)("h4",{id:"query-parameter"},"Query parameter"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"dataSource")," (required)",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Type: String"),(0,i.kt)("li",{parentName:"ul"},"Name of the datasource for this status information.")))),(0,i.kt)("h4",{id:"responses-6"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully retrieved segment size awaiting compaction")," "),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Unknown datasource name or datasource does not have automatic compaction enabled")," "),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request-6"},"Sample request"),(0,i.kt)("p",null,"The following example retrieves the remaining segments to be compacted for datasource ",(0,i.kt)("inlineCode",{parentName:"p"},"wikipedia_hour"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/compaction/progress?dataSource=wikipedia_hour"\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},"GET /druid/coordinator/v1/compaction/progress?dataSource=wikipedia_hour HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\n")),(0,i.kt)("h4",{id:"sample-response-6"},"Sample response"),(0,i.kt)("details",null,(0,i.kt)("summary",null,"Click to show sample response"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{\n "remainingSegmentSize": 7615837\n}\n'))),(0,i.kt)("h3",{id:"get-compaction-status-and-statistics"},"Get compaction status and statistics"),(0,i.kt)("p",null,"Retrieves an array of ",(0,i.kt)("inlineCode",{parentName:"p"},"latestStatus")," objects representing the status and statistics from the latest automatic compaction run for all datasources with automatic compaction enabled."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"latestStatus")," object has the following properties:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"dataSource"),": Name of the datasource for this status information."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"scheduleStatus"),": Automatic compaction scheduling status. Possible values are ",(0,i.kt)("inlineCode",{parentName:"li"},"NOT_ENABLED")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"RUNNING"),". Returns ",(0,i.kt)("inlineCode",{parentName:"li"},"RUNNING ")," if the datasource has an active automatic compaction configuration submitted. Otherwise, returns ",(0,i.kt)("inlineCode",{parentName:"li"},"NOT_ENABLED"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"bytesAwaitingCompaction"),": Total bytes of this datasource waiting to be compacted by the automatic compaction (only consider intervals/segments that are eligible for automatic compaction)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"bytesCompacted"),": Total bytes of this datasource that are already compacted with the spec set in the automatic compaction configuration."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"bytesSkipped"),": Total bytes of this datasource that are skipped (not eligible for automatic compaction) by the automatic compaction."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"segmentCountAwaitingCompaction"),": Total number of segments of this datasource waiting to be compacted by the automatic compaction (only consider intervals/segments that are eligible for automatic compaction)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"segmentCountCompacted"),": Total number of segments of this datasource that are already compacted with the spec set in the automatic compaction configuration."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"segmentCountSkipped"),": Total number of segments of this datasource that are skipped (not eligible for automatic compaction) by the automatic compaction."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"intervalCountAwaitingCompaction"),": Total number of intervals of this datasource waiting to be compacted by the automatic compaction (only consider intervals/segments that are eligible for automatic compaction)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"intervalCountCompacted"),": Total number of intervals of this datasource that are already compacted with the spec set in the automatic compaction configuration."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"intervalCountSkipped"),": Total number of intervals of this datasource that are skipped (not eligible for automatic compaction) by the automatic compaction.")),(0,i.kt)("h4",{id:"url-7"},"URL"),(0,i.kt)("code",{class:"getAPI"},"GET")," ",(0,i.kt)("code",null,"/druid/coordinator/v1/compaction/status"),(0,i.kt)("h4",{id:"query-parameters-2"},"Query parameters"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"dataSource")," (optional)",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Type: String"),(0,i.kt)("li",{parentName:"ul"},"Filter the result by name of a specific datasource.")))),(0,i.kt)("h4",{id:"responses-7"},"Responses"),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"Successfully retrieved ",(0,i.kt)("inlineCode",{parentName:"em"},"latestStatus")," object")," "),(0,i.kt)("hr",null),(0,i.kt)("h4",{id:"sample-request-7"},"Sample request"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/compaction/status"\n')),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},"GET /druid/coordinator/v1/compaction/status HTTP/1.1\nHost: http://ROUTER_IP:ROUTER_PORT\n")),(0,i.kt)("h4",{id:"sample-response-7"},"Sample response"),(0,i.kt)("details",null,(0,i.kt)("summary",null,"Click to show sample response"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{\n "latestStatus": [\n {\n "dataSource": "wikipedia_api",\n "scheduleStatus": "RUNNING",\n "bytesAwaitingCompaction": 0,\n "bytesCompacted": 0,\n "bytesSkipped": 64133616,\n "segmentCountAwaitingCompaction": 0,\n "segmentCountCompacted": 0,\n "segmentCountSkipped": 8,\n "intervalCountAwaitingCompaction": 0,\n "intervalCountCompacted": 0,\n "intervalCountSkipped": 1\n },\n {\n "dataSource": "wikipedia_hour",\n "scheduleStatus": "RUNNING",\n "bytesAwaitingCompaction": 0,\n "bytesCompacted": 5998634,\n "bytesSkipped": 0,\n "segmentCountAwaitingCompaction": 0,\n "segmentCountCompacted": 1,\n "segmentCountSkipped": 0,\n "intervalCountAwaitingCompaction": 0,\n "intervalCountCompacted": 1,\n "intervalCountSkipped": 0\n }\n ]\n}\n'))))}k.isMDXComponent=!0}}]);