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

Method OpenSession

be/src/service/internal-server.cc:43–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41static const int32_t ROWS_TO_FETCH = 8192;
42
43Status ImpalaServer::OpenSession(const string& user_name, TUniqueId& new_session_id,
44 const QueryOptionMap& query_opts) {
45 shared_ptr<ThriftServer::ConnectionContext> conn_ctx =
46 make_shared<ThriftServer::ConnectionContext>();
47 conn_ctx->connection_id = RandomUniqueID();
48 conn_ctx->server_name = ImpalaServer::INTERNAL_SERVER_NAME;
49 conn_ctx->username = user_name;
50 conn_ctx->network_address.hostname = "in-memory.localhost";
51
52 ConnectionStart(*conn_ctx.get());
53
54 {
55 lock_guard<mutex> l(connection_to_sessions_map_lock_);
56 new_session_id = *connection_to_sessions_map_[conn_ctx->connection_id].cbegin();
57 }
58
59 {
60 lock_guard<mutex> l(internal_server_connections_lock_);
61 internal_server_connections_.insert(make_pair(new_session_id, conn_ctx));
62 }
63
64 shared_ptr<ImpalaServer::SessionState> session_state;
65 {
66 lock_guard<mutex> l(session_state_map_lock_);
67 session_state = session_state_map_[new_session_id];
68 }
69
70 for (const auto& iter : query_opts) {
71 RETURN_IF_ERROR(SetQueryOption(iter.first, iter.second,
72 &session_state->set_query_options, &session_state->set_query_options_mask));
73 }
74
75 MarkSessionActive(session_state);
76
77 return Status::OK();
78} // ImpalaServer::OpenSession
79
80bool ImpalaServer::CloseSession(const TUniqueId& session_id) {
81 {

Calls 4

OKFunction · 0.85
cbeginMethod · 0.80
getMethod · 0.65
insertMethod · 0.45