MCPcopy Create free account
hub / github.com/apache/arrow / CreateNewSession

Method CreateNewSession

cpp/src/arrow/flight/sql/server_session_middleware.cc:179–192  ·  view source on GitHub ↗

\brief Get a new, empty session option map & its id key; {"",NULLPTR} on collision.

Source from the content-addressed store, hash-verified

177
178/// \brief Get a new, empty session option map & its id key; {"",NULLPTR} on collision.
179std::pair<std::string, std::shared_ptr<FlightSession>>
180ServerSessionMiddlewareFactory::CreateNewSession() {
181 auto new_id = id_generator_();
182 auto session = std::make_shared<FlightSession>();
183
184 const std::lock_guard<std::shared_mutex> l(session_store_lock_);
185 if (session_store_.count(new_id)) {
186 // Collision
187 return {"", NULLPTR};
188 }
189 session_store_[new_id] = session;
190
191 return {new_id, session};
192}
193
194Status ServerSessionMiddlewareFactory::CloseSession(std::string id) {
195 const std::lock_guard<std::shared_mutex> l(session_store_lock_);

Callers 1

GetSessionMethod · 0.80

Calls 1

countMethod · 0.45

Tested by

no test coverage detected