| 1518 | } |
| 1519 | |
| 1520 | Status ImpalaServer::RegisterQuery(const TUniqueId& query_id, |
| 1521 | const shared_ptr<SessionState>& session_state, QueryHandle* query_handle) { |
| 1522 | lock_guard<mutex> l2(session_state->lock); |
| 1523 | // The session wasn't expired at the time it was checked out and it isn't allowed to |
| 1524 | // expire while checked out, so it must not be expired. |
| 1525 | DCHECK_GT(session_state->ref_count, 0); |
| 1526 | DCHECK(!session_state->expired); |
| 1527 | // The session may have been closed after it was checked out. |
| 1528 | if (session_state->closed) { |
| 1529 | VLOG(1) << "RegisterQuery(): session has been closed, ignoring query."; |
| 1530 | return Status::Expected("Session has been closed, ignoring query."); |
| 1531 | } |
| 1532 | DCHECK_EQ(this, ExecEnv::GetInstance()->impala_server()); |
| 1533 | RETURN_IF_ERROR(query_driver_map_.Add(query_id, query_handle->query_driver())); |
| 1534 | // Metric is decremented in UnregisterQuery(). |
| 1535 | ImpaladMetrics::NUM_QUERIES_REGISTERED->Increment(1L); |
| 1536 | VLOG_QUERY << "Registered query query_id=" << PrintId(query_id) << " session_id=" |
| 1537 | << PrintId(session_state->session_id); |
| 1538 | return Status::OK(); |
| 1539 | } |
| 1540 | |
| 1541 | static inline int32_t GetIdleTimeout(const TQueryOptions& query_options) { |
| 1542 | int32_t idle_timeout_s = query_options.query_timeout_s; |
no test coverage detected