hbase 的操作
create 'User111','info'
put 'User111', 'row1', 'info:name', 'xiaoming'
put 'User111', 'row5', 'info:name3', 'xiaoming233'
get 'User111', 'row3'
get 'User111', 'row2'
scan 'User111', {LIMIT => 2}
count 'User111'
deleteall 'User111', 'row2'
base(main):001:0> user_permission
User Namespace,Table,Family,Qualifier:Permission
ERROR: DISABLED: Security features are not available
Here is some help for this command:
Show all permissions for the particular user.
Syntax : user_permission <table>
Note: A namespace must always precede with '@' character.
For example:
hbase> user_permission
hbase> user_permission '@ns1'
hbase> user_permission 'table1'
hbase> user_permission 'namespace1:table1'
hbase> user_permission '.*'
hbase> user_permission '^[A-C].*'
hbase(main):002:0> user_permission '.*'
User Namespace,Table,Family,Qualifier:Permission
ERROR: DISABLED: Security features are not available
Here is some help for this command:
Show all permissions for the particular user.
Syntax : user_permission <table>
Note: A namespace must always precede with '@' character.
For example:
hbase> user_permission
hbase> user_permission '@ns1'
hbase> user_permission 'table1'
hbase> user_permission 'namespace1:table1'
hbase> user_permission '.*'
hbase> user_permission '^[A-C].*'
hbase(main):003:0> get 'User111', 'row2'
COLUMN CELL
info:name2 timestamp=1530185309654, value=xiaoming23
1 row(s) in 0.0500 seconds
hbase(main):004:0> get 'User111', 'row3'
COLUMN CELL
0 row(s) in 0.0080 seconds
hbase(main):005:0> put 'User111', 'row5', 'info:name3', 'xiaoming233'
0 row(s) in 0.0700 seconds
hbase(main):006:0> get 'User111', 'row3'
COLUMN CELL
0 row(s) in 0.0080 seconds
hbase(main):007:0> get 'User111', 'row2'
COLUMN CELL
info:name2 timestamp=1530185309654, value=xiaoming23
1 row(s) in 0.0090 seconds
hbase(main):008:0> scan 'User111', {LIMIT => 2}
ROW COLUMN+CELL
row1 column=info:name, timestamp=1530185082846, value=xiaoming
row2 column=info:name2, timestamp=1530185309654, value=xiaoming23
2 row(s) in 0.0190 seconds
hbase(main):009:0> count 'User111'
3 row(s) in 0.0430 seconds
=> 3
hbase(main):010:0> deleteall 'User111', 'row2'
0 row(s) in 0.0670 seconds
hbase(main):011:0> scan 'User111', {LIMIT => 2}
ROW COLUMN+CELL
row1 column=info:name, timestamp=1530185082846, value=xiaoming
row5 column=info:name3, timestamp=1530185833273, value=xiaoming233
2 row(s) in 0.0130 seconds
hbase(main):012:0> disbale
NameError: undefined local variable or method `d' for #<Object:0x5db948c9>
hbase(main):013:0> disbale
NameError: undefined local variable or method `disbale' for #<Object:0x5db948c9>
hbase(main):014:0> disable 'User111'
0 row(s) in 2.5060 seconds
hbase(main):015:0> count 'User111'
ERROR: User111 is disabled.
Here is some help for this command:
Count the number of rows in a table. Return value is the number of rows.
This operation may take a LONG time (Run '$HADOOP_HOME/bin/hadoop jar
hbase.jar rowcount' to run a counting mapreduce job). Current count is shown
every 1000 rows by default. Count interval may be optionally specified. Scan
caching is enabled on count scans by default. Default cache size is 10 rows.
If your rows are small in size, you may want to increase this
parameter. Examples:
hbase> count 'ns1:t1'
hbase> count 't1'
hbase> count 't1', INTERVAL => 100000
hbase> count 't1', CACHE => 1000
hbase> count 't1', INTERVAL => 10, CACHE => 1000
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding commands would be:
hbase> t.count
hbase> t.count INTERVAL => 100000
hbase> t.count CACHE => 1000
hbase> t.count INTERVAL => 10, CACHE => 1000
hbase(main):016:0> enable 'User111'
0 row(s) in 2.3520 seconds
hbase(main):017:0> count 'User111'
2 row(s) in 0.0120 seconds
=> 2
hbase(main):018:0>
- 点赞
- 收藏
- 关注作者
评论(0)