MCPcopy Create free account
hub / github.com/baidu/tera / AsyncReadCell

Method AsyncReadCell

src/observer/executor/scanner_impl.cc:431–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void 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
463void ScannerImpl::GetObserveColumns(const std::string& table_name,
464 std::set<Column>* observe_columns) {

Callers

nothing calls this directly

Calls 8

AddTaskMethod · 0.80
NewRowReaderMethod · 0.45
AddColumnMethod · 0.45
SetContextMethod · 0.45
SetCallBackMethod · 0.45
GetContextMethod · 0.45
getMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected