blob: 418f99f85a52e78a3514c31bac51158561cb2a86 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9570],{3905:(e,t,a)=>{a.d(t,{Zo:()=>m,kt:()=>k});var n=a(67294);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 p(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({}),u=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},m=function(e){var t=u(e.components);return n.createElement(o.Provider,{value:t},e.children)},d="mdxType",s={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),d=u(a),c=r,k=d["".concat(o,".").concat(c)]||d[c]||s[c]||l;return a?n.createElement(k,i(i({ref:t},m),{},{components:a})):n.createElement(k,i({ref:t},m))}));function k(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=c;var p={};for(var o in t)hasOwnProperty.call(t,o)&&(p[o]=t[o]);p.originalType=e,p[d]="string"==typeof e?e:r,i[1]=p;for(var u=2;u<l;u++)i[u]=a[u];return n.createElement.apply(null,i)}return n.createElement.apply(null,a)}c.displayName="MDXCreateElement"},82175:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>m,contentTitle:()=>o,default:()=>k,frontMatter:()=>p,metadata:()=>u,toc:()=>d});var n=a(87462),r=a(63366),l=(a(67294),a(3905)),i=["components"],p={id:"human-readable-byte",title:"Human-readable Byte Configuration Reference"},o=void 0,u={unversionedId:"configuration/human-readable-byte",id:"configuration/human-readable-byte",title:"Human-readable Byte Configuration Reference",description:"\x3c!--",source:"@site/docs/27.0.0/configuration/human-readable-byte.md",sourceDirName:"configuration",slug:"/configuration/human-readable-byte",permalink:"/docs/27.0.0/configuration/human-readable-byte",draft:!1,tags:[],version:"current",frontMatter:{id:"human-readable-byte",title:"Human-readable Byte Configuration Reference"}},m={},d=[{value:"A number in bytes",id:"a-number-in-bytes",level:2},{value:"A number with a unit suffix",id:"a-number-with-a-unit-suffix",level:2},{value:"Supported Units",id:"supported-units",level:3}],s={toc:d},c="wrapper";function k(e){var t=e.components,a=(0,r.Z)(e,i);return(0,l.kt)(c,(0,n.Z)({},s,a,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("p",null,"This page documents configuration properties related to bytes."),(0,l.kt)("p",null,"These properties can be configured through 2 ways: "),(0,l.kt)("ol",null,(0,l.kt)("li",{parentName:"ol"},"a simple number in bytes"),(0,l.kt)("li",{parentName:"ol"},"a number with a unit suffix")),(0,l.kt)("h2",{id:"a-number-in-bytes"},"A number in bytes"),(0,l.kt)("p",null,"Given that cache size is 3G, there's a configuration as below"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-properties"},"# 3G bytes = 3_000_000_000 bytes\ndruid.cache.sizeInBytes=3000000000 \n")),(0,l.kt)("h2",{id:"a-number-with-a-unit-suffix"},"A number with a unit suffix"),(0,l.kt)("p",null,"When you have to put a large number for some configuration as above, it is easy to make a mistake such as extra or missing 0s. Druid supports a better way, a number with a unit suffix."),(0,l.kt)("p",null,"Given a disk of 1T, the configuration can be"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-properties"},'druid.segmentCache.locations=[{"path":"/segment-cache-00","maxSize":"1t"},{"path":"/segment-cache-01","maxSize":"1200g"}]\n')),(0,l.kt)("p",null,"Note: in above example, both ",(0,l.kt)("inlineCode",{parentName:"p"},"1t")," and ",(0,l.kt)("inlineCode",{parentName:"p"},"1T")," are acceptable since it's case-insensitive.\nAlso, only integers are valid as the number part. For example, you can't replace ",(0,l.kt)("inlineCode",{parentName:"p"},"1200g")," with ",(0,l.kt)("inlineCode",{parentName:"p"},"1.2t"),"."),(0,l.kt)("h3",{id:"supported-units"},"Supported Units"),(0,l.kt)("p",null,"In the world of computer, a unit like ",(0,l.kt)("inlineCode",{parentName:"p"},"K")," is ambiguous. It means 1000 or 1024 in different contexts, for more information please see ",(0,l.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Binary_prefix"},"Here"),"."),(0,l.kt)("p",null,"To make it clear, the base of units are defined in Druid as below"),(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},"Unit"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Base"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"K"),(0,l.kt)("td",{parentName:"tr",align:null},"Kilo Decimal Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1_000")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"M"),(0,l.kt)("td",{parentName:"tr",align:null},"Mega Decimal Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1_000_000")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"G"),(0,l.kt)("td",{parentName:"tr",align:null},"Giga Decimal Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1_000_000_000")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"T"),(0,l.kt)("td",{parentName:"tr",align:null},"Tera Decimal Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1_000_000_000_000")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"P"),(0,l.kt)("td",{parentName:"tr",align:null},"Peta Decimal Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1_000_000_000_000_000")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"Ki"),(0,l.kt)("td",{parentName:"tr",align:null},"Kilo Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"Mi"),(0,l.kt)("td",{parentName:"tr",align:null},"Mega Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 * 1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"Gi"),(0,l.kt)("td",{parentName:"tr",align:null},"Giga Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"Ti"),(0,l.kt)("td",{parentName:"tr",align:null},"Tera Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024 * 1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"Pi"),(0,l.kt)("td",{parentName:"tr",align:null},"Peta Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"KiB"),(0,l.kt)("td",{parentName:"tr",align:null},"Kilo Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"MiB"),(0,l.kt)("td",{parentName:"tr",align:null},"Mega Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 * 1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"GiB"),(0,l.kt)("td",{parentName:"tr",align:null},"Giga Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"TiB"),(0,l.kt)("td",{parentName:"tr",align:null},"Tera Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024 * 1024")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"PiB"),(0,l.kt)("td",{parentName:"tr",align:null},"Peta Binary Byte"),(0,l.kt)("td",{parentName:"tr",align:null},"1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024 ",(0,l.kt)("em",{parentName:"td"}," 1024 ")," 1024")))),(0,l.kt)("p",null,"Unit is case-insensitive. ",(0,l.kt)("inlineCode",{parentName:"p"},"k"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"kib"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"ki"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"KiB"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"Ki"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"kiB")," are all acceptable."),(0,l.kt)("p",null,"Here are some examples"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-properties"},"# 1G bytes = 1_000_000_000 bytes\ndruid.cache.sizeInBytes=1g \n")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-properties"},"# 256MiB bytes = 256 * 1024 * 1024 bytes\ndruid.cache.sizeInBytes=256MiB \n")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-properties"},"# 256Mi = 256MiB = 256 * 1024 * 1024 bytes\ndruid.cache.sizeInBytes=256Mi\n")))}k.isMDXComponent=!0}}]);