example qualifier: C:url C: cf; column: url;
| 397 | // example qualifier: C:url |
| 398 | // C: cf; column: url; |
| 399 | bool ScannerImpl::ParseNotifyQualifier(const std::string& notify_qualifier, |
| 400 | std::string* data_family, std::string* data_qualifier) { |
| 401 | std::vector<std::string> frags; |
| 402 | std::size_t pos = std::string::npos; |
| 403 | std::size_t start_pos = 0; |
| 404 | std::string frag; |
| 405 | |
| 406 | // parse cf |
| 407 | pos = notify_qualifier.find_first_of(':', start_pos); |
| 408 | if (pos == std::string::npos) { |
| 409 | LOG(ERROR) << "Parse notify qualifier error: " << notify_qualifier; |
| 410 | return false; |
| 411 | } |
| 412 | frag = notify_qualifier.substr(start_pos, pos - start_pos); |
| 413 | frags.push_back(frag); |
| 414 | start_pos = pos + 1; |
| 415 | |
| 416 | pos = notify_qualifier.size(); |
| 417 | frag = notify_qualifier.substr(start_pos, pos - start_pos); |
| 418 | frags.push_back(frag); |
| 419 | if (2 != frags.size()) { |
| 420 | return false; |
| 421 | } |
| 422 | if (frags[0] == "" || frags[1] == "") { |
| 423 | return false; |
| 424 | } |
| 425 | *data_family = frags[0]; |
| 426 | *data_qualifier = frags[1]; |
| 427 | |
| 428 | return true; |
| 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 " |