| 262 | } |
| 263 | |
| 264 | virtual void ApplyMutation(RowMutationReplicate* mutation_rep) { |
| 265 | RowMutationReplicateImpl* mutation_rep_impl = (RowMutationReplicateImpl*)mutation_rep; |
| 266 | bool is_async = mutation_rep_impl->IsAsync(); |
| 267 | const std::vector<RowMutation*>& mutation_list = mutation_rep_impl->GetRowMutationList(); |
| 268 | const std::vector<Table*>& table_list = mutation_rep_impl->GetTableList(); |
| 269 | // in async mode, after the last call of ApplyMutation, we should not access |
| 270 | // 'mutation_rep_impl' anymore, that's why we assign the value of |
| 271 | // 'mutation_list.size()' |
| 272 | // to a local variable 'mutation_num' |
| 273 | size_t mutation_num = mutation_list.size(); |
| 274 | for (size_t i = 0; i < mutation_num; i++) { |
| 275 | table_list[i]->ApplyMutation(mutation_list[i]); |
| 276 | } |
| 277 | if (!is_async) { |
| 278 | mutation_rep_impl->Wait(); |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | virtual RowReaderReplicate* NewRowReader(const std::string& row_key) { |
| 283 | std::vector<RowReader*> row_readers; |