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

Method createContext

be/src/rpc/thrift-server.cc:204–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void* ThriftServer::ThriftServerEventProcessor::createContext(
205 std::shared_ptr<TProtocol> input, std::shared_ptr<TProtocol> output) {
206 std::shared_ptr<ConnectionContext> connection_ptr =
207 std::shared_ptr<ConnectionContext>(new ConnectionContext);
208 thrift_server_->auth_provider_->SetupConnectionContext(connection_ptr,
209 thrift_server_->transport_type_, input->getTransport().get(),
210 output->getTransport().get());
211
212 {
213 connection_ptr->server_name = thrift_server_->name_;
214
215 lock_guard<mutex> l(thrift_server_->connection_contexts_lock_);
216 uuid connection_uuid = thrift_server_->uuid_generator_();
217 UUIDToTUniqueId(connection_uuid, &connection_ptr->connection_id);
218
219 // Add the connection to the connection map.
220 __connection_context__ = connection_ptr.get();
221 thrift_server_->connection_contexts_[connection_ptr.get()] = connection_ptr;
222 }
223
224 if (thrift_server_->connection_handler_ != NULL) {
225 thrift_server_->connection_handler_->ConnectionStart(*__connection_context__);
226 }
227
228 if (thrift_server_->metrics_enabled_) {
229 thrift_server_->num_current_connections_metric_->Increment(1L);
230 thrift_server_->total_connections_metric_->Increment(1L);
231 }
232
233 // Store the __connection_context__ in the per-client context. If only this were
234 // accessible from RPC method calls, we wouldn't have to
235 // mess around with thread locals.
236 return (void*)__connection_context__;
237}
238
239void ThriftServer::ThriftServerEventProcessor::processContext(void* context,
240 std::shared_ptr<TTransport> transport) {

Callers 1

runMethod · 0.45

Calls 6

UUIDToTUniqueIdFunction · 0.85
ConnectionStartMethod · 0.80
getMethod · 0.65
getTransportMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected