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

ResultCallback for secondary indices; used by TableScannerAsync. More...

#include <IndexScannerCallback.h>

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

Public Member Functions

 IndexScannerCallback (TableScannerAsync *primary_scanner, Table *primary_table, const ScanSpec &primary_spec, std::vector< CellPredicate > &cell_predicates, ResultCallback *original_cb, uint32_t timeout_ms, bool qualifier_scan, bool row_intervals_applied)
 
virtual ~IndexScannerCallback ()
 
void shutdown ()
 
void sspecs_clear ()
 
virtual void scan_ok (TableScannerAsync *scanner, ScanCellsPtr &scancells)
 Callback method for successful scan. More...
 
virtual void register_scanner (TableScannerAsync *scanner)
 Hook for derived classes which want to keep track of scanners/mutators. More...
 
virtual void scan_error (TableScannerAsync *scanner, int error, const std::string &error_msg, bool eos)
 Callback method for scan errors. More...
 
virtual void update_ok (TableMutatorAsync *mutator)
 Callback method for successful update. More...
 
virtual void update_error (TableMutatorAsync *mutator, int error, FailedMutations &failures)
 Callback method for update errors. More...
 
- Public Member Functions inherited from Hypertable::ResultCallback
 ResultCallback ()
 
virtual ~ResultCallback ()
 
virtual void deregister_scanner (TableScannerAsync *scanner)
 Hook for derived classes which want to keep track of scanners/mutators. More...
 
virtual void register_mutator (TableMutatorAsync *mutator)
 Hook for derived classes which want to keep track of scanners/mutators. More...
 
virtual void deregister_mutator (TableMutatorAsync *mutator)
 Hook for derived classes which want to keep track of scanners/mutators. More...
 
virtual void completed ()
 Callback method for completion, default one does nothing. More...
 
void wait_for_completion ()
 Blocks till outstanding == 0. More...
 
void increment_outstanding ()
 
void decrement_outstanding ()
 
bool is_done ()
 
- Public Member Functions inherited from Hypertable::ClientObject
virtual ~ClientObject ()
 Destructor. More...
 

Private Types

typedef std::map< KeySpec,
uint32_t > 
CkeyMap
 
typedef std::map< String, StringCstrMap
 

Private Member Functions

void final_decrement (bool is_eos)
 
void collect_indices (TableScannerAsync *scanner, ScanCellsPtr &scancells)
 
void create_temp_table ()
 
void verify_results (std::unique_lock< std::mutex > &lock, TableScannerAsync *scanner, ScanCellsPtr &scancells)
 
void readahead ()
 
void track_predicates (ScanCellsPtr &scancells)
 
bool row_intervals_match (const RowIntervals &rivec, const char *row)
 
bool cell_intervals_match (const CellIntervals &civec, const char *row, const char *column)
 

Private Attributes

TableScannerAsyncm_primary_scanner {}
 
Tablem_primary_table {}
 
ScanSpecBuilder m_primary_spec
 
std::vector< CellPredicatem_cell_predicates
 
ResultCallbackm_original_cb {}
 
uint32_t m_timeout_ms {}
 
std::vector< TableScannerAsync * > m_scanners
 
std::mutex m_scanner_mutex
 
std::deque< ScanSpecBuilder * > m_sspecs
 
std::condition_variable m_sspecs_cond
 
std::map< uint32_t, Stringm_column_map
 
TablePtr m_tmp_table
 
std::unique_ptr
< TableMutatorAsync
m_mutator
 
int m_row_limit {}
 
int m_cell_limit {}
 
int m_cell_count {}
 
int m_row_offset {}
 
int m_cell_offset {}
 
int m_row_count {}
 
int m_cell_limit_per_family {}
 
bool m_eos {}
 
bool m_track_limits {}
 
bool m_limits_reached {}
 
std::mutex m_mutex
 
int m_readahead_count {}
 
std::string m_last_rowkey_verify
 
std::string m_last_rowkey_tracking
 
uint32_t m_cur_matching {}
 
uint32_t m_all_matching {}
 
bool m_qualifier_scan {}
 
bool m_row_intervals_applied {}
 
CkeyMap m_tmp_keys
 
FlyweightString m_strings
 
size_t m_tmp_cutoff {}
 
bool m_final_decrement {}
 
std::atomic< int > m_outstanding_scanners {0}
 
bool m_shutdown {}
 

Static Private Attributes

static const size_t SSB_QUEUE_LIMIT = 40
 
static const size_t TMP_CUTOFF = 16*1024*1024
 if more than TMP_CUTOFF bytes are received from the index then store all results in a temporary table More...
 

Additional Inherited Members

- Protected Attributes inherited from Hypertable::ResultCallback
int m_outstanding {}
 
std::mutex m_outstanding_mutex
 
std::condition_variable m_outstanding_cond
 

Detailed Description

ResultCallback for secondary indices; used by TableScannerAsync.

Definition at line 85 of file IndexScannerCallback.h.

Member Typedef Documentation

typedef std::map<KeySpec, uint32_t> Hypertable::IndexScannerCallback::CkeyMap
private

Definition at line 859 of file IndexScannerCallback.h.

Definition at line 860 of file IndexScannerCallback.h.

Constructor & Destructor Documentation

Hypertable::IndexScannerCallback::IndexScannerCallback ( TableScannerAsync primary_scanner,
Table primary_table,
const ScanSpec primary_spec,
std::vector< CellPredicate > &  cell_predicates,
ResultCallback original_cb,
uint32_t  timeout_ms,
bool  qualifier_scan,
bool  row_intervals_applied 
)
inline

Definition at line 103 of file IndexScannerCallback.h.

virtual Hypertable::IndexScannerCallback::~IndexScannerCallback ( )
inlinevirtual

Definition at line 147 of file IndexScannerCallback.h.

Member Function Documentation

bool Hypertable::IndexScannerCallback::cell_intervals_match ( const CellIntervals civec,
const char *  row,
const char *  column 
)
inlineprivate

Definition at line 817 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::collect_indices ( TableScannerAsync scanner,
ScanCellsPtr scancells 
)
inlineprivate

Definition at line 286 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::create_temp_table ( )
inlineprivate

Definition at line 530 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::final_decrement ( bool  is_eos)
inlineprivate

Definition at line 267 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::readahead ( )
inlineprivate

Definition at line 692 of file IndexScannerCallback.h.

virtual void Hypertable::IndexScannerCallback::register_scanner ( TableScannerAsync scanner)
inlinevirtual

Hook for derived classes which want to keep track of scanners/mutators.

Reimplemented from Hypertable::ResultCallback.

Definition at line 239 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::row_intervals_match ( const RowIntervals rivec,
const char *  row 
)
inlineprivate

Definition at line 790 of file IndexScannerCallback.h.

virtual void Hypertable::IndexScannerCallback::scan_error ( TableScannerAsync scanner,
int  error,
const std::string &  error_msg,
bool  eos 
)
inlinevirtual

Callback method for scan errors.

Parameters
scanner
error
error_msg
eosend of scan

Implements Hypertable::ResultCallback.

Definition at line 251 of file IndexScannerCallback.h.

virtual void Hypertable::IndexScannerCallback::scan_ok ( TableScannerAsync scanner,
ScanCellsPtr scancells 
)
inlinevirtual

Callback method for successful scan.

Parameters
scannerPointer to scanner
scancellsreturned cells

Implements Hypertable::ResultCallback.

Definition at line 188 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::shutdown ( )
inline

Definition at line 159 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::sspecs_clear ( )
inline

Definition at line 175 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::track_predicates ( ScanCellsPtr scancells)
inlineprivate

Definition at line 717 of file IndexScannerCallback.h.

virtual void Hypertable::IndexScannerCallback::update_error ( TableMutatorAsync mutator,
int  error,
FailedMutations failures 
)
inlinevirtual

Callback method for update errors.

Parameters
mutatorMutator pointer
errorerror code
failuresvector of failed mutations

Implements Hypertable::ResultCallback.

Definition at line 261 of file IndexScannerCallback.h.

virtual void Hypertable::IndexScannerCallback::update_ok ( TableMutatorAsync mutator)
inlinevirtual

Callback method for successful update.

Parameters
mutator

Implements Hypertable::ResultCallback.

Definition at line 258 of file IndexScannerCallback.h.

void Hypertable::IndexScannerCallback::verify_results ( std::unique_lock< std::mutex > &  lock,
TableScannerAsync scanner,
ScanCellsPtr scancells 
)
inlineprivate

Definition at line 552 of file IndexScannerCallback.h.

Member Data Documentation

uint32_t Hypertable::IndexScannerCallback::m_all_matching {}
private

Definition at line 935 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_cell_count {}
private

Definition at line 904 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_cell_limit {}
private

Definition at line 903 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_cell_limit_per_family {}
private

Definition at line 908 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_cell_offset {}
private

Definition at line 906 of file IndexScannerCallback.h.

std::vector<CellPredicate> Hypertable::IndexScannerCallback::m_cell_predicates
private

Definition at line 872 of file IndexScannerCallback.h.

std::map<uint32_t, String> Hypertable::IndexScannerCallback::m_column_map
private

Definition at line 893 of file IndexScannerCallback.h.

uint32_t Hypertable::IndexScannerCallback::m_cur_matching {}
private

Definition at line 932 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::m_eos {}
private

Definition at line 911 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::m_final_decrement {}
private

Definition at line 954 of file IndexScannerCallback.h.

std::string Hypertable::IndexScannerCallback::m_last_rowkey_tracking
private

Definition at line 929 of file IndexScannerCallback.h.

std::string Hypertable::IndexScannerCallback::m_last_rowkey_verify
private

Definition at line 926 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::m_limits_reached {}
private

Definition at line 917 of file IndexScannerCallback.h.

std::unique_ptr<TableMutatorAsync> Hypertable::IndexScannerCallback::m_mutator
private

Definition at line 899 of file IndexScannerCallback.h.

std::mutex Hypertable::IndexScannerCallback::m_mutex
private

Definition at line 920 of file IndexScannerCallback.h.

ResultCallback* Hypertable::IndexScannerCallback::m_original_cb {}
private

Definition at line 875 of file IndexScannerCallback.h.

std::atomic<int> Hypertable::IndexScannerCallback::m_outstanding_scanners {0}
private

Definition at line 957 of file IndexScannerCallback.h.

TableScannerAsync* Hypertable::IndexScannerCallback::m_primary_scanner {}
private

Definition at line 863 of file IndexScannerCallback.h.

ScanSpecBuilder Hypertable::IndexScannerCallback::m_primary_spec
private

Definition at line 869 of file IndexScannerCallback.h.

Table* Hypertable::IndexScannerCallback::m_primary_table {}
private

Definition at line 866 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::m_qualifier_scan {}
private

Definition at line 938 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_readahead_count {}
private

Definition at line 923 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_row_count {}
private

Definition at line 907 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::m_row_intervals_applied {}
private

Definition at line 941 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_row_limit {}
private

Definition at line 902 of file IndexScannerCallback.h.

int Hypertable::IndexScannerCallback::m_row_offset {}
private

Definition at line 905 of file IndexScannerCallback.h.

std::mutex Hypertable::IndexScannerCallback::m_scanner_mutex
private

Definition at line 884 of file IndexScannerCallback.h.

std::vector<TableScannerAsync *> Hypertable::IndexScannerCallback::m_scanners
private

Definition at line 881 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::m_shutdown {}
private

Definition at line 960 of file IndexScannerCallback.h.

std::deque<ScanSpecBuilder *> Hypertable::IndexScannerCallback::m_sspecs
private

Definition at line 887 of file IndexScannerCallback.h.

std::condition_variable Hypertable::IndexScannerCallback::m_sspecs_cond
private

Definition at line 890 of file IndexScannerCallback.h.

FlyweightString Hypertable::IndexScannerCallback::m_strings
private

Definition at line 947 of file IndexScannerCallback.h.

uint32_t Hypertable::IndexScannerCallback::m_timeout_ms {}
private

Definition at line 878 of file IndexScannerCallback.h.

size_t Hypertable::IndexScannerCallback::m_tmp_cutoff {}
private

Definition at line 951 of file IndexScannerCallback.h.

CkeyMap Hypertable::IndexScannerCallback::m_tmp_keys
private

Definition at line 944 of file IndexScannerCallback.h.

TablePtr Hypertable::IndexScannerCallback::m_tmp_table
private

Definition at line 896 of file IndexScannerCallback.h.

bool Hypertable::IndexScannerCallback::m_track_limits {}
private

Definition at line 914 of file IndexScannerCallback.h.

const size_t Hypertable::IndexScannerCallback::SSB_QUEUE_LIMIT = 40
staticprivate

Definition at line 90 of file IndexScannerCallback.h.

const size_t Hypertable::IndexScannerCallback::TMP_CUTOFF = 16*1024*1024
staticprivate

if more than TMP_CUTOFF bytes are received from the index then store all results in a temporary table

Definition at line 98 of file IndexScannerCallback.h.


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