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

Synchronous table scanner. More...

#include <TableScanner.h>

Inheritance diagram for Hypertable::TableScanner:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::TableScanner:
Collaboration graph
[legend]

Public Member Functions

 TableScanner (Comm *comm, Table *table, RangeLocatorPtr &range_locator, const ScanSpec &scan_spec, uint32_t timeout_ms)
 Constructor. More...
 
virtual ~TableScanner ()
 Destructor. More...
 
bool next (Cell &cell)
 Gets the next cell. More...
 
void unget (const Cell &cell)
 Ungets one cell. More...
 
void get_profile_data (ProfileDataScanner &profile_data)
 Gets profile data. More...
 
- Public Member Functions inherited from Hypertable::ClientObject
virtual ~ClientObject ()
 Destructor. More...
 

Private Member Functions

void scan_ok (ScanCellsPtr &cells)
 Callback for successful scan. More...
 
void scan_error (int error, const std::string &error_msg)
 Callback for scan errors. More...
 

Private Attributes

TableCallback m_callback
 
TableScannerQueuePtr m_queue
 
TableScannerAsyncPtr m_scanner
 
ScanCellsPtr m_cur_cells
 
ProfileDataScanner m_profile_data
 
size_t m_cur_cells_index
 
size_t m_cur_cells_size
 
int m_error
 
std::string m_error_msg
 
bool m_eos
 
Cell m_ungot
 

Friends

class TableCallback
 

Detailed Description

Synchronous table scanner.

Definition at line 39 of file TableScanner.h.

Constructor & Destructor Documentation

TableScanner::TableScanner ( Comm comm,
Table table,
RangeLocatorPtr range_locator,
const ScanSpec scan_spec,
uint32_t  timeout_ms 
)

Constructor.

Parameters
commComm layer object
tableTable object
range_locatorSmart pointer to range locator
scan_specScan specification
timeout_msTimeout (deadline) milliseconds

Definition at line 35 of file TableScanner.cc.

virtual Hypertable::TableScanner::~TableScanner ( )
inlinevirtual

Destructor.

Cancel asynchronous scanner and keep dealing with RangeServer responses till async scanner is finished.

Definition at line 57 of file TableScanner.h.

Member Function Documentation

void Hypertable::TableScanner::get_profile_data ( ProfileDataScanner profile_data)
inline

Gets profile data.

Parameters
profile_dataReference to profile data object populated by this method

Definition at line 91 of file TableScanner.h.

bool TableScanner::next ( Cell cell)

Gets the next cell.

Parameters
cellThe cell object to contain the result
Returns
true on success, false on end of scan

Definition at line 49 of file TableScanner.cc.

void TableScanner::scan_error ( int  error,
const std::string &  error_msg 
)
private

Callback for scan errors.

Parameters
error
error_msg

Definition at line 98 of file TableScanner.cc.

void TableScanner::scan_ok ( ScanCellsPtr cells)
private

Callback for successful scan.

Parameters
cellsVector of returned cells

Definition at line 94 of file TableScanner.cc.

void TableScanner::unget ( const Cell cell)

Ungets one cell.

Only one cell that's previously obtained from next can be unget. Mostly designed to provide one cell look-ahead for downstream wrapper to implement next_row.

Parameters
cellthe cell object to unget
Exceptions
exceptionif unget is called twice without intervening next

Definition at line 87 of file TableScanner.cc.

Friends And Related Function Documentation

friend class TableCallback
friend

Definition at line 97 of file TableScanner.h.

Member Data Documentation

TableCallback Hypertable::TableScanner::m_callback
private

Definition at line 110 of file TableScanner.h.

ScanCellsPtr Hypertable::TableScanner::m_cur_cells
private

Definition at line 113 of file TableScanner.h.

size_t Hypertable::TableScanner::m_cur_cells_index
private

Definition at line 115 of file TableScanner.h.

size_t Hypertable::TableScanner::m_cur_cells_size
private

Definition at line 116 of file TableScanner.h.

bool Hypertable::TableScanner::m_eos
private

Definition at line 119 of file TableScanner.h.

int Hypertable::TableScanner::m_error
private

Definition at line 117 of file TableScanner.h.

std::string Hypertable::TableScanner::m_error_msg
private

Definition at line 118 of file TableScanner.h.

ProfileDataScanner Hypertable::TableScanner::m_profile_data
private

Definition at line 114 of file TableScanner.h.

TableScannerQueuePtr Hypertable::TableScanner::m_queue
private

Definition at line 111 of file TableScanner.h.

TableScannerAsyncPtr Hypertable::TableScanner::m_scanner
private

Definition at line 112 of file TableScanner.h.

Cell Hypertable::TableScanner::m_ungot
private

Definition at line 120 of file TableScanner.h.


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