| 1931 | } |
| 1932 | |
| 1933 | shared_ptr<QueryDriver> ImpalaServer::GetQueryDriver( |
| 1934 | const TUniqueId& query_id, bool return_unregistered) { |
| 1935 | DCHECK_EQ(this, ExecEnv::GetInstance()->impala_server()); |
| 1936 | ScopedShardedMapRef<shared_ptr<QueryDriver>> map_ref(query_id, &query_driver_map_); |
| 1937 | DCHECK(map_ref.get() != nullptr); |
| 1938 | |
| 1939 | auto entry = map_ref->find(query_id); |
| 1940 | if (entry == map_ref->end()) return shared_ptr<QueryDriver>(); |
| 1941 | |
| 1942 | // This started_unregister() check can race with unregistration. It cannot prevent |
| 1943 | // unregistration starting immediately after the value is loaded. This check, however, |
| 1944 | // is sufficient to ensure that after a client operation has unregistered the request, |
| 1945 | // subsequent operations won't spuriously find the request. |
| 1946 | if (!return_unregistered && entry->second->finalized()) { |
| 1947 | return shared_ptr<QueryDriver>(); |
| 1948 | } |
| 1949 | return entry->second; |
| 1950 | } |
| 1951 | |
| 1952 | Status ImpalaServer::GetInterruptedStatus(const TUniqueId& query_id) { |
| 1953 | lock_guard<mutex> l(interrupted_query_statuses_lock_); |
no test coverage detected