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

Method DoScheduleRpc

src/tabletnode/remote_tabletnode.cc:764–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762}
763
764void RemoteTabletNode::DoScheduleRpc(RpcSchedule* rpc_schedule) {
765 RpcTask* rpc = NULL;
766 bool status = rpc_schedule->DequeueRpc(&rpc);
767 CHECK(status);
768 std::string table_name;
769
770 switch (rpc->rpc_type) {
771 case RPC_READ: {
772 ReadRpc* read_rpc = (ReadRpc*)rpc;
773 table_name = read_rpc->request->tablet_name();
774 DoReadTablet(read_rpc->controller, read_rpc->start_micros, read_rpc->request,
775 read_rpc->response, read_rpc->done, read_rpc->timer);
776 } break;
777 case RPC_SCAN: {
778 ScanRpc* scan_rpc = (ScanRpc*)rpc;
779 table_name = scan_rpc->request->table_name();
780 scan_pending_counter.Dec();
781 DoScanTablet(scan_rpc->controller, scan_rpc->request, scan_rpc->response, scan_rpc->done);
782 } break;
783 default:
784 abort();
785 }
786
787 delete rpc;
788 status = rpc_schedule->FinishRpc(table_name);
789 CHECK(status);
790}
791
792} // namespace tabletnode
793} // namespace tera

Callers

nothing calls this directly

Calls 3

DequeueRpcMethod · 0.80
DecMethod · 0.80
FinishRpcMethod · 0.80

Tested by

no test coverage detected