\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{wangjl1900} \pdfinfo{ /Title (hbase.pdf) /Creator (Cheatography) /Author (wangjl1900) /Subject (hbase Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{hbase Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{wangjl1900} via \textcolor{DarkBackground}{\uline{cheatography.com/56848/cs/15078/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}wangjl1900 \\ \uline{cheatography.com/wangjl1900} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 12th March, 2018.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{status}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{hbase(main):006:0\textgreater{} status \newline % Row Count 1 (+ 1) 1 servers, 0 dead, 5.0000 average load \newline % Row Count 2 (+ 1) hbase(main):002:0\textgreater{} help 'status' \newline % Row Count 3 (+ 1) hbase\textgreater{} status \newline % Row Count 4 (+ 1) hbase\textgreater{} status 'simple' \newline % Row Count 5 (+ 1) hbase\textgreater{} status 'summary' \newline % Row Count 6 (+ 1) hbase\textgreater{} status 'detailed' \newline % Row Count 7 (+ 1) hbase\textgreater{} status 'replication' \newline % Row Count 8 (+ 1) hbase\textgreater{} status 'replication', 'source' \newline % Row Count 9 (+ 1) hbase\textgreater{} status 'replication', 'sink'% Row Count 10 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{whoami}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{hbase(main):011:0\textgreater{} whoami \newline % Row Count 1 (+ 1) datanode1 (auth:SIMPLE) \newline % Row Count 2 (+ 1) groups: datanode1% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{alter / alter\_async}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{作用:可以修改,增加,删除表的列族信息、属性、配置等。} \newline % Row Count 2 (+ 2) \seqsplit{\#对于表t1,如果t1含有f1列族,则将f1列族的版本数设为5}. \newline % Row Count 4 (+ 2) \# \seqsplit{如果t1不含f1列数,则添加f1列族到表t1上。并将f1的版本数设置为5}. \newline % Row Count 6 (+ 2) hbase\textgreater{} alter 't1', NAME =\textgreater{} 'f1', VERSIONS =\textgreater{} 5 \newline % Row Count 7 (+ 1) \seqsplit{\#添加或修改多个列族} \newline % Row Count 8 (+ 1) hbase\textgreater{} alter 't1', 'f1', \{NAME =\textgreater{} 'f2', IN\_MEMORY =\textgreater{} true\}, \{NAME =\textgreater{} 'f3', VERSIONS =\textgreater{} 5\} \newline % Row Count 10 (+ 2) \#删除 命名空间ns1 中的 表t1 的 列族f1 的两种方法 \newline % Row Count 12 (+ 2) hbase\textgreater{} alter 'ns1:t1', NAME =\textgreater{} 'f1', METHOD =\textgreater{} 'delete' \newline % Row Count 14 (+ 2) hbase\textgreater{} alter 'ns1:t1', 'delete' =\textgreater{} 'f1' \newline % Row Count 15 (+ 1) \seqsplit{\#修改表t1的MAX\_FILESIZE属性的值。} \newline % Row Count 16 (+ 1) hbase\textgreater{} alter 't1', MAX\_FILESIZE =\textgreater{} '134217728' \newline % Row Count 17 (+ 1) \# \seqsplit{修改表t1或者列族f2的配置} \newline % Row Count 18 (+ 1) hbase\textgreater{} alter 't1', CONFIGURATION =\textgreater{} \{'hbase.hregion.scan.loadColumnFamiliesOnDemand' =\textgreater{} 'true'\} \newline % Row Count 20 (+ 2) hbase\textgreater{} alter 't1', \{NAME =\textgreater{} 'f2', CONFIGURATION =\textgreater{} \{'hbase.hstore.blockingStoreFiles' =\textgreater{} '10'\}\} \newline % Row Count 22 (+ 2) \#删除属性 \newline % Row Count 23 (+ 1) hbase\textgreater{} alter 't1', METHOD =\textgreater{} 'table\_att\_unset', NAME =\textgreater{} 'MAX\_FILESIZE' \newline % Row Count 25 (+ 2) hbase\textgreater{} alter 't1', METHOD =\textgreater{} 'table\_att\_unset', NAME =\textgreater{} 'coprocessor\$1' \newline % Row Count 27 (+ 2) \seqsplit{\#一次性修改多个属性值} \newline % Row Count 28 (+ 1) hbase\textgreater{} alter 't1', \{ NAME =\textgreater{} 'f1', VERSIONS =\textgreater{} 3 \}, \newline % Row Count 30 (+ 2) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{alter / alter\_async (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{ \{ MAX\_FILESIZE =\textgreater{} '134217728' \}, \{ METHOD =\textgreater{} 'delete', NAME =\textgreater{} 'f2' \}, \newline % Row Count 2 (+ 2) OWNER =\textgreater{} 'johndoe', METADATA =\textgreater{} \{ 'mykey' =\textgreater{} 'myvalue' \} \newline % Row Count 4 (+ 2) hbase(main):014:0\textgreater{}% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{scan}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{扫描命名空间hbase下的meta表,显示出meta表的所有数据} \newline % Row Count 2 (+ 2) hbase\textgreater{} scan 'hbase:meta' \newline % Row Count 3 (+ 1) \# \seqsplit{扫描命名空间hbase下的meta表的列族info的列regioninfo,显示出meta表的列族info下的regioninfo列的所有数据} \newline % Row Count 6 (+ 3) hbase\textgreater{} scan 'hbase:meta', \{COLUMNS =\textgreater{} 'info:regioninfo'\} \newline % Row Count 8 (+ 2) \# \seqsplit{扫描命名空间ns1下表t1的列族'c1'和'c2'。显示出命名空间ns1下表t1的列族'c1'和'c2'的所有数据} \newline % Row Count 11 (+ 3) hbase\textgreater{} scan 'ns1:t1', \{COLUMNS =\textgreater{} {[}'c1', 'c2'{]}\} \newline % Row Count 13 (+ 2) \# \seqsplit{扫描命名空间ns1下表t1的列族'c1'和'c2'。显示出命名空间ns1下表t1的列族'c1'和'c2',且只显示前10个rowkey的数据。} \newline % Row Count 16 (+ 3) hbase\textgreater{} scan 'ns1:t1', \{COLUMNS =\textgreater{} {[}'c1', 'c2'{]}, LIMIT =\textgreater{} 10\} \newline % Row Count 18 (+ 2) \# \seqsplit{扫描命名空间ns1下表t1的列族'c1'和'c2'。显示出命名空间ns1下表t1的列族'c1'和'c2',且只显示从rowkey="xyz"开始的前10个rowkey的数据。} \newline % Row Count 22 (+ 4) hbase\textgreater{} scan 'ns1:t1', \{COLUMNS =\textgreater{} {[}'c1', 'c2'{]}, LIMIT =\textgreater{} 10, STARTROW =\textgreater{} 'xyz'\} \newline % Row Count 24 (+ 2) \# \seqsplit{扫描默认命名空间下表t1的列族c1时间戳从'1303668804'到'1303668904'的数据} \newline % Row Count 26 (+ 2) hbase\textgreater{} scan 't1', \{COLUMNS =\textgreater{} 'c1', TIMERANGE =\textgreater{} {[}1303668804, 1303668904{]}\} \newline % Row Count 28 (+ 2) \# \seqsplit{反向显示表t1的数据} \newline % Row Count 29 (+ 1) hbase\textgreater{} scan 't1', \{REVERSED =\textgreater{} true\} \newline % Row Count 30 (+ 1) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{scan (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{过滤显示表t1的数据} \newline % Row Count 1 (+ 1) hbase\textgreater{} scan 't1', \{FILTER =\textgreater{} "(PrefixFilter ('row2') AND \newline % Row Count 3 (+ 2) (QualifierFilter (\textgreater{}=, 'binary:xyz'))) AND (TimestampsFilter ( 123, 456))"\} \newline % Row Count 5 (+ 2) \# \seqsplit{RAW为true,显示出表t1的所有数据,包括已经删除的} \newline % Row Count 7 (+ 2) hbase\textgreater{} scan 't1', \{RAW =\textgreater{} true, VERSIONS =\textgreater{} 10\} \newline % Row Count 8 (+ 1) \# 表t1的引用的扫描 \newline % Row Count 9 (+ 1) hbase\textgreater{} t11 = get\_table 't1' \newline % Row Count 10 (+ 1) hbase\textgreater{} t11.scan% Row Count 11 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{get}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{\#得到命名空间ns1下表t1的rowkey为r1的数据} \newline % Row Count 2 (+ 2) hbase\textgreater{} get 'ns1:t1', 'r1' \newline % Row Count 3 (+ 1) \seqsplit{\#得到默认命名空间下表t1的rowkey为r1的数据} \newline % Row Count 5 (+ 2) hbase\textgreater{} get 't1', 'r1' \newline % Row Count 6 (+ 1) \seqsplit{\#得到默认命名空间下表t1的rowkey为r1,时间戳范围在ts1和ts2之间的数据} \newline % Row Count 8 (+ 2) hbase\textgreater{} get 't1', 'r1', \{TIMERANGE =\textgreater{} {[}ts1, ts2{]}\} \newline % Row Count 10 (+ 2) \seqsplit{\#得到默认命名空间下表t1的rowkey为r1的c1列的数据} \newline % Row Count 12 (+ 2) hbase\textgreater{} get 't1', 'r1', \{COLUMN =\textgreater{} 'c1'\} \newline % Row Count 13 (+ 1) \seqsplit{\#得到默认命名空间下表t1的rowkey为r1的c1},c2,c3列的数据 \newline % Row Count 15 (+ 2) hbase\textgreater{} get 't1', 'r1', \{COLUMN =\textgreater{} {[}'c1', 'c2', 'c3'{]}\} \newline % Row Count 17 (+ 2) \seqsplit{\#得到默认命名空间下表t1的rowkey为r1的c1列,时间戳为ts1的数据} \newline % Row Count 19 (+ 2) hbase\textgreater{} get 't1', 'r1', \{COLUMN =\textgreater{} 'c1', TIMESTAMP =\textgreater{} ts1\} \newline % Row Count 21 (+ 2) \seqsplit{\#得到默认命名空间下表t1的rowkey为r1的c1列,时间戳范围为ts1到ts2,版本数为4的数据} \newline % Row Count 24 (+ 3) hbase\textgreater{} get 't1', 'r1', \{COLUMN =\textgreater{} 'c1', TIMERANGE =\textgreater{} {[}ts1, ts2{]}, VERSIONS =\textgreater{} 4\} \newline % Row Count 26 (+ 2) \#应用对象的用法 \newline % Row Count 27 (+ 1) hbase\textgreater{} t.get 'r1' \newline % Row Count 28 (+ 1) hbase\textgreater{} t.get 'r1', \{TIMERANGE =\textgreater{} {[}ts1, ts2{]}\} \newline % Row Count 29 (+ 1) hbase\textgreater{} t.get 'r1', \{COLUMN =\textgreater{} 'c1'\} \newline % Row Count 30 (+ 1) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{get (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{ hbase\textgreater{} t.get 'r1', \{COLUMN =\textgreater{} {[}'c1', 'c2', 'c3'{]}\} \newline % Row Count 2 (+ 2) hbase\textgreater{} t.get 'r1', \{COLUMN =\textgreater{} 'c1', TIMESTAMP =\textgreater{} ts1\} \newline % Row Count 4 (+ 2) hbase\textgreater{} t.get 'r1', \{COLUMN =\textgreater{} 'c1', TIMERANGE =\textgreater{} {[}ts1, ts2{]}, VERSIONS =\textgreater{} 4\} \newline % Row Count 6 (+ 2) hbase\textgreater{} t.get 'r1', \{COLUMN =\textgreater{} 'c1', TIMESTAMP =\textgreater{} ts1, VERSIONS =\textgreater{} 4\}% Row Count 8 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{put}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{向命名空间ns1下表t1的rowkey为r1的列c1添加数据} \newline % Row Count 2 (+ 2) hbase\textgreater{} put 'ns1:t1', 'r1', 'c1', 'value' \newline % Row Count 3 (+ 1) \# \seqsplit{向默认命名空间下表t1的rowkey为r1的列c1添加数据} \newline % Row Count 5 (+ 2) hbase\textgreater{} put 't1', 'r1', 'c1', 'value' \newline % Row Count 6 (+ 1) \# \seqsplit{向默认命名空间下表t1的rowkey为r1的列c1添加数据,并设置时间戳为ts1} \newline % Row Count 8 (+ 2) hbase\textgreater{} put 't1', 'r1', 'c1', 'value', ts1 \newline % Row Count 9 (+ 1) \# \seqsplit{向默认命名空间下表t1的rowkey为r1的列c1添加数据,并设置时间戳为ts1,并设置属性} \newline % Row Count 12 (+ 3) hbase\textgreater{} put 't1', 'r1', 'c1', 'value', ts1, \{ATTRIBUTES=\textgreater{}\{'mykey'=\textgreater{}'myvalue'\}\} \newline % Row Count 14 (+ 2) \#引用对象的用法 \newline % Row Count 15 (+ 1) t.put 'r1', 'c1', 'value', ts1, \{ATTRIBUTES=\textgreater{}\{'mykey'=\textgreater{}'myvalue'\}\}% Row Count 17 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{version}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{hbase(main):010:0\textgreater{} version \newline % Row Count 1 (+ 1) 1.0.3, \seqsplit{rf1e1312f9790a7c40f6a4b5a1bab2ea1dd559890}, Tue Jan 19 19:26:53 PST 2016% Row Count 3 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{create}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{\#在命名空间ns1下,创建表t1,其中有一个列族f1,f1的版本数为5} \newline % Row Count 2 (+ 2) hbase\textgreater{} create 'ns1:t1', \{NAME =\textgreater{} 'f1', VERSIONS =\textgreater{} 5\} \newline % Row Count 4 (+ 2) \seqsplit{\#在默认命名空间下,创建表t1,有三个列族f1},f2,f3 \newline % Row Count 6 (+ 2) hbase\textgreater{} create 't1', \{NAME =\textgreater{} 'f1'\}, \{NAME =\textgreater{} 'f2'\}, \{NAME =\textgreater{} 'f3'\} \newline % Row Count 8 (+ 2) \#等价于 \newline % Row Count 9 (+ 1) hbase\textgreater{} create 't1', 'f1', 'f2', 'f3' \newline % Row Count 10 (+ 1) \seqsplit{\#创建表t1,列族f1,并设置f1的版本数为1,属性TTL为2592000,属性BLOCKCACHE为true。属性的含义在这就不解释了。} \newline % Row Count 13 (+ 3) hbase\textgreater{} create 't1', \{NAME =\textgreater{} 'f1', VERSIONS =\textgreater{} 1, TTL =\textgreater{} 2592000, BLOCKCACHE =\textgreater{} true\} \newline % Row Count 15 (+ 2) \# 创建表t1,列族f1,并设置f1的配置hbase.hstore.blockingStoreFiles 为 10 \newline % Row Count 17 (+ 2) hbase\textgreater{} create 't1', \{NAME =\textgreater{} 'f1', CONFIGURATION =\textgreater{} \{'hbase.hstore.blockingStoreFiles' =\textgreater{} '10'\}\} \newline % Row Count 19 (+ 2) \seqsplit{\#创建表时,配置信息可以放在最后,例如:} \newline % Row Count 21 (+ 2) hbase\textgreater{} create 'ns1:t1', 'f1', SPLITS =\textgreater{} {[}'10', '20', '30', '40'{]} \newline % Row Count 23 (+ 2) hbase\textgreater{} create 't1', 'f1', SPLITS =\textgreater{} {[}'10', '20', '30', '40'{]} \newline % Row Count 25 (+ 2) hbase\textgreater{} create 't1', 'f1', SPLITS\_FILE =\textgreater{} 'splits.txt', OWNER =\textgreater{} 'johndoe' \newline % Row Count 27 (+ 2) hbase\textgreater{} create 't1', \{NAME =\textgreater{} 'f1', VERSIONS =\textgreater{} 5\}, METADATA =\textgreater{} \{ 'mykey' =\textgreater{} 'myvalue' \} \newline % Row Count 29 (+ 2) hbase\textgreater{} \# Optionally pre-split the table into NUMREGIONS, using \newline % Row Count 31 (+ 2) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{create (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{ hbase\textgreater{} \# SPLITALGO ("HexStringSplit", "UniformSplit" or classname) \newline % Row Count 2 (+ 2) \seqsplit{\#指定Pre-splitting的region的块数,和分割函数。} \newline % Row Count 4 (+ 2) hbase\textgreater{} create 't1', 'f1', \{NUMREGIONS =\textgreater{} 15, SPLITALGO =\textgreater{} 'HexStringSplit'\} \newline % Row Count 6 (+ 2) hbase\textgreater{} create 't1', 'f1', \{NUMREGIONS =\textgreater{} 15, SPLITALGO =\textgreater{} 'HexStringSplit', REGION\_REPLICATION =\textgreater{} 2, CONFIGURATION =\textgreater{} \{'hbase.hregion.scan.loadColumnFamiliesOnDemand' =\textgreater{} 'true'\}\} \newline % Row Count 10 (+ 4) \seqsplit{\#也可以用另一个表t2的引用去创建一个新表t1,t1表具有t2的所有列族,并且加上f1列族。} \newline % Row Count 13 (+ 3) hbase\textgreater{} t1 = create 't2', 'f1'% Row Count 14 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{describe / desc}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{作用:显示表的属性,表的列族的属性。} \newline % Row Count 2 (+ 2) \# \seqsplit{命令:显示表t1信息} \newline % Row Count 3 (+ 1) hbase\textgreater{} describe 't3' \newline % Row Count 4 (+ 1) \# 显示出的信息: \newline % Row Count 5 (+ 1) Table t3 is ENABLED \newline % Row Count 7 (+ 2) t3 \newline % Row Count 9 (+ 2) COLUMN FAMILIES DESCRIPTION \newline % Row Count 11 (+ 2) \{NAME =\textgreater{} 'colfa', BLOOMFILTER =\textgreater{} 'ROW', VERSIONS =\textgreater{} '1', IN\_MEMORY =\textgreater{} 'false', KEEP \newline % Row Count 13 (+ 2) \_DELETED\_CELLS =\textgreater{} 'false', DATA\_BLOCK\_ENCODING =\textgreater{} 'NONE', COMPRESSION =\textgreater{} 'NONE', TT \newline % Row Count 15 (+ 2) L =\textgreater{} 'FOREVER', MIN\_VERSIONS =\textgreater{} '0', BLOCKCACHE =\textgreater{} 'true', BLOCKSIZE =\textgreater{} '65536', RE \newline % Row Count 17 (+ 2) PLICATION\_SCOPE =\textgreater{} '0'\} \newline % Row Count 19 (+ 2) 1 row(s) in 0.0200 seconds% Row Count 20 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{get\_table}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{将表t1的应用对象赋给t1d} \newline % Row Count 1 (+ 1) hbase\textgreater{} t1d = get\_table 't1' \newline % Row Count 2 (+ 1) \#t1d操作 \newline % Row Count 3 (+ 1) t1d.scan \newline % Row Count 4 (+ 1) t1d.describe% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{list}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{\#显示所有命名空间的所有表} \newline % Row Count 1 (+ 1) hbase\textgreater{} list \newline % Row Count 2 (+ 1) \seqsplit{\#显示表名以abc开头的表} \newline % Row Count 3 (+ 1) hbase\textgreater{} list 'abc.*' \newline % Row Count 4 (+ 1) \seqsplit{\#显示命名空间ns下的表名以abc开头的表} \newline % Row Count 6 (+ 2) hbase\textgreater{} list 'ns:abc.*' \newline % Row Count 7 (+ 1) \seqsplit{\#显示命名空间ns下的所有表} \newline % Row Count 8 (+ 1) hbase\textgreater{} list 'ns:.*'% Row Count 9 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{show\_filters}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{作用:显示出所有过滤器}% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{append}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{向表t1的rowkey为r1的列c1的值后面添加字符串value} \newline % Row Count 2 (+ 2) hbase\textgreater{} append 't1', 'r1', 'c1', 'value' \newline % Row Count 3 (+ 1) \seqsplit{\#表t1的引用对象t11使用append。} \newline % Row Count 4 (+ 1) hbase\textgreater{} t11.append 'r1', 'c1', 'value'% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{count}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{删除命名空间ns1下的表t1的rowkey的r1的列c1,时间戳为ts1} \newline % Row Count 2 (+ 2) hbase\textgreater{} delete 'ns1:t1', 'r1', 'c1', ts1 \newline % Row Count 3 (+ 1) \# \seqsplit{删除默认命名空间下的表t1的rowkey的r1的列c1,时间戳为ts1} \newline % Row Count 5 (+ 2) hbase\textgreater{} delete 't1', 'r1', 'c1', ts1 \newline % Row Count 6 (+ 1) \#应用对象的用法 \newline % Row Count 7 (+ 1) hbase\textgreater{} t.delete 'r1', 'c1', ts1% Row Count 8 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{delete / deleteall}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{删除命名空间ns1下的表t1的rowkey的r1的列c1,时间戳为ts1} \newline % Row Count 2 (+ 2) hbase\textgreater{} delete 'ns1:t1', 'r1', 'c1', ts1 \newline % Row Count 3 (+ 1) \# \seqsplit{删除默认命名空间下的表t1的rowkey的r1的列c1,时间戳为ts1} \newline % Row Count 5 (+ 2) hbase\textgreater{} delete 't1', 'r1', 'c1', ts1 \newline % Row Count 6 (+ 1) \#应用对象的用法 \newline % Row Count 7 (+ 1) hbase\textgreater{} t.delete 'r1', 'c1', ts1 \newline % Row Count 8 (+ 1) \seqsplit{\#删除命名空间ns1下表t1的rowkey为r1的所有数据} \newline % Row Count 10 (+ 2) hbase\textgreater{} deleteall 'ns1:t1', 'r1' \newline % Row Count 11 (+ 1) \seqsplit{\#删除默认命名空间下表t1的rowkey为r1的所有数据} \newline % Row Count 13 (+ 2) hbase\textgreater{} deleteall 't1', 'r1' \newline % Row Count 14 (+ 1) \seqsplit{\#删除命名空间ns1下表t1的rowkey为r1的列c1的所有数据} \newline % Row Count 16 (+ 2) hbase\textgreater{} deleteall 't1', 'r1', 'c1' \newline % Row Count 17 (+ 1) \# \seqsplit{删除默认命名空间下的表t1的rowkey的r1的列c1,时间戳为ts1} \newline % Row Count 19 (+ 2) hbase\textgreater{} deleteall 't1', 'r1', 'c1', ts1 \newline % Row Count 20 (+ 1) \#应用对象的用法 \newline % Row Count 21 (+ 1) hbase\textgreater{} t.deleteall 'r1' \newline % Row Count 22 (+ 1) hbase\textgreater{} t.deleteall 'r1', 'c1' \newline % Row Count 23 (+ 1) hbase\textgreater{} t.deleteall 'r1', 'c1', ts1% Row Count 24 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{truncate}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{\#删除表t3,不用disable} \newline % Row Count 1 (+ 1) truncate 't3'% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}