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

Method NextRow

src/observer/executor/scanner_impl.cc:357–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357bool ScannerImpl::NextRow(tera::ResultStream* result_stream, const std::string& table_name,
358 bool* finished, std::string* row, std::vector<Column>* notify_columns) {
359 tera::ErrorCode err;
360
361 // check finish
362 if (result_stream->Done(&err)) {
363 *finished = true;
364 return false;
365 }
366
367 if (tera::ErrorCode::kOK != err.GetType()) {
368 LOG(ERROR) << "scanning failed" << err.ToString();
369 return false;
370 }
371
372 notify_columns->clear();
373 *row = result_stream->RowName();
374
375 // scan cell
376 while (!result_stream->Done(&err) && result_stream->RowName() == *row) {
377 std::string observe_cf;
378 std::string observe_qu;
379 if (quit_) {
380 return false;
381 }
382
383 if (!ParseNotifyQualifier(result_stream->Qualifier(), &observe_cf, &observe_qu)) {
384 LOG(WARNING) << "parse notify qualifier failed: " << result_stream->Qualifier();
385 result_stream->Next();
386 continue;
387 }
388
389 Column notify_column = {table_name, observe_cf, observe_qu};
390
391 notify_columns->push_back(notify_column);
392 result_stream->Next();
393 }
394 return true;
395}
396
397// example qualifier: C:url
398// C: cf; column: url;

Callers 1

TESTFunction · 0.80

Calls 8

push_backMethod · 0.80
DoneMethod · 0.45
GetTypeMethod · 0.45
ToStringMethod · 0.45
clearMethod · 0.45
RowNameMethod · 0.45
QualifierMethod · 0.45
NextMethod · 0.45

Tested by 1

TESTFunction · 0.64