blob: 47f1df4b8a9eeac81fda27a866277e8db37293ad [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4340],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>g});var a=n(67294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),d=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=d(e.components);return a.createElement(o.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},k=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=d(n),k=r,g=u["".concat(o,".").concat(k)]||u[k]||m[k]||i;return n?a.createElement(g,s(s({ref:t},p),{},{components:n})):a.createElement(g,s({ref:t},p))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,s=new Array(i);s[0]=k;var l={};for(var o in t)hasOwnProperty.call(t,o)&&(l[o]=t[o]);l.originalType=e,l[u]="string"==typeof e?e:r,s[1]=l;for(var d=2;d<i;d++)s[d]=n[d];return a.createElement.apply(null,s)}return a.createElement.apply(null,n)}k.displayName="MDXCreateElement"},85162:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(67294),r=n(86010);const i={tabItem:"tabItem_Ymn6"};function s(e){var t=e.children,n=e.hidden,s=e.className;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(i.tabItem,s),hidden:n},t)}},74866:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(87462),r=n(67294),i=n(86010),s=n(12466),l=n(16550),o=n(91980),d=n(67392),p=n(50012);function u(e){return function(e){var t,n;return null!=(t=null==(n=r.Children.map(e,(function(e){if(!e||(0,r.isValidElement)(e)&&(t=e.props)&&"object"==typeof t&&"value"in t)return e;var t;throw new Error("Docusaurus error: Bad <Tabs> child <"+("string"==typeof e.type?e.type:e.type.name)+'>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.')})))?void 0:n.filter(Boolean))?t:[]}(e).map((function(e){var t=e.props;return{value:t.value,label:t.label,attributes:t.attributes,default:t.default}}))}function m(e){var t=e.values,n=e.children;return(0,r.useMemo)((function(){var e=null!=t?t:u(n);return function(e){var t=(0,d.l)(e,(function(e,t){return e.value===t.value}));if(t.length>0)throw new Error('Docusaurus error: Duplicate values "'+t.map((function(e){return e.value})).join(", ")+'" found in <Tabs>. Every value needs to be unique.')}(e),e}),[t,n])}function k(e){var t=e.value;return e.tabValues.some((function(e){return e.value===t}))}function g(e){var t=e.queryString,n=void 0!==t&&t,a=e.groupId,i=(0,l.k6)(),s=function(e){var t=e.queryString,n=void 0!==t&&t,a=e.groupId;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!a)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=a?a:null}({queryString:n,groupId:a});return[(0,o._X)(s),(0,r.useCallback)((function(e){if(s){var t=new URLSearchParams(i.location.search);t.set(s,e),i.replace(Object.assign({},i.location,{search:t.toString()}))}}),[s,i])]}function c(e){var t,n,a,i,s=e.defaultValue,l=e.queryString,o=void 0!==l&&l,d=e.groupId,u=m(e),c=(0,r.useState)((function(){return function(e){var t,n=e.defaultValue,a=e.tabValues;if(0===a.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!k({value:n,tabValues:a}))throw new Error('Docusaurus error: The <Tabs> has a defaultValue "'+n+'" but none of its children has the corresponding value. Available values are: '+a.map((function(e){return e.value})).join(", ")+". If you intend to show no default tab, use defaultValue={null} instead.");return n}var r=null!=(t=a.find((function(e){return e.default})))?t:a[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:s,tabValues:u})})),h=c[0],N=c[1],f=g({queryString:o,groupId:d}),b=f[0],v=f[1],y=(t=function(e){return e?"docusaurus.tab."+e:null}({groupId:d}.groupId),n=(0,p.Nk)(t),a=n[0],i=n[1],[a,(0,r.useCallback)((function(e){t&&i.set(e)}),[t,i])]),C=y[0],w=y[1],T=function(){var e=null!=b?b:C;return k({value:e,tabValues:u})?e:null}();return(0,r.useLayoutEffect)((function(){T&&N(T)}),[T]),{selectedValue:h,selectValue:(0,r.useCallback)((function(e){if(!k({value:e,tabValues:u}))throw new Error("Can't select invalid tab value="+e);N(e),v(e),w(e)}),[v,w,u]),tabValues:u}}var h=n(72389);const N={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function f(e){var t=e.className,n=e.block,l=e.selectedValue,o=e.selectValue,d=e.tabValues,p=[],u=(0,s.o5)().blockElementScrollPositionUntilNextRender,m=function(e){var t=e.currentTarget,n=p.indexOf(t),a=d[n].value;a!==l&&(u(t),o(a))},k=function(e){var t,n=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":var a,r=p.indexOf(e.currentTarget)+1;n=null!=(a=p[r])?a:p[0];break;case"ArrowLeft":var i,s=p.indexOf(e.currentTarget)-1;n=null!=(i=p[s])?i:p[p.length-1]}null==(t=n)||t.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},t)},d.map((function(e){var t=e.value,n=e.label,s=e.attributes;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:l===t?0:-1,"aria-selected":l===t,key:t,ref:function(e){return p.push(e)},onKeyDown:k,onClick:m},s,{className:(0,i.Z)("tabs__item",N.tabItem,null==s?void 0:s.className,{"tabs__item--active":l===t})}),null!=n?n:t)})))}function b(e){var t=e.lazy,n=e.children,a=e.selectedValue,i=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){var s=i.find((function(e){return e.props.value===a}));return s?(0,r.cloneElement)(s,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},i.map((function(e,t){return(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})})))}function v(e){var t=c(e);return r.createElement("div",{className:(0,i.Z)("tabs-container",N.tabList)},r.createElement(f,(0,a.Z)({},e,t)),r.createElement(b,(0,a.Z)({},e,t)))}function y(e){var t=(0,h.Z)();return r.createElement(v,(0,a.Z)({key:String(t)},e))}},58297:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>p,default:()=>h,frontMatter:()=>d,metadata:()=>u,toc:()=>k});var a=n(87462),r=n(63366),i=(n(67294),n(3905)),s=n(74866),l=n(85162),o=["components"],d={id:"kinesis-ingestion",title:"Amazon Kinesis ingestion",sidebar_label:"Amazon Kinesis"},p=void 0,u={unversionedId:"development/extensions-core/kinesis-ingestion",id:"development/extensions-core/kinesis-ingestion",title:"Amazon Kinesis ingestion",description:"\x3c!--",source:"@site/docs/28.0.0/development/extensions-core/kinesis-ingestion.md",sourceDirName:"development/extensions-core",slug:"/development/extensions-core/kinesis-ingestion",permalink:"/docs/28.0.0/development/extensions-core/kinesis-ingestion",draft:!1,tags:[],version:"current",frontMatter:{id:"kinesis-ingestion",title:"Amazon Kinesis ingestion",sidebar_label:"Amazon Kinesis"},sidebar:"docs",previous:{title:"Apache Kafka operations",permalink:"/docs/28.0.0/development/extensions-core/kafka-supervisor-operations"},next:{title:"JSON-based batch",permalink:"/docs/28.0.0/ingestion/native-batch"}},m={},k=[{value:"Setup",id:"setup",level:2},{value:"Supervisor spec",id:"supervisor-spec",level:2},{value:"Supervisor I/O configuration",id:"supervisor-io-configuration",level:2},{value:"Task autoscaler properties",id:"task-autoscaler-properties",level:3},{value:"Lag based autoscaler strategy related properties",id:"lag-based-autoscaler-strategy-related-properties",level:3},{value:"Specify data format",id:"specify-data-format",level:3},{value:"Supervisor tuning configuration",id:"supervisor-tuning-configuration",level:2},{value:"IndexSpec",id:"indexspec",level:3},{value:"Operations",id:"operations",level:2},{value:"AWS authentication",id:"aws-authentication",level:3},{value:"Get supervisor status report",id:"get-supervisor-status-report",level:3},{value:"Update existing supervisors",id:"update-existing-supervisors",level:3},{value:"Suspend and resume a supervisor",id:"suspend-and-resume-a-supervisor",level:3},{value:"Reset a supervisor",id:"reset-a-supervisor",level:3},{value:"Resetting Offsets for a supervisor",id:"resetting-offsets-for-a-supervisor",level:3},{value:"Terminate a supervisor",id:"terminate-a-supervisor",level:3},{value:"Capacity planning",id:"capacity-planning",level:2},{value:"Shards and segment handoff",id:"shards-and-segment-handoff",level:2},{value:"Determine fetch settings",id:"determine-fetch-settings",level:2},{value:"Deaggregation",id:"deaggregation",level:2},{value:"Resharding",id:"resharding",level:2},{value:"Kinesis known issues",id:"kinesis-known-issues",level:2}],g={toc:k},c="wrapper";function h(e){var t=e.components,n=(0,r.Z)(e,o);return(0,i.kt)(c,(0,a.Z)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"When you enable the Kinesis indexing service, you can configure supervisors on the Overlord to manage the creation and lifetime of Kinesis indexing tasks. These indexing tasks read events using Kinesis' own shard and sequence number mechanism to guarantee exactly-once ingestion. The supervisor oversees the state of the indexing tasks to coordinate handoffs, manage failures, and ensure that scalability and replication requirements are maintained."),(0,i.kt)("p",null,"This topic contains configuration reference information for the Kinesis indexing service supervisor for Apache Druid."),(0,i.kt)("h2",{id:"setup"},"Setup"),(0,i.kt)("p",null,"To use the Kinesis indexing service, you must first load the ",(0,i.kt)("inlineCode",{parentName:"p"},"druid-kinesis-indexing-service")," core extension on both the Overlord and the Middle Manager. See ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/configuration/extensions#loading-extensions"},"Loading extensions")," for more information.\nReview the ",(0,i.kt)("a",{parentName:"p",href:"#kinesis-known-issues"},"Kinesis known issues")," before deploying the ",(0,i.kt)("inlineCode",{parentName:"p"},"druid-kinesis-indexing-service")," extension to production."),(0,i.kt)("h2",{id:"supervisor-spec"},"Supervisor spec"),(0,i.kt)("p",null,"The following table outlines the high-level configuration options for the Kinesis supervisor object.\nSee ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/api-reference/supervisor-api"},"Supervisor API")," for more information."),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Property"),(0,i.kt)("th",{parentName:"tr",align:null},"Type"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"),(0,i.kt)("th",{parentName:"tr",align:null},"Required"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"type")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor type; this should always be ",(0,i.kt)("inlineCode",{parentName:"td"},"kinesis"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"spec")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"The container object for the supervisor configuration."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"ioConfig")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"The ",(0,i.kt)("a",{parentName:"td",href:"#supervisor-io-configuration"},"I/O configuration")," object for configuring Kinesis connection and I/O-related settings for the supervisor and indexing task."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"dataSchema")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"The schema used by the Kinesis indexing task during ingestion. See ",(0,i.kt)("a",{parentName:"td",href:"/docs/28.0.0/ingestion/ingestion-spec#dataschema"},(0,i.kt)("inlineCode",{parentName:"a"},"dataSchema"))," for more information."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"tuningConfig")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"The ",(0,i.kt)("a",{parentName:"td",href:"#supervisor-tuning-configuration"},"tuning configuration")," object for configuring performance-related settings for the supervisor and indexing tasks."),(0,i.kt)("td",{parentName:"tr",align:null},"No")))),(0,i.kt)("p",null,"Druid starts a new supervisor when you define a supervisor spec.\nTo create a supervisor, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"POST")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor")," endpoint.\nOnce created, the supervisor persists in the configured metadata database. There can only be a single supervisor per datasource, and submitting a second spec for the same datasource overwrites the previous one."),(0,i.kt)("p",null,"When an Overlord gains leadership, either by being started or as a result of another Overlord failing, it spawns\na supervisor for each supervisor spec in the metadata database. The supervisor then discovers running Kinesis indexing\ntasks and attempts to adopt them if they are compatible with the supervisor's configuration. If they are not\ncompatible because they have a different ingestion spec or shard allocation, the tasks are killed and the\nsupervisor creates a new set of tasks. In this way, the supervisors persist across Overlord restarts and failovers."),(0,i.kt)("p",null,"The following example shows how to submit a supervisor spec for a stream with the name ",(0,i.kt)("inlineCode",{parentName:"p"},"KinesisStream"),".\nIn this example, ",(0,i.kt)("inlineCode",{parentName:"p"},"http://SERVICE_IP:SERVICE_PORT")," is a placeholder for the server address of deployment and the service port."),(0,i.kt)(s.Z,{mdxType:"Tabs"},(0,i.kt)(l.Z,{value:"1",label:"cURL",mdxType:"TabItem"},(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell"},'curl -X POST "http://SERVICE_IP:SERVICE_PORT/druid/indexer/v1/supervisor" \\\n-H "Content-Type: application/json" \\\n-d \'{\n "type": "kinesis",\n "spec": {\n "ioConfig": {\n "type": "kinesis",\n "stream": "KinesisStream",\n "inputFormat": {\n "type": "json"\n },\n "useEarliestSequenceNumber": true\n },\n "tuningConfig": {\n "type": "kinesis"\n },\n "dataSchema": {\n "dataSource": "KinesisStream",\n "timestampSpec": {\n "column": "timestamp",\n "format": "iso"\n },\n "dimensionsSpec": {\n "dimensions": [\n "isRobot",\n "channel",\n "flags",\n "isUnpatrolled",\n "page",\n "diffUrl",\n {\n "type": "long",\n "name": "added"\n },\n "comment",\n {\n "type": "long",\n "name": "commentLength"\n },\n "isNew",\n "isMinor",\n {\n "type": "long",\n "name": "delta"\n },\n "isAnonymous",\n "user",\n {\n "type": "long",\n "name": "deltaBucket"\n },\n {\n "type": "long",\n "name": "deleted"\n },\n "namespace",\n "cityName",\n "countryName",\n "regionIsoCode",\n "metroCode",\n "countryIsoCode",\n "regionName"\n ]\n },\n "granularitySpec": {\n "queryGranularity": "none",\n "rollup": false,\n "segmentGranularity": "hour"\n }\n }\n }\n}\'\n'))),(0,i.kt)(l.Z,{value:"2",label:"HTTP",mdxType:"TabItem"},(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-HTTP"},'POST /druid/indexer/v1/supervisor\nHTTP/1.1\nHost: http://SERVICE_IP:SERVICE_PORT\nContent-Type: application/json\n\n{\n "type": "kinesis",\n "spec": {\n "ioConfig": {\n "type": "kinesis",\n "stream": "KinesisStream",\n "inputFormat": {\n "type": "json"\n },\n "useEarliestSequenceNumber": true\n },\n "tuningConfig": {\n "type": "kinesis"\n },\n "dataSchema": {\n "dataSource": "KinesisStream",\n "timestampSpec": {\n "column": "timestamp",\n "format": "iso"\n },\n "dimensionsSpec": {\n "dimensions": [\n "isRobot",\n "channel",\n "flags",\n "isUnpatrolled",\n "page",\n "diffUrl",\n {\n "type": "long",\n "name": "added"\n },\n "comment",\n {\n "type": "long",\n "name": "commentLength"\n },\n "isNew",\n "isMinor",\n {\n "type": "long",\n "name": "delta"\n },\n "isAnonymous",\n "user",\n {\n "type": "long",\n "name": "deltaBucket"\n },\n {\n "type": "long",\n "name": "deleted"\n },\n "namespace",\n "cityName",\n "countryName",\n "regionIsoCode",\n "metroCode",\n "countryIsoCode",\n "regionName"\n ]\n },\n "granularitySpec": {\n "queryGranularity": "none",\n "rollup": false,\n "segmentGranularity": "hour"\n }\n }\n }\n}\n')))),(0,i.kt)("h2",{id:"supervisor-io-configuration"},"Supervisor I/O configuration"),(0,i.kt)("p",null,"The following table outlines the configuration options for ",(0,i.kt)("inlineCode",{parentName:"p"},"ioConfig"),":"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Property"),(0,i.kt)("th",{parentName:"tr",align:null},"Type"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"),(0,i.kt)("th",{parentName:"tr",align:null},"Required"),(0,i.kt)("th",{parentName:"tr",align:null},"Default"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"stream")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"The Kinesis stream to read."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"inputFormat")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"The ",(0,i.kt)("a",{parentName:"td",href:"/docs/28.0.0/ingestion/data-formats#input-format"},"input format")," to specify how to parse input data. See ",(0,i.kt)("a",{parentName:"td",href:"#specify-data-format"},"Specify data format")," for more information."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"endpoint")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"The AWS Kinesis stream endpoint for a region. You can find a list of endpoints in the ",(0,i.kt)("a",{parentName:"td",href:"http://docs.aws.amazon.com/general/latest/gr/rande.html#ak_region"},"AWS service endpoints")," document."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"kinesis.us-east-1.amazonaws.com"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"replicas")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of replica sets, where 1 is a single set of tasks (no replication). Druid always assigns replicate tasks to different workers to provide resiliency against process failure."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"1")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"taskCount")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The maximum number of reading tasks in a replica set. Multiply ",(0,i.kt)("inlineCode",{parentName:"td"},"taskCount")," and ",(0,i.kt)("inlineCode",{parentName:"td"},"replicas")," to measure the maximum number of reading tasks. ",(0,i.kt)("br",null),"The total number of tasks (reading and publishing) is higher than the maximum number of reading tasks. See ",(0,i.kt)("a",{parentName:"td",href:"#capacity-planning"},"Capacity planning")," for more details. When ",(0,i.kt)("inlineCode",{parentName:"td"},"taskCount > {numKinesisShards}"),", the actual number of reading tasks is less than the ",(0,i.kt)("inlineCode",{parentName:"td"},"taskCount")," value."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"1")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"taskDuration")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"The length of time before tasks stop reading and begin publishing their segments."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT1H")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"startDelay")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"The period to wait before the supervisor starts managing tasks."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT5S")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"period")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"Determines how often the supervisor executes its management logic. Note that the supervisor also runs in response to certain events, such as tasks succeeding, failing, and reaching their task duration, so this value specifies the maximum time between iterations."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT30S")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"useEarliestSequenceNumber")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"If a supervisor is managing a datasource for the first time, it obtains a set of starting sequence numbers from Kinesis. This flag determines whether a supervisor retrieves the earliest or latest sequence numbers in Kinesis. Under normal circumstances, subsequent tasks start from where the previous segments ended so this flag is only used on the first run."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"completionTimeout")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"The length of time to wait before Druid declares a publishing task has failed and terminates it. If this is set too low, your tasks may never publish. The publishing clock for a task begins roughly after ",(0,i.kt)("inlineCode",{parentName:"td"},"taskDuration")," elapses."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT6H")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"lateMessageRejectionPeriod")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"Configure tasks to reject messages with timestamps earlier than this period before the task is created. For example, if ",(0,i.kt)("inlineCode",{parentName:"td"},"lateMessageRejectionPeriod")," is set to ",(0,i.kt)("inlineCode",{parentName:"td"},"PT1H")," and the supervisor creates a task at ",(0,i.kt)("inlineCode",{parentName:"td"},"2016-01-01T12:00Z"),", messages with timestamps earlier than ",(0,i.kt)("inlineCode",{parentName:"td"},"2016-01-01T11:00Z")," are dropped. This may help prevent concurrency issues if your data stream has late messages and you have multiple pipelines that need to operate on the same segments, such as a streaming and a nightly batch ingestion pipeline."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"earlyMessageRejectionPeriod")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"Configure tasks to reject messages with timestamps later than this period after the task reached its ",(0,i.kt)("inlineCode",{parentName:"td"},"taskDuration"),". For example, if ",(0,i.kt)("inlineCode",{parentName:"td"},"earlyMessageRejectionPeriod")," is set to ",(0,i.kt)("inlineCode",{parentName:"td"},"PT1H"),", the ",(0,i.kt)("inlineCode",{parentName:"td"},"taskDuration")," is set to ",(0,i.kt)("inlineCode",{parentName:"td"},"PT1H")," and the supervisor creates a task at ",(0,i.kt)("inlineCode",{parentName:"td"},"2016-01-01T12:00Z"),". Messages with timestamps later than ",(0,i.kt)("inlineCode",{parentName:"td"},"2016-01-01T14:00Z")," are dropped. ",(0,i.kt)("strong",{parentName:"td"},"Note:")," Tasks sometimes run past their task duration, for example, in cases of supervisor failover. Setting ",(0,i.kt)("inlineCode",{parentName:"td"},"earlyMessageRejectionPeriod")," too low may cause messages to be dropped unexpectedly whenever a task runs past its originally configured task duration."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"recordsPerFetch")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of records to request per call to fetch records from Kinesis."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"See ",(0,i.kt)("a",{parentName:"td",href:"#determine-fetch-settings"},"Determine fetch settings")," for defaults.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"fetchDelayMillis")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"Time in milliseconds to wait between subsequent calls to fetch records from Kinesis. See ",(0,i.kt)("a",{parentName:"td",href:"#determine-fetch-settings"},"Determine fetch settings"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"0")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"awsAssumedRoleArn")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"The AWS assumed role to use for additional permissions."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"awsExternalId")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"The AWS external ID to use for additional permissions."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"deaggregate")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"Whether to use the deaggregate function of the Kinesis Client Library (KCL)."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"autoScalerConfig")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"Defines autoscaling behavior for Kinesis ingest tasks. See ",(0,i.kt)("a",{parentName:"td",href:"#task-autoscaler-properties"},"Task autoscaler properties")," for more information."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"null")))),(0,i.kt)("h3",{id:"task-autoscaler-properties"},"Task autoscaler properties"),(0,i.kt)("p",null,"The following table outlines the configuration options for ",(0,i.kt)("inlineCode",{parentName:"p"},"autoScalerConfig"),":"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Property"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"),(0,i.kt)("th",{parentName:"tr",align:null},"Required"),(0,i.kt)("th",{parentName:"tr",align:null},"Default"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"enableTaskAutoScaler")),(0,i.kt)("td",{parentName:"tr",align:null},"Enables the auto scaler. If not specified, Druid disables the auto scaler even when ",(0,i.kt)("inlineCode",{parentName:"td"},"autoScalerConfig")," is not null."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"taskCountMax")),(0,i.kt)("td",{parentName:"tr",align:null},"Maximum number of Kinesis ingestion tasks. Must be greater than or equal to ",(0,i.kt)("inlineCode",{parentName:"td"},"taskCountMin"),". If greater than ",(0,i.kt)("inlineCode",{parentName:"td"},"{numKinesisShards}"),", Druid sets the maximum number of reading tasks to ",(0,i.kt)("inlineCode",{parentName:"td"},"{numKinesisShards}")," and ignores ",(0,i.kt)("inlineCode",{parentName:"td"},"taskCountMax"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"taskCountMin")),(0,i.kt)("td",{parentName:"tr",align:null},"Minimum number of Kinesis ingestion tasks. When you enable the auto scaler, Druid ignores the value of ",(0,i.kt)("inlineCode",{parentName:"td"},"taskCount")," in ",(0,i.kt)("inlineCode",{parentName:"td"},"IOConfig")," and uses ",(0,i.kt)("inlineCode",{parentName:"td"},"taskCountMin")," for the initial number of tasks to launch."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"minTriggerScaleActionFrequencyMillis")),(0,i.kt)("td",{parentName:"tr",align:null},"Minimum time interval between two scale actions."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"600000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"autoScalerStrategy")),(0,i.kt)("td",{parentName:"tr",align:null},"The algorithm of ",(0,i.kt)("inlineCode",{parentName:"td"},"autoScaler"),". Druid only supports the ",(0,i.kt)("inlineCode",{parentName:"td"},"lagBased")," strategy. See ",(0,i.kt)("a",{parentName:"td",href:"#lag-based-autoscaler-strategy-related-properties"},"Lag based autoscaler strategy related properties")," for more information."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"Defaults to ",(0,i.kt)("inlineCode",{parentName:"td"},"lagBased"),".")))),(0,i.kt)("h3",{id:"lag-based-autoscaler-strategy-related-properties"},"Lag based autoscaler strategy related properties"),(0,i.kt)("p",null,"Unlike the Kafka indexing service, Kinesis reports lag metrics measured in time difference in milliseconds between the current sequence number and latest sequence number, rather than message count."),(0,i.kt)("p",null,"The following table outlines the configuration options for ",(0,i.kt)("inlineCode",{parentName:"p"},"autoScalerStrategy"),":"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Property"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"),(0,i.kt)("th",{parentName:"tr",align:null},"Required"),(0,i.kt)("th",{parentName:"tr",align:null},"Default"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"lagCollectionIntervalMillis")),(0,i.kt)("td",{parentName:"tr",align:null},"The time period during which Druid collects lag metric points."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"30000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"lagCollectionRangeMillis")),(0,i.kt)("td",{parentName:"tr",align:null},"The total time window of lag collection. Use with ",(0,i.kt)("inlineCode",{parentName:"td"},"lagCollectionIntervalMillis")," to specify the intervals at which to collect lag metric points."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"600000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"scaleOutThreshold")),(0,i.kt)("td",{parentName:"tr",align:null},"The threshold of scale out action."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"6000000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"triggerScaleOutFractionThreshold")),(0,i.kt)("td",{parentName:"tr",align:null},"Enables scale out action if ",(0,i.kt)("inlineCode",{parentName:"td"},"triggerScaleOutFractionThreshold")," percent of lag points is higher than ",(0,i.kt)("inlineCode",{parentName:"td"},"scaleOutThreshold"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"0.3")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"scaleInThreshold")),(0,i.kt)("td",{parentName:"tr",align:null},"The threshold of scale in action."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"1000000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"triggerScaleInFractionThreshold")),(0,i.kt)("td",{parentName:"tr",align:null},"Enables scale in action if ",(0,i.kt)("inlineCode",{parentName:"td"},"triggerScaleInFractionThreshold")," percent of lag points is lower than ",(0,i.kt)("inlineCode",{parentName:"td"},"scaleOutThreshold"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"0.9")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"scaleActionStartDelayMillis")),(0,i.kt)("td",{parentName:"tr",align:null},"The number of milliseconds to delay after the supervisor starts before the first scale logic check."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"300000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"scaleActionPeriodMillis")),(0,i.kt)("td",{parentName:"tr",align:null},"The frequency in milliseconds to check if a scale action is triggered."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"60000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"scaleInStep")),(0,i.kt)("td",{parentName:"tr",align:null},"The number of tasks to reduce at once when scaling down."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"1")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"scaleOutStep")),(0,i.kt)("td",{parentName:"tr",align:null},"The number of tasks to add at once when scaling out."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"2")))),(0,i.kt)("p",null,"The following example shows a supervisor spec with ",(0,i.kt)("inlineCode",{parentName:"p"},"lagBased")," auto scaler enabled."),(0,i.kt)("details",null,(0,i.kt)("summary",null,"Click to view the example"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "kinesis",\n "dataSchema": {\n "dataSource": "metrics-kinesis",\n "timestampSpec": {\n "column": "timestamp",\n "format": "auto"\n },\n "dimensionsSpec": {\n "dimensions": [],\n "dimensionExclusions": [\n "timestamp",\n "value"\n ]\n },\n "metricsSpec": [\n {\n "name": "count",\n "type": "count"\n },\n {\n "name": "value_sum",\n "fieldName": "value",\n "type": "doubleSum"\n },\n {\n "name": "value_min",\n "fieldName": "value",\n "type": "doubleMin"\n },\n {\n "name": "value_max",\n "fieldName": "value",\n "type": "doubleMax"\n }\n ],\n "granularitySpec": {\n "type": "uniform",\n "segmentGranularity": "HOUR",\n "queryGranularity": "NONE"\n }\n },\n "ioConfig": {\n "stream": "metrics",\n "autoScalerConfig": {\n "enableTaskAutoScaler": true,\n "taskCountMax": 6,\n "taskCountMin": 2,\n "minTriggerScaleActionFrequencyMillis": 600000,\n "autoScalerStrategy": "lagBased",\n "lagCollectionIntervalMillis": 30000,\n "lagCollectionRangeMillis": 600000,\n "scaleOutThreshold": 600000,\n "triggerScaleOutFractionThreshold": 0.3,\n "scaleInThreshold": 100000,\n "triggerScaleInFractionThreshold": 0.9,\n "scaleActionStartDelayMillis": 300000,\n "scaleActionPeriodMillis": 60000,\n "scaleInStep": 1,\n "scaleOutStep": 2\n },\n "inputFormat": {\n "type": "json"\n },\n "endpoint": "kinesis.us-east-1.amazonaws.com",\n "taskCount": 1,\n "replicas": 1,\n "taskDuration": "PT1H"\n },\n "tuningConfig": {\n "type": "kinesis",\n "maxRowsPerSegment": 5000000\n }\n}\n'))),(0,i.kt)("h3",{id:"specify-data-format"},"Specify data format"),(0,i.kt)("p",null,"The Kinesis indexing service supports both ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/ingestion/data-formats#input-format"},(0,i.kt)("inlineCode",{parentName:"a"},"inputFormat"))," and ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/ingestion/data-formats#parser"},(0,i.kt)("inlineCode",{parentName:"a"},"parser"))," to specify the data format.\nUse the ",(0,i.kt)("inlineCode",{parentName:"p"},"inputFormat")," to specify the data format for the Kinesis indexing service unless you need a format only supported by the legacy ",(0,i.kt)("inlineCode",{parentName:"p"},"parser"),"."),(0,i.kt)("p",null,"Supported values for ",(0,i.kt)("inlineCode",{parentName:"p"},"inputFormat")," include:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"csv")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"delimited")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"json")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"avro_stream")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"avro_ocf")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"protobuf"))),(0,i.kt)("p",null,"For more information, see ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/ingestion/data-formats"},"Data formats"),". You can also read ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/development/extensions-contrib/thrift"},(0,i.kt)("inlineCode",{parentName:"a"},"thrift"))," formats using ",(0,i.kt)("inlineCode",{parentName:"p"},"parser"),"."),(0,i.kt)("h2",{id:"supervisor-tuning-configuration"},"Supervisor tuning configuration"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"tuningConfig")," object is optional. If you don't specify the ",(0,i.kt)("inlineCode",{parentName:"p"},"tuningConfig")," object, Druid uses the default configuration settings."),(0,i.kt)("p",null,"The following table outlines the configuration options for ",(0,i.kt)("inlineCode",{parentName:"p"},"tuningConfig"),":"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Property"),(0,i.kt)("th",{parentName:"tr",align:null},"Type"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"),(0,i.kt)("th",{parentName:"tr",align:null},"Required"),(0,i.kt)("th",{parentName:"tr",align:null},"Default"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"type")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"The indexing task type. This should always be ",(0,i.kt)("inlineCode",{parentName:"td"},"kinesis"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"Yes"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsInMemory")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of rows to aggregate before persisting. This number represents the post-aggregation rows. It is not equivalent to the number of input events, but the resulting number of aggregated rows. Druid uses ",(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsInMemory")," to manage the required JVM heap size. The maximum heap memory usage for indexing scales is ",(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsInMemory * (2 + maxPendingPersists)"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"100000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxBytesInMemory")),(0,i.kt)("td",{parentName:"tr",align:null},"Long"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of bytes to aggregate in heap memory before persisting. This is based on a rough estimate of memory usage and not actual usage. Normally, this is computed internally. The maximum heap memory usage for indexing is ",(0,i.kt)("inlineCode",{parentName:"td"},"maxBytesInMemory * (2 + maxPendingPersists)"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"One-sixth of max JVM memory")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"skipBytesInMemoryOverheadCheck")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"The calculation of ",(0,i.kt)("inlineCode",{parentName:"td"},"maxBytesInMemory")," takes into account overhead objects created during ingestion and each intermediate persist. To exclude the bytes of these overhead objects from the ",(0,i.kt)("inlineCode",{parentName:"td"},"maxBytesInMemory")," check, set ",(0,i.kt)("inlineCode",{parentName:"td"},"skipBytesInMemoryOverheadCheck")," to ",(0,i.kt)("inlineCode",{parentName:"td"},"true"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsPerSegment")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of rows to aggregate into a segment; this number represents the post-aggregation rows. Handoff occurs when ",(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsPerSegment")," or ",(0,i.kt)("inlineCode",{parentName:"td"},"maxTotalRows")," is reached or every ",(0,i.kt)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod"),", whichever happens first."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"5000000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxTotalRows")),(0,i.kt)("td",{parentName:"tr",align:null},"Long"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of rows to aggregate across all segments; this number represents the post-aggregation rows. Handoff occurs when ",(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsPerSegment")," or ",(0,i.kt)("inlineCode",{parentName:"td"},"maxTotalRows")," is reached or every ",(0,i.kt)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod"),", whichever happens first."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"unlimited")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"The period that determines how often tasks hand off segments. Handoff occurs if ",(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsPerSegment")," or ",(0,i.kt)("inlineCode",{parentName:"td"},"maxTotalRows")," is reached or every ",(0,i.kt)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod"),", whichever happens first."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"P2147483647D")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"intermediatePersistPeriod")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"The period that determines the rate at which intermediate persists occur."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT10M")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxPendingPersists")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"Maximum number of persists that can be pending but not started. If a new intermediate persist exceeds this limit, Druid blocks ingestion until the currently running persist finishes. One persist can be running concurrently with ingestion, and none can be queued up. The maximum heap memory usage for indexing scales is ",(0,i.kt)("inlineCode",{parentName:"td"},"maxRowsInMemory * (2 + maxPendingPersists)"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"0")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"indexSpec")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"Defines how Druid indexes the data. See ",(0,i.kt)("a",{parentName:"td",href:"#indexspec"},"IndexSpec")," for more information."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null})),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"indexSpecForIntermediatePersists")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"Defines segment storage format options to use at indexing time for intermediate persisted temporary segments. You can use ",(0,i.kt)("inlineCode",{parentName:"td"},"indexSpecForIntermediatePersists")," to disable dimension/metric compression on intermediate segments to reduce memory required for final merging. However, disabling compression on intermediate segments might increase page cache use while they are used before getting merged into final segment published. See ",(0,i.kt)("a",{parentName:"td",href:"#indexspec"},"IndexSpec")," for possible values."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"Same as ",(0,i.kt)("inlineCode",{parentName:"td"},"indexSpec"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"reportParseExceptions")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"If ",(0,i.kt)("inlineCode",{parentName:"td"},"true"),", Druid throws exceptions encountered during parsing causing ingestion to halt. If ",(0,i.kt)("inlineCode",{parentName:"td"},"false"),", Druid skips unparseable rows and fields."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"handoffConditionTimeout")),(0,i.kt)("td",{parentName:"tr",align:null},"Long"),(0,i.kt)("td",{parentName:"tr",align:null},"Number of milliseconds to wait for segment handoff. Set to a value >= 0, where 0 means to wait indefinitely."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"0")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"resetOffsetAutomatically")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"Controls behavior when Druid needs to read Kinesis messages that are no longer available.",(0,i.kt)("br",null),"If ",(0,i.kt)("inlineCode",{parentName:"td"},"false"),", the exception bubbles up causing tasks to fail and ingestion to halt. If this occurs, manual intervention is required to correct the situation, potentially using the ",(0,i.kt)("a",{parentName:"td",href:"/docs/28.0.0/api-reference/supervisor-api"},"Reset Supervisor API"),". This mode is useful for production, since it highlights issues with ingestion.",(0,i.kt)("br",null),"If ",(0,i.kt)("inlineCode",{parentName:"td"},"true"),", Druid automatically resets to the earliest or latest sequence number available in Kinesis, based on the value of the ",(0,i.kt)("inlineCode",{parentName:"td"},"useEarliestSequenceNumber")," property (earliest if ",(0,i.kt)("inlineCode",{parentName:"td"},"true"),", latest if ",(0,i.kt)("inlineCode",{parentName:"td"},"false"),"). Note that this can lead to dropping data (if ",(0,i.kt)("inlineCode",{parentName:"td"},"useEarliestSequenceNumber")," is ",(0,i.kt)("inlineCode",{parentName:"td"},"false"),") or duplicating data (if ",(0,i.kt)("inlineCode",{parentName:"td"},"useEarliestSequenceNumber")," is ",(0,i.kt)("inlineCode",{parentName:"td"},"true"),") without your knowledge. Druid logs messages indicating that a reset has occurred without interrupting ingestion. This mode is useful for non-production situations since it enables Druid to recover from problems automatically, even if they lead to quiet dropping or duplicating of data."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"skipSequenceNumberAvailabilityCheck")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"Whether to enable checking if the current sequence number is still available in a particular Kinesis shard. If ",(0,i.kt)("inlineCode",{parentName:"td"},"false"),", the indexing task attempts to reset the current sequence number, depending on the value of ",(0,i.kt)("inlineCode",{parentName:"td"},"resetOffsetAutomatically"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"workerThreads")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of threads that the supervisor uses to handle requests/responses for worker tasks, along with any other internal asynchronous operation."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"min(10, taskCount)"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"chatRetries")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of times Druid retries HTTP requests to indexing tasks before considering tasks unresponsive."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"8")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"httpTimeout")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"The period of time to wait for a HTTP response from an indexing task."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT10S")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"shutdownTimeout")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"The period of time to wait for the supervisor to attempt a graceful shutdown of tasks before exiting."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT80S")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"recordBufferSize")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The size of the buffer (number of events) Druid uses between the Kinesis fetch threads and the main ingestion thread."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"See ",(0,i.kt)("a",{parentName:"td",href:"#determine-fetch-settings"},"Determine fetch settings")," for defaults.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"recordBufferOfferTimeout")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of milliseconds to wait for space to become available in the buffer before timing out."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"5000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"recordBufferFullWait")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The number of milliseconds to wait for the buffer to drain before Druid attempts to fetch records from Kinesis again."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"5000")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"fetchThreads")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The size of the pool of threads fetching data from Kinesis. There is no benefit in having more threads than Kinesis shards."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"procs * 2"),", where ",(0,i.kt)("inlineCode",{parentName:"td"},"procs")," is the number of processors available to the task.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"segmentWriteOutMediumFactory")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"The segment write-out medium to use when creating segments See ",(0,i.kt)("a",{parentName:"td",href:"/docs/28.0.0/configuration/#segmentwriteoutmediumfactory"},"Additional Peon configuration: SegmentWriteOutMediumFactory")," for explanation and available options."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"If not specified, Druid uses the value from ",(0,i.kt)("inlineCode",{parentName:"td"},"druid.peon.defaultSegmentWriteOutMediumFactory.type"),".")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"logParseExceptions")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"If ",(0,i.kt)("inlineCode",{parentName:"td"},"true"),", Druid logs an error message when a parsing exception occurs, containing information about the row where the error occurred."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxParseExceptions")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The maximum number of parse exceptions that can occur before the task halts ingestion and fails. Overridden if ",(0,i.kt)("inlineCode",{parentName:"td"},"reportParseExceptions")," is set."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"unlimited")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxSavedParseExceptions")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"When a parse exception occurs, Druid keeps track of the most recent parse exceptions. ",(0,i.kt)("inlineCode",{parentName:"td"},"maxSavedParseExceptions")," limits the number of saved exception instances. These saved exceptions are available after the task finishes in the ",(0,i.kt)("a",{parentName:"td",href:"/docs/28.0.0/ingestion/tasks#task-reports"},"task completion report"),". Overridden if ",(0,i.kt)("inlineCode",{parentName:"td"},"reportParseExceptions")," is set."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"0")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"maxRecordsPerPoll")),(0,i.kt)("td",{parentName:"tr",align:null},"Integer"),(0,i.kt)("td",{parentName:"tr",align:null},"The maximum number of records to be fetched from buffer per poll. The actual maximum will be ",(0,i.kt)("inlineCode",{parentName:"td"},"Max(maxRecordsPerPoll, Max(bufferSize, 1))"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"See ",(0,i.kt)("a",{parentName:"td",href:"#determine-fetch-settings"},"Determine fetch settings")," for defaults.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"repartitionTransitionDuration")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"When shards are split or merged, the supervisor recomputes shard to task group mappings. The supervisor also signals any running tasks created under the old mappings to stop early at current time + ",(0,i.kt)("inlineCode",{parentName:"td"},"repartitionTransitionDuration"),". Stopping the tasks early allows Druid to begin reading from the new shards more quickly. The repartition transition wait time controlled by this property gives the stream additional time to write records to the new shards after the split or merge, which helps avoid issues with ",(0,i.kt)("a",{parentName:"td",href:"https://github.com/apache/druid/issues/7600"},"empty shard handling"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT2M")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"offsetFetchPeriod")),(0,i.kt)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.kt)("td",{parentName:"tr",align:null},"Determines how often the supervisor queries Kinesis and the indexing tasks to fetch current offsets and calculate lag. If the user-specified value is below the minimum value of PT5S, the supervisor ignores the value and uses the minimum value instead."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"PT30S")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"useListShards")),(0,i.kt)("td",{parentName:"tr",align:null},"Boolean"),(0,i.kt)("td",{parentName:"tr",align:null},"Indicates if ",(0,i.kt)("inlineCode",{parentName:"td"},"listShards")," API of AWS Kinesis SDK can be used to prevent ",(0,i.kt)("inlineCode",{parentName:"td"},"LimitExceededException")," during ingestion. You must set the necessary ",(0,i.kt)("inlineCode",{parentName:"td"},"IAM")," permissions."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"false"))))),(0,i.kt)("h3",{id:"indexspec"},"IndexSpec"),(0,i.kt)("p",null,"The following table outlines the configuration options for ",(0,i.kt)("inlineCode",{parentName:"p"},"indexSpec"),":"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Property"),(0,i.kt)("th",{parentName:"tr",align:null},"Type"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"),(0,i.kt)("th",{parentName:"tr",align:null},"Required"),(0,i.kt)("th",{parentName:"tr",align:null},"Default"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"bitmap")),(0,i.kt)("td",{parentName:"tr",align:null},"Object"),(0,i.kt)("td",{parentName:"tr",align:null},"Compression format for bitmap indexes. Druid supports roaring and concise bitmap types."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},"Roaring")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"dimensionCompression")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"Compression format for dimension columns. Choose from ",(0,i.kt)("inlineCode",{parentName:"td"},"LZ4"),", ",(0,i.kt)("inlineCode",{parentName:"td"},"LZF"),", or ",(0,i.kt)("inlineCode",{parentName:"td"},"uncompressed"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"LZ4"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"metricCompression")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"Compression format for primitive type metric columns. Choose from ",(0,i.kt)("inlineCode",{parentName:"td"},"LZ4"),", ",(0,i.kt)("inlineCode",{parentName:"td"},"LZF"),", ",(0,i.kt)("inlineCode",{parentName:"td"},"uncompressed"),", or ",(0,i.kt)("inlineCode",{parentName:"td"},"none"),"."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"LZ4"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"longEncoding")),(0,i.kt)("td",{parentName:"tr",align:null},"String"),(0,i.kt)("td",{parentName:"tr",align:null},"Encoding format for metric and dimension columns with type long. Choose from ",(0,i.kt)("inlineCode",{parentName:"td"},"auto")," or ",(0,i.kt)("inlineCode",{parentName:"td"},"longs"),". ",(0,i.kt)("inlineCode",{parentName:"td"},"auto")," encodes the values using sequence number or lookup table depending on column cardinality and stores them with variable sizes. ",(0,i.kt)("inlineCode",{parentName:"td"},"longs")," stores the value as is with 8 bytes each."),(0,i.kt)("td",{parentName:"tr",align:null},"No"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"longs"))))),(0,i.kt)("h2",{id:"operations"},"Operations"),(0,i.kt)("p",null,"This section describes how to use the ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/api-reference/supervisor-api"},"Supervisor API")," with the Kinesis indexing service."),(0,i.kt)("h3",{id:"aws-authentication"},"AWS authentication"),(0,i.kt)("p",null,"Druid uses AWS access and secret keys to authenticate Kinesis API requests. There are a few ways to provide this information to Druid:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Using roles or short-term credentials:"),(0,i.kt)("p",{parentName:"li"}," Druid looks for credentials set in ",(0,i.kt)("a",{parentName:"p",href:"https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html"},"environment variables"),",\nvia ",(0,i.kt)("a",{parentName:"p",href:"https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html"},"Web Identity Token"),", in the\ndefault ",(0,i.kt)("a",{parentName:"p",href:"https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html"},"profile configuration file"),", and from the\nEC2 instance profile provider (in this order).")),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Using long-term security credentials:"),(0,i.kt)("p",{parentName:"li"},"You can directly provide your AWS access key and AWS secret key in the ",(0,i.kt)("inlineCode",{parentName:"p"},"common.runtime.properties")," file as shown in the example below:"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-properties"},"druid.kinesis.accessKey=AKIAWxxxxxxxxxx4NCKS\ndruid.kinesis.secretKey=Jbytxxxxxxxxxxx2+555\n")),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Note: AWS does not recommend providing long-term security credentials in configuration files since it might pose a security risk.\nIf you use this approach, it takes precedence over all other methods of providing credentials.")),(0,i.kt)("p",null,"To ingest data from Kinesis, ensure that the policy attached to your IAM role contains the necessary permissions.\nThe required permissions depend on the value of ",(0,i.kt)("inlineCode",{parentName:"p"},"useListShards"),"."),(0,i.kt)("p",null,"If the ",(0,i.kt)("inlineCode",{parentName:"p"},"useListShards")," flag is set to ",(0,i.kt)("inlineCode",{parentName:"p"},"true"),", you need following permissions:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ListStreams")," to list your data streams."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Get*")," required for ",(0,i.kt)("inlineCode",{parentName:"li"},"GetShardIterator"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"GetRecords")," to get data records from a data stream's shard."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ListShards")," to get the shards for a stream of interest.")),(0,i.kt)("p",null,"The following is an example policy:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'[\n {\n "Effect": "Allow",\n "Action": ["kinesis:List*"],\n "Resource": ["*"]\n },\n {\n "Effect": "Allow",\n "Action": ["kinesis:Get*"],\n "Resource": [<ARN for shards to be ingested>]\n }\n]\n')),(0,i.kt)("p",null,"If the ",(0,i.kt)("inlineCode",{parentName:"p"},"useListShards")," flag is set to ",(0,i.kt)("inlineCode",{parentName:"p"},"false"),", you need following permissions:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"ListStreams")," to list your data streams."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"Get*")," required for ",(0,i.kt)("inlineCode",{parentName:"li"},"GetShardIterator"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"GetRecords")," to get data records from a data stream's shard."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"DescribeStream")," to describe the specified data stream.")),(0,i.kt)("p",null,"The following is an example policy:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'[\n {\n "Effect": "Allow",\n "Action": ["kinesis:ListStreams"],\n "Resource": ["*"]\n },\n {\n "Effect": "Allow",\n "Action": ["kinesis:DescribeStream"],\n "Resource": ["*"]\n },\n {\n "Effect": "Allow",\n "Action": ["kinesis:Get*"],\n "Resource": [<ARN for shards to be ingested>]\n }\n]\n')),(0,i.kt)("h3",{id:"get-supervisor-status-report"},"Get supervisor status report"),(0,i.kt)("p",null,"To retrieve the current status report for a single supervisor, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"GET")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor/:supervisorId/status")," endpoint."),(0,i.kt)("p",null,"The report contains the state of the supervisor tasks, the latest sequence numbers, and an array of recently thrown exceptions reported as ",(0,i.kt)("inlineCode",{parentName:"p"},"recentErrors"),". You can control the maximum size of the exceptions using the ",(0,i.kt)("inlineCode",{parentName:"p"},"druid.supervisor.maxStoredExceptionEvents")," configuration."),(0,i.kt)("p",null,"The two properties related to the supervisor's state are ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"detailedState"),". The ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," property contains a small number of generic states that apply to any type of supervisor, while the ",(0,i.kt)("inlineCode",{parentName:"p"},"detailedState")," property contains a more descriptive, implementation-specific state that may provide more insight into the supervisor's activities."),(0,i.kt)("p",null,"Possible ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," values are ",(0,i.kt)("inlineCode",{parentName:"p"},"PENDING"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"RUNNING"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"SUSPENDED"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"STOPPING"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"UNHEALTHY_SUPERVISOR"),", and ",(0,i.kt)("inlineCode",{parentName:"p"},"UNHEALTHY_TASKS"),"."),(0,i.kt)("p",null,"The following table lists ",(0,i.kt)("inlineCode",{parentName:"p"},"detailedState")," values and their corresponding ",(0,i.kt)("inlineCode",{parentName:"p"},"state")," mapping:"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"Detailed state"),(0,i.kt)("th",{parentName:"tr",align:null},"Corresponding state"),(0,i.kt)("th",{parentName:"tr",align:null},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor encountered errors on previous ",(0,i.kt)("inlineCode",{parentName:"td"},"druid.supervisor.unhealthinessThreshold")," iterations.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"UNHEALTHY_TASKS")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"UNHEALTHY_TASKS")),(0,i.kt)("td",{parentName:"tr",align:null},"The last ",(0,i.kt)("inlineCode",{parentName:"td"},"druid.supervisor.taskUnhealthinessThreshold")," tasks all failed.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"UNABLE_TO_CONNECT_TO_STREAM")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor is encountering connectivity issues with Kinesis and has not successfully connected in the past.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"LOST_CONTACT_WITH_STREAM")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor is encountering connectivity issues with Kinesis but has successfully connected in the past.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"PENDING")," (first iteration only)"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"PENDING")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor has been initialized but hasn't started connecting to the stream.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"CONNECTING_TO_STREAM")," (first iteration only)"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor is trying to connect to the stream and update partition data.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"DISCOVERING_INITIAL_TASKS")," (first iteration only)"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor is discovering already-running tasks.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"CREATING_TASKS")," (first iteration only)"),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor is creating tasks and discovering state.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor has started tasks and is waiting for ",(0,i.kt)("inlineCode",{parentName:"td"},"taskDuration")," to elapse.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"SUSPENDED")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"SUSPENDED")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor is suspended.")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"STOPPING")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"STOPPING")),(0,i.kt)("td",{parentName:"tr",align:null},"The supervisor is stopping.")))),(0,i.kt)("p",null,"On each iteration of the supervisor's run loop, the supervisor completes the following tasks in sequence:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Fetch the list of shards from Kinesis and determine the starting sequence number for each shard (either based on the last processed sequence number if continuing, or starting from the beginning or ending of the stream if this is a new stream)."),(0,i.kt)("li",{parentName:"ol"},"Discover any running indexing tasks that are writing to the supervisor's datasource and adopt them if they match the supervisor's configuration, else signal them to stop."),(0,i.kt)("li",{parentName:"ol"},"Send a status request to each supervised task to update the view of the state of the tasks under supervision."),(0,i.kt)("li",{parentName:"ol"},"Handle tasks that have exceeded ",(0,i.kt)("inlineCode",{parentName:"li"},"taskDuration")," and should transition from the reading to publishing state."),(0,i.kt)("li",{parentName:"ol"},"Handle tasks that have finished publishing and signal redundant replica tasks to stop."),(0,i.kt)("li",{parentName:"ol"},"Handle tasks that have failed and clean up the supervisor's internal state."),(0,i.kt)("li",{parentName:"ol"},"Compare the list of healthy tasks to the requested ",(0,i.kt)("inlineCode",{parentName:"li"},"taskCount")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"replicas")," configurations and create additional tasks if required.")),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"detailedState"),' property shows additional values (marked with "first iteration only" in the preceding table) the first time the\nsupervisor executes this run loop after startup or after resuming from a suspension. This is intended to surface\ninitialization-type issues, where the supervisor is unable to reach a stable state. For example, if the supervisor cannot connect to\nKinesis, if it\'s unable to read from the stream, or cannot communicate with existing tasks. Once the supervisor is stable;\nthat is, once it has completed a full execution without encountering any issues, ',(0,i.kt)("inlineCode",{parentName:"p"},"detailedState")," will show a ",(0,i.kt)("inlineCode",{parentName:"p"},"RUNNING"),"\nstate until it is stopped, suspended, or hits a failure threshold and transitions to an unhealthy state."),(0,i.kt)("h3",{id:"update-existing-supervisors"},"Update existing supervisors"),(0,i.kt)("p",null,"To update an existing supervisor spec, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"POST")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor")," endpoint."),(0,i.kt)("p",null,"When you call this endpoint on an existing supervisor for the same datasource, the running supervisor signals its tasks to stop reading and begin publishing their segments, exiting itself. Druid then uses the provided configuration from the request body to create a new supervisor with a new set of tasks that start reading from the sequence numbers, where the previous now-publishing tasks left off, but using the updated schema.\nIn this way, configuration changes can be applied without requiring any pause in ingestion."),(0,i.kt)("p",null,"You can achieve seamless schema migrations by submitting the new schema using the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor")," endpoint."),(0,i.kt)("h3",{id:"suspend-and-resume-a-supervisor"},"Suspend and resume a supervisor"),(0,i.kt)("p",null,"To suspend a supervisor, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"POST")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor/:supervisorId/suspend")," endpoint.\nSuspending a supervisor does not prevent it from operating and emitting logs and metrics. It ensures that no indexing tasks are running until the supervisor resumes."),(0,i.kt)("p",null,"To resume a supervisor, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"POST")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor/:supervisorId/resume")," endpoint."),(0,i.kt)("h3",{id:"reset-a-supervisor"},"Reset a supervisor"),(0,i.kt)("p",null,"The supervisor must be running for this endpoint to be available"),(0,i.kt)("p",null,"To reset a supervisor, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"POST")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor/:supervisorId/reset")," endpoint. This endpoint clears stored\nsequence numbers, prompting the supervisor to start reading from either the earliest or the\nlatest sequence numbers in Kinesis (depending on the value of ",(0,i.kt)("inlineCode",{parentName:"p"},"useEarliestSequenceNumber"),").\nAfter clearing stored sequence numbers, the supervisor kills and recreates active tasks,\nso that tasks begin reading from valid sequence numbers."),(0,i.kt)("p",null,"This endpoint is useful when you need to recover from a stopped state due to missing sequence numbers in Kinesis.\nUse this endpoint with caution as it may result in skipped messages, leading to data loss or duplicate data."),(0,i.kt)("p",null,"The indexing service keeps track of the latest\npersisted sequence number to provide exactly-once ingestion guarantees across\ntasks.\nSubsequent tasks must start reading from where the previous task completed\nfor the generated segments to be accepted. If the messages at the expected starting sequence numbers are\nno longer available in Kinesis (typically because the message retention period has elapsed or the topic was\nremoved and re-created) the supervisor will refuse to start and in-flight tasks will fail. This endpoint enables you to recover from this condition."),(0,i.kt)("h3",{id:"resetting-offsets-for-a-supervisor"},"Resetting Offsets for a supervisor"),(0,i.kt)("p",null,"To reset partition offsets for a supervisor, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"POST")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor/:supervisorId/resetOffsets")," endpoint. This endpoint clears stored\nsequence numbers, prompting the supervisor to start reading from the specified offsets.\nAfter resetting stored offsets, the supervisor kills and recreates any active tasks pertaining to the specified partitions,\nso that tasks begin reading specified offsets. For partitions that are not specified in this operation, the supervisor will resume from the last\nstored offset."),(0,i.kt)("p",null,"Use this endpoint with caution as it may result in skipped messages, leading to data loss or duplicate data."),(0,i.kt)("h3",{id:"terminate-a-supervisor"},"Terminate a supervisor"),(0,i.kt)("p",null,"To terminate a supervisor and its associated indexing tasks, send a ",(0,i.kt)("inlineCode",{parentName:"p"},"POST")," request to the ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor/:supervisorId/terminate")," endpoint.\nThis places a tombstone marker in the database to prevent the supervisor from being reloaded on a restart and then gracefully\nshuts down the currently running supervisor.\nThe tasks stop reading and begin publishing their segments immediately.\nThe call returns after all tasks have been signaled to stop but before the tasks finish publishing their segments."),(0,i.kt)("p",null,"The terminated supervisor continues exists in the metadata store and its history can be retrieved.\nThe only way to restart a terminated supervisor is by submitting a functioning supervisor spec to ",(0,i.kt)("inlineCode",{parentName:"p"},"/druid/indexer/v1/supervisor"),"."),(0,i.kt)("h2",{id:"capacity-planning"},"Capacity planning"),(0,i.kt)("p",null,"Kinesis indexing tasks run on Middle Managers and are limited by the resources available in the Middle Manager cluster. In particular, you should make sure that you have sufficient worker capacity, configured using the\n",(0,i.kt)("inlineCode",{parentName:"p"},"druid.worker.capacity")," property, to handle the configuration in the supervisor spec. Note that worker capacity is\nshared across all types of indexing tasks, so you should plan your worker capacity to handle your total indexing load, such as batch processing, streaming tasks, and merging tasks. If your workers run out of capacity, Kinesis indexing tasks queue and wait for the next available worker. This may cause queries to return partial results but will not result in data loss, assuming the tasks run before Kinesis purges those sequence numbers."),(0,i.kt)("p",null,"A running task can be in one of two states: reading or publishing. A task remains in reading state for the period defined in ",(0,i.kt)("inlineCode",{parentName:"p"},"taskDuration"),", at which point it transitions to publishing state. A task remains in publishing state for as long as it takes to generate segments, push segments to deep storage, and have them loaded and served by a Historical process or until ",(0,i.kt)("inlineCode",{parentName:"p"},"completionTimeout")," elapses."),(0,i.kt)("p",null,"The number of reading tasks is controlled by ",(0,i.kt)("inlineCode",{parentName:"p"},"replicas")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"taskCount"),". In general, there are ",(0,i.kt)("inlineCode",{parentName:"p"},"replicas * taskCount")," reading tasks. An exception occurs if ",(0,i.kt)("inlineCode",{parentName:"p"},"taskCount > {numKinesisShards}"),", in which case Druid uses ",(0,i.kt)("inlineCode",{parentName:"p"},"{numKinesisShards}")," tasks. When ",(0,i.kt)("inlineCode",{parentName:"p"},"taskDuration")," elapses, these tasks transition to publishing state and ",(0,i.kt)("inlineCode",{parentName:"p"},"replicas * taskCount")," new reading tasks are created. To allow for reading tasks and publishing tasks to run concurrently, there should be a minimum capacity of:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-text"},"workerCapacity = 2 * replicas * taskCount\n")),(0,i.kt)("p",null,"This value is for the ideal situation in which there is at most one set of tasks publishing while another set is reading.\nIn some circumstances, it is possible to have multiple sets of tasks publishing simultaneously. This would happen if the\ntime-to-publish (generate segment, push to deep storage, load on Historical) is greater than ",(0,i.kt)("inlineCode",{parentName:"p"},"taskDuration"),". This is a valid and correct scenario but requires additional worker capacity to support. In general, it is a good idea to have ",(0,i.kt)("inlineCode",{parentName:"p"},"taskDuration")," be large enough that the previous set of tasks finishes publishing before the current set begins."),(0,i.kt)("h2",{id:"shards-and-segment-handoff"},"Shards and segment handoff"),(0,i.kt)("p",null,"Each Kinesis indexing task writes the events it consumes from Kinesis shards into a single segment for the segment granularity interval until it reaches one of the following limits: ",(0,i.kt)("inlineCode",{parentName:"p"},"maxRowsPerSegment"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"maxTotalRows"),", or ",(0,i.kt)("inlineCode",{parentName:"p"},"intermediateHandoffPeriod"),".\nAt this point, the task creates a new shard for this segment granularity to contain subsequent events."),(0,i.kt)("p",null,"The Kinesis indexing task also performs incremental hand-offs so that the segments created by the task are not held up until the task duration is over.\nWhen the task reaches one of the ",(0,i.kt)("inlineCode",{parentName:"p"},"maxRowsPerSegment"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"maxTotalRows"),", or ",(0,i.kt)("inlineCode",{parentName:"p"},"intermediateHandoffPeriod")," limits, it hands off all the segments and creates a new set of segments for further events. This allows the task to run for longer durations\nwithout accumulating old segments locally on Middle Manager processes."),(0,i.kt)("p",null,"The Kinesis indexing service may still produce some small segments.\nFor example, consider the following scenario:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Task duration is 4 hours"),(0,i.kt)("li",{parentName:"ul"},"Segment granularity is set to an HOUR"),(0,i.kt)("li",{parentName:"ul"},"The supervisor was started at 9:10")),(0,i.kt)("p",null,"After 4 hours at 13:10, Druid starts a new set of tasks. The events for the interval 13:00 - 14:00 may be split across existing tasks and the new set of tasks which could result in small segments. To merge them together into new segments of an ideal size (in the range of ~500-700 MB per segment), you can schedule re-indexing tasks, optionally with a different segment granularity."),(0,i.kt)("p",null,"For more detail, see ",(0,i.kt)("a",{parentName:"p",href:"/docs/28.0.0/operations/segment-optimization"},"Segment size optimization"),"."),(0,i.kt)("h2",{id:"determine-fetch-settings"},"Determine fetch settings"),(0,i.kt)("p",null,"Kinesis indexing tasks fetch records using ",(0,i.kt)("inlineCode",{parentName:"p"},"fetchThreads")," threads.\nIf ",(0,i.kt)("inlineCode",{parentName:"p"},"fetchThreads")," is higher than the number of Kinesis shards, the excess threads are unused.\nEach fetch thread fetches up to ",(0,i.kt)("inlineCode",{parentName:"p"},"recordsPerFetch")," records at once from a Kinesis shard, with a delay between fetches\nof ",(0,i.kt)("inlineCode",{parentName:"p"},"fetchDelayMillis"),".\nThe records fetched by each thread are pushed into a shared queue of size ",(0,i.kt)("inlineCode",{parentName:"p"},"recordBufferSize"),".\nThe main runner thread for each task polls up to ",(0,i.kt)("inlineCode",{parentName:"p"},"maxRecordsPerPoll")," records from the queue at once."),(0,i.kt)("p",null,"When using Kinesis Producer Library's aggregation feature, that is when ",(0,i.kt)("a",{parentName:"p",href:"#deaggregation"},(0,i.kt)("inlineCode",{parentName:"a"},"deaggregate"))," is set,\neach of these parameters refers to aggregated records rather than individual records."),(0,i.kt)("p",null,"The default values for these parameters are:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"fetchThreads"),": Twice the number of processors available to the task. The number of processors available to the task\nis the total number of processors on the server, divided by ",(0,i.kt)("inlineCode",{parentName:"li"},"druid.worker.capacity")," (the number of task slots on that\nparticular server)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"fetchDelayMillis"),": 0 (no delay between fetches)."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"recordsPerFetch"),": 100 MB or an estimated 5% of available heap, whichever is smaller, divided by ",(0,i.kt)("inlineCode",{parentName:"li"},"fetchThreads"),".\nFor estimation purposes, Druid uses a figure of 10 KB for regular records and 1 MB for ",(0,i.kt)("a",{parentName:"li",href:"#deaggregation"},"aggregated records"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"recordBufferSize"),": 100 MB or an estimated 10% of available heap, whichever is smaller.\nFor estimation purposes, Druid uses a figure of 10 KB for regular records and 1 MB for ",(0,i.kt)("a",{parentName:"li",href:"#deaggregation"},"aggregated records"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"maxRecordsPerPoll"),": 100 for regular records, 1 for ",(0,i.kt)("a",{parentName:"li",href:"#deaggregation"},"aggregated records"),".")),(0,i.kt)("p",null,"Kinesis places the following restrictions on calls to fetch records:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Each data record can be up to 1 MB in size."),(0,i.kt)("li",{parentName:"ul"},"Each shard can support up to 5 transactions per second for reads."),(0,i.kt)("li",{parentName:"ul"},"Each shard can read up to 2 MB per second."),(0,i.kt)("li",{parentName:"ul"},"The maximum size of data that GetRecords can return is 10 MB.")),(0,i.kt)("p",null,"If the above limits are exceeded, Kinesis throws ",(0,i.kt)("inlineCode",{parentName:"p"},"ProvisionedThroughputExceededException")," errors. If this happens, Druid\nKinesis tasks pause by ",(0,i.kt)("inlineCode",{parentName:"p"},"fetchDelayMillis")," or 3 seconds, whichever is larger, and then attempt the call again."),(0,i.kt)("p",null,"In most cases, the default settings for fetch parameters are sufficient to achieve good performance without excessive\nmemory usage. However, in some cases, you may need to adjust these parameters to control fetch rate\nand memory usage more finely. Optimal values depend on the average size of a record and the number of consumers you\nhave reading from a given shard, which will be ",(0,i.kt)("inlineCode",{parentName:"p"},"replicas")," unless you have other consumers also reading from this\nKinesis stream."),(0,i.kt)("h2",{id:"deaggregation"},"Deaggregation"),(0,i.kt)("p",null,"The Kinesis indexing service supports de-aggregation of multiple rows packed into a single record by the Kinesis\nProducer Library's aggregate method for more efficient data transfer."),(0,i.kt)("p",null,"To enable this feature, set ",(0,i.kt)("inlineCode",{parentName:"p"},"deaggregate")," to true in your ",(0,i.kt)("inlineCode",{parentName:"p"},"ioConfig")," when submitting a supervisor spec."),(0,i.kt)("h2",{id:"resharding"},"Resharding"),(0,i.kt)("p",null,"When changing the shard count for a Kinesis stream, there is a window of time around the resharding operation with early shutdown of Kinesis ingestion tasks and possible task failures."),(0,i.kt)("p",null,"The early shutdowns and task failures are expected. They occur because the supervisor updates the shard to task group mappings as shards are closed and fully read. This ensures that tasks are not running\nwith an assignment of closed shards that have been fully read and balances distribution of active shards across tasks."),(0,i.kt)("p",null,"This window with early task shutdowns and possible task failures concludes when:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},'All closed shards have been fully read and the Kinesis ingestion tasks have published the data from those shards, committing the "closed" state to metadata storage.'),(0,i.kt)("li",{parentName:"ul"},"Any remaining tasks that had inactive shards in the assignment have been shut down. These tasks would have been created before the closed shards were completely drained.")),(0,i.kt)("h2",{id:"kinesis-known-issues"},"Kinesis known issues"),(0,i.kt)("p",null,"Before you deploy the Kinesis extension to production, consider the following known issues:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Avoid implementing more than one Kinesis supervisor that reads from the same Kinesis stream for ingestion. Kinesis has a per-shard read throughput limit and having multiple supervisors on the same stream can reduce available read throughput for an individual supervisor's tasks. Multiple supervisors ingesting to the same Druid datasource can also cause increased contention for locks on the datasource."),(0,i.kt)("li",{parentName:"ul"},"The only way to change the stream reset policy is to submit a new ingestion spec and set up a new supervisor."),(0,i.kt)("li",{parentName:"ul"},"If ingestion tasks get stuck, the supervisor does not automatically recover. You should monitor ingestion tasks and investigate if your ingestion falls behind."),(0,i.kt)("li",{parentName:"ul"},"A Kinesis supervisor can sometimes compare the checkpoint offset to retention window of the stream to see if it has fallen behind. These checks fetch the earliest sequence number for Kinesis which can result in ",(0,i.kt)("inlineCode",{parentName:"li"},"IteratorAgeMilliseconds")," becoming very high in AWS CloudWatch.")))}h.isMDXComponent=!0}}]);