You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Henry Robinson (Code Review)" <ge...@cloudera.org> on 2016/07/20 00:03:46 UTC
[Impala-CR](cdh5-trunk) IMPALA-3873: Add QueryStateAccessor
Henry Robinson has uploaded a new change for review.
http://gerrit.cloudera.org:8080/3678
Change subject: IMPALA-3873: Add QueryStateAccessor
......................................................................
IMPALA-3873: Add QueryStateAccessor
In-flight and completed queries are tracked by different data structures
in ImpalaServer. However, we often want to access both in the same way,
by reading various bits of query metadata that are common to both. This
would involve special-case logic depending on what state the query was
in.
This patch adds ImpalaServer::QueryStateAccessor which wraps either a
QueryExecState or a QueryStateRecord and provides a common struct-like
interface to both. This is mostly useful for the debug webpages that use
these accessors to generate JSON for the query tables etc.
Change-Id: Iec3dae66a81988c99cde1516ff511186e17dd8c0
---
M be/src/service/CMakeLists.txt
M be/src/service/impala-http-handler.cc
M be/src/service/impala-server.cc
M be/src/service/impala-server.h
A be/src/service/query-state-accessor.cc
A be/src/service/query-state-accessor.h
M www/query_detail_tabs.tmpl
7 files changed, 319 insertions(+), 138 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/78/3678/1
--
To view, visit http://gerrit.cloudera.org:8080/3678
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec3dae66a81988c99cde1516ff511186e17dd8c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Henry Robinson <he...@cloudera.com>
[Impala-CR](cdh5-trunk) IMPALA-3873: Add QueryStateAccessor
Posted by "Henry Robinson (Code Review)" <ge...@cloudera.org>.
Henry Robinson has posted comments on this change.
Change subject: IMPALA-3873: Add QueryStateAccessor
......................................................................
Patch Set 1:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/3678/1/be/src/service/query-state-accessor.cc
File be/src/service/query-state-accessor.cc:
PS1, Line 56: Copied by value
> Why go with copy by value? It seems like there's a lot of stuff to copy in
the answer is the second part of this sentence:
"to ensure that its contents are accessible for the lifetime of this accessor".
There are other options, but none seem particularly attractive.
--
To view, visit http://gerrit.cloudera.org:8080/3678
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iec3dae66a81988c99cde1516ff511186e17dd8c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-CR](cdh5-trunk) IMPALA-3873: Add QueryStateAccessor
Posted by "Henry Robinson (Code Review)" <ge...@cloudera.org>.
Henry Robinson has posted comments on this change.
Change subject: IMPALA-3873: Add QueryStateAccessor
......................................................................
Patch Set 1:
(5 comments)
Moved to http://gerrit.cloudera.org:8080/3851
http://gerrit.cloudera.org:8080/#/c/3678/1/be/src/service/query-state-accessor.cc
File be/src/service/query-state-accessor.cc:
Line 27: virtual const std::string profile_str() const { return record_.profile_str; }
> It's a little unfortunate that we have to copy these profiles strings again
It is a bit unfortunate, but most of the time reads of a QueryRecord through this interface are done out of the critical path of any query, so probably not worth optimizing just yet.
PS1, Line 29: TUniqueId
> Why return by ref? This should be cheap to copy.
Done
PS1, Line 56: Copied by value
> It seems possibly better to use shared_ptr for QueryStateRecords to avoid t
Agreed, not worth doing for now.
http://gerrit.cloudera.org:8080/#/c/3678/1/be/src/service/query-state-accessor.h
File be/src/service/query-state-accessor.h:
Line 30: /// safe.
> We should document that values that are returned by reference are only guar
Done
http://gerrit.cloudera.org:8080/#/c/3678/1/www/query_detail_tabs.tmpl
File www/query_detail_tabs.tmpl:
Line 10:
> ?
Done
--
To view, visit http://gerrit.cloudera.org:8080/3678
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iec3dae66a81988c99cde1516ff511186e17dd8c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-CR](cdh5-trunk) IMPALA-3873: Add QueryStateAccessor
Posted by "Sailesh Mukil (Code Review)" <ge...@cloudera.org>.
Sailesh Mukil has posted comments on this change.
Change subject: IMPALA-3873: Add QueryStateAccessor
......................................................................
Patch Set 1:
(2 comments)
This change makes the code a lot cleaner and easy to understand. Thanks for doing this.
http://gerrit.cloudera.org:8080/#/c/3678/1/be/src/service/impala-server.h
File be/src/service/impala-server.h:
PS1, Line 486: /// The number of scan ranges that have completed
: int64_t num_complete_scan_ranges;
:
: /// The total number of scan ranges.
: int64_t total_scan_ranges;
These were previously misnomers right?
Maybe add that in the commit message.
http://gerrit.cloudera.org:8080/#/c/3678/1/be/src/service/query-state-accessor.cc
File be/src/service/query-state-accessor.cc:
PS1, Line 56: Copied by value
Why go with copy by value? It seems like there's a lot of stuff to copy in a QueryStateRecord.
--
To view, visit http://gerrit.cloudera.org:8080/3678
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iec3dae66a81988c99cde1516ff511186e17dd8c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-CR](cdh5-trunk) IMPALA-3873: Add QueryStateAccessor
Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.
Change subject: IMPALA-3873: Add QueryStateAccessor
......................................................................
Patch Set 1:
(5 comments)
Design makes sense to me, only had some minor comments.
http://gerrit.cloudera.org:8080/#/c/3678/1/be/src/service/query-state-accessor.cc
File be/src/service/query-state-accessor.cc:
Line 27: virtual const std::string profile_str() const { return record_.profile_str; }
It's a little unfortunate that we have to copy these profiles strings again when returning them. Probably not worth worrying about though.
PS1, Line 29: TUniqueId
Why return by ref? This should be cheap to copy.
PS1, Line 56: Copied by value
> the answer is the second part of this sentence:
It seems possibly better to use shared_ptr for QueryStateRecords to avoid the copy, since QueryStateRecord is an immutable struct (if I understand correctly)
Not sure if this is worth optimising though to be honest.
http://gerrit.cloudera.org:8080/#/c/3678/1/be/src/service/query-state-accessor.h
File be/src/service/query-state-accessor.h:
Line 30: /// safe.
We should document that values that are returned by reference are only guaranteed to be valid as long as the QueryStateAccessor is valid.
http://gerrit.cloudera.org:8080/#/c/3678/1/www/query_detail_tabs.tmpl
File www/query_detail_tabs.tmpl:
Line 10:
?
--
To view, visit http://gerrit.cloudera.org:8080/3678
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iec3dae66a81988c99cde1516ff511186e17dd8c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-CR](cdh5-trunk) IMPALA-3873: Add QueryStateAccessor
Posted by "Henry Robinson (Code Review)" <ge...@cloudera.org>.
Henry Robinson has abandoned this change.
Change subject: IMPALA-3873: Add QueryStateAccessor
......................................................................
Abandoned
Moved to http://gerrit.cloudera.org:8080/3851
--
To view, visit http://gerrit.cloudera.org:8080/3678
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: Iec3dae66a81988c99cde1516ff511186e17dd8c0
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sa...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>