You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2020/01/16 17:11:59 UTC

[kudu] branch master updated (8463663 -> b924d18)

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git.


    from 8463663  [python] Fix Python 3 syntax issues
     new 50ac527  [consensus] simplify RpcPeerProxy a bit
     new b924d18  [build] Fix IWYU script

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build-support/iwyu.py                 |  4 ++--
 src/kudu/consensus/consensus_peers.cc | 13 ++++++-------
 src/kudu/consensus/consensus_peers.h  |  4 ++--
 3 files changed, 10 insertions(+), 11 deletions(-)


[kudu] 02/02: [build] Fix IWYU script

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit b924d18850cbf7fe98402265a0305acab32937fc
Author: Grant Henke <gr...@apache.org>
AuthorDate: Thu Jan 16 10:29:15 2020 -0600

    [build] Fix IWYU script
    
    This is a follow up to 965e59f to fix iwyu.py
    
    Change-Id: I8a6c05ad2a715887dd50e05df8fc83ed3cd4e72f
    Reviewed-on: http://gerrit.cloudera.org:8080/15052
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
 build-support/iwyu.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-support/iwyu.py b/build-support/iwyu.py
index 06efbbb..9af043b 100755
--- a/build-support/iwyu.py
+++ b/build-support/iwyu.py
@@ -18,7 +18,7 @@
 # under the License.
 
 from __future__ import print_function
-from io import BytesIO
+from io import StringIO
 import glob
 import json
 import logging
@@ -175,7 +175,7 @@ def _do_iwyu(flags, paths):
     logging.info("Dumping iwyu output to %s", flags.dump_iwyu_output)
     with open(flags.dump_iwyu_output, "w") as f:
       print(iwyu_output, file=f)
-  stream = BytesIO(iwyu_output)
+  stream = StringIO(iwyu_output)
   fixer_flags = _get_fixer_flags(flags)
 
   # Passing None as 'fix_paths' tells the fixer script to process


[kudu] 01/02: [consensus] simplify RpcPeerProxy a bit

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 50ac527ec1b046884eade2216f28dc3893eef95d
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Wed Jan 15 19:31:40 2020 -0800

    [consensus] simplify RpcPeerProxy a bit
    
    It's a small clean-up on the RpcPeerProxy class to avoid
    an extra call to operator new while preparing its HostPort
    parameter at call sites.
    
    Change-Id: Ie3185142ee16130f66609e88bcd3439956961c2e
    Reviewed-on: http://gerrit.cloudera.org:8080/15049
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 src/kudu/consensus/consensus_peers.cc | 13 ++++++-------
 src/kudu/consensus/consensus_peers.h  |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/kudu/consensus/consensus_peers.cc b/src/kudu/consensus/consensus_peers.cc
index 5cd12f0..554ff4d 100644
--- a/src/kudu/consensus/consensus_peers.cc
+++ b/src/kudu/consensus/consensus_peers.cc
@@ -27,7 +27,6 @@
 #include <vector>
 
 #include <gflags/gflags.h>
-#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 
 #include "kudu/common/common.pb.h"
@@ -510,9 +509,9 @@ Peer::~Peer() {
   request_.mutable_ops()->ExtractSubrange(0, request_.ops_size(), nullptr);
 }
 
-RpcPeerProxy::RpcPeerProxy(gscoped_ptr<HostPort> hostport,
+RpcPeerProxy::RpcPeerProxy(HostPort hostport,
                            gscoped_ptr<ConsensusServiceProxy> consensus_proxy)
-    : hostport_(std::move(DCHECK_NOTNULL(hostport))),
+    : hostport_(std::move(hostport)),
       consensus_proxy_(std::move(DCHECK_NOTNULL(consensus_proxy))) {
 }
 
@@ -548,7 +547,7 @@ void RpcPeerProxy::StartTabletCopyAsync(const StartTabletCopyRequestPB& request,
 }
 
 string RpcPeerProxy::PeerName() const {
-  return hostport_->ToString();
+  return hostport_.ToString();
 }
 
 namespace {
@@ -579,11 +578,11 @@ RpcPeerProxyFactory::RpcPeerProxyFactory(shared_ptr<Messenger> messenger,
 
 Status RpcPeerProxyFactory::NewProxy(const RaftPeerPB& peer_pb,
                                      gscoped_ptr<PeerProxy>* proxy) {
-  gscoped_ptr<HostPort> hostport(new HostPort);
-  RETURN_NOT_OK(HostPortFromPB(peer_pb.last_known_addr(), hostport.get()));
+  HostPort hostport;
+  RETURN_NOT_OK(HostPortFromPB(peer_pb.last_known_addr(), &hostport));
   gscoped_ptr<ConsensusServiceProxy> new_proxy;
   RETURN_NOT_OK(CreateConsensusServiceProxyForHost(
-      *hostport, messenger_, dns_resolver_, &new_proxy));
+      hostport, messenger_, dns_resolver_, &new_proxy));
   proxy->reset(new RpcPeerProxy(std::move(hostport), std::move(new_proxy)));
   return Status::OK();
 }
diff --git a/src/kudu/consensus/consensus_peers.h b/src/kudu/consensus/consensus_peers.h
index acfdd8a..0b4f24b 100644
--- a/src/kudu/consensus/consensus_peers.h
+++ b/src/kudu/consensus/consensus_peers.h
@@ -251,7 +251,7 @@ class PeerProxyFactory {
 // PeerProxy implementation that does RPC calls
 class RpcPeerProxy : public PeerProxy {
  public:
-  RpcPeerProxy(gscoped_ptr<HostPort> hostport,
+  RpcPeerProxy(HostPort hostport,
                gscoped_ptr<ConsensusServiceProxy> consensus_proxy);
 
   void UpdateAsync(const ConsensusRequestPB& request,
@@ -277,7 +277,7 @@ class RpcPeerProxy : public PeerProxy {
   std::string PeerName() const override;
 
  private:
-  gscoped_ptr<HostPort> hostport_;
+  const HostPort hostport_;
   gscoped_ptr<ConsensusServiceProxy> consensus_proxy_;
 };