0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
Hypertable::ScanBlock Class Reference

Encapsulates a block of scan results. More...

#include <ScanBlock.h>

Collaboration diagram for Hypertable::ScanBlock:
Collaboration graph
[legend]

Public Types

typedef std::vector< std::pair
< SerializedKey, ByteString > > 
Vector
 

Public Member Functions

 ScanBlock ()
 
int load (EventPtr &event)
 Loads scanblock data returned from RangeServer. More...
 
size_t size ()
 Returns the number of key/value pairs in the scanblock. More...
 
void reset ()
 Resets iterator to first key/value pair in the scanblock. More...
 
bool next (SerializedKey &key, ByteString &value)
 Returns the next key/value pair in the scanblock. More...
 
bool eos ()
 Returns true if this is the final scanblock returned by the scanner. More...
 
bool more ()
 Indicates whether or not there are more key/value pairs in block. More...
 
size_t memory_used () const
 Approximate estimate of memory used by scanblock (returns the size of the event payload) which contains most of the data. More...
 
int get_scanner_id ()
 Returns scanner ID associated with this scanblock. More...
 
int get_skipped_rows ()
 Returns number of skipped rows because of an OFFSET predicate. More...
 
int get_skipped_cells ()
 Returns number of skipped rows because of a CELL_OFFSET predicate. More...
 
const ProfileDataScannerprofile_data ()
 Returns reference to profile data. More...
 

Private Attributes

int m_error {}
 
Vector m_vec
 
Vector::iterator m_iter
 
EventPtr m_event
 
Lib::RangeServer::Response::Parameters::CreateScanner m_response
 

Detailed Description

Encapsulates a block of scan results.

The CREATE_SCANNER and FETCH_SCANBLOCK RangeServer methods return a block of scan results and this class parses and provides easy access to the key/value pairs in that result.

Definition at line 50 of file ScanBlock.h.

Member Typedef Documentation

typedef std::vector< std::pair<SerializedKey, ByteString> > Hypertable::ScanBlock::Vector

Definition at line 53 of file ScanBlock.h.

Constructor & Destructor Documentation

ScanBlock::ScanBlock ( )

Definition at line 41 of file ScanBlock.cc.

Member Function Documentation

bool Hypertable::ScanBlock::eos ( )
inline

Returns true if this is the final scanblock returned by the scanner.

Returns
true if this is the final scanblock, or false if more to come

Definition at line 85 of file ScanBlock.h.

int Hypertable::ScanBlock::get_scanner_id ( )
inline

Returns scanner ID associated with this scanblock.

Returns
scanner ID

Definition at line 109 of file ScanBlock.h.

int Hypertable::ScanBlock::get_skipped_cells ( )
inline

Returns number of skipped rows because of a CELL_OFFSET predicate.

Definition at line 115 of file ScanBlock.h.

int Hypertable::ScanBlock::get_skipped_rows ( )
inline

Returns number of skipped rows because of an OFFSET predicate.

Definition at line 112 of file ScanBlock.h.

int ScanBlock::load ( EventPtr event)

Loads scanblock data returned from RangeServer.

Both the CREATE_SCANNER and FETCH_SCANBLOCK methods return a block of key/value pairs.

Parameters
eventsmart pointer to response MESSAGE event
Returns
Error::OK on success or error code on failure

Definition at line 46 of file ScanBlock.cc.

size_t Hypertable::ScanBlock::memory_used ( ) const
inline

Approximate estimate of memory used by scanblock (returns the size of the event payload) which contains most of the data.

Definition at line 100 of file ScanBlock.h.

bool Hypertable::ScanBlock::more ( )
inline

Indicates whether or not there are more key/value pairs in block.

Returns
ture if next will return more key/value pairs, false otherwise

Definition at line 90 of file ScanBlock.h.

bool ScanBlock::next ( SerializedKey key,
ByteString value 
)

Returns the next key/value pair in the scanblock.

NOTE: invoking the load method invalidates all pointers previously returned from this method.

Parameters
keyreference to return key pointer
valuereference to return value pointer
Returns
true if key/value returned, false if no more key/value pairs

Definition at line 84 of file ScanBlock.cc.

const ProfileDataScanner& Hypertable::ScanBlock::profile_data ( )
inline

Returns reference to profile data.

Returns
Reference to profile data

Definition at line 119 of file ScanBlock.h.

void Hypertable::ScanBlock::reset ( )
inline

Resets iterator to first key/value pair in the scanblock.

Definition at line 71 of file ScanBlock.h.

size_t Hypertable::ScanBlock::size ( )
inline

Returns the number of key/value pairs in the scanblock.

Returns
number of key/value pairs in the scanblock

Definition at line 68 of file ScanBlock.h.

Member Data Documentation

int Hypertable::ScanBlock::m_error {}
private

Definition at line 122 of file ScanBlock.h.

EventPtr Hypertable::ScanBlock::m_event
private

Definition at line 125 of file ScanBlock.h.

Vector::iterator Hypertable::ScanBlock::m_iter
private

Definition at line 124 of file ScanBlock.h.

Lib::RangeServer::Response::Parameters::CreateScanner Hypertable::ScanBlock::m_response
private

Definition at line 126 of file ScanBlock.h.

Vector Hypertable::ScanBlock::m_vec
private

Definition at line 123 of file ScanBlock.h.


The documentation for this class was generated from the following files: