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