impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tarmstr...@apache.org
Subject [2/6] impala git commit: IMPALA-6269: Cherry-pick dependency change for KRPC
Date Wed, 14 Feb 2018 01:09:05 GMT
IMPALA-6269: Cherry-pick dependency change for KRPC

Expose RPC method info map and various metrics

These changes are needed for IMPALA-6269.

Change-Id: I8bda390ea92cceb0d696767402c978a83b386825
Reviewed-on: http://gerrit.cloudera.org:8080/9269
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
Reviewed-by: Todd Lipcon <todd@apache.org>
Reviewed-on: http://gerrit.cloudera.org:8080/9287
Reviewed-by: Lars Volker <lv@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/92c1a485
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/92c1a485
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/92c1a485

Branch: refs/heads/2.x
Commit: 92c1a4855c29b50c768685909c6f0301e067973e
Parents: 4e29a7f
Author: Lars Volker <lv@cloudera.com>
Authored: Mon Feb 12 14:46:19 2018 -0800
Committer: Impala Public Jenkins <impala-public-jenkins@gerrit.cloudera.org>
Committed: Tue Feb 13 07:44:19 2018 +0000

----------------------------------------------------------------------
 be/src/kudu/rpc/acceptor_pool.cc | 4 ++++
 be/src/kudu/rpc/acceptor_pool.h  | 4 ++++
 be/src/kudu/rpc/service_if.h     | 6 +++++-
 be/src/kudu/util/metrics.h       | 4 ++++
 4 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/92c1a485/be/src/kudu/rpc/acceptor_pool.cc
----------------------------------------------------------------------
diff --git a/be/src/kudu/rpc/acceptor_pool.cc b/be/src/kudu/rpc/acceptor_pool.cc
index cbb1232..deff77b 100644
--- a/be/src/kudu/rpc/acceptor_pool.cc
+++ b/be/src/kudu/rpc/acceptor_pool.cc
@@ -134,6 +134,10 @@ Status AcceptorPool::GetBoundAddress(Sockaddr* addr) const {
   return socket_.GetSocketAddress(addr);
 }
 
+int64_t AcceptorPool::num_rpc_connections_accepted() const {
+  return rpc_connections_accepted_->value();
+}
+
 void AcceptorPool::RunThread() {
   while (true) {
     Socket new_sock;

http://git-wip-us.apache.org/repos/asf/impala/blob/92c1a485/be/src/kudu/rpc/acceptor_pool.h
----------------------------------------------------------------------
diff --git a/be/src/kudu/rpc/acceptor_pool.h b/be/src/kudu/rpc/acceptor_pool.h
index 92b7fc5..653f135 100644
--- a/be/src/kudu/rpc/acceptor_pool.h
+++ b/be/src/kudu/rpc/acceptor_pool.h
@@ -18,6 +18,7 @@
 #ifndef KUDU_RPC_ACCEPTOR_POOL_H
 #define KUDU_RPC_ACCEPTOR_POOL_H
 
+#include <stdint.h>
 #include <vector>
 
 #include "kudu/gutil/atomicops.h"
@@ -59,6 +60,9 @@ class AcceptorPool {
   // actual port that was bound.
   Status GetBoundAddress(Sockaddr* addr) const;
 
+  // Return the number of connections accepted by this messenger. Thread-safe.
+  int64_t num_rpc_connections_accepted() const;
+
  private:
   void RunThread();
 

http://git-wip-us.apache.org/repos/asf/impala/blob/92c1a485/be/src/kudu/rpc/service_if.h
----------------------------------------------------------------------
diff --git a/be/src/kudu/rpc/service_if.h b/be/src/kudu/rpc/service_if.h
index a3722c6..7846c0c 100644
--- a/be/src/kudu/rpc/service_if.h
+++ b/be/src/kudu/rpc/service_if.h
@@ -121,12 +121,16 @@ class GeneratedServiceIf : public ServiceIf {
 
   RpcMethodInfo* LookupMethod(const RemoteMethod& method) override;
 
+  // Returns the mapping from method names to method infos.
+  typedef std::unordered_map<std::string, scoped_refptr<RpcMethodInfo>> MethodInfoMap;
+  const MethodInfoMap& methods_by_name() const { return methods_by_name_; }
+
  protected:
   // For each method, stores the relevant information about how to handle the
   // call. Methods are inserted by the constructor of the generated subclass.
   // After construction, this map is accessed by multiple threads and therefore
   // must not be modified.
-  std::unordered_map<std::string, scoped_refptr<RpcMethodInfo>> methods_by_name_;
+  MethodInfoMap methods_by_name_;
 
   // The result tracker for this service's methods.
   scoped_refptr<ResultTracker> result_tracker_;

http://git-wip-us.apache.org/repos/asf/impala/blob/92c1a485/be/src/kudu/util/metrics.h
----------------------------------------------------------------------
diff --git a/be/src/kudu/util/metrics.h b/be/src/kudu/util/metrics.h
index 8aeaf93..0db08ee 100644
--- a/be/src/kudu/util/metrics.h
+++ b/be/src/kudu/util/metrics.h
@@ -987,6 +987,10 @@ class Histogram : public Metric {
   Status GetHistogramSnapshotPB(HistogramSnapshotPB* snapshot,
                                 const MetricJsonOptions& opts) const;
 
+  // Returns a pointer to the underlying histogram. The implementation of HdrHistogram
+  // is thread safe.
+  const HdrHistogram* histogram() const { return histogram_.get(); }
+
   uint64_t CountInBucketForValueForTests(uint64_t value) const;
   uint64_t MinValueForTests() const;
   uint64_t MaxValueForTests() const;


Mime
View raw message