NAME
HBase::JSONRest::Scanner - Simple client for HBase stateless REST scanners
SYNOPSIS
A simple scanner:
use HBase::JSONRest;
my $hbase = HBase::JSONRest->new(host => 'my-rest-host');
my $table = 'name of table to scan';
my $prefix = 'key prefix to scan';
my $batch_size = 100; # rows per one batch
my $scanner = HBase::JSONRest::Scanner->new({
hbase => $hbase,
table => $table,
prefix => $prefix,
atatime => $batch_size,
});
my $rows;
while ($rows = $scanner->get_next_batch()) {
print STDERR "got "
. @$rows . " rows in "
. sprintf("%.3f", $scanner->{last_batch_time}) . " seconds\n\n";
print STDERR "first key in batch ==> " . $rows->[0]->{row} . "\n";
print STDERR "last key in batch ==> " . $rows->[-1]->{row} . "\n";
}
DESCRIPTION
Simple client for HBase stateless REST scanners.
METHODS
new
Constructor. Cretes an HBase stateless REST scanner object.
my $scanner = HBase::JSONRest::Scanner->new({
hbase => $hbase,
table => $table,
prefix => $prefix,
atatime => $batch_size,
});
get_next_batch
Gets the next batch of records
while ($rows = $scanner->get_next_batch()) {
...
}