blob: 9f5efbfcc0dfc4cc45af443d18781d2d4396c4c8 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8431],{3905:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>c});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function s(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var o=n.createContext({}),p=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},d=function(e){var t=p(e.components);return n.createElement(o.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),m=p(a),h=r,c=m["".concat(o,".").concat(h)]||m[h]||u[h]||l;return a?n.createElement(c,i(i({ref:t},d),{},{components:a})):n.createElement(c,i({ref:t},d))}));function c(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=h;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[m]="string"==typeof e?e:r,i[1]=s;for(var p=2;p<l;p++)i[p]=a[p];return n.createElement.apply(null,i)}return n.createElement.apply(null,a)}h.displayName="MDXCreateElement"},6792:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>o,default:()=>c,frontMatter:()=>s,metadata:()=>p,toc:()=>m});var n=a(7462),r=a(3366),l=(a(7294),a(3905)),i=["components"],s={id:"native-batch-firehose",title:"Native batch ingestion with firehose (Deprecated)",sidebar_label:"Firehose (deprecated)"},o=void 0,p={unversionedId:"ingestion/native-batch-firehose",id:"ingestion/native-batch-firehose",title:"Native batch ingestion with firehose (Deprecated)",description:"\x3c!--",source:"@site/docs/latest/ingestion/native-batch-firehose.md",sourceDirName:"ingestion",slug:"/ingestion/native-batch-firehose",permalink:"/docs/latest/ingestion/native-batch-firehose",draft:!1,tags:[],version:"current",frontMatter:{id:"native-batch-firehose",title:"Native batch ingestion with firehose (Deprecated)",sidebar_label:"Firehose (deprecated)"},sidebar:"docs",previous:{title:"Migrate from firehose",permalink:"/docs/latest/ingestion/migrate-from-firehose"},next:{title:"Hadoop-based",permalink:"/docs/latest/ingestion/hadoop"}},d={},m=[{value:"StaticS3Firehose",id:"statics3firehose",level:2},{value:"StaticGoogleBlobStoreFirehose",id:"staticgoogleblobstorefirehose",level:2},{value:"HDFSFirehose",id:"hdfsfirehose",level:2},{value:"LocalFirehose",id:"localfirehose",level:2},{value:"HttpFirehose",id:"httpfirehose",level:2},{value:"IngestSegmentFirehose",id:"ingestsegmentfirehose",level:2},{value:"SqlFirehose",id:"sqlfirehose",level:2},{value:"Database",id:"database",level:3},{value:"InlineFirehose",id:"inlinefirehose",level:2},{value:"CombiningFirehose",id:"combiningfirehose",level:2}],u={toc:m},h="wrapper";function c(e){var t=e.components,a=(0,r.Z)(e,i);return(0,l.kt)(h,(0,n.Z)({},u,a,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("blockquote",null,(0,l.kt)("p",{parentName:"blockquote"},"Firehose ingestion is deprecated. See ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/migrate-from-firehose"},"Migrate from firehose to input source ingestion")," for instructions on migrating from firehose ingestion to using native batch ingestion input sources.")),(0,l.kt)("p",null,"There are several firehoses readily available in Druid, some are meant for examples, others can be used directly in a production environment."),(0,l.kt)("h2",{id:"statics3firehose"},"StaticS3Firehose"),(0,l.kt)("p",null,"You need to include the ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/development/extensions-core/s3"},(0,l.kt)("inlineCode",{parentName:"a"},"druid-s3-extensions"))," as an extension to use the StaticS3Firehose."),(0,l.kt)("p",null,"This firehose ingests events from a predefined list of S3 objects.\nThis firehose is ",(0,l.kt)("em",{parentName:"p"},"splittable")," and can be used by the ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/native-batch"},"Parallel task"),".\nSince each split represents an object in this firehose, each worker task of ",(0,l.kt)("inlineCode",{parentName:"p"},"index_parallel")," will read an object."),(0,l.kt)("p",null,"Sample spec:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'"firehose" : {\n "type" : "static-s3",\n "uris": ["s3://foo/bar/file.gz", "s3://bar/foo/file2.gz"]\n}\n')),(0,l.kt)("p",null,"This firehose provides caching and prefetching features. In the Simple task, a firehose can be read twice if intervals or\nshardSpecs are not specified, and, in this case, caching can be useful. Prefetching is preferred when direct scan of objects is slow.\nNote that prefetching or caching isn't that useful in the Parallel task."),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"default"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},"This should be ",(0,l.kt)("inlineCode",{parentName:"td"},"static-s3"),"."),(0,l.kt)("td",{parentName:"tr",align:null},"None"),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"uris"),(0,l.kt)("td",{parentName:"tr",align:null},"JSON array of URIs where s3 files to be ingested are located."),(0,l.kt)("td",{parentName:"tr",align:null},"None"),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"uris")," or ",(0,l.kt)("inlineCode",{parentName:"td"},"prefixes")," must be set")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"prefixes"),(0,l.kt)("td",{parentName:"tr",align:null},"JSON array of URI prefixes for the locations of s3 files to be ingested."),(0,l.kt)("td",{parentName:"tr",align:null},"None"),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"uris")," or ",(0,l.kt)("inlineCode",{parentName:"td"},"prefixes")," must be set")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxCacheCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the cache space in bytes. 0 means disabling cache. Cached files are not removed until the ingestion task completes."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the fetch space in bytes. 0 means disabling prefetch. Prefetched files are removed immediately once they are read."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"prefetchTriggerBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Threshold to trigger prefetching s3 objects."),(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes / 2"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"fetchTimeout"),(0,l.kt)("td",{parentName:"tr",align:null},"Timeout for fetching an s3 object."),(0,l.kt)("td",{parentName:"tr",align:null},"60000"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchRetry"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum retry for fetching an s3 object."),(0,l.kt)("td",{parentName:"tr",align:null},"3"),(0,l.kt)("td",{parentName:"tr",align:null},"no")))),(0,l.kt)("h2",{id:"staticgoogleblobstorefirehose"},"StaticGoogleBlobStoreFirehose"),(0,l.kt)("p",null,"You need to include the ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/development/extensions-core/google"},(0,l.kt)("inlineCode",{parentName:"a"},"druid-google-extensions"))," as an extension to use the StaticGoogleBlobStoreFirehose."),(0,l.kt)("p",null,"This firehose ingests events, similar to the StaticS3Firehose, but from an Google Cloud Store."),(0,l.kt)("p",null,"As with the S3 blobstore, it is assumed to be gzipped if the extension ends in .gz"),(0,l.kt)("p",null,"This firehose is ",(0,l.kt)("em",{parentName:"p"},"splittable")," and can be used by the ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/native-batch"},"Parallel task"),".\nSince each split represents an object in this firehose, each worker task of ",(0,l.kt)("inlineCode",{parentName:"p"},"index_parallel")," will read an object."),(0,l.kt)("p",null,"Sample spec:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'"firehose" : {\n "type" : "static-google-blobstore",\n "blobs": [\n {\n "bucket": "foo",\n "path": "/path/to/your/file.json"\n },\n {\n "bucket": "bar",\n "path": "/another/path.json"\n }\n ]\n}\n')),(0,l.kt)("p",null,"This firehose provides caching and prefetching features. In the Simple task, a firehose can be read twice if intervals or\nshardSpecs are not specified, and, in this case, caching can be useful. Prefetching is preferred when direct scan of objects is slow.\nNote that prefetching or caching isn't that useful in the Parallel task."),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"default"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},"This should be ",(0,l.kt)("inlineCode",{parentName:"td"},"static-google-blobstore"),"."),(0,l.kt)("td",{parentName:"tr",align:null},"None"),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"blobs"),(0,l.kt)("td",{parentName:"tr",align:null},"JSON array of Google Blobs."),(0,l.kt)("td",{parentName:"tr",align:null},"None"),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxCacheCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the cache space in bytes. 0 means disabling cache. Cached files are not removed until the ingestion task completes."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the fetch space in bytes. 0 means disabling prefetch. Prefetched files are removed immediately once they are read."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"prefetchTriggerBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Threshold to trigger prefetching Google Blobs."),(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes / 2"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"fetchTimeout"),(0,l.kt)("td",{parentName:"tr",align:null},"Timeout for fetching a Google Blob."),(0,l.kt)("td",{parentName:"tr",align:null},"60000"),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchRetry"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum retry for fetching a Google Blob."),(0,l.kt)("td",{parentName:"tr",align:null},"3"),(0,l.kt)("td",{parentName:"tr",align:null},"no")))),(0,l.kt)("p",null,"Google Blobs:"),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"default"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"bucket"),(0,l.kt)("td",{parentName:"tr",align:null},"Name of the Google Cloud bucket"),(0,l.kt)("td",{parentName:"tr",align:null},"None"),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"path"),(0,l.kt)("td",{parentName:"tr",align:null},"The path where data is located."),(0,l.kt)("td",{parentName:"tr",align:null},"None"),(0,l.kt)("td",{parentName:"tr",align:null},"yes")))),(0,l.kt)("h2",{id:"hdfsfirehose"},"HDFSFirehose"),(0,l.kt)("p",null,"You need to include the ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/development/extensions-core/hdfs"},(0,l.kt)("inlineCode",{parentName:"a"},"druid-hdfs-storage"))," as an extension to use the HDFSFirehose."),(0,l.kt)("p",null,"This firehose ingests events from a predefined list of files from the HDFS storage.\nThis firehose is ",(0,l.kt)("em",{parentName:"p"},"splittable")," and can be used by the ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/native-batch"},"Parallel task"),".\nSince each split represents an HDFS file, each worker task of ",(0,l.kt)("inlineCode",{parentName:"p"},"index_parallel")," will read files."),(0,l.kt)("p",null,"Sample spec:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'"firehose" : {\n "type" : "hdfs",\n "paths": "/foo/bar,/foo/baz"\n}\n')),(0,l.kt)("p",null,"This firehose provides caching and prefetching features. During native batch indexing, a firehose can be read twice if\n",(0,l.kt)("inlineCode",{parentName:"p"},"intervals")," are not specified, and, in this case, caching can be useful. Prefetching is preferred when direct scanning\nof files is slow.\nNote that prefetching or caching isn't that useful in the Parallel task."),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Property"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Default"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},"This should be ",(0,l.kt)("inlineCode",{parentName:"td"},"hdfs"),"."),(0,l.kt)("td",{parentName:"tr",align:null},"none (required)")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"paths"),(0,l.kt)("td",{parentName:"tr",align:null},"HDFS paths. Can be either a JSON array or comma-separated string of paths. Wildcards like ",(0,l.kt)("inlineCode",{parentName:"td"},"*")," are supported in these paths."),(0,l.kt)("td",{parentName:"tr",align:null},"none (required)")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxCacheCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the cache space in bytes. 0 means disabling cache. Cached files are not removed until the ingestion task completes."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the fetch space in bytes. 0 means disabling prefetch. Prefetched files are removed immediately once they are read."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"prefetchTriggerBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Threshold to trigger prefetching files."),(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes / 2")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"fetchTimeout"),(0,l.kt)("td",{parentName:"tr",align:null},"Timeout for fetching each file."),(0,l.kt)("td",{parentName:"tr",align:null},"60000")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchRetry"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum number of retries for fetching each file."),(0,l.kt)("td",{parentName:"tr",align:null},"3")))),(0,l.kt)("p",null,"You can also ingest from other storage using the HDFS firehose if the HDFS client supports that storage.\nHowever, if you want to ingest from cloud storage, consider using the service-specific input source for your data storage.\nIf you want to use a non-hdfs protocol with the HDFS firehose, you need to include the protocol you want\nin ",(0,l.kt)("inlineCode",{parentName:"p"},"druid.ingestion.hdfs.allowedProtocols"),". See ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/configuration/#hdfs-input-source"},"HDFS firehose security configuration")," for more details."),(0,l.kt)("h2",{id:"localfirehose"},"LocalFirehose"),(0,l.kt)("p",null,"This Firehose can be used to read the data from files on local disk, and is mainly intended for proof-of-concept testing, and works with ",(0,l.kt)("inlineCode",{parentName:"p"},"string")," typed parsers.\nThis Firehose is ",(0,l.kt)("em",{parentName:"p"},"splittable")," and can be used by ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/native-batch"},"native parallel index tasks"),".\nSince each split represents a file in this Firehose, each worker task of ",(0,l.kt)("inlineCode",{parentName:"p"},"index_parallel")," will read a file.\nA sample local Firehose spec is shown below:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "local",\n "filter" : "*.csv",\n "baseDir": "/data/directory"\n}\n')),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},'This should be "local".'),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"filter"),(0,l.kt)("td",{parentName:"tr",align:null},"A wildcard filter for files. See ",(0,l.kt)("a",{parentName:"td",href:"http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/filefilter/WildcardFileFilter"},"here")," for more information."),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"baseDir"),(0,l.kt)("td",{parentName:"tr",align:null},"directory to search recursively for files to be ingested."),(0,l.kt)("td",{parentName:"tr",align:null},"yes")))),(0,l.kt)("a",{name:"http-firehose"}),(0,l.kt)("h2",{id:"httpfirehose"},"HttpFirehose"),(0,l.kt)("p",null,"This Firehose can be used to read the data from remote sites via HTTP, and works with ",(0,l.kt)("inlineCode",{parentName:"p"},"string")," typed parsers.\nThis Firehose is ",(0,l.kt)("em",{parentName:"p"},"splittable")," and can be used by ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/native-batch"},"native parallel index tasks"),".\nSince each split represents a file in this Firehose, each worker task of ",(0,l.kt)("inlineCode",{parentName:"p"},"index_parallel")," will read a file.\nA sample HTTP Firehose spec is shown below:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "http",\n "uris": ["http://example.com/uri1", "http://example2.com/uri2"]\n}\n')),(0,l.kt)("p",null,"You can only use protocols listed in the ",(0,l.kt)("inlineCode",{parentName:"p"},"druid.ingestion.http.allowedProtocols")," property as HTTP firehose input sources.\nThe ",(0,l.kt)("inlineCode",{parentName:"p"},"http")," and ",(0,l.kt)("inlineCode",{parentName:"p"},"https")," protocols are allowed by default. See ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/configuration/#http-input-source"},"HTTP firehose security configuration")," for more details."),(0,l.kt)("p",null,"The below configurations can be optionally used if the URIs specified in the spec require a Basic Authentication Header.\nOmitting these fields from your spec will result in HTTP requests with no Basic Authentication Header."),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"default"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"httpAuthenticationUsername"),(0,l.kt)("td",{parentName:"tr",align:null},"Username to use for authentication with specified URIs"),(0,l.kt)("td",{parentName:"tr",align:null},"None")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"httpAuthenticationPassword"),(0,l.kt)("td",{parentName:"tr",align:null},"PasswordProvider to use with specified URIs"),(0,l.kt)("td",{parentName:"tr",align:null},"None")))),(0,l.kt)("p",null,"Example with authentication fields using the DefaultPassword provider (this requires the password to be in the ingestion spec):"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "http",\n "uris": ["http://example.com/uri1", "http://example2.com/uri2"],\n "httpAuthenticationUsername": "username",\n "httpAuthenticationPassword": "password123"\n}\n')),(0,l.kt)("p",null,"You can also use the other existing Druid PasswordProviders. Here is an example using the EnvironmentVariablePasswordProvider:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "http",\n "uris": ["http://example.com/uri1", "http://example2.com/uri2"],\n "httpAuthenticationUsername": "username",\n "httpAuthenticationPassword": {\n "type": "environment",\n "variable": "HTTP_FIREHOSE_PW"\n }\n}\n')),(0,l.kt)("p",null,"The below configurations can optionally be used for tuning the Firehose performance.\nNote that prefetching or caching isn't that useful in the Parallel task."),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"default"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxCacheCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the cache space in bytes. 0 means disabling cache. Cached files are not removed until the ingestion task completes."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the fetch space in bytes. 0 means disabling prefetch. Prefetched files are removed immediately once they are read."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"prefetchTriggerBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Threshold to trigger prefetching HTTP objects."),(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes / 2")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"fetchTimeout"),(0,l.kt)("td",{parentName:"tr",align:null},"Timeout for fetching an HTTP object."),(0,l.kt)("td",{parentName:"tr",align:null},"60000")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchRetry"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum retries for fetching an HTTP object."),(0,l.kt)("td",{parentName:"tr",align:null},"3")))),(0,l.kt)("a",{name:"segment-firehose"}),(0,l.kt)("h2",{id:"ingestsegmentfirehose"},"IngestSegmentFirehose"),(0,l.kt)("p",null,"This Firehose can be used to read the data from existing druid segments, potentially using a new schema and changing the name, dimensions, metrics, rollup, etc. of the segment.\nThis Firehose is ",(0,l.kt)("em",{parentName:"p"},"splittable")," and can be used by ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/native-batch"},"native parallel index tasks"),".\nThis firehose will accept any type of parser, but will only utilize the list of dimensions and the timestamp specification.\nA sample ingest Firehose spec is shown below:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "ingestSegment",\n "dataSource": "wikipedia",\n "interval": "2013-01-01/2013-01-02"\n}\n')),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},'This should be "ingestSegment".'),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"dataSource"),(0,l.kt)("td",{parentName:"tr",align:null},"A String defining the data source to fetch rows from, very similar to a table in a relational database"),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"interval"),(0,l.kt)("td",{parentName:"tr",align:null},"A String representing the ISO-8601 interval. This defines the time range to fetch the data over."),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"dimensions"),(0,l.kt)("td",{parentName:"tr",align:null},"The list of dimensions to select. If left empty, no dimensions are returned. If left null or not defined, all dimensions are returned."),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"metrics"),(0,l.kt)("td",{parentName:"tr",align:null},"The list of metrics to select. If left empty, no metrics are returned. If left null or not defined, all metrics are selected."),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"filter"),(0,l.kt)("td",{parentName:"tr",align:null},"See ",(0,l.kt)("a",{parentName:"td",href:"/docs/latest/querying/filters"},"Filters")),(0,l.kt)("td",{parentName:"tr",align:null},"no")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxInputSegmentBytesPerTask"),(0,l.kt)("td",{parentName:"tr",align:null},"Deprecated. Use ",(0,l.kt)("a",{parentName:"td",href:"/docs/latest/ingestion/native-batch#segments-split-hint-spec"},"Segments Split Hint Spec")," instead. When used with the native parallel index task, the maximum number of bytes of input segments to process in a single task. If a single segment is larger than this number, it will be processed by itself in a single task (input segments are never split across tasks). Defaults to 150MB."),(0,l.kt)("td",{parentName:"tr",align:null},"no")))),(0,l.kt)("a",{name:"sql-firehose"}),(0,l.kt)("h2",{id:"sqlfirehose"},"SqlFirehose"),(0,l.kt)("p",null,"This Firehose can be used to ingest events residing in an RDBMS. The database connection information is provided as part of the ingestion spec.\nFor each query, the results are fetched locally and indexed.\nIf there are multiple queries from which data needs to be indexed, queries are prefetched in the background, up to ",(0,l.kt)("inlineCode",{parentName:"p"},"maxFetchCapacityBytes")," bytes.\nThis Firehose is ",(0,l.kt)("em",{parentName:"p"},"splittable")," and can be used by ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/ingestion/native-batch"},"native parallel index tasks"),".\nThis firehose will accept any type of parser, but will only utilize the list of dimensions and the timestamp specification. See the extension documentation for more detailed ingestion examples."),(0,l.kt)("p",null,"Requires one of the following extensions:"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"/docs/latest/development/extensions-core/mysql"},"MySQL Metadata Store"),"."),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"/docs/latest/development/extensions-core/postgresql"},"PostgreSQL Metadata Store"),".")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "sql",\n "database": {\n "type": "mysql",\n "connectorConfig": {\n "connectURI": "jdbc:mysql://host:port/schema",\n "user": "user",\n "password": "password"\n }\n },\n "sqls": ["SELECT * FROM table1", "SELECT * FROM table2"]\n}\n')),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"default"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},'This should be "sql".'),(0,l.kt)("td",{parentName:"tr",align:null}),(0,l.kt)("td",{parentName:"tr",align:null},"Yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"database"),(0,l.kt)("td",{parentName:"tr",align:null},"Specifies the database connection details. The database type corresponds to the extension that supplies the ",(0,l.kt)("inlineCode",{parentName:"td"},"connectorConfig")," support. The specified extension must be loaded into Druid:",(0,l.kt)("br",null),(0,l.kt)("br",null),(0,l.kt)("ul",null,(0,l.kt)("li",null,(0,l.kt)("a",{parentName:"td",href:"/docs/latest/development/extensions-core/mysql"},"mysql-metadata-storage")," for ",(0,l.kt)("inlineCode",{parentName:"td"},"mysql")),(0,l.kt)("li",null," ",(0,l.kt)("a",{parentName:"td",href:"/docs/latest/development/extensions-core/postgresql"},"postgresql-metadata-storage")," extension for ",(0,l.kt)("inlineCode",{parentName:"td"},"postgresql"),".")),(0,l.kt)("br",null),(0,l.kt)("br",null),"You can selectively allow JDBC properties in ",(0,l.kt)("inlineCode",{parentName:"td"},"connectURI"),". See ",(0,l.kt)("a",{parentName:"td",href:"/docs/latest/configuration/#jdbc-connections-to-external-databases"},"JDBC connections security config")," for more details."),(0,l.kt)("td",{parentName:"tr",align:null}),(0,l.kt)("td",{parentName:"tr",align:null},"Yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxCacheCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the cache space in bytes. 0 means disabling cache. Cached files are not removed until the ingestion task completes."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824"),(0,l.kt)("td",{parentName:"tr",align:null},"No")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Maximum size of the fetch space in bytes. 0 means disabling prefetch. Prefetched files are removed immediately once they are read."),(0,l.kt)("td",{parentName:"tr",align:null},"1073741824"),(0,l.kt)("td",{parentName:"tr",align:null},"No")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"prefetchTriggerBytes"),(0,l.kt)("td",{parentName:"tr",align:null},"Threshold to trigger prefetching SQL result objects."),(0,l.kt)("td",{parentName:"tr",align:null},"maxFetchCapacityBytes / 2"),(0,l.kt)("td",{parentName:"tr",align:null},"No")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"fetchTimeout"),(0,l.kt)("td",{parentName:"tr",align:null},"Timeout for fetching the result set."),(0,l.kt)("td",{parentName:"tr",align:null},"60000"),(0,l.kt)("td",{parentName:"tr",align:null},"No")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"foldCase"),(0,l.kt)("td",{parentName:"tr",align:null},"Toggle case folding of database column names. This may be enabled in cases where the database returns case insensitive column names in query results."),(0,l.kt)("td",{parentName:"tr",align:null},"false"),(0,l.kt)("td",{parentName:"tr",align:null},"No")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"sqls"),(0,l.kt)("td",{parentName:"tr",align:null},"List of SQL queries where each SQL query would retrieve the data to be indexed."),(0,l.kt)("td",{parentName:"tr",align:null}),(0,l.kt)("td",{parentName:"tr",align:null},"Yes")))),(0,l.kt)("h3",{id:"database"},"Database"),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"default"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},"The type of database to query. Valid values are ",(0,l.kt)("inlineCode",{parentName:"td"},"mysql")," and ",(0,l.kt)("inlineCode",{parentName:"td"},"postgresql"),"_"),(0,l.kt)("td",{parentName:"tr",align:null}),(0,l.kt)("td",{parentName:"tr",align:null},"Yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"connectorConfig"),(0,l.kt)("td",{parentName:"tr",align:null},"Specify the database connection properties via ",(0,l.kt)("inlineCode",{parentName:"td"},"connectURI"),", ",(0,l.kt)("inlineCode",{parentName:"td"},"user")," and ",(0,l.kt)("inlineCode",{parentName:"td"},"password")),(0,l.kt)("td",{parentName:"tr",align:null}),(0,l.kt)("td",{parentName:"tr",align:null},"Yes")))),(0,l.kt)("h2",{id:"inlinefirehose"},"InlineFirehose"),(0,l.kt)("p",null,"This Firehose can be used to read the data inlined in its own spec.\nIt can be used for demos or for quickly testing out parsing and schema, and works with ",(0,l.kt)("inlineCode",{parentName:"p"},"string")," typed parsers.\nA sample inline Firehose spec is shown below:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "inline",\n "data": "0,values,formatted\\n1,as,CSV"\n}\n')),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},'This should be "inline".'),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"data"),(0,l.kt)("td",{parentName:"tr",align:null},"Inlined data to ingest."),(0,l.kt)("td",{parentName:"tr",align:null},"yes")))),(0,l.kt)("h2",{id:"combiningfirehose"},"CombiningFirehose"),(0,l.kt)("p",null,"This Firehose can be used to combine and merge data from a list of different Firehoses."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "type": "combining",\n "delegates": [ { firehose1 }, { firehose2 }, ... ]\n}\n')),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"property"),(0,l.kt)("th",{parentName:"tr",align:null},"description"),(0,l.kt)("th",{parentName:"tr",align:null},"required?"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"type"),(0,l.kt)("td",{parentName:"tr",align:null},'This should be "combining"'),(0,l.kt)("td",{parentName:"tr",align:null},"yes")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"delegates"),(0,l.kt)("td",{parentName:"tr",align:null},"List of Firehoses to combine data from"),(0,l.kt)("td",{parentName:"tr",align:null},"yes")))))}c.isMDXComponent=!0}}]);