set_visibility
Definition
Sets the visibility expression on one or more existing table cells. Requires a table name, an expression, using available visibility labels, and a dictionary, containing specifications for scanning the desired cells.
Usage
set_visibility '[<namespace_name>:]<table_name>',
'<visibility_expression>',
{COLUMNS => <columns_array[]>[,
TIMERANGE => [<timestamp_start>, <timestamp_end>]][,
TIMESTAMP => <cell_timestamp>][,
ROWPREFIXFILTER => '<row_prefix>'][,
STARTROW => '<start_row_key>'][,
STOPROW => '<stop_row_key>'][,
FILTER => "<filter_description>"]}
Parameter | Description |
---|---|
namespace_name |
A namespace name |
table_name |
A table name |
visibility_expression |
A logical expression that refers to existing visibility labels. Can use the following logical operators: |
columns_array |
An array of strings specified in the format |
timestamp_start |
A start value for searching cells timestamps |
timestamp_end |
A stop value for searching cells timestamps |
cell_timestamp |
A cell timestamp |
row_prefix |
A prefix for searching row keys |
start_row_key |
A start value for searching row keys |
stop_row_key |
A stop value for searching row keys |
filter_description |
A filter used for searching the table cells |
Examples
Set visibility for all existing cells of the defined column
hbase(main):010:0> set_visibility 'ns1:temp2', 'PRIVATE|SECRET', {COLUMNS => ['cf1:c1']} 1 row(s) Took 0.0841 seconds
Attempt to use all available parameters
hbase(main):009:0> set_visibility 'ns1:temp2', 'PRIVATE|SECRET', {COLUMNS => ['cf1:c1'], TIMERANGE => [1303668804000, 1303668904000], TIMESTAMP => 1303668804000, ROWPREFIXFILTER => 'r', STARTROW => 'r1', STOPROW => 'r2', FILTER => "ValueFilter(=, 'regexstring:value*')"} 0 row(s) Took 0.0427 seconds
Attempt to use non-existent visibility labels
hbase(main):013:0> set_visibility 'ns1:temp2', 'Z&Y', {COLUMNS => ['cf1:c1']} ERROR: org.apache.hadoop.hbase.exceptions.FailedSanityCheckException: Invalid visibility label Z at org.apache.hadoop.hbase.regionserver.HRegion.doBatchMutate(HRegion.java:4119) at org.apache.hadoop.hbase.regionserver.HRegion.put(HRegion.java:2975) at org.apache.hadoop.hbase.regionserver.RSRpcServices.mutate(RSRpcServices.java:2806) at org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:42000) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:413) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:130) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:324) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:304) Set the visibility expression on one or more existing cells. Pass table name, visibility expression, and a dictionary containing scanner specifications. Scanner specifications may include one or more of: TIMERANGE, FILTER, STARTROW, STOPROW, ROWPREFIXFILTER, TIMESTAMP, or COLUMNS If no columns are specified, all columns will be included. To include all members of a column family, leave the qualifier empty as in 'col_family:'. The filter can be specified in two ways: 1. Using a filterString - more information on this is available in the Filter Language document attached to the HBASE-4176 JIRA 2. Using the entire package name of the filter. Examples: hbase> set_visibility 't1', 'A|B', {COLUMNS => ['c1', 'c2']} hbase> set_visibility 't1', '(A&B)|C', {COLUMNS => 'c1', TIMERANGE => [1303668804000, 1303668904000]} hbase> set_visibility 't1', 'A&B&C', {ROWPREFIXFILTER => 'row2', FILTER => "(QualifierFilter (>=, 'binary:xyz')) AND (TimestampsFilter ( 123, 456))"} This command will only affect existing cells and is expected to be mainly useful for feature testing and functional verification. Took 0.5326 seconds