blob: 6d490ef5b7a602ae5ab739d964e65cca9bb686b6 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8770],{3905:(t,e,a)=>{a.d(e,{Zo:()=>m,kt:()=>f});var o=a(67294);function n(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function i(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,o)}return a}function r(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?i(Object(a),!0).forEach((function(e){n(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function c(t,e){if(null==t)return{};var a,o,n=function(t,e){if(null==t)return{};var a,o,n={},i=Object.keys(t);for(o=0;o<i.length;o++)a=i[o],e.indexOf(a)>=0||(n[a]=t[a]);return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)a=i[o],e.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}var l=o.createContext({}),p=function(t){var e=o.useContext(l),a=e;return t&&(a="function"==typeof t?t(e):r(r({},e),t)),a},m=function(t){var e=p(t.components);return o.createElement(l.Provider,{value:e},t.children)},u="mdxType",s={inlineCode:"code",wrapper:function(t){var e=t.children;return o.createElement(o.Fragment,{},e)}},d=o.forwardRef((function(t,e){var a=t.components,n=t.mdxType,i=t.originalType,l=t.parentName,m=c(t,["components","mdxType","originalType","parentName"]),u=p(a),d=n,f=u["".concat(l,".").concat(d)]||u[d]||s[d]||i;return a?o.createElement(f,r(r({ref:e},m),{},{components:a})):o.createElement(f,r({ref:e},m))}));function f(t,e){var a=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var i=a.length,r=new Array(i);r[0]=d;var c={};for(var l in e)hasOwnProperty.call(e,l)&&(c[l]=e[l]);c.originalType=t,c[u]="string"==typeof t?t:n,r[1]=c;for(var p=2;p<i;p++)r[p]=a[p];return o.createElement.apply(null,r)}return o.createElement.apply(null,a)}d.displayName="MDXCreateElement"},90795:(t,e,a)=>{a.r(e),a.d(e,{assets:()=>m,contentTitle:()=>l,default:()=>f,frontMatter:()=>c,metadata:()=>p,toc:()=>u});var o=a(87462),n=a(63366),i=(a(67294),a(3905)),r=["components"],c={id:"automatic-compaction-api",title:"Automatic compaction API",sidebar_label:"Automatic compaction"},l=void 0,p={unversionedId:"api-reference/automatic-compaction-api",id:"api-reference/automatic-compaction-api",title:"Automatic compaction API",description:"\x3c!--",source:"@site/docs/27.0.0/api-reference/automatic-compaction-api.md",sourceDirName:"api-reference",slug:"/api-reference/automatic-compaction-api",permalink:"/docs/27.0.0/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/27.0.0/api-reference/data-management-api"},next:{title:"Lookups",permalink:"/docs/27.0.0/api-reference/lookups-api"}},m={},u=[{value:"Automatic compaction status",id:"automatic-compaction-status",level:2},{value:"Automatic compaction configuration",id:"automatic-compaction-configuration",level:2}],s={toc:u},d="wrapper";function f(t){var e=t.components,a=(0,n.Z)(t,r);return(0,i.kt)(d,(0,o.Z)({},s,a,{components:e,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"This document describes status and configuration API endpoints for ",(0,i.kt)("a",{parentName:"p",href:"/docs/27.0.0/data-management/automatic-compaction"},"automatic compaction")," in Apache Druid."),(0,i.kt)("h2",{id:"automatic-compaction-status"},"Automatic compaction status"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"GET /druid/coordinator/v1/compaction/progress?dataSource={dataSource}")),(0,i.kt)("p",null,"Returns the total size of segments awaiting compaction for the given dataSource. The specified dataSource must have ",(0,i.kt)("a",{parentName:"p",href:"/docs/27.0.0/data-management/automatic-compaction"},"automatic compaction")," enabled."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"GET /druid/coordinator/v1/compaction/status")),(0,i.kt)("p",null,"Returns the status and statistics from the auto-compaction run of all dataSources which have auto-compaction enabled in the latest run. The response payload includes a list of ",(0,i.kt)("inlineCode",{parentName:"p"},"latestStatus")," objects. Each ",(0,i.kt)("inlineCode",{parentName:"p"},"latestStatus")," represents the status for a dataSource (which has/had auto-compaction enabled)."),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"latestStatus")," object has the following keys:"),(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"),": auto-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 auto-compaction config 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 auto-compaction (only consider intervals/segments that are eligible for auto-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 auto-compaction config"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"bytesSkipped"),": total bytes of this datasource that are skipped (not eligible for auto-compaction) by the auto-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 auto-compaction (only consider intervals/segments that are eligible for auto-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 auto-compaction config"),(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 auto-compaction) by the auto-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 auto-compaction (only consider intervals/segments that are eligible for auto-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 auto-compaction config"),(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 auto-compaction) by the auto-compaction")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"GET /druid/coordinator/v1/compaction/status?dataSource={dataSource}")),(0,i.kt)("p",null,"Similar to the API ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/coordinator/v1/compaction/status")," above but filters response to only return information for the dataSource given.\nThe dataSource must have auto-compaction enabled."),(0,i.kt)("h2",{id:"automatic-compaction-configuration"},"Automatic compaction configuration"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"GET /druid/coordinator/v1/config/compaction")),(0,i.kt)("p",null,"Returns all automatic compaction configs."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"GET /druid/coordinator/v1/config/compaction/{dataSource}")),(0,i.kt)("p",null,"Returns an automatic compaction config of a dataSource."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"GET /druid/coordinator/v1/config/compaction/{dataSource}/history?interval={interval}&count={count}")),(0,i.kt)("p",null,"Returns the history of the automatic compaction config for a dataSource. Optionally accepts ",(0,i.kt)("inlineCode",{parentName:"p"},"interval")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"count"),"\nquery string parameters to filter by interval and limit the number of results respectively. If the dataSource does not\nexist or there is no compaction history for the dataSource, an empty list is returned."),(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 config 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 config for the datasource."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"auditInfo"),": A json object that contains information about the change made - like ",(0,i.kt)("inlineCode",{parentName:"li"},"author"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"comment")," and ",(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)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"POST /druid/coordinator/v1/config/compaction/taskslots?ratio={someRatio}&max={someMaxSlots}")),(0,i.kt)("p",null,"Update the capacity for compaction tasks. ",(0,i.kt)("inlineCode",{parentName:"p"},"ratio")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"max")," are used to limit the max number of compaction tasks.\nThey mean the ratio of the total task slots to the compaction task slots and the maximum number of task slots for compaction tasks, respectively. The actual max number of compaction tasks is ",(0,i.kt)("inlineCode",{parentName:"p"},"min(max, ratio * total task slots)"),".\nNote that ",(0,i.kt)("inlineCode",{parentName:"p"},"ratio")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"max")," are optional and can be omitted. If they are omitted, default values (0.1 and unbounded)\nwill be set for them."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"POST /druid/coordinator/v1/config/compaction")),(0,i.kt)("p",null,"Creates or updates the ",(0,i.kt)("a",{parentName:"p",href:"/docs/27.0.0/data-management/automatic-compaction"},"automatic compaction")," config for a dataSource. See ",(0,i.kt)("a",{parentName:"p",href:"/docs/27.0.0/configuration/#automatic-compaction-dynamic-configuration"},"Automatic compaction dynamic configuration")," for configuration details."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"DELETE /druid/coordinator/v1/config/compaction/{dataSource}")),(0,i.kt)("p",null,"Removes the automatic compaction config for a dataSource."))}f.isMDXComponent=!0}}]);