joshelser commented on a change in pull request #2650:
URL: https://github.com/apache/hbase/pull/2650#discussion_r529096584



##########
File path: hbase-shell/src/main/ruby/shell/commands/count.rb
##########
@@ -49,6 +49,17 @@ def help
  hbase> t.count FILTER => "
     (QualifierFilter (>=, 'binary:xyz')) AND (TimestampsFilter ( 123, 456))"
  hbase> t.count COLUMNS => ['c1', 'c2'], STARTROW => 'abc', STOPROW => 'xyz'
+
+By default, this operation does not cause any new blocks to be read into
+the RegionServer block cache. This is typically the desired action; however,
+if you want to force all blocks for a table to be loaded into the block cache
+on-demand, you can pass the 'CACHE_BLOCKS' option with a value of 'true'. A 
value
+of 'false' is the default and will result in no blocks being cached. This
+command can be used in conjunction with all other options.
+
+hbase> count 'ns1:t1', CACHE_BLOCKS => true
+hbase> count 'ns1:t1', CACHE_BLOCKS => 'true'

Review comment:
       Correct.

##########
File path: hbase-shell/src/main/ruby/shell/commands/count.rb
##########
@@ -60,17 +71,27 @@ def count(table, params = {})
         # If the second parameter is an integer, then it is the old command 
syntax
         params = { 'INTERVAL' => params } if params.is_a?(Integer)
 
+        # Try to be nice and convert a string to a bool
+        if params.include?('CACHE_BLOCKS') and 
params['CACHE_BLOCKS'].is_a?(String)
+          if params['CACHE_BLOCKS'].downcase == 'true'
+            params['CACHE_BLOCKS'] = true
+          elsif params['CACHE_BLOCKS'].downcase == 'false'
+            params['CACHE_BLOCKS'] = false
+          end

Review comment:
       Good idea.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to