20 #ifndef Hypertable_Lib_Future_h
21 #define Hypertable_Lib_Future_h
43 Future(
size_t capacity=0) : m_capacity(capacity) { }
61 bool get(
ResultPtr &result, uint32_t timeout_ms,
bool &timed_out);
82 std::lock_guard<std::mutex> lock(m_outstanding_mutex);
83 return !has_remaining_capacity();
90 std::lock_guard<std::mutex> lock(m_outstanding_mutex);
98 std::lock_guard<std::mutex> lock(m_outstanding_mutex);
99 return _is_cancelled();
115 void scan_error(
TableScannerAsync *scanner,
int error,
const std::string &error_msg,
121 return m_memory_used;
129 return m_memory_used < m_capacity;
138 return m_outstanding == 0;
144 size_t m_capacity {};
145 size_t m_memory_used {};
155 #endif // Hypertable_Lib_Future_h
bool _is_cancelled() const
bool is_cancelled()
Checks whether the Future object has been cancelled.
Asynchronous table scanner.
std::shared_ptr< Result > ResultPtr
Smart pointer to Result.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
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.
map< uint64_t, TableScannerAsync * > ScannerMap
bool is_empty()
Checks whether the Future result queue is empty.
list< ResultPtr > ResultQueue
map< uint64_t, TableMutatorAsync * > MutatorMap
bool has_outstanding()
Checks whether there are any outstanding operations.
std::shared_ptr< Future > FuturePtr
Future(size_t capacity=0)
Future objects are used to access results from asynchronous scanners/mutators.
bool has_remaining_capacity()
Represents an open table.
bool is_full()
Checks whether the Future result queue is full.
std::vector< FailedMutation > FailedMutations