MCPcopy Create free account
hub / github.com/apache/impala / DestroyConnection

Method DestroyConnection

be/src/kudu/rpc/reactor.cc:689–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687}
688
689void ReactorThread::DestroyConnection(Connection* conn,
690 const Status& conn_status,
691 unique_ptr<ErrorStatusPB> rpc_error) {
692 DCHECK(IsCurrentThread());
693
694 conn->Shutdown(conn_status, std::move(rpc_error));
695
696 // Unlink connection from lists.
697 if (conn->direction() == Connection::CLIENT) {
698 const auto range = client_conns_.equal_range(conn->outbound_connection_id());
699 CHECK(range.first != range.second) << "Couldn't find connection " << conn->ToString();
700 // The client_conns_ container is a multi-map.
701 for (auto it = range.first; it != range.second;) {
702 if (it->second.get() == conn) {
703 it = client_conns_.erase(it);
704 break;
705 }
706 ++it;
707 }
708 } else if (conn->direction() == Connection::SERVER) {
709 auto it = server_conns_.begin();
710 while (it != server_conns_.end()) {
711 if ((*it).get() == conn) {
712 server_conns_.erase(it);
713 break;
714 }
715 ++it;
716 }
717 }
718}
719
720DelayedTask::DelayedTask(std::function<void(const Status&)> func,
721 MonoDelta when)

Callers 4

ReadHandlerMethod · 0.80
HandleIncomingCallMethod · 0.80
WriteHandlerMethod · 0.80

Calls 8

moveFunction · 0.85
directionMethod · 0.80
eraseMethod · 0.80
getMethod · 0.65
ShutdownMethod · 0.45
ToStringMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected