Class: HBase::Request::ScannerRequest
- Inherits:
-
BasicRequest
- Object
- BasicRequest
- HBase::Request::ScannerRequest
- Defined in:
- lib/hbase/request/scanner_request.rb
Instance Attribute Summary collapse
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Attributes inherited from BasicRequest
Instance Method Summary collapse
- #close(scanner_id) ⇒ Object
- #get_rows(scanner_id, limit = 1) ⇒ Object
-
#initialize(table_name) ⇒ ScannerRequest
constructor
A new instance of ScannerRequest.
- #open(columns, start_row = nil, stop_row = nil, timestamp = nil) ⇒ Object
Constructor Details
#initialize(table_name) ⇒ ScannerRequest
Returns a new instance of ScannerRequest.
6 7 8 9 10 |
# File 'lib/hbase/request/scanner_request.rb', line 6 def initialize(table_name) @table_name = CGI.escape(table_name) path = "/#{@table_name}/scanner" super(path) end |
Instance Attribute Details
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
4 5 6 |
# File 'lib/hbase/request/scanner_request.rb', line 4 def table_name @table_name end |
Instance Method Details
#close(scanner_id) ⇒ Object
26 27 28 |
# File 'lib/hbase/request/scanner_request.rb', line 26 def close(scanner_id) @path << "/#{scanner_id}" end |
#get_rows(scanner_id, limit = 1) ⇒ Object
22 23 24 |
# File 'lib/hbase/request/scanner_request.rb', line 22 def get_rows(scanner_id, limit = 1) @path << "/#{scanner_id}?limit=#{limit}" end |
#open(columns, start_row = nil, stop_row = nil, timestamp = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/hbase/request/scanner_request.rb', line 12 def open(columns, start_row = nil, stop_row = nil, = nil) search = [] search << pack_params(columns) search << "start_row=#{CGI.escape(start_row)}" if start_row search << "stop_row=#{CGI.escape(end_row)}" if stop_row search << "timestamp=#{CGI.escape()}" if @path << "?" << search.join('&') end |