Class: HBaseRb::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/hbaserb/scanner.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, scanner_id) ⇒ Scanner

Returns a new instance of Scanner.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/hbaserb/scanner.rb', line 4

def initialize(client, scanner_id)
  @client = client
  @sid = scanner_id
  if block_given?
    n = next_row
    while n.length > 0
      yield n.first
      n = next_row
    end        
    close
  end
end

Instance Method Details

#closeObject



21
22
23
# File 'lib/hbaserb/scanner.rb', line 21

def close
  call :scannerClose
end

#eachObject



25
26
27
28
29
30
31
# File 'lib/hbaserb/scanner.rb', line 25

def each 
  n = next_row
  while n.length > 0
    yield n.first
    n = next_row
  end
end

#next_rowObject



17
18
19
# File 'lib/hbaserb/scanner.rb', line 17

def next_row
  call :scannerGet
end