2013年7月27日星期六

HBase Shell 's SPLIT

About HBase I look at the HBase Shell
 create 't1', 'f1', {SPLITS => ['01 ', '02', '03 ', ; '04 ']}  
on the above sentence in SPLITS Please pass heroes gets advice
Shell seem to introduce this evening only to find a few this , but did not explain
------ Solution - ------------------------------------------
?This post last edited by the tntzbzc on 2013-06-07 00:24:31 ah , the official website of courage vague explanation
SPLITS role is to create a table , it will default to the table of the N Region
examples according to the official website [ '01 ', '02 ', '03 ', '04' ] , table t1 will be created when the sub- 5 region, RowKEY by lexicographical partition
Rowkey less than " 01" , assigned to the region1
Rowkey greater than equal to " 01" is less than "02" , assigned to the region2
Rowkey greater than equal to " 02" is less than "03" , assigned region3
Rowkey greater than equal to " 03 " is less than "04" , assigned region4
Rowkey greater than equal to " 04" , assigned region5

Assuming execute the following command
put 't1', '00101 ',' f1: c1 ',' hello '
put 't1', '00201 ',' f1: c1 ',' hello '
put 't1', '01101 ',' f1: c1 ',' hello '
put 't1', '02101 ',' f1: c1 ',' hello '
put 't1', '02201 ',' f1: c1 ',' hello '
put 't1', '03101 ',' f1: c1 ',' hello '
put 't1', '03201 ',' f1: c1 ',' hello '
put 't1', '04101 ',' f1: c1 ',' hello '
00101 and 00201 will be assigned region1, because lexicographical 00 101 and 00 201 's left (2) is less than " 01 ", pay attention to see bold , and so on
01101 assigned region2
02101 and 02201 assigned region3
03101 and 03201 assigned region4
04101 assigned region5

1 条评论:

  1. Thank you, my boss assigned me such a task and i could do it fast.Thank u very much

    回复删除