HBASE-10389 Add namespace help info in table related shell commands (Jerry He)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1566755 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Enis Soztutar 2014-02-10 21:39:32 +00:00
parent 8755eb8bee
commit f823cca32c
33 changed files with 61 additions and 16 deletions

View File

@ -38,10 +38,10 @@ You can operate on several column families:
hbase> alter 't1', 'f1', {NAME => 'f2', IN_MEMORY => true}, {NAME => 'f3', VERSIONS => 5}
To delete the 'f1' column family in table 't1', use one of:
To delete the 'f1' column family in table 'ns1:t1', use one of:
hbase> alter 't1', NAME => 'f1', METHOD => 'delete'
hbase> alter 't1', 'delete' => 'f1'
hbase> alter 'ns1:t1', NAME => 'f1', METHOD => 'delete'
hbase> alter 'ns1:t1', 'delete' => 'f1'
You can also change table-scope attributes like MAX_FILESIZE, READONLY,
MEMSTORE_FLUSHSIZE, DEFERRED_LOG_FLUSH, etc. These can be put at the end;

View File

@ -32,13 +32,13 @@ to instead keep a maximum of 5 cell VERSIONS, do:
hbase> alter_async 't1', NAME => 'f1', VERSIONS => 5
To delete the 'f1' column family in table 't1', do:
To delete the 'f1' column family in table 'ns1:t1', do:
hbase> alter_async 't1', NAME => 'f1', METHOD => 'delete'
hbase> alter_async 'ns1:t1', NAME => 'f1', METHOD => 'delete'
or a shorter version:
hbase> alter_async 't1', 'delete' => 'f1'
hbase> alter_async 'ns1:t1', 'delete' => 'f1'
You can also change table-scope attributes like MAX_FILESIZE
MEMSTORE_FLUSHSIZE, READONLY, and DEFERRED_LOG_FLUSH.

View File

@ -27,6 +27,7 @@ table that have received the updated schema
Pass table name.
hbase> alter_status 't1'
hbase> alter_status 'ns1:t1'
EOF
end
def command(table)

View File

@ -27,6 +27,7 @@ And writing on the newly created table will not influence the snapshot data.
Examples:
hbase> clone_snapshot 'snapshotName', 'tableName'
hbase> clone_snapshot 'snapshotName', 'namespace:tableName'
EOF
end

View File

@ -30,6 +30,8 @@ directly close a region, you pass the regions' encoded name only. A region
name looks like this:
TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.
or
Namespace:TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.
The trailing period is part of the regionserver name. A region's encoded name
is the hash at the end of a region name; e.g. 527db22f95c8a9e0116f0cc13c680396

View File

@ -27,6 +27,7 @@ module Shell
family within a region.
Examples:
Compact all regions in a table:
hbase> compact 'ns1:t1'
hbase> compact 't1'
Compact an entire region:
hbase> compact 'r1'

View File

@ -30,6 +30,7 @@ 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

View File

@ -29,7 +29,10 @@ Column specification can be a simple string (name), or a dictionary
including NAME attribute.
Examples:
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}
Create a table with namespace=ns1 and table qualifier=t1
hbase> create 'ns1:t1', {NAME => 'f1', VERSIONS => 5}
Create a table with namespace=default and table qualifier=t1
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
hbase> # The above in shorthand would be the following:
hbase> create 't1', 'f1', 'f2', 'f3'
@ -39,6 +42,7 @@ Examples:
Table configuration options can be put at the end.
Examples:
hbase> create 'ns1:t1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe'
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 'myvalue' }

View File

@ -28,6 +28,7 @@ coordinates exactly. When scanning, a delete cell suppresses older
versions. To delete a cell from 't1' at row 'r1' under column 'c1'
marked with the time 'ts1', do:
hbase> delete 'ns1:t1', 'r1', 'c1', ts1
hbase> delete 't1', 'r1', 'c1', ts1
The same command can also be run on a table reference. Suppose you had a reference

View File

@ -25,6 +25,7 @@ module Shell
Delete all cells in a given row; pass a table name, row, and optionally
a column and timestamp. Examples:
hbase> deleteall 'ns1:t1', 'r1'
hbase> deleteall 't1', 'r1'
hbase> deleteall 't1', 'r1', 'c1'
hbase> deleteall 't1', 'r1', 'c1', ts1

View File

@ -24,6 +24,7 @@ module Shell
return <<-EOF
Describe the named table. For example:
hbase> describe 't1'
hbase> describe 'ns1:t1'
EOF
end

View File

@ -22,7 +22,9 @@ module Shell
class Disable < Command
def help
return <<-EOF
Start disable of named table: e.g. "hbase> disable 't1'"
Start disable of named table:
hbase> disable 't1'
hbase> disable 'ns1:t1'
EOF
end

View File

@ -25,6 +25,8 @@ module Shell
Disable all of tables matching the given regex:
hbase> disable_all 't.*'
hbase> disable_all 'ns:t.*'
hbase> disable_all 'ns:.*'
EOF
end

View File

@ -22,7 +22,9 @@ module Shell
class Drop < Command
def help
return <<-EOF
Drop the named table. Table must first be disabled: e.g. "hbase> drop 't1'"
Drop the named table. Table must first be disabled:
hbase> drop 't1'
hbase> drop 'ns1:t1'
EOF
end

View File

@ -25,6 +25,8 @@ module Shell
Drop all of the tables matching the given regex:
hbase> drop_all 't.*'
hbase> drop_all 'ns:t.*'
hbase> drop_all 'ns:.*'
EOF
end

View File

@ -22,7 +22,9 @@ module Shell
class Enable < Command
def help
return <<-EOF
Start enable of named table: e.g. "hbase> enable 't1'"
Start enable of named table:
hbase> enable 't1'
hbase> enable 'ns1:t1'
EOF
end

View File

@ -25,6 +25,8 @@ module Shell
Enable all of the tables matching the given regex:
hbase> enable_all 't.*'
hbase> enable_all 'ns:t.*'
hbase> enable_all 'ns:.*'
EOF
end

View File

@ -22,7 +22,9 @@ module Shell
class Exists < Command
def help
return <<-EOF
Does the named table exist? e.g. "hbase> exists 't1'"
Does the named table exist?
hbase> exists 't1'
hbase> exists 'ns1:t1'
EOF
end

View File

@ -25,6 +25,7 @@ module Shell
Get row or cell contents; pass table name, row, and optionally
a dictionary of column(s), timestamp, timerange and versions. Examples:
hbase> get 'ns1:t1', 'r1'
hbase> get 't1', 'r1'
hbase> get 't1', 'r1', {TIMERANGE => [ts1, ts2]}
hbase> get 't1', 'r1', {COLUMN => 'c1'}

View File

@ -26,6 +26,7 @@ Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 'ns1:t1', 'r1', 'c1'
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference

View File

@ -27,6 +27,7 @@ on how to use the table.
Eg.
hbase> t1 = get_table 't1'
hbase> t1 = get_table 'ns1:t1'
returns the table named 't1' as a table object. You can then do

View File

@ -31,6 +31,7 @@ For example:
hbase> grant 'bobsmith', 'RWXCA'
hbase> grant 'bobsmith', 'RW', 't1', 'f1', 'col1'
hbase> grant 'bobsmith', 'RW', 'ns1:t1', 'f1', 'col1'
EOF
end

View File

@ -23,9 +23,10 @@ module Shell
def help
return <<-EOF
Increments a cell 'value' at specified table/row/column coordinates.
To increment a cell value in table 't1' at row 'r1' under column
To increment a cell value in table 'ns1:t1' or 't1' at row 'r1' under column
'c1' by 1 (can be omitted) or 10 do:
hbase> incr 'ns1:t1', 'r1', 'c1'
hbase> incr 't1', 'r1', 'c1'
hbase> incr 't1', 'r1', 'c1', 1
hbase> incr 't1', 'r1', 'c1', 10

View File

@ -22,7 +22,9 @@ module Shell
class IsDisabled < Command
def help
return <<-EOF
Is named table disabled?: e.g. "hbase> is_disabled 't1'"
Is named table disabled? For example:
hbase> is_disabled 't1'
hbase> is_disabled 'ns1:t1'
EOF
end

View File

@ -22,7 +22,9 @@ module Shell
class IsEnabled < Command
def help
return <<-EOF
Is named table enabled?: e.g. "hbase> is_enabled 't1'"
Is named table enabled? For example:
hbase> is_enabled 't1'
hbase> is_enabled 'ns1:t1'
EOF
end

View File

@ -27,6 +27,8 @@ be used to filter the output. Examples:
hbase> list
hbase> list 'abc.*'
hbase> list 'ns:abc.*'
hbase> list 'ns:.*'
EOF
end

View File

@ -29,6 +29,7 @@ module Shell
Examples:
Compact all regions in a table:
hbase> major_compact 't1'
hbase> major_compact 'ns1:t1'
Compact an entire region:
hbase> major_compact 'r1'
Compact a single column family within a region:

View File

@ -23,9 +23,10 @@ module Shell
def help
return <<-EOF
Put a cell 'value' at specified table/row/column and optionally
timestamp coordinates. To put a cell value into table 't1' at
row 'r1' under column 'c1' marked with the time 'ts1', do:
timestamp coordinates. To put a cell value into table 'ns1:t1' or 't1'
at row 'r1' under column 'c1' marked with the time 'ts1', do:
hbase> put 'ns1:t1', 'r1', 'c1', 'value'
hbase> put 't1', 'r1', 'c1', 'value'
hbase> put 't1', 'r1', 'c1', 'value', ts1
hbase> put 't1', 'r1', 'c1', 'value', {ATTRIBUTES=>{'mykey'=>'myvalue'}}

View File

@ -27,6 +27,7 @@ For example:
hbase> revoke 'bobsmith'
hbase> revoke 'bobsmith', 't1', 'f1', 'col1'
hbase> revoke 'bobsmith', 'ns1:t1', 'f1', 'col1'
EOF
end

View File

@ -40,6 +40,7 @@ Some examples:
hbase> scan 'hbase:meta'
hbase> scan 'hbase:meta', {COLUMNS => 'info:regioninfo'}
hbase> scan 'ns1:t1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, STARTROW => 'xyz'}
hbase> scan 't1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, STARTROW => 'xyz'}
hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804, 1303668904]}
hbase> scan 't1', {REVERSED => true}

View File

@ -24,6 +24,7 @@ module Shell
Take a snapshot of specified table. Examples:
hbase> snapshot 'sourceTable', 'snapshotName'
hbase> snapshot 'namespace:sourceTable', 'snapshotName'
EOF
end

View File

@ -26,6 +26,7 @@ Split entire table or pass a region to split individual region. With the
second parameter, you can specify an explicit split key for the region.
Examples:
split 'tableName'
split 'namespace:tableName'
split 'regionName' # format: 'tableName,startKey,id'
split 'tableName', 'splitKey'
split 'regionName', 'splitKey'

View File

@ -27,6 +27,7 @@ For example:
hbase> user_permission
hbase> user_permission 'table1'
hbase> user_permission 'namespace1:table1'
EOF
end