You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Sean Busbey (Jira)" <ji...@apache.org> on 2019/11/08 16:48:00 UTC

[jira] [Comment Edited] (HBASE-15611) add examples to shell docs

    [ https://issues.apache.org/jira/browse/HBASE-15611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16970384#comment-16970384 ] 

Sean Busbey edited comment on HBASE-15611 at 11/8/19 4:47 PM:
--------------------------------------------------------------

Eventually I'll put this into the MOB section for troubleshooting.

"scan for mob references rather than for the values themselves"

{code}
hbase(main):074:0> scan 'example_table', {LIMIT => 1, CACHE_BLOCKS => false, ATTRIBUTES => { 'hbase.mob.scan.raw' => '1', 'hbase.mob.scan.ref.only' => '1' } }
{code}

"count the number of rows with mob references and the number of mob reference cells"

{code}
hbase(main):031:0> row_count = 0
=> 0
hbase(main):032:0> cell_count = 0
=> 0
hbase(main):033:0> table = get_table('clone_table')
0 row(s) in 0.0000 seconds
=> Hbase::Table - clone_table
hbase(main):034:0> rows = table._get_scanner({CACHE_BLOCKS => false, ATTRIBUTES => { 'hbase.mob.scan.raw' => '1', 'hbase.mob.scan.ref.only' => '1' } }).iterator
=> #<#<Class:0x588cf573>:0x7da887f>
hbase(main):035:0> rows.each do | row | row_count+=1; row.list.each do | cell | cell_count+=1; end end
hbase(main):036:0> p row_count
10000
hbase(main):037:0> p cell_count
52360
{code}


Very important warning: if you use this without at least one column with MOB enabled, you will get a full table scan with no filtering.


was (Author: busbey):
Eventually I'll put this into the MOB section for troubleshooting.

"scan for mob references rather than for the values themselves"

{code}
hbase(main):074:0> scan 'example_table', {LIMIT => 1, CACHE_BLOCKS => false, ATTRIBUTES => { 'hbase.mob.scan.raw' => '1', 'hbase.mob.scan.ref.only' => '1' } }
{code}

"count the number of rows with mob references and the number of mob reference cells"

{code}
hbase(main):031:0> row_count = 0
=> 0
hbase(main):032:0> cell_count = 0
=> 0
hbase(main):033:0> table = get_table('clone_table')
0 row(s) in 0.0000 seconds
=> Hbase::Table - clone_table
hbase(main):034:0> rows = table._get_scanner({CACHE_BLOCKS => false, ATTRIBUTES => { 'hbase.mob.scan.raw' => '1', 'hbase.mob.scan.ref.only' => '1' } }).iterator
=> #<#<Class:0x588cf573>:0x7da887f>
hbase(main):035:0> rows.each do | row | row_count+=1; row.list.each do | cell | cell_count+=1; end end
hbase(main):036:0> p row_count
10000
hbase(main):037:0> p cell_count
52360
{code}

> add examples to shell docs 
> ---------------------------
>
>                 Key: HBASE-15611
>                 URL: https://issues.apache.org/jira/browse/HBASE-15611
>             Project: HBase
>          Issue Type: Improvement
>          Components: documentation, shell
>            Reporter: Sean Busbey
>            Priority: Major
>              Labels: beginner
>
> It would be nice if our shell documentation included some additional examples of operational tasks one can perform.
> things to include to come in comments. when we have a patch to submit we can update the jira summary to better reflect what scope we end up with.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)