Class: HBase::Request::ScannerRequest

Inherits:
BasicRequest show all
Defined in:
lib/hbase/request/scanner_request.rb

Instance Attribute Summary collapse

Attributes inherited from BasicRequest

#path

Instance Method Summary collapse

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_nameObject (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, timestamp = 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(timestamp)}" if timestamp

  @path << "?" << search.join('&')
end