| 429 | } |
| 430 | |
| 431 | void ScannerImpl::AsyncReadCell(std::shared_ptr<NotifyCell> notify_cell) { |
| 432 | VLOG(12) << "[time] do read value start. [row] " << notify_cell->row << " cf:qu " |
| 433 | << notify_cell->observed_column.family << ":" << notify_cell->observed_column.qualifier; |
| 434 | tera::RowReader* value_reader = notify_cell->table->NewRowReader(notify_cell->row); |
| 435 | assert(value_reader != NULL); |
| 436 | value_reader->AddColumn(notify_cell->observed_column.family, |
| 437 | notify_cell->observed_column.qualifier); |
| 438 | // transaction read |
| 439 | NotificationContext* context = new NotificationContext(); |
| 440 | context->notify_cell = notify_cell; |
| 441 | context->scanner_impl = this; |
| 442 | |
| 443 | value_reader->SetContext(context); |
| 444 | value_reader->SetCallBack([](RowReader* value_reader) { |
| 445 | NotificationContext* context = (NotificationContext*)(value_reader->GetContext()); |
| 446 | if (!context->scanner_impl->quit_) { |
| 447 | context->scanner_impl->transaction_callback_threads_->AddTask( |
| 448 | std::bind(&ScannerImpl::ValidateCellValue, context->scanner_impl, value_reader)); |
| 449 | } else { |
| 450 | // call auto unlocker |
| 451 | delete context; |
| 452 | context = NULL; |
| 453 | delete value_reader; |
| 454 | } |
| 455 | }); |
| 456 | if (notify_cell->notify_transaction.get()) { |
| 457 | notify_cell->notify_transaction->Get(value_reader); |
| 458 | } else { |
| 459 | notify_cell->table->Get(value_reader); |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | void ScannerImpl::GetObserveColumns(const std::string& table_name, |
| 464 | std::set<Column>* observe_columns) { |
nothing calls this directly
no test coverage detected