IMPALA-4102: Remote Kudu reads should be reported Adds a profile counter for the number of kudu scan tokens (ranges) that are "expected" to be remote.
Testing: Manual; Have been running with this on the Kudu cluster. Cannot easily simulate this in the minicluster because the scheduler considers multiple impalads on the same host to be local for the purposes of determining locality. See BackendConfig::LookUpBackendIp(). Change-Id: I74fd5773c4ae10267de80b6572d93197a4131696 Reviewed-on: http://gerrit.cloudera.org:8080/4687 Reviewed-by: Alex Behm <alex.b...@cloudera.com> Tested-by: Internal Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/a1c9cb36 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/a1c9cb36 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/a1c9cb36 Branch: refs/heads/master Commit: a1c9cb364655d0a65c4b00cb37757d55fc3131a1 Parents: 1a5c43e Author: Matthew Jacobs <m...@cloudera.com> Authored: Thu Sep 8 17:30:14 2016 -0700 Committer: Internal Jenkins <cloudera-hud...@gerrit.cloudera.org> Committed: Sat Oct 15 00:43:56 2016 +0000 ---------------------------------------------------------------------- be/src/exec/kudu-scan-node.cc | 5 +++++ be/src/exec/kudu-scan-node.h | 2 ++ 2 files changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/a1c9cb36/be/src/exec/kudu-scan-node.cc ---------------------------------------------------------------------- diff --git a/be/src/exec/kudu-scan-node.cc b/be/src/exec/kudu-scan-node.cc index faa093e..6e97378 100644 --- a/be/src/exec/kudu-scan-node.cc +++ b/be/src/exec/kudu-scan-node.cc @@ -62,6 +62,7 @@ namespace impala { const string KuduScanNode::KUDU_READ_TIMER = "TotalKuduReadTime"; const string KuduScanNode::KUDU_ROUND_TRIPS = "TotalKuduScanRoundTrips"; +const string KuduScanNode::KUDU_REMOTE_TOKENS = "KuduRemoteScanTokens"; KuduScanNode::KuduScanNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs) @@ -97,6 +98,7 @@ Status KuduScanNode::Prepare(RuntimeState* state) { kudu_read_timer_ = ADD_CHILD_TIMER(runtime_profile(), KUDU_READ_TIMER, SCANNER_THREAD_TOTAL_WALLCLOCK_TIME); kudu_round_trips_ = ADD_COUNTER(runtime_profile(), KUDU_ROUND_TRIPS, TUnit::UNIT); + kudu_remote_tokens_ = ADD_COUNTER(runtime_profile(), KUDU_REMOTE_TOKENS, TUnit::UNIT); DCHECK(state->desc_tbl().GetTupleDescriptor(tuple_id_) != NULL); @@ -104,9 +106,12 @@ Status KuduScanNode::Prepare(RuntimeState* state) { // Initialize the list of scan tokens to process from the TScanRangeParams. DCHECK(scan_range_params_ != NULL); + int num_remote_tokens = 0; for (const TScanRangeParams& params: *scan_range_params_) { + if (params.__isset.is_remote && params.is_remote) ++num_remote_tokens; scan_tokens_.push_back(params.scan_range.kudu_scan_token); } + COUNTER_SET(kudu_remote_tokens_, num_remote_tokens); return Status::OK(); } http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/a1c9cb36/be/src/exec/kudu-scan-node.h ---------------------------------------------------------------------- diff --git a/be/src/exec/kudu-scan-node.h b/be/src/exec/kudu-scan-node.h index b1848d7..d4f742a 100644 --- a/be/src/exec/kudu-scan-node.h +++ b/be/src/exec/kudu-scan-node.h @@ -101,8 +101,10 @@ class KuduScanNode : public ScanNode { RuntimeProfile::Counter* kudu_read_timer_; RuntimeProfile::Counter* kudu_round_trips_; + RuntimeProfile::Counter* kudu_remote_tokens_; static const std::string KUDU_READ_TIMER; static const std::string KUDU_ROUND_TRIPS; + static const std::string KUDU_REMOTE_TOKENS; /// The id of the callback added to the thread resource manager when a thread /// is available. Used to remove the callback before this scan node is destroyed.