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

Method Scan

src/benchmark/mark.cc:425–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425void Adapter::Scan(const std::string& start_key, const std::string& end_key,
426 const std::vector<std::string>& cf_list, bool print, bool is_async) {
427 tera::ScanDescriptor scan_desp(start_key);
428 scan_desp.SetEnd(end_key);
429 scan_desp.SetBufferSize(FLAGS_buf_size);
430 for (size_t i = 0; i < cf_list.size(); i++) {
431 scan_desp.AddColumnFamily(cf_list[i]);
432 }
433 tera::ErrorCode err;
434 tera::ResultStream* result = table_->Scan(scan_desp, &err);
435 if (result == NULL) {
436 std::cerr << "fail to scan: " << tera::strerr(err);
437 return;
438 }
439
440 uint64_t count = 0;
441 while (!result->Done()) {
442 if (print) {
443 std::cerr << count++ << "\t" << result->RowName() << "\t" << result->Family() << "\t"
444 << result->Qualifier() << "\t" << result->Timestamp() << "\t" << result->Value()
445 << std::endl;
446 }
447 size_t size = result->RowName().size() + result->Family().size() + result->Qualifier().size() +
448 sizeof(result->Timestamp()) + result->Value().size();
449 scan_marker_.OnFinish(size, 0);
450 scan_marker_.OnSuccess(size, 0);
451 result->Next();
452 }
453 delete result;
454}
455
456void Adapter::WaitComplete() {
457 pthread_mutex_lock(&mutex_);

Callers 4

mainFunction · 0.45
GetCustomerMethod · 0.45
OrderStatusTxnMethod · 0.45
DeliveryTxnMethod · 0.45

Calls 14

strerrFunction · 0.85
OnSuccessMethod · 0.80
SetEndMethod · 0.45
SetBufferSizeMethod · 0.45
sizeMethod · 0.45
AddColumnFamilyMethod · 0.45
DoneMethod · 0.45
RowNameMethod · 0.45
FamilyMethod · 0.45
QualifierMethod · 0.45
TimestampMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected