HBase Shell for MapR-DB
You can manage MapR-DB tables using HBase shell commands and additional HBase shell commands included in the MapR distribution of Hadoop.
Before running the shell, ensure that your user ID has both the readAce
and writeAce
permissions on the volume. For information about these
permissions, see Whole Volume ACEs.
When you specify a table in the HBase shell, use the following syntax:
- For a table on the local cluster, start the path at the volume mount point. For example, for a table named test under a volume with a mount point at /volume1, specify the following path as the table name: “/volume1/test”
- For a table on a remote cluster, you must also specify the cluster name in the path. For example, for a table named customer under volume1 in the sanfrancisco cluster, specify the following path as the table name: “/mapr/sanfrancisco/volume1/customer”
The following table lists the supported HBase shell commands that you can use to manage MapR-DB tables:
Command | Description |
---|---|
alter | Performs the following actions on MapR-DB tables:
|
alter_async | On MapR-DB tables, this has the same behavior as the alter command. |
count | Counts the number of rows in a specified table. |
create | Creates a table in the specified path. |
delete | Deletes a value in a specified table, row, and column. Optionally, you can also specify the timestamp associated with the value that you want to delete. |
deleteall | Delete all values in a row based on the table name and row. Optionally, you can also specify the timestamp associated with the values that you want to delete. |
describe | Describes a specified table. |
disable | Marks a specified table as disabled. This state is recorded only in the client process (HBase shell) memory and does not actually disable any operations on a MapR-DB table. |
disable_all | Marks tables as disabled if they have names matching the specified regular expression. This state is recorded only in the client process (HBase shell) memory and does not actually disable any operations on the MapR-DB tables. |
drop | Drops a specified table that is marked as disabled. |
drop_all | Drops all tables that are marked as disabled. |
enable | Marks a specified table as enabled. This state is recorded only in the client process (HBase shell) memory. |
enable_all | Marks tables as enabled if they have a table name that matches the specified regular expression. This state is recorded only in the client process (HBase shell) memory. |
exists | Returns boolean value true if the specified table exists. |
exit | Exits the HBase shell. |
get | Gets the contents of a row or cell. |
get_counter | Returns the value of a counter at a specified table, row, and column. |
incr | Increments a value at a specified table, row, and column. |
is_disabled | Returns a value that indicates if a specified table is disabled. You can perform operations on MapR-DB tables that are disabled. |
is_enabled | Returns a value that indicates if a specified table is enabled. You can perform operations on MapR-DB tables even if they are not enabled. |
list | When the HBase table namespace mapping points to a directory on the MapR-FS, the command lists all the MapR-DB tables in the specified MapR-FS directory. Otherwise, it lists all Apache HBase tables associated with the HBase service that is currently running. If the HBase table namespace mapping does not point to a directory on the MapR-FS and the HBase service is not running, it lists the tables in the home directory of the user that is running the HBase shell. For more information, see Mapping Table Namespace Between Apache HBase Tables and MapR-DB Tables. |
list_perm | Lists all permissions set by Access Control Expressions for a specified table. This HBase shell command only operates on MapR-DB tables. For more information, see list_perm. |
put | Puts a value at a specified table, row, and column. Optionally, you can also specify the timestamp for that value. |
scan | Scans a specified table. Optionally, you can also specify a dictionary of scanner specifications. |
set_perm | Sets permissions with Access Control Expressions on a specified table, column family, or column qualifier. This Hbase shell command only operates on MapR-DB tables. For more information, see set_perm. |
show_filters | Shows all the filters supported by the Hbase or MapR-DB tables. Provide the link to 4.1 supported filters doc |
truncate | Disables, drops, and recreates a specified table. |
version | Returns the HBase client version. |
whoami | Returns the current user. |
MapR-DB does not support the following HBase shell commands:
- add_peer
- alter_status
- assign
- balance_switch
- balancer
- close_region
- compact
- disable_peer
- enable_peer
- flush
- grant
- hlog_roll
- list_peer
- major_compact
- move
- remove_peer
- start_replication
- stop_replication
- status
- split
- revoke
- unassign
- user_permission
- zk_dump
For more information about the HBase shell commands, see the Apache HBase documentation.