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

Method UnregisterQuery

be/src/service/impala-server.cc:1761–1795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1759}
1760
1761Status ImpalaServer::UnregisterQuery(
1762 const TUniqueId& query_id, const Status* cause, bool interrupted) {
1763 VLOG_QUERY << "UnregisterQuery(): query_id=" << PrintId(query_id);
1764
1765 QueryHandle query_handle;
1766 // Skips updating RPCs since we'll finalize them right after, and this avoids
1767 // acquiring a ClientRequestState lock.
1768 RETURN_IF_ERROR(GetActiveQueryHandle(query_id, &query_handle, /* skip_rpcs */ true));
1769
1770 DebugActionNoFail(query_handle->query_options(), "FINALIZE_INFLIGHT_QUERY");
1771
1772 if (interrupted) {
1773 // Register interrupted query status with the session.
1774 shared_ptr<SessionState> session = query_handle->session();
1775 lock_guard<mutex> l(session->lock);
1776 if (!session->closed) {
1777 lock_guard<mutex> l(interrupted_query_statuses_lock_);
1778 interrupted_query_statuses_.emplace(query_id, *cause);
1779 session->interrupted_queries.emplace_back(query_id);
1780 }
1781 }
1782
1783 // Do the work of unregistration that needs to be done synchronously. Once
1784 // Finalize() returns, the query is considered unregistered from the client's point of
1785 // view. If Finalize() returns OK, this thread is responsible for doing the
1786 // unregistration work. Finalize() succeeds for the first thread to call it to avoid
1787 // multiple threads unregistering.
1788 RETURN_IF_ERROR(
1789 query_handle.query_driver()->Finalize(&query_handle, cause));
1790
1791 // Do the rest of the unregistration work in the background so that the client does
1792 // not need to wait for profile serialization, etc.
1793 unreg_thread_pool_->Offer(move(query_handle));
1794 return Status::OK();
1795}
1796
1797void ImpalaServer::FinishUnregisterQuery(const QueryHandle& query_handle) {
1798 DCHECK_EQ(this, ExecEnv::GetInstance()->impala_server());

Callers 2

CancelMethod · 0.80
CancelQueryHandlerMethod · 0.80

Calls 7

PrintIdFunction · 0.85
DebugActionNoFailFunction · 0.85
moveFunction · 0.85
OKFunction · 0.85
OfferMethod · 0.80
sessionMethod · 0.45
FinalizeMethod · 0.45

Tested by

no test coverage detected