| 649 | } |
| 650 | |
| 651 | void RemoteTabletNode::DoReadTablet(google::protobuf::RpcController* controller, |
| 652 | int64_t start_micros, const ReadTabletRequest* request, |
| 653 | ReadTabletResponse* response, google::protobuf::Closure* done, |
| 654 | ReadRpcTimer* timer) { |
| 655 | VLOG(8) << "run RPC (ReadTablet)"; |
| 656 | int32_t row_num = request->row_info_list_size(); |
| 657 | read_pending_counter.Sub(row_num); |
| 658 | |
| 659 | bool is_read_timeout = false; |
| 660 | if (request->has_client_timeout_ms()) { |
| 661 | int64_t read_timeout = request->client_timeout_ms() * 1000; // ms -> us |
| 662 | int64_t detal = get_micros() - start_micros; |
| 663 | if (detal > read_timeout) { |
| 664 | LOG(WARNING) << "timeout, drop read request for:" << request->tablet_name() |
| 665 | << ", detal(in us):" << detal << ", read_timeout(in us):" << read_timeout; |
| 666 | is_read_timeout = true; |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | if (!is_read_timeout) { |
| 671 | tabletnode_impl_->ReadTablet(start_micros, request, response, done, read_thread_pool_.get()); |
| 672 | } else { |
| 673 | response->set_sequence_id(request->sequence_id()); |
| 674 | response->set_success_num(0); |
| 675 | response->set_status(kTableIsBusy); |
| 676 | read_reject_counter.Inc(); |
| 677 | done->Run(); |
| 678 | } |
| 679 | |
| 680 | if (NULL != timer) { |
| 681 | RpcTimerList::Instance()->Erase(timer); |
| 682 | delete timer; |
| 683 | } |
| 684 | VLOG(8) << "finish RPC (ReadTablet)"; |
| 685 | } |
| 686 | |
| 687 | void RemoteTabletNode::DoWriteTablet(google::protobuf::RpcController* controller, |
| 688 | const WriteTabletRequest* request, |
nothing calls this directly
no test coverage detected