22 #ifndef Hypertable_Lib_ResultCallback_h
23 #define Hypertable_Lib_ResultCallback_h
28 #include <condition_variable>
50 wait_for_completion();
95 virtual void scan_error(
TableScannerAsync *scanner,
int error,
const std::string &error_msg,
118 std::unique_lock<std::mutex> lock(m_outstanding_mutex);
119 m_outstanding_cond.wait(lock, [
this](){
return m_outstanding == 0; });
126 std::lock_guard<std::mutex> lock(m_outstanding_mutex);
134 std::lock_guard<std::mutex> lock(m_outstanding_mutex);
137 if (m_outstanding == 0) {
139 m_outstanding_cond.notify_all();
147 std::lock_guard<std::mutex> lock(m_outstanding_mutex);
148 return m_outstanding == 0;
152 int m_outstanding {};
162 #endif // Hypertable_Lib_ResultCallback_h
Asynchronous table scanner.
void increment_outstanding()
virtual void register_mutator(TableMutatorAsync *mutator)
Hook for derived classes which want to keep track of scanners/mutators.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
std::shared_ptr< ScanCells > ScanCellsPtr
Smart pointer to ScanCells.
virtual ~ResultCallback()
std::mutex m_outstanding_mutex
Declarations for ClientObject.
virtual void register_scanner(TableScannerAsync *scanner)
Hook for derived classes which want to keep track of scanners/mutators.
virtual void deregister_mutator(TableMutatorAsync *mutator)
Hook for derived classes which want to keep track of scanners/mutators.
Base class for Hypertable client objects.
virtual void completed()
Callback method for completion, default one does nothing.
std::shared_ptr< ResultCallback > ResultCallbackPtr
Shared smart pointer to ResultCallback.
std::condition_variable m_outstanding_cond
void decrement_outstanding()
Represents an open table.
virtual void deregister_scanner(TableScannerAsync *scanner)
Hook for derived classes which want to keep track of scanners/mutators.
void wait_for_completion()
Blocks till outstanding == 0.
std::vector< FailedMutation > FailedMutations