| 497 | } |
| 498 | |
| 499 | void ScannerImpl::AsyncReadAck(std::shared_ptr<NotifyCell> notify_cell) { |
| 500 | VLOG(12) << "[time] Check ACK start. [cf:qu] " << notify_cell->observed_column.family |
| 501 | << notify_cell->observed_column.qualifier; |
| 502 | |
| 503 | const std::string& ack_qualifier_prefix = GetAckQualifierPrefix( |
| 504 | notify_cell->observed_column.family, notify_cell->observed_column.qualifier); |
| 505 | |
| 506 | // use transaction to read column Ack |
| 507 | std::shared_ptr<tera::Transaction> row_transaction( |
| 508 | notify_cell->table->StartRowTransaction(notify_cell->row)); |
| 509 | NotificationContext* context = new NotificationContext(); |
| 510 | |
| 511 | // read Acks |
| 512 | tera::RowReader* row_reader = notify_cell->table->NewRowReader(notify_cell->row); |
| 513 | |
| 514 | const std::string& ack_qualifier = |
| 515 | GetAckQualifier(ack_qualifier_prefix, notify_cell->observer->GetObserverName()); |
| 516 | context->ack_qualifier = ack_qualifier; |
| 517 | |
| 518 | row_reader->AddColumn(notify_cell->observed_column.family, ack_qualifier); |
| 519 | |
| 520 | context->notify_cell = notify_cell; |
| 521 | context->scanner_impl = this; |
| 522 | context->ack_transaction = row_transaction; |
| 523 | row_reader->SetContext(context); |
| 524 | row_reader->SetCallBack([](RowReader* ack_reader) { |
| 525 | NotificationContext* context = (NotificationContext*)(ack_reader->GetContext()); |
| 526 | if (!context->scanner_impl->quit_) { |
| 527 | context->scanner_impl->transaction_callback_threads_->AddTask( |
| 528 | std::bind(&ScannerImpl::ValidateAckConfict, context->scanner_impl, ack_reader)); |
| 529 | } else { |
| 530 | // call auto unlocker |
| 531 | delete context; |
| 532 | context = NULL; |
| 533 | delete ack_reader; |
| 534 | } |
| 535 | }); |
| 536 | |
| 537 | row_transaction->Get(row_reader); |
| 538 | } |
| 539 | |
| 540 | std::string ScannerImpl::GetAckQualifierPrefix(const std::string& family, |
| 541 | const std::string& qualifier) const { |
nothing calls this directly
no test coverage detected