You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2026/10/16 05:45:35 UTC

(kudu) branch master updated: [rpc] remove unused/dead methods

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 10c354f6a [rpc] remove unused/dead methods
10c354f6a is described below

commit 10c354f6a2d3375caf1e686547f54cbf3b875c0d
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Thu Oct 15 19:17:11 2026 -0700

    [rpc] remove unused/dead methods
    
    The analysis was performed by running
    
      ollama run qwen3.8:27b-mxfp8
    
    locally on MacBookPro M5 with the prompt below followed by
    the contents of source files under $KUDU_HOME/src/kudu/rpc:
    
      Analyze the C++ source code below and find unused methods/functions.
    
    This changelist doesn't contain any functional modifications.
    
    Change-Id: I223b6eb745cef65b2dff417e9d839115290115ea
    Reviewed-on: http://gerrit.cloudera.org:8080/25138
    Reviewed-by: Zoltan Martonka <zm...@cloudera.com>
    Tested-by: Zoltan Martonka <zm...@cloudera.com>
---
 src/kudu/rpc/client_negotiation.h |  8 +-------
 src/kudu/rpc/messenger.h          |  2 --
 src/kudu/rpc/sasl_common.cc       | 10 ----------
 src/kudu/rpc/sasl_common.h        | 10 ++--------
 src/kudu/rpc/server_negotiation.h |  8 +-------
 src/kudu/rpc/transfer.cc          |  8 --------
 src/kudu/rpc/transfer.h           |  4 ----
 7 files changed, 4 insertions(+), 46 deletions(-)

diff --git a/src/kudu/rpc/client_negotiation.h b/src/kudu/rpc/client_negotiation.h
index d867d74ac..c48350e18 100644
--- a/src/kudu/rpc/client_negotiation.h
+++ b/src/kudu/rpc/client_negotiation.h
@@ -95,15 +95,9 @@ class ClientNegotiation {
     return tls_negotiated_;
   }
 
-  // Returns the set of RPC system features supported by the remote server.
-  // Must be called before Negotiate().
-  std::set<RpcFeatureFlag> server_features() const {
-    return server_features_;
-  }
-
   // Returns the set of RPC system features supported by the remote server.
   // Must be called after Negotiate().
-  // Subsequent calls to this method or server_features() will return an empty set.
+  // Subsequent calls to this method will return an empty set.
   std::set<RpcFeatureFlag> take_server_features() {
     return std::move(server_features_);
   }
diff --git a/src/kudu/rpc/messenger.h b/src/kudu/rpc/messenger.h
index b8efd367c..1126742bc 100644
--- a/src/kudu/rpc/messenger.h
+++ b/src/kudu/rpc/messenger.h
@@ -488,8 +488,6 @@ class Messenger final {
 
   Reactor* RemoteToReactor(const Sockaddr& remote) const;
   Status Init();
-  void RunTimeoutThread();
-  void UpdateCurTime();
 
   // Shuts down the messenger.
   //
diff --git a/src/kudu/rpc/sasl_common.cc b/src/kudu/rpc/sasl_common.cc
index 57c877838..9fc09c4ca 100644
--- a/src/kudu/rpc/sasl_common.cc
+++ b/src/kudu/rpc/sasl_common.cc
@@ -34,7 +34,6 @@
 #include "kudu/rpc/constants.h"
 #include "kudu/security/init.h"
 #include "kudu/util/mutex.h"
-#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/rw_mutex.h"
 #include "kudu/util/stopwatch.h"
 #include "kudu/util/string_case.h"
@@ -405,15 +404,6 @@ Status SaslDecode(sasl_conn_t* conn, Slice ciphertext, Slice* plaintext) {
   return Status::OK();
 }
 
-string SaslIpPortString(const Sockaddr& addr) {
-  string addr_str = addr.ToString();
-  size_t colon_pos = addr_str.find(':');
-  if (colon_pos != string::npos) {
-    addr_str[colon_pos] = ';';
-  }
-  return addr_str;
-}
-
 set<SaslMechanism::Type> SaslListAvailableMechs() {
   set<SaslMechanism::Type> mechs;
 
diff --git a/src/kudu/rpc/sasl_common.h b/src/kudu/rpc/sasl_common.h
index b03e0a974..b8801935b 100644
--- a/src/kudu/rpc/sasl_common.h
+++ b/src/kudu/rpc/sasl_common.h
@@ -16,15 +16,14 @@
 // under the License.
 #pragma once
 
+#include <sasl/sasl.h>
+
 #include <cstddef>
 #include <cstdint>
 #include <functional>
 #include <set>
 #include <string>
 
-#include <sasl/sasl.h>
-
-#include "kudu/gutil/port.h"
 #include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 
@@ -37,8 +36,6 @@
 
 namespace kudu {
 
-class Sockaddr;
-
 namespace rpc {
 
 // Constants
@@ -104,9 +101,6 @@ Status WrapSaslCall(sasl_conn_t* conn,
                     const std::function<int()>& call,
                     const char* description);
 
-// Return <ip>;<port> string formatted for SASL library use.
-std::string SaslIpPortString(const Sockaddr& addr);
-
 // Return available plugin mechanisms for the given connection.
 std::set<SaslMechanism::Type> SaslListAvailableMechs();
 
diff --git a/src/kudu/rpc/server_negotiation.h b/src/kudu/rpc/server_negotiation.h
index 7bdaf1a80..b9f441849 100644
--- a/src/kudu/rpc/server_negotiation.h
+++ b/src/kudu/rpc/server_negotiation.h
@@ -100,13 +100,7 @@ class ServerNegotiation {
 
   // Returns the set of RPC system features supported by the remote client.
   // Must be called after Negotiate().
-  std::set<RpcFeatureFlag> client_features() const {
-    return client_features_;
-  }
-
-  // Returns the set of RPC system features supported by the remote client.
-  // Must be called after Negotiate().
-  // Subsequent calls to this method or client_features() will return an empty set.
+  // Subsequent calls to this method will return an empty set.
   std::set<RpcFeatureFlag> take_client_features() {
     return std::move(client_features_);
   }
diff --git a/src/kudu/rpc/transfer.cc b/src/kudu/rpc/transfer.cc
index c65a6d1c2..b95922674 100644
--- a/src/kudu/rpc/transfer.cc
+++ b/src/kudu/rpc/transfer.cc
@@ -300,13 +300,5 @@ string OutboundTransfer::HexDump() const {
   return ret;
 }
 
-size_t OutboundTransfer::TotalLength() const {
-  size_t ret = 0;
-  for (const auto& s : payload_slices_) {
-    ret += s.size();
-  }
-  return ret;
-}
-
 } // namespace rpc
 } // namespace kudu
diff --git a/src/kudu/rpc/transfer.h b/src/kudu/rpc/transfer.h
index bf2af31e5..ccdc75dff 100644
--- a/src/kudu/rpc/transfer.h
+++ b/src/kudu/rpc/transfer.h
@@ -17,7 +17,6 @@
 #pragma once
 
 #include <climits>
-#include <cstddef>
 #include <cstdint>
 #include <memory>
 #include <string>
@@ -154,9 +153,6 @@ class OutboundTransfer final : public boost::intrusive::list_base_hook<> {
   // Return true if the entire transfer has been sent.
   bool TransferFinished() const;
 
-  // Return the total number of bytes to be sent (including those already sent).
-  size_t TotalLength() const;
-
   std::string HexDump() const;
 
   bool is_for_outbound_call() const {