22 #ifndef Hypertable_Lib_IndexMutatorCallback_h
23 #define Hypertable_Lib_IndexMutatorCallback_h
39 bool operator()(
const char *lhs,
const char *rhs)
const {
40 return strcmp(lhs, rhs) < 0;
50 typedef std::multimap<const char *, Cell, ltStringPtr>
KeyMap;
64 std::lock_guard<std::mutex>lock(
m_mutex);
75 strlen(key.
row) + tmp.
size() + 20 + value_len;
104 const std::string &error_msg,
bool eos) {
125 std::lock_guard<std::mutex>lock(
m_mutex);
130 for (
const auto &fm : failures) {
131 const Cell &cell = fm.first;
135 while (*row !=
'\t' && row > cell.
row_key)
150 std::lock_guard<std::mutex>lock(
m_mutex);
155 std::pair<KeyMap::iterator, KeyMap::iterator> it =
156 m_keymap.equal_range(fail.first.c_str());
157 for (KeyMap::iterator i = it.first; i != it.second; ++i) {
158 Cell &cell = i->second;
159 propagate.push_back(std::pair<Cell, int>(cell, fail.second));
161 m_keymap.erase(it.first, it.second);
169 std::lock_guard<std::mutex>lock(
m_mutex);
174 std::lock_guard<std::mutex>lock(
m_mutex);
176 IndexMutatorCallback::KeyMap::iterator it;
224 #endif // Hypertable_Lib_IndexMutatorCallback_h
IndexMutatorCallback(TableMutatorAsync *primary_mutator, ResultCallback *original_cb, uint64_t max_memory)
void propagate_failures()
Asynchronous table scanner.
bool operator()(const char *lhs, const char *rhs) const
virtual void update_ok(TableMutatorAsync *mutator)
Callback method for successful update.
void get_cell(Cell &cc, size_t ii)
std::shared_ptr< IndexMutatorCallback > IndexMutatorCallbackPtr
virtual void scan_error(TableScannerAsync *scanner, int error, const std::string &error_msg, bool eos)=0
Callback method for scan errors.
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 void scan_ok(TableScannerAsync *scanner, ScanCellsPtr &scancells)
Callback method for successful scan.
virtual void update_error(TableMutatorAsync *mutator, int error, FailedMutations &failures)=0
Callback method for update errors.
virtual void update_ok(TableMutatorAsync *mutator)=0
Callback method for successful update.
void update_without_index(const Cell &cell)
virtual void scan_ok(TableScannerAsync *scanner, ScanCellsPtr &cells)=0
Callback method for successful scan.
virtual void update_error(TableMutatorAsync *mutator, int error, FailedMutations &failures)
Callback method for update errors.
std::pair< String, int > FailedRow
ResultCallback * m_original_cb
void buffer_key(Key &key, const void *value, uint32_t value_len)
buffers a cell in the cellbuffer and the keymap
virtual void scan_error(TableScannerAsync *scanner, int error, const std::string &error_msg, bool eos)
Callback method for scan errors.
ResultCallback for secondary indices; used by TableMutatorAsync.
Provides access to internal components of opaque key.
std::multimap< const char *, Cell, ltStringPtr > KeyMap
TableMutatorAsync * m_primary_mutator
void consume_keybuffer(TableMutatorAsync *mutator)
uint8_t column_family_code
void add(const Cell &cell, bool own=true)
CellsBuilder m_cellbuffer
std::vector< FailedRow > m_failed_rows
Encapsulates decomposed key and value.
const char * column_qualifier
Represents an open table.
virtual ~IndexMutatorCallback()
std::vector< FailedMutation > FailedMutations