kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [07/14] kudu git commit: [iwyu] first pass
Date Mon, 21 Aug 2017 21:03:54 GMT
http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/connection.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/connection.cc b/src/kudu/rpc/connection.cc
index c532759..f8588db 100644
--- a/src/kudu/rpc/connection.cc
+++ b/src/kudu/rpc/connection.cc
@@ -17,45 +17,43 @@
 
 #include "kudu/rpc/connection.h"
 
-#include <stdint.h>
-
 #include <algorithm>
+#include <cerrno>
+#include <cstddef>
+#include <functional>
 #include <iostream>
 #include <memory>
 #include <set>
 #include <string>
-#include <unordered_set>
-#include <vector>
+#include <type_traits>
 
+#include <boost/intrusive/detail/list_iterator.hpp>
 #include <boost/intrusive/list.hpp>
-#include <gflags/gflags.h>
+#include <ev.h>
 #include <glog/logging.h>
 
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/move.h"
+#include "kudu/util/slice.h"
 #include "kudu/gutil/strings/human_readable.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/rpc/client_negotiation.h"
-#include "kudu/rpc/constants.h"
+#include "kudu/rpc/inbound_call.h"
 #include "kudu/rpc/messenger.h"
+#include "kudu/rpc/outbound_call.h"
 #include "kudu/rpc/reactor.h"
 #include "kudu/rpc/rpc_controller.h"
 #include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/rpc/rpc_introspection.pb.h"
 #include "kudu/rpc/transfer.h"
-#include "kudu/util/debug-util.h"
-#include "kudu/util/flag_tags.h"
-#include "kudu/util/logging.h"
 #include "kudu/util/net/sockaddr.h"
 #include "kudu/util/net/socket.h"
 #include "kudu/util/status.h"
-#include "kudu/util/trace.h"
 
 using std::function;
 using std::includes;
 using std::set;
 using std::shared_ptr;
 using std::unique_ptr;
-using std::vector;
 using strings::Substitute;
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/connection.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/connection.h b/src/kudu/rpc/connection.h
index e782e0b..9413b4b 100644
--- a/src/kudu/rpc/connection.h
+++ b/src/kudu/rpc/connection.h
@@ -18,24 +18,27 @@
 #ifndef KUDU_RPC_CONNECTION_H
 #define KUDU_RPC_CONNECTION_H
 
+#include <algorithm>
 #include <cstdint>
 #include <limits>
 #include <memory>
 #include <set>
 #include <string>
 #include <unordered_map>
-#include <vector>
 
 #include <boost/intrusive/list.hpp>
 #include <ev++.h>
+#include <glog/logging.h>
 
 #include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/map-util.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/rpc/inbound_call.h"
-#include "kudu/rpc/outbound_call.h"
-#include "kudu/rpc/remote_user.h"
 #include "kudu/rpc/rpc_controller.h"
+#include "kudu/rpc/rpc_header.pb.h"
+#include "kudu/rpc/remote_user.h"
 #include "kudu/rpc/transfer.h"
+#include "kudu/rpc/user_credentials.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/net/sockaddr.h"
 #include "kudu/util/net/socket.h"
@@ -43,10 +46,12 @@
 #include "kudu/util/status.h"
 
 namespace kudu {
+
 namespace rpc {
 
 class DumpRunningRpcsRequestPB;
-class ErrorStatusPB;
+class InboundCall;
+class OutboundCall;
 class RpcConnectionPB;
 class ReactorThread;
 class RpczStore;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/connection_id.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/connection_id.cc b/src/kudu/rpc/connection_id.cc
index a17b783..1d3076d 100644
--- a/src/kudu/rpc/connection_id.cc
+++ b/src/kudu/rpc/connection_id.cc
@@ -17,7 +17,10 @@
 
 #include "kudu/rpc/connection_id.h"
 
-#include <boost/functional/hash.hpp>
+#include <algorithm>
+#include <cstddef>
+
+#include <boost/functional/hash/hash.hpp>
 
 #include "kudu/gutil/strings/substitute.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/connection_id.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/connection_id.h b/src/kudu/rpc/connection_id.h
index 09f1738..1e2ba68 100644
--- a/src/kudu/rpc/connection_id.h
+++ b/src/kudu/rpc/connection_id.h
@@ -16,6 +16,7 @@
 // under the License.
 #pragma once
 
+#include <cstddef>
 #include <string>
 
 #include "kudu/rpc/user_credentials.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/exactly_once_rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/exactly_once_rpc-test.cc b/src/kudu/rpc/exactly_once_rpc-test.cc
index 6601ed0..edf3767 100644
--- a/src/kudu/rpc/exactly_once_rpc-test.cc
+++ b/src/kudu/rpc/exactly_once_rpc-test.cc
@@ -15,10 +15,42 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <unistd.h>
+
+#include <algorithm>
+#include <atomic>
+#include <cstdint>
+#include <cstdlib>
+#include <memory>
+#include <ostream>
+#include <string>
+#include <vector>
+
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
+
+#include "kudu/gutil/callback.h"
+#include "kudu/gutil/ref_counted.h"
+#include "kudu/rpc/request_tracker.h"
+#include "kudu/rpc/response_callback.h"
+#include "kudu/rpc/result_tracker.h"
 #include "kudu/rpc/retriable_rpc.h"
 #include "kudu/rpc/rpc-test-base.h"
 #include "kudu/rpc/rpc.h"
+#include "kudu/rpc/rpc_controller.h"
+#include "kudu/rpc/rpc_header.pb.h"
+#include "kudu/rpc/rtest.pb.h"
+#include "kudu/rpc/rtest.proxy.h"
+#include "kudu/util/countdown_latch.h"
+#include "kudu/util/mem_tracker.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/pb_util.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
+#include "kudu/util/test_util.h"
+#include "kudu/util/thread.h"
 
 DECLARE_int64(remember_clients_ttl_ms);
 DECLARE_int64(remember_responses_ttl_ms);
@@ -34,6 +66,8 @@ using std::vector;
 namespace kudu {
 namespace rpc {
 
+class Messenger;
+
 namespace {
 
 const char* kClientId = "test-client";

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/inbound_call.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/inbound_call.cc b/src/kudu/rpc/inbound_call.cc
index 11b7585..a360e0b 100644
--- a/src/kudu/rpc/inbound_call.cc
+++ b/src/kudu/rpc/inbound_call.cc
@@ -17,9 +17,16 @@
 
 #include "kudu/rpc/inbound_call.h"
 
-#include <glog/stl_logging.h>
+#include <cstdint>
 #include <memory>
+#include <ostream>
 
+#include <glog/logging.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/message_lite.h>
+
+#include "kudu/gutil/move.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/connection.h"
 #include "kudu/rpc/rpc_introspection.pb.h"
@@ -27,12 +34,20 @@
 #include "kudu/rpc/rpcz_store.h"
 #include "kudu/rpc/serialization.h"
 #include "kudu/rpc/service_if.h"
+#include "kudu/rpc/transfer.h"
 #include "kudu/util/debug/trace_event.h"
 #include "kudu/util/metrics.h"
+#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/trace.h"
 
+namespace google {
+namespace protobuf {
+class FieldDescriptor;
+}
+}
+
 using google::protobuf::FieldDescriptor;
-using google::protobuf::io::CodedOutputStream;
+using google::protobuf::Message;
 using google::protobuf::MessageLite;
 using std::string;
 using std::unique_ptr;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/inbound_call.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/inbound_call.h b/src/kudu/rpc/inbound_call.h
index 83a750f..b6281e7 100644
--- a/src/kudu/rpc/inbound_call.h
+++ b/src/kudu/rpc/inbound_call.h
@@ -17,16 +17,22 @@
 #ifndef KUDU_RPC_INBOUND_CALL_H
 #define KUDU_RPC_INBOUND_CALL_H
 
-#include <glog/logging.h>
+#include <algorithm>
+#include <cstddef>
+#include <cstdint>
+#include <memory>
+#include <ostream>
 #include <string>
 #include <vector>
 
+#include <glog/logging.h>
+
 #include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/rpc/remote_method.h"
-#include "kudu/rpc/service_if.h"
 #include "kudu/rpc/rpc_header.pb.h"
+#include "kudu/rpc/service_if.h"
 #include "kudu/rpc/transfer.h"
 #include "kudu/util/faststring.h"
 #include "kudu/util/monotime.h"
@@ -35,13 +41,14 @@
 
 namespace google {
 namespace protobuf {
-class Message;
+class MessageLite;
 } // namespace protobuf
 } // namespace google
 
 namespace kudu {
 
 class Histogram;
+class Sockaddr;
 class Trace;
 
 namespace rpc {
@@ -50,7 +57,6 @@ class Connection;
 class DumpRunningRpcsRequestPB;
 class RemoteUser;
 class RpcCallInProgressPB;
-struct RpcMethodInfo;
 class RpcSidecar;
 
 struct InboundCallTiming {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/messenger.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/messenger.cc b/src/kudu/rpc/messenger.cc
index 35fda52..bfe38cc 100644
--- a/src/kudu/rpc/messenger.cc
+++ b/src/kudu/rpc/messenger.cc
@@ -17,47 +17,51 @@
 
 #include "kudu/rpc/messenger.h"
 
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <list>
+#include <algorithm>
+#include <cstdlib>
+#include <functional>
 #include <mutex>
-#include <set>
+#include <ostream>
 #include <string>
+#include <type_traits>
 
 #include <boost/algorithm/string/predicate.hpp>
 #include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 
 #include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/move.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/acceptor_pool.h"
-#include "kudu/rpc/connection.h"
-#include "kudu/rpc/constants.h"
+#include "kudu/rpc/connection_id.h"
+#include "kudu/rpc/inbound_call.h"
+#include "kudu/rpc/outbound_call.h"
 #include "kudu/rpc/reactor.h"
+#include "kudu/rpc/remote_method.h"
 #include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/rpc/rpc_service.h"
 #include "kudu/rpc/rpcz_store.h"
 #include "kudu/rpc/sasl_common.h"
 #include "kudu/rpc/server_negotiation.h"
-#include "kudu/rpc/transfer.h"
+#include "kudu/rpc/service_if.h"
+#include "kudu/security/openssl_util.h"
 #include "kudu/security/tls_context.h"
 #include "kudu/security/token_verifier.h"
 #include "kudu/util/env.h"
-#include "kudu/util/errno.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/flag_validators.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/net/socket.h"
 #include "kudu/util/scoped_cleanup.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/status.h"
+#include "kudu/util/thread_restrictions.h"
 #include "kudu/util/threadpool.h"
-#include "kudu/util/trace.h"
 
 using std::string;
 using std::shared_ptr;
@@ -116,6 +120,10 @@ TAG_FLAG(rpc_default_keepalive_time_ms, advanced);
 DECLARE_string(keytab_file);
 DECLARE_bool(allow_world_readable_credentials);
 
+namespace boost {
+template <typename Signature> class function;
+}
+
 namespace kudu {
 namespace rpc {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/messenger.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/messenger.h b/src/kudu/rpc/messenger.h
index 8a02104..cf34c95 100644
--- a/src/kudu/rpc/messenger.h
+++ b/src/kudu/rpc/messenger.h
@@ -17,21 +17,20 @@
 #ifndef KUDU_RPC_MESSENGER_H
 #define KUDU_RPC_MESSENGER_H
 
-#include <stdint.h>
-
-#include <list>
+#include <cstdint>
 #include <memory>
+#include <mutex>
 #include <string>
 #include <unordered_map>
 #include <vector>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
 #include <gtest/gtest_prod.h>
 
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/rpc/connection.h"
-#include "kudu/rpc/response_callback.h"
 #include "kudu/security/token.pb.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/metrics.h"
@@ -39,6 +38,11 @@
 #include "kudu/util/net/sockaddr.h"
 #include "kudu/util/status.h"
 
+namespace boost {
+template <typename Signature>
+class function;
+}
+
 namespace kudu {
 
 class Socket;
@@ -58,7 +62,6 @@ class InboundCall;
 class Messenger;
 class OutboundCall;
 class Reactor;
-class ReactorThread;
 class RpcService;
 class RpczStore;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/mt-rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/mt-rpc-test.cc b/src/kudu/rpc/mt-rpc-test.cc
index 0fa11e5..65121e5 100644
--- a/src/kudu/rpc/mt-rpc-test.cc
+++ b/src/kudu/rpc/mt-rpc-test.cc
@@ -17,16 +17,38 @@
 
 #include "kudu/rpc/rpc-test-base.h"
 
+#include <algorithm>
+#include <cstddef>
+#include <memory>
+#include <ostream>
 #include <string>
+#include <type_traits>
+#include <vector>
 
-#include <boost/bind.hpp>
+#include <glog/logging.h>
 #include <gtest/gtest.h>
 
-#include "kudu/gutil/stl_util.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/move.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/rpc/acceptor_pool.h"
+#include "kudu/rpc/messenger.h"
+#include "kudu/rpc/proxy.h"
+#include "kudu/rpc/rpc_service.h"
+#include "kudu/rpc/service_if.h"
+#include "kudu/rpc/service_pool.h"
 #include "kudu/util/countdown_latch.h"
 #include "kudu/util/metrics.h"
-#include "kudu/util/test_util.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/net/sockaddr.h"
+#include "kudu/util/net/socket.h"
+#include "kudu/util/status.h"
+#include "kudu/util/stopwatch.h"
+#include "kudu/util/test_macros.h"
+#include "kudu/util/thread.h"
+
 
 METRIC_DECLARE_counter(rpc_connections_accepted);
 METRIC_DECLARE_counter(rpcs_queue_overflow);

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/negotiation-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/negotiation-test.cc b/src/kudu/rpc/negotiation-test.cc
index 901475b..43ec276 100644
--- a/src/kudu/rpc/negotiation-test.cc
+++ b/src/kudu/rpc/negotiation-test.cc
@@ -30,14 +30,11 @@
 #include <gtest/gtest.h>
 #include <sasl/sasl.h>
 
-#include "kudu/gutil/gscoped_ptr.h"
-#include "kudu/gutil/map-util.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/walltime.h"
 #include "kudu/rpc/client_negotiation.h"
-#include "kudu/rpc/constants.h"
 #include "kudu/rpc/negotiation.h"
 #include "kudu/rpc/server_negotiation.h"
 #include "kudu/security/crypto.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/negotiation.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/negotiation.cc b/src/kudu/rpc/negotiation.cc
index 591258f..8578e37 100644
--- a/src/kudu/rpc/negotiation.cc
+++ b/src/kudu/rpc/negotiation.cc
@@ -18,29 +18,36 @@
 #include "kudu/rpc/negotiation.h"
 
 #include <poll.h>
-#include <sys/time.h>
+#include <sys/socket.h>
 
+#include <algorithm>
+#include <cerrno>
+#include <ctime>
 #include <memory>
 #include <ostream>
 #include <string>
 
+#include <boost/optional.hpp> // IWYU pragma: keep
 #include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 
-#include "kudu/gutil/stringprintf.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/rpc/blocking_ops.h"
 #include "kudu/rpc/client_negotiation.h"
 #include "kudu/rpc/connection.h"
 #include "kudu/rpc/messenger.h"
 #include "kudu/rpc/reactor.h"
+#include "kudu/rpc/rpc_controller.h"
 #include "kudu/rpc/rpc_header.pb.h"
-#include "kudu/rpc/sasl_common.h"
 #include "kudu/rpc/server_negotiation.h"
 #include "kudu/security/tls_context.h"
 #include "kudu/util/errno.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/logging.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/net/socket.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 #include "kudu/util/trace.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/negotiation.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/negotiation.h b/src/kudu/rpc/negotiation.h
index 2ca459b..fb08d6d 100644
--- a/src/kudu/rpc/negotiation.h
+++ b/src/kudu/rpc/negotiation.h
@@ -20,9 +20,12 @@
 #include <iosfwd>
 
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/util/monotime.h"
+#include "kudu/gutil/macros.h"
 
 namespace kudu {
+
+class MonoTime;
+
 namespace rpc {
 
 class Connection;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/outbound_call.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/outbound_call.cc b/src/kudu/rpc/outbound_call.cc
index 5010270..2dad6e7 100644
--- a/src/kudu/rpc/outbound_call.cc
+++ b/src/kudu/rpc/outbound_call.cc
@@ -16,15 +16,23 @@
 // under the License.
 
 #include <algorithm>
-#include <gflags/gflags.h>
+#include <cstdint>
 #include <memory>
 #include <mutex>
 #include <string>
+#include <type_traits>
 #include <unordered_set>
 #include <vector>
 
+#include <boost/function.hpp>
+#include <gflags/gflags.h>
+#include <google/protobuf/message.h>
+
+#include "kudu/gutil/move.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/gutil/sysinfo.h"
 #include "kudu/gutil/walltime.h"
 #include "kudu/rpc/connection.h"
 #include "kudu/rpc/constants.h"
@@ -36,6 +44,7 @@
 #include "kudu/rpc/transfer.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/kernel_stack_watchdog.h"
+#include "kudu/util/net/sockaddr.h"
 
 // 100M cycles should be about 50ms on a 2Ghz box. This should be high
 // enough that involuntary context switches don't trigger it, but low enough

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/outbound_call.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/outbound_call.h b/src/kudu/rpc/outbound_call.h
index 77e62d6..a55fe97 100644
--- a/src/kudu/rpc/outbound_call.h
+++ b/src/kudu/rpc/outbound_call.h
@@ -17,11 +17,17 @@
 #ifndef KUDU_RPC_CLIENT_CALL_H
 #define KUDU_RPC_CLIENT_CALL_H
 
+#include <cstddef>
+#include <cstdint>
+#include <memory>
+#include <ostream>
 #include <set>
 #include <string>
 #include <vector>
 
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
+#include <gtest/gtest_prod.h>
 
 #include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/macros.h"
@@ -30,8 +36,8 @@
 #include "kudu/rpc/remote_method.h"
 #include "kudu/rpc/response_callback.h"
 #include "kudu/rpc/rpc_header.pb.h"
-#include "kudu/rpc/rpc_sidecar.h"
 #include "kudu/rpc/transfer.h"
+#include "kudu/util/faststring.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/slice.h"
@@ -51,7 +57,6 @@ namespace rpc {
 class CallResponse;
 class Connection;
 class DumpRunningRpcsRequestPB;
-class InboundTransfer;
 class RpcCallInProgressPB;
 class RpcController;
 class RpcSidecar;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/protoc-gen-krpc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/protoc-gen-krpc.cc b/src/kudu/rpc/protoc-gen-krpc.cc
index e892897..9ce166e 100644
--- a/src/kudu/rpc/protoc-gen-krpc.cc
+++ b/src/kudu/rpc/protoc-gen-krpc.cc
@@ -20,15 +20,14 @@
 // protoc --plugin=protoc-gen-krpc --krpc_out . --proto_path . <file>.proto
 ////////////////////////////////////////////////////////////////////////////////
 
-#include <ctype.h>
-
-#include <iostream>
+#include <cstddef>
 #include <map>
 #include <memory>
-#include <sstream>
+#include <set>
 #include <string>
+#include <vector>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
 #include <glog/logging.h>
 #include <google/protobuf/compiler/code_generator.h>
 #include <google/protobuf/compiler/plugin.h>
@@ -36,9 +35,9 @@
 #include <google/protobuf/descriptor.pb.h>
 #include <google/protobuf/io/printer.h>
 #include <google/protobuf/io/zero_copy_stream.h>
-#include <google/protobuf/stubs/common.h>
 
 #include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/numbers.h"
 #include "kudu/gutil/strings/split.h"
@@ -353,27 +352,27 @@ class CodeGenerator : public ::google::protobuf::compiler::CodeGenerator {
       "#ifndef KUDU_RPC_$upper_case$_SERVICE_IF_DOT_H\n"
       "#define KUDU_RPC_$upper_case$_SERVICE_IF_DOT_H\n"
       "\n"
-      "#include \"$path_no_extension$.pb.h\"\n"
-      "\n"
-      "#include <functional>\n"
-      "#include <memory>\n"
       "#include <string>\n"
       "\n"
-      "#include \"kudu/rpc/rpc_header.pb.h\"\n"
+      "#include \"kudu/gutil/ref_counted.h\"\n"
       "#include \"kudu/rpc/service_if.h\"\n"
       "\n"
+      "namespace google {\n"
+      "namespace protobuf {\n"
+      "class Message;\n"
+      "} // namespace protobuf\n"
+      "} // namespace google\n"
+      "\n"
       "namespace kudu {\n"
       "class MetricEntity;\n"
       "namespace rpc {\n"
-      "class Messenger;\n"
       "class ResultTracker;\n"
       "class RpcContext;\n"
       "} // namespace rpc\n"
       "} // namespace kudu\n"
       "\n"
       "$open_namespace$"
-      "\n"
-      );
+      "\n");
 
     for (int service_idx = 0; service_idx < file->service_count();
          ++service_idx) {
@@ -398,8 +397,8 @@ class CodeGenerator : public ::google::protobuf::compiler::CodeGenerator {
         subs->PushMethod(method);
 
         Print(printer, *subs,
-        "  virtual void $rpc_name$(const $request$ *req,\n"
-        "     $response$ *resp, ::kudu::rpc::RpcContext *context) = 0;\n"
+        "  virtual void $rpc_name$(const class $request$ *req,\n"
+        "      class $response$ *resp, ::kudu::rpc::RpcContext *context) = 0;\n"
         );
         subs->Pop();
         if (auto m = GetAuthzMethod(*method)) {
@@ -439,14 +438,17 @@ class CodeGenerator : public ::google::protobuf::compiler::CodeGenerator {
     Print(printer, *subs,
       "// THIS FILE IS AUTOGENERATED FROM $path$\n"
       "\n"
+      "#include <algorithm>\n"
+      "#include <functional>\n"
+      "#include <memory>\n"
+      "#include <unordered_map>\n"
+      "\n"
+      "#include <google/protobuf/message.h>\n"
+      "\n"
       "#include \"$path_no_extension$.pb.h\"\n"
       "#include \"$path_no_extension$.service.h\"\n"
       "\n"
-      "#include <glog/logging.h>\n"
-      "\n"
-      "#include \"kudu/rpc/inbound_call.h\"\n"
-      "#include \"kudu/rpc/remote_method.h\"\n"
-      "#include \"kudu/rpc/rpc_context.h\"\n"
+      "#include \"kudu/rpc/result_tracker.h\"\n"
       "#include \"kudu/rpc/service_if.h\"\n"
       "#include \"kudu/util/metrics.h\"\n"
       "\n");
@@ -556,17 +558,22 @@ class CodeGenerator : public ::google::protobuf::compiler::CodeGenerator {
       "#ifndef KUDU_RPC_$upper_case$_PROXY_DOT_H\n"
       "#define KUDU_RPC_$upper_case$_PROXY_DOT_H\n"
       "\n"
-      "#include \"$path_no_extension$.pb.h\"\n"
+      "#include <memory>\n"
       "\n"
       "#include \"kudu/rpc/proxy.h\"\n"
+      "#include \"kudu/rpc/response_callback.h\"\n"
       "#include \"kudu/util/status.h\"\n"
       "\n"
       "namespace kudu { class Sockaddr; }\n"
-      "namespace kudu { namespace rpc { class UserCredentials; } }\n"
-      "$open_namespace$"
-      "\n"
+      "namespace kudu {\n"
+      "namespace rpc {\n"
+      "class Messenger;\n"
+      "class RpcController;\n"
+      "} // namespace rpc\n"
+      "} // namespace kudu\n"
       "\n"
-    );
+      "$open_namespace$"
+      "\n");
 
     for (int service_idx = 0; service_idx < file->service_count();
          ++service_idx) {
@@ -589,10 +596,11 @@ class CodeGenerator : public ::google::protobuf::compiler::CodeGenerator {
 
         Print(printer, *subs,
         "\n"
-        "  ::kudu::Status $rpc_name$(const $request$ &req, $response$ *resp,\n"
-        "                          ::kudu::rpc::RpcController *controller);\n"
-        "  void $rpc_name$Async(const $request$ &req,\n"
-        "                       $response$ *response,\n"
+        "  ::kudu::Status $rpc_name$(const class $request$ &req,\n"
+        "                            class $response$ *resp,\n"
+        "                            ::kudu::rpc::RpcController *controller);\n"
+        "  void $rpc_name$Async(const class $request$ &req,\n"
+        "                       class $response$ *response,\n"
         "                       ::kudu::rpc::RpcController *controller,\n"
         "                       const ::kudu::rpc::ResponseCallback &callback);\n"
         );
@@ -616,14 +624,20 @@ class CodeGenerator : public ::google::protobuf::compiler::CodeGenerator {
     Print(printer, *subs,
       "// THIS FILE IS AUTOGENERATED FROM $path$\n"
       "\n"
+      "#include <string>\n"
+      "\n"
+      "#include \"$path_no_extension$.pb.h\"\n"
       "#include \"$path_no_extension$.proxy.h\"\n"
       "\n"
-      "#include \"kudu/rpc/outbound_call.h\"\n"
-      "#include \"kudu/util/net/sockaddr.h\"\n"
+      "namespace kudu {\n"
+      "namespace rpc {\n"
+      "class Messenger;\n"
+      "class RpcController;\n"
+      "} // namespace rpc\n"
+      "} // namespace kudu\n"
       "\n"
       "$open_namespace$"
-      "\n"
-      );
+      "\n");
 
     for (int service_idx = 0; service_idx < file->service_count();
          ++service_idx) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/proxy.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/proxy.cc b/src/kudu/rpc/proxy.cc
index 0d946ed..84c9ba8 100644
--- a/src/kudu/rpc/proxy.cc
+++ b/src/kudu/rpc/proxy.cc
@@ -17,25 +17,22 @@
 
 #include "kudu/rpc/proxy.h"
 
-#include <boost/bind.hpp>
-#include <glog/logging.h>
-#include <inttypes.h>
+#include <algorithm>
+#include <iostream>
 #include <memory>
-#include <stdint.h>
 
-#include <iostream>
-#include <sstream>
-#include <vector>
+#include <boost/bind.hpp> // IWYU pragma: keep
+#include <boost/core/ref.hpp>
+#include <glog/logging.h>
 
-#include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/outbound_call.h"
 #include "kudu/rpc/messenger.h"
 #include "kudu/rpc/remote_method.h"
 #include "kudu/rpc/response_callback.h"
-#include "kudu/rpc/rpc_header.pb.h"
+#include "kudu/rpc/rpc_controller.h"
+#include "kudu/rpc/user_credentials.h"
 #include "kudu/util/net/sockaddr.h"
-#include "kudu/util/net/socket.h"
 #include "kudu/util/countdown_latch.h"
 #include "kudu/util/status.h"
 #include "kudu/util/user.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/proxy.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/proxy.h b/src/kudu/rpc/proxy.h
index 6e43e93..50640e2 100644
--- a/src/kudu/rpc/proxy.h
+++ b/src/kudu/rpc/proxy.h
@@ -22,12 +22,9 @@
 #include <string>
 
 #include "kudu/gutil/atomicops.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/rpc/connection_id.h"
 #include "kudu/rpc/response_callback.h"
-#include "kudu/rpc/rpc_controller.h"
-#include "kudu/rpc/rpc_header.pb.h"
-#include "kudu/util/monotime.h"
-#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/status.h"
 
 namespace google {
@@ -37,9 +34,14 @@ class Message;
 } // namespace google
 
 namespace kudu {
+
+class Sockaddr;
+
 namespace rpc {
 
 class Messenger;
+class RpcController;
+class UserCredentials;
 
 // Interface to send calls to a remote service.
 //

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/reactor-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/reactor-test.cc b/src/kudu/rpc/reactor-test.cc
index 2faac2a..8080723 100644
--- a/src/kudu/rpc/reactor-test.cc
+++ b/src/kudu/rpc/reactor-test.cc
@@ -15,10 +15,19 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "kudu/rpc/reactor.h"
+#include <memory>
 
+#include <boost/bind.hpp> // IWYU pragma: keep
+#include <boost/function.hpp>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
+
+#include "kudu/rpc/messenger.h"
 #include "kudu/rpc/rpc-test-base.h"
 #include "kudu/util/countdown_latch.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/status.h"
+#include "kudu/util/thread.h"
 
 using std::shared_ptr;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/reactor.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/reactor.cc b/src/kudu/rpc/reactor.cc
index 5dc2f0f..ee6f105 100644
--- a/src/kudu/rpc/reactor.cc
+++ b/src/kudu/rpc/reactor.cc
@@ -17,22 +17,21 @@
 
 #include "kudu/rpc/reactor.h"
 
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <stdlib.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
+#include <cerrno>
 #include <memory>
 #include <mutex>
+#include <ostream>
 #include <string>
+#include <utility>
 
+#include <boost/bind.hpp> // IWYU pragma: keep
 #include <boost/intrusive/list.hpp>
 #include <boost/optional.hpp>
 #include <ev++.h>
+#include <gflags/gflags.h>
 #include <glog/logging.h>
 
+#include "kudu/gutil/bind.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/substitute.h"
@@ -40,15 +39,13 @@
 #include "kudu/rpc/connection.h"
 #include "kudu/rpc/messenger.h"
 #include "kudu/rpc/negotiation.h"
-#include "kudu/rpc/rpc_controller.h"
 #include "kudu/rpc/rpc_introspection.pb.h"
 #include "kudu/rpc/server_negotiation.h"
-#include "kudu/rpc/transfer.h"
 #include "kudu/util/countdown_latch.h"
 #include "kudu/util/debug/sanitizer_scopes.h"
-#include "kudu/util/errno.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/monotime.h"
+#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/net/socket.h"
 #include "kudu/util/status.h"
 #include "kudu/util/thread.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/reactor.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/reactor.h b/src/kudu/rpc/reactor.h
index 6b436f4..6d39ba2 100644
--- a/src/kudu/rpc/reactor.h
+++ b/src/kudu/rpc/reactor.h
@@ -19,29 +19,31 @@
 
 #include <cstdint>
 #include <list>
-#include <map>
 #include <memory>
 #include <set>
 #include <string>
+#include <unordered_map>
 
-#include <boost/function.hpp>
+#include <boost/function.hpp> // IWYU pragma: keep
 #include <boost/intrusive/list.hpp>
-#include <boost/optional.hpp>
+#include <boost/intrusive/list_hook.hpp>
 #include <ev++.h>
 
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/rpc/connection.h"
 #include "kudu/rpc/connection_id.h"
 #include "kudu/rpc/messenger.h"
-#include "kudu/rpc/transfer.h"
+#include "kudu/rpc/outbound_call.h"
+#include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/monotime.h"
-#include "kudu/util/net/socket.h"
 #include "kudu/util/status.h"
 #include "kudu/util/thread.h"
 
 namespace kudu {
 
+class Sockaddr;
 class Socket;
 
 namespace rpc {
@@ -51,6 +53,7 @@ typedef std::list<scoped_refptr<Connection>> conn_list_t;
 class DumpRunningRpcsRequestPB;
 class DumpRunningRpcsResponsePB;
 class Reactor;
+class ReactorThread;
 enum class CredentialsPolicy;
 
 // Simple metrics information from within a reactor.

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/remote_method.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/remote_method.cc b/src/kudu/rpc/remote_method.cc
index 35020bc..71995f2 100644
--- a/src/kudu/rpc/remote_method.cc
+++ b/src/kudu/rpc/remote_method.cc
@@ -15,6 +15,9 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <algorithm>
+#include <ostream>
+
 #include <glog/logging.h>
 
 #include "kudu/gutil/strings/substitute.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/remote_user.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/remote_user.cc b/src/kudu/rpc/remote_user.cc
index 50e3fcd..047f10a 100644
--- a/src/kudu/rpc/remote_user.cc
+++ b/src/kudu/rpc/remote_user.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/rpc/remote_user.h"
 
-#include <boost/optional.hpp>
 #include <string>
 
 #include "kudu/gutil/strings/substitute.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/remote_user.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/remote_user.h b/src/kudu/rpc/remote_user.h
index 7dc0590..c93a261 100644
--- a/src/kudu/rpc/remote_user.h
+++ b/src/kudu/rpc/remote_user.h
@@ -16,9 +16,10 @@
 // under the License.
 #pragma once
 
+#include <algorithm>
 #include <string>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
 
 namespace kudu {
 namespace rpc {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/request_tracker-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/request_tracker-test.cc b/src/kudu/rpc/request_tracker-test.cc
index f39e131..f1e4d55 100644
--- a/src/kudu/rpc/request_tracker-test.cc
+++ b/src/kudu/rpc/request_tracker-test.cc
@@ -15,11 +15,14 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <gtest/gtest.h>
+#include <string>
 #include <vector>
 
+#include <gtest/gtest.h>
+
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/rpc/request_tracker.h"
-#include "kudu/util/test_util.h"
+#include "kudu/util/test_macros.h"
 
 using std::vector;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/request_tracker.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/request_tracker.h b/src/kudu/rpc/request_tracker.h
index 7542bd1..5cc3995 100644
--- a/src/kudu/rpc/request_tracker.h
+++ b/src/kudu/rpc/request_tracker.h
@@ -16,9 +16,11 @@
 // under the License.
 #pragma once
 
+#include <cstdint>
 #include <set>
 #include <string>
 
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/status.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/result_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/result_tracker.cc b/src/kudu/rpc/result_tracker.cc
index c9c1aad..e04aa0b 100644
--- a/src/kudu/rpc/result_tracker.cc
+++ b/src/kudu/rpc/result_tracker.cc
@@ -18,17 +18,25 @@
 #include "kudu/rpc/result_tracker.h"
 
 #include <algorithm>
-#include <limits>
+#include <mutex>
+#include <ostream>
+
+#include <gflags/gflags.h>
+#include <glog/logging.h>
 
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/inbound_call.h"
+#include "kudu/rpc/remote_method.h"
 #include "kudu/rpc/rpc_context.h"
 #include "kudu/util/debug/trace_event.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/pb_util.h"
+#include "kudu/util/status.h"
+#include "kudu/util/thread.h"
 #include "kudu/util/trace.h"
+// IWYU pragma: no_include <deque>
 
 DEFINE_int64(remember_clients_ttl_ms, 3600 * 1000 /* 1 hour */,
     "Maximum amount of time, in milliseconds, the server \"remembers\" a client for the "

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/result_tracker.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/result_tracker.h b/src/kudu/rpc/result_tracker.h
index 4e808d1..6256e71 100644
--- a/src/kudu/rpc/result_tracker.h
+++ b/src/kudu/rpc/result_tracker.h
@@ -16,14 +16,19 @@
 // under the License.
 #pragma once
 
+#include <cstdint>
 #include <functional>
 #include <map>
+#include <memory>
 #include <string>
 #include <utility>
 #include <vector>
 
+#include <google/protobuf/message.h>
+
+#include "kudu/gutil/macros.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/gutil/stl_util.h"
 #include "kudu/rpc/request_tracker.h"
 #include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/util/countdown_latch.h"
@@ -31,15 +36,12 @@
 #include "kudu/util/malloc.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/monotime.h"
-#include "kudu/util/thread.h"
-
-namespace google {
-namespace protobuf {
-class Message;
-} // protobuf
-} // google
 
 namespace kudu {
+
+class Status;
+class Thread;
+
 namespace rpc {
 class RpcContext;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc-bench.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-bench.cc b/src/kudu/rpc/rpc-bench.cc
index d569ea1..5d0dc1d 100644
--- a/src/kudu/rpc/rpc-bench.cc
+++ b/src/kudu/rpc/rpc-bench.cc
@@ -15,17 +15,30 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <algorithm>
+#include <cstdint>
 #include <functional>
-#include <gflags/gflags.h>
-#include <gtest/gtest.h>
 #include <memory>
+#include <ostream>
 #include <string>
 #include <thread>
+#include <vector>
+
+#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
 
 #include "kudu/gutil/atomicops.h"
 #include "kudu/rpc/rpc-test-base.h"
+#include "kudu/rpc/rpc_controller.h"
+#include "kudu/rpc/rtest.pb.h"
 #include "kudu/rpc/rtest.proxy.h"
 #include "kudu/util/countdown_latch.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/net/sockaddr.h"
+#include "kudu/util/status.h"
+#include "kudu/util/stopwatch.h"
 #include "kudu/util/test_util.h"
 
 using std::bind;
@@ -59,6 +72,8 @@ DEFINE_bool(enable_encryption, false, "Whether to enable TLS encryption for rpc-
 namespace kudu {
 namespace rpc {
 
+class Messenger;
+
 class RpcBench : public RpcTestBase {
  public:
   RpcBench()

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc-test-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-test-base.h b/src/kudu/rpc/rpc-test-base.h
index 38a9bda..25d3845 100644
--- a/src/kudu/rpc/rpc-test-base.h
+++ b/src/kudu/rpc/rpc-test-base.h
@@ -47,6 +47,7 @@
 #include "kudu/util/random.h"
 #include "kudu/util/random_util.h"
 #include "kudu/util/stopwatch.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 #include "kudu/util/trace.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-test.cc b/src/kudu/rpc/rpc-test.cc
index 313b469..12ef436 100644
--- a/src/kudu/rpc/rpc-test.cc
+++ b/src/kudu/rpc/rpc-test.cc
@@ -17,26 +17,54 @@
 
 #include "kudu/rpc/rpc-test-base.h"
 
+#include <sys/resource.h>
+
+#include <cerrno>
+#include <cstdint>
+#include <cstdlib>
 #include <memory>
+#include <ostream>
+#include <set>
 #include <string>
 #include <unordered_map>
 #include <vector>
 
 #include <boost/bind.hpp>
+#include <gflags/gflags_declare.h>
 #include <gtest/gtest.h>
 
+#include "kudu/gutil/casts.h"
+#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/map-util.h"
-#include "kudu/gutil/strings/join.h"
+#include "kudu/gutil/ref_counted.h"
+#include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/gutil/walltime.h"
+#include "kudu/rpc/acceptor_pool.h"
 #include "kudu/rpc/constants.h"
+#include "kudu/rpc/messenger.h"
 #include "kudu/rpc/outbound_call.h"
+#include "kudu/rpc/proxy.h"
+#include "kudu/rpc/reactor.h"
+#include "kudu/rpc/rpc_controller.h"
+#include "kudu/rpc/rpc_header.pb.h"
+#include "kudu/rpc/rtest.pb.h"
 #include "kudu/rpc/serialization.h"
 #include "kudu/security/test/test_certs.h"
 #include "kudu/util/countdown_latch.h"
 #include "kudu/util/env.h"
+#include "kudu/util/logging.h"
+#include "kudu/util/metrics.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/net/sockaddr.h"
+#include "kudu/util/net/socket.h"
 #include "kudu/util/random.h"
 #include "kudu/util/scoped_cleanup.h"
+#include "kudu/util/slice.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
+#include "kudu/util/thread.h"
 
 METRIC_DECLARE_histogram(handler_latency_kudu_rpc_test_CalculatorService_Sleep);
 METRIC_DECLARE_histogram(rpc_incoming_queue_time);

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc.cc b/src/kudu/rpc/rpc.cc
index d4c8b60..84ea892 100644
--- a/src/kudu/rpc/rpc.cc
+++ b/src/kudu/rpc/rpc.cc
@@ -17,9 +17,13 @@
 
 #include "kudu/rpc/rpc.h"
 
-#include <boost/bind.hpp>
+#include <cstdlib>
 #include <string>
 
+#include <boost/bind.hpp> // IWYU pragma: keep
+#include <boost/function.hpp>
+#include <glog/logging.h>
+
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/messenger.h"
 #include "kudu/rpc/rpc_header.pb.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc.h b/src/kudu/rpc/rpc.h
index 7bc484f..3cd57c0 100644
--- a/src/kudu/rpc/rpc.h
+++ b/src/kudu/rpc/rpc.h
@@ -17,13 +17,16 @@
 #ifndef KUDU_RPC_RPC_H
 #define KUDU_RPC_RPC_H
 
+#include <algorithm>
 #include <memory>
 #include <string>
 
 #include "kudu/gutil/callback.h"
+#include "kudu/gutil/macros.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/rpc/rpc_controller.h"
 #include "kudu/util/monotime.h"
-#include "kudu/util/status_callback.h"
+#include "kudu/util/status.h"
 
 namespace kudu {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc_context.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_context.cc b/src/kudu/rpc/rpc_context.cc
index 4483a8f..d4faffb 100644
--- a/src/kudu/rpc/rpc_context.cc
+++ b/src/kudu/rpc/rpc_context.cc
@@ -17,17 +17,20 @@
 
 #include "kudu/rpc/rpc_context.h"
 
+#include <algorithm>
 #include <memory>
 #include <ostream>
-#include <sstream>
+
+#include <glog/logging.h>
+#include <google/protobuf/message.h>
 
 #include "kudu/rpc/inbound_call.h"
+#include "kudu/rpc/remote_method.h"
 #include "kudu/rpc/remote_user.h"
 #include "kudu/rpc/result_tracker.h"
 #include "kudu/rpc/rpc_sidecar.h"
-#include "kudu/rpc/service_if.h"
-#include "kudu/util/hdr_histogram.h"
-#include "kudu/util/metrics.h"
+#include "kudu/util/debug/trace_event.h"
+#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/pb_util.h"
 #include "kudu/util/trace.h"
 
@@ -37,6 +40,9 @@ using std::string;
 using std::unique_ptr;
 
 namespace kudu {
+
+class Slice;
+
 namespace rpc {
 
 RpcContext::RpcContext(InboundCall *call,

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc_context.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_context.h b/src/kudu/rpc/rpc_context.h
index ac895fc..42f096e 100644
--- a/src/kudu/rpc/rpc_context.h
+++ b/src/kudu/rpc/rpc_context.h
@@ -17,11 +17,15 @@
 #ifndef KUDU_RPC_RPC_CONTEXT_H
 #define KUDU_RPC_RPC_CONTEXT_H
 
+#include <memory>
 #include <string>
 
+#include <glog/logging.h>
+
 #include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/rpc/rpc_header.pb.h"
-#include "kudu/rpc/service_if.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/status.h"
 
 namespace google {
@@ -32,6 +36,7 @@ class Message;
 
 namespace kudu {
 
+class Slice;
 class Sockaddr;
 class Trace;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc_controller.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_controller.cc b/src/kudu/rpc/rpc_controller.cc
index 9139cd4..5a07006 100644
--- a/src/kudu/rpc/rpc_controller.cc
+++ b/src/kudu/rpc/rpc_controller.cc
@@ -20,16 +20,22 @@
 #include <algorithm>
 #include <memory>
 #include <mutex>
+#include <ostream>
 
 #include <glog/logging.h>
 
+#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/rpc/messenger.h"
 #include "kudu/rpc/outbound_call.h"
 #include "kudu/rpc/rpc_header.pb.h"
+#include "kudu/rpc/rpc_sidecar.h"
+#include "kudu/rpc/transfer.h"
 
 using std::unique_ptr;
-
 namespace kudu {
+
+class Slice;
+
 namespace rpc {
 
 RpcController::RpcController()

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc_controller.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_controller.h b/src/kudu/rpc/rpc_controller.h
index bd3fbe3..41c062e 100644
--- a/src/kudu/rpc/rpc_controller.h
+++ b/src/kudu/rpc/rpc_controller.h
@@ -17,14 +17,12 @@
 #ifndef KUDU_RPC_RPC_CONTROLLER_H
 #define KUDU_RPC_RPC_CONTROLLER_H
 
+#include <cstdint>
 #include <memory>
 #include <unordered_set>
 #include <vector>
 
-#include <glog/logging.h>
-
 #include "kudu/gutil/macros.h"
-#include "kudu/gutil/stl_util.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/status.h"
@@ -37,6 +35,8 @@ class Message;
 
 namespace kudu {
 
+class Slice;
+
 namespace rpc {
 
 class ErrorStatusPB;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc_sidecar.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_sidecar.cc b/src/kudu/rpc/rpc_sidecar.cc
index 580c6eb..509f57d 100644
--- a/src/kudu/rpc/rpc_sidecar.cc
+++ b/src/kudu/rpc/rpc_sidecar.cc
@@ -17,9 +17,15 @@
 
 #include "kudu/rpc/rpc_sidecar.h"
 
-#include "kudu/util/status.h"
-#include "kudu/rpc/transfer.h"
+#include <algorithm>
+#include <cstdint>
+
+#include <google/protobuf/repeated_field.h>
+
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/rpc/transfer.h"
+#include "kudu/util/faststring.h"
+#include "kudu/util/status.h"
 
 using std::unique_ptr;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc_sidecar.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_sidecar.h b/src/kudu/rpc/rpc_sidecar.h
index 00d6e4b..859f35f 100644
--- a/src/kudu/rpc/rpc_sidecar.h
+++ b/src/kudu/rpc/rpc_sidecar.h
@@ -17,13 +17,19 @@
 #ifndef KUDU_RPC_RPC_SIDECAR_H
 #define KUDU_RPC_RPC_SIDECAR_H
 
-#include <google/protobuf/repeated_field.h>
+#include <cstdint>
 #include <memory>
 
-#include "kudu/util/faststring.h"
+#include <google/protobuf/repeated_field.h> // IWYU pragma: keep
+
+#include "kudu/gutil/integral_types.h"
 #include "kudu/util/slice.h"
 
 namespace kudu {
+
+class Status;
+class faststring;
+
 namespace rpc {
 
 // An RpcSidecar is a mechanism which allows replies to RPCs to reference blocks of data

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpc_stub-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_stub-test.cc b/src/kudu/rpc/rpc_stub-test.cc
index 3cf9e99..4adc8b1 100644
--- a/src/kudu/rpc/rpc_stub-test.cc
+++ b/src/kudu/rpc/rpc_stub-test.cc
@@ -15,27 +15,55 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <algorithm>
 #include <atomic>
+#include <csignal>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <limits>
 #include <memory>
+#include <ostream>
+#include <string>
 #include <thread>
 #include <vector>
 
+#include <boost/bind.hpp>
+#include <gflags/gflags.h>
 #include <glog/logging.h>
 #include <glog/stl_logging.h>
 #include <gtest/gtest.h>
-#include <boost/bind.hpp>
 
+#include "kudu/gutil/atomicops.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/stl_util.h"
+#include "kudu/rpc/messenger.h"
+#include "kudu/rpc/outbound_call.h"
+#include "kudu/rpc/proxy.h"
+#include "kudu/rpc/rpc-test-base.h"
+#include "kudu/rpc/rpc_controller.h"
+#include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/rpc/rpc_introspection.pb.h"
 #include "kudu/rpc/rpcz_store.h"
+#include "kudu/rpc/rtest.pb.h"
 #include "kudu/rpc/rtest.proxy.h"
-#include "kudu/rpc/rtest.service.h"
-#include "kudu/rpc/rpc-test-base.h"
+#include "kudu/rpc/service_pool.h"
 #include "kudu/util/countdown_latch.h"
+#include "kudu/util/env.h"
+#include "kudu/util/locks.h"
+#include "kudu/util/logging.h"
 #include "kudu/util/metrics.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/pb_util.h"
+#include "kudu/util/random.h"
+#include "kudu/util/status.h"
 #include "kudu/util/subprocess.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
+#include "kudu/util/thread_restrictions.h"
 #include "kudu/util/user.h"
 
 DEFINE_bool(is_panic_test_child, false, "Used by TestRpcPanic");

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/rpcz_store.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpcz_store.cc b/src/kudu/rpc/rpcz_store.cc
index 9f56d3d..ffbbf2f 100644
--- a/src/kudu/rpc/rpcz_store.cc
+++ b/src/kudu/rpc/rpcz_store.cc
@@ -17,23 +17,32 @@
 
 #include "kudu/rpc/rpcz_store.h"
 
-#include <algorithm>
+#include <algorithm>  // IWYU pragma: keep
 #include <array>
-#include <glog/stl_logging.h>
+#include <cstdint>
 #include <mutex> // for unique_lock
+#include <ostream>
 #include <string>
 #include <utility>
 #include <vector>
 
+#include <gflags/gflags.h>
+#include <glog/logging.h>
+#include <google/protobuf/message.h>
+
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/ref_counted.h"
+#include "kudu/gutil/strings/stringpiece.h"
 #include "kudu/gutil/walltime.h"
 #include "kudu/rpc/inbound_call.h"
+#include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/rpc/rpc_introspection.pb.h"
 #include "kudu/rpc/service_if.h"
 #include "kudu/util/atomic.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/trace.h"
-
+#include "kudu/util/trace_metrics.h"
 
 DEFINE_bool(rpc_dump_all_traces, false,
             "If true, dump all RPC traces at INFO level");

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/sasl_common.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_common.cc b/src/kudu/rpc/sasl_common.cc
index ffeb1b2..a2da58c 100644
--- a/src/kudu/rpc/sasl_common.cc
+++ b/src/kudu/rpc/sasl_common.cc
@@ -17,15 +17,16 @@
 
 #include "kudu/rpc/sasl_common.h"
 
-#include <string.h>
-
 #include <algorithm>
+#include <cstdio>
+#include <cstring>
 #include <limits>
 #include <mutex>
+#include <ostream>
 #include <string>
 
 #include <boost/algorithm/string/predicate.hpp>
-#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 #include <regex.h>
 #include <sasl/sasl.h>
@@ -33,13 +34,11 @@
 
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/once.h"
-#include "kudu/gutil/stringprintf.h"
 #include "kudu/rpc/constants.h"
-#include "kudu/util/flag_tags.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/security/init.h"
 
 using std::set;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/sasl_common.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_common.h b/src/kudu/rpc/sasl_common.h
index 437c9cd..3ec43d2 100644
--- a/src/kudu/rpc/sasl_common.h
+++ b/src/kudu/rpc/sasl_common.h
@@ -18,13 +18,14 @@
 #ifndef KUDU_RPC_SASL_COMMON_H
 #define KUDU_RPC_SASL_COMMON_H
 
-#include <stdint.h> // Required for sasl/sasl.h
-
+#include <cstddef>
+#include <functional>
 #include <string>
 #include <set>
 
 #include <sasl/sasl.h>
 
+#include "kudu/gutil/port.h"
 #include "kudu/util/status.h"
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/sasl_helper.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_helper.cc b/src/kudu/rpc/sasl_helper.cc
index 53f9d08..765118e 100644
--- a/src/kudu/rpc/sasl_helper.cc
+++ b/src/kudu/rpc/sasl_helper.cc
@@ -17,12 +17,14 @@
 
 #include "kudu/rpc/sasl_helper.h"
 
+#include <cstring>
+#include <ostream>
+#include <set>
 #include <string>
 
 #include <glog/logging.h>
-#include <google/protobuf/message_lite.h>
+#include <sasl/sasl.h>
 
-#include "kudu/gutil/macros.h"
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/join.h"
@@ -30,7 +32,7 @@
 #include "kudu/rpc/constants.h"
 #include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/rpc/sasl_common.h"
-#include "kudu/rpc/serialization.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 
 using std::string;
@@ -38,8 +40,6 @@ using std::string;
 namespace kudu {
 namespace rpc {
 
-using google::protobuf::MessageLite;
-
 SaslHelper::SaslHelper(PeerType peer_type)
   : peer_type_(peer_type),
     global_mechs_(SaslListAvailableMechs()),

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/sasl_helper.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_helper.h b/src/kudu/rpc/sasl_helper.h
index 0a3107c..aa0c8bf 100644
--- a/src/kudu/rpc/sasl_helper.h
+++ b/src/kudu/rpc/sasl_helper.h
@@ -18,17 +18,17 @@
 #ifndef KUDU_RPC_SASL_HELPER_H
 #define KUDU_RPC_SASL_HELPER_H
 
+#include <cstdint>
 #include <set>
 #include <string>
 
-#include <sasl/sasl.h>
-
+#include "kudu/gutil/macros.h"
 #include "kudu/rpc/sasl_common.h"
-#include "kudu/util/status.h"
 
 namespace kudu {
 
-class Sockaddr;
+class Slice;
+class Status;
 
 namespace rpc {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/serialization.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/serialization.cc b/src/kudu/rpc/serialization.cc
index bf24948..ac494d9 100644
--- a/src/kudu/rpc/serialization.cc
+++ b/src/kudu/rpc/serialization.cc
@@ -17,11 +17,16 @@
 
 #include "kudu/rpc/serialization.h"
 
+#include <ostream>
+#include <string>
+
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 #include <google/protobuf/message_lite.h>
 #include <google/protobuf/io/coded_stream.h>
 
 #include "kudu/gutil/endian.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/constants.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/serialization.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/serialization.h b/src/kudu/rpc/serialization.h
index f61f973..d82e378 100644
--- a/src/kudu/rpc/serialization.h
+++ b/src/kudu/rpc/serialization.h
@@ -18,8 +18,8 @@
 #ifndef KUDU_RPC_SERIALIZATION_H
 #define KUDU_RPC_SERIALIZATION_H
 
-#include <inttypes.h>
-#include <string.h>
+#include <cstdint>
+#include <cstring>
 
 namespace google {
 namespace protobuf {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/server_negotiation.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/server_negotiation.cc b/src/kudu/rpc/server_negotiation.cc
index 6e0ccf8..ca39ced 100644
--- a/src/kudu/rpc/server_negotiation.cc
+++ b/src/kudu/rpc/server_negotiation.cc
@@ -17,20 +17,24 @@
 
 #include "kudu/rpc/server_negotiation.h"
 
-#include <limits>
+#include <cstdint>
+#include <cstdlib>
 #include <memory>
+#include <mutex>
+#include <ostream>
 #include <set>
 #include <string>
 
+#include <boost/optional/optional.hpp>
 #include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
-#include <google/protobuf/message_lite.h>
 #include <sasl/sasl.h>
 
-#include "kudu/gutil/casts.h"
-#include "kudu/gutil/endian.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/strings/split.h"
+#include "kudu/gutil/strings/stringpiece.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/blocking_ops.h"
 #include "kudu/rpc/constants.h"
@@ -41,15 +45,16 @@
 #include "kudu/security/init.h"
 #include "kudu/security/tls_context.h"
 #include "kudu/security/tls_handshake.h"
-#include "kudu/security/tls_socket.h"
+#include "kudu/security/token.pb.h"
 #include "kudu/security/token_verifier.h"
+#include "kudu/util/faststring.h"
 #include "kudu/util/fault_injection.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/logging.h"
 #include "kudu/util/net/net_util.h"
 #include "kudu/util/net/sockaddr.h"
 #include "kudu/util/net/socket.h"
-#include "kudu/util/scoped_cleanup.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/trace.h"
 
 using std::set;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/server_negotiation.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/server_negotiation.h b/src/kudu/rpc/server_negotiation.h
index e9e945a..852a6ad 100644
--- a/src/kudu/rpc/server_negotiation.h
+++ b/src/kudu/rpc/server_negotiation.h
@@ -17,13 +17,18 @@
 
 #pragma once
 
+#include <algorithm>
 #include <memory>
 #include <set>
 #include <string>
 #include <vector>
 
+#include <boost/optional/optional.hpp>
+#include <glog/logging.h>
 #include <sasl/sasl.h>
 
+#include "kudu/gutil/port.h"
+#include "kudu/rpc/messenger.h"
 #include "kudu/rpc/negotiation.h"
 #include "kudu/rpc/remote_user.h"
 #include "kudu/rpc/rpc_header.pb.h"
@@ -36,7 +41,8 @@
 
 namespace kudu {
 
-class Slice;
+class Sockaddr;
+class faststring;
 
 namespace security {
 class TlsContext;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/service_if.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_if.cc b/src/kudu/rpc/service_if.cc
index 39e9ab5..008c478 100644
--- a/src/kudu/rpc/service_if.cc
+++ b/src/kudu/rpc/service_if.cc
@@ -18,16 +18,27 @@
 #include "kudu/rpc/service_if.h"
 
 #include <memory>
+#include <ostream>
 #include <string>
-#include <google/protobuf/descriptor.pb.h>
+#include <utility>
 
-#include "kudu/gutil/strings/substitute.h"
+#include <gflags/gflags.h>
+#include <glog/logging.h>
 
+#include "kudu/gutil/macros.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/connection.h"
 #include "kudu/rpc/inbound_call.h"
+#include "kudu/rpc/remote_method.h"
+#include "kudu/rpc/result_tracker.h"
 #include "kudu/rpc/rpc_context.h"
 #include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/util/flag_tags.h"
+#include "kudu/util/net/sockaddr.h"
+#include "kudu/util/net/socket.h"
+#include "kudu/util/slice.h"
+#include "kudu/util/status.h"
 
 // TODO remove this once we have fully cluster-tested this.
 // Despite being on by default, this is left in in case we discover

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/service_if.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_if.h b/src/kudu/rpc/service_if.h
index a3722c6..c0b72b4 100644
--- a/src/kudu/rpc/service_if.h
+++ b/src/kudu/rpc/service_if.h
@@ -17,31 +17,24 @@
 #ifndef KUDU_RPC_SERVICE_IF_H
 #define KUDU_RPC_SERVICE_IF_H
 
-#include <unordered_map>
+#include <cstdint>
+#include <functional>
+#include <memory>
 #include <string>
+#include <unordered_map>
+
+#include <google/protobuf/message.h>
 
-#include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/metrics.h"
-#include "kudu/util/net/sockaddr.h"
-#include "kudu/rpc/result_tracker.h"
-
-namespace google {
-namespace protobuf {
-class Message;
-}
-}
 
 namespace kudu {
-
-class Histogram;
-
 namespace rpc {
 
 class InboundCall;
 class RemoteMethod;
+class ResultTracker;
 class RpcContext;
-class ServiceIf;
 
 // Generated services define an instance of this class for each
 // method that they implement. The generic server code implemented

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/service_pool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_pool.cc b/src/kudu/rpc/service_pool.cc
index 82a3ad4..b10e6c1 100644
--- a/src/kudu/rpc/service_pool.cc
+++ b/src/kudu/rpc/service_pool.cc
@@ -17,21 +17,31 @@
 
 #include "kudu/rpc/service_pool.h"
 
-#include <glog/logging.h>
+#include <algorithm>
+#include <cstdint>
 #include <memory>
+#include <ostream>
 #include <string>
+#include <type_traits>
 #include <vector>
 
+#include <boost/optional/optional.hpp>
+#include <glog/logging.h>
+
+#include "kudu/gutil/basictypes.h"
 #include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/move.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/inbound_call.h"
-#include "kudu/rpc/messenger.h"
+#include "kudu/rpc/remote_method.h"
+#include "kudu/rpc/rpc_header.pb.h"
 #include "kudu/rpc/service_if.h"
 #include "kudu/rpc/service_queue.h"
 #include "kudu/util/logging.h"
 #include "kudu/util/metrics.h"
+#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/status.h"
 #include "kudu/util/thread.h"
 #include "kudu/util/trace.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/service_pool.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_pool.h b/src/kudu/rpc/service_pool.h
index 70611c8..51956b9 100644
--- a/src/kudu/rpc/service_pool.h
+++ b/src/kudu/rpc/service_pool.h
@@ -18,16 +18,17 @@
 #ifndef KUDU_SERVICE_POOL_H
 #define KUDU_SERVICE_POOL_H
 
+#include <cstddef>
 #include <string>
 #include <vector>
 
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/rpc/rpc_service.h"
 #include "kudu/rpc/service_queue.h"
 #include "kudu/util/mutex.h"
-#include "kudu/util/thread.h"
 #include "kudu/util/status.h"
 
 namespace kudu {
@@ -35,13 +36,16 @@ namespace kudu {
 class Counter;
 class Histogram;
 class MetricEntity;
-class Socket;
+class Thread;
 
 namespace rpc {
 
-class Messenger;
+class InboundCall;
+class RemoteMethod;
 class ServiceIf;
 
+struct RpcMethodInfo;
+
 // A pool of threads that handle new incoming RPC calls.
 // Also includes a queue that calls get pushed onto for handling by the pool.
 class ServicePool : public RpcService {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/service_queue-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_queue-test.cc b/src/kudu/rpc/service_queue-test.cc
index 0bcbd12..f1450fd 100644
--- a/src/kudu/rpc/service_queue-test.cc
+++ b/src/kudu/rpc/service_queue-test.cc
@@ -15,17 +15,24 @@
 // specific language governing permissions and limitations
 // under the License.
 
-
 #include <atomic>
-#include <gflags/gflags.h>
-#include <glog/logging.h>
-#include <gtest/gtest.h>
+#include <cstdint>
 #include <memory>
+#include <ostream>
 #include <string>
 #include <thread>
 #include <vector>
 
+#include <boost/optional/optional.hpp>
+#include <gflags/gflags.h>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
+
+#include "kudu/gutil/atomicops.h"
+#include "kudu/gutil/port.h"
+#include "kudu/rpc/inbound_call.h"
 #include "kudu/rpc/service_queue.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/stopwatch.h"
 #include "kudu/util/test_util.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/service_queue.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_queue.cc b/src/kudu/rpc/service_queue.cc
index 9b938f6..29c0516 100644
--- a/src/kudu/rpc/service_queue.cc
+++ b/src/kudu/rpc/service_queue.cc
@@ -18,8 +18,11 @@
 #include "kudu/rpc/service_queue.h"
 
 #include <mutex>
+#include <ostream>
 
-#include "kudu/util/logging.h"
+#include <boost/optional/optional.hpp>
+
+#include "kudu/gutil/port.h"
 
 namespace kudu {
 namespace rpc {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/service_queue.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_queue.h b/src/kudu/rpc/service_queue.h
index d68576f..2751a30 100644
--- a/src/kudu/rpc/service_queue.h
+++ b/src/kudu/rpc/service_queue.h
@@ -17,16 +17,26 @@
 #ifndef KUDU_UTIL_SERVICE_QUEUE_H
 #define KUDU_UTIL_SERVICE_QUEUE_H
 
-#include <boost/optional.hpp>
 #include <memory>
 #include <string>
 #include <set>
 #include <vector>
 
+#include <glog/logging.h>
+
+#include "kudu/gutil/dynamic_annotations.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/rpc/inbound_call.h"
 #include "kudu/util/condition_variable.h"
+#include "kudu/util/locks.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/mutex.h"
 
+namespace boost {
+template <class T>
+class optional;
+}
+
 namespace kudu {
 namespace rpc {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/transfer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/transfer.cc b/src/kudu/rpc/transfer.cc
index 6446d5e..84d8bc9 100644
--- a/src/kudu/rpc/transfer.cc
+++ b/src/kudu/rpc/transfer.cc
@@ -17,21 +17,22 @@
 
 #include "kudu/rpc/transfer.h"
 
-#include <stdint.h>
+#include <sys/uio.h>
 
+#include <cstdint>
 #include <iostream>
-#include <sstream>
 
+#include <gflags/gflags.h>
 #include <glog/logging.h>
 
 #include "kudu/gutil/endian.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/rpc/constants.h"
-#include "kudu/rpc/messenger.h"
+#include "kudu/rpc/outbound_call.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/logging.h"
-#include "kudu/util/memory/memory.h"
-#include "kudu/util/net/sockaddr.h"
+#include "kudu/util/memory/overwrite.h"
 #include "kudu/util/net/socket.h"
 
 DEFINE_int32(rpc_max_message_size, (50 * 1024 * 1024),

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/transfer.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/transfer.h b/src/kudu/rpc/transfer.h
index d8e3a59..0bbbc85 100644
--- a/src/kudu/rpc/transfer.h
+++ b/src/kudu/rpc/transfer.h
@@ -19,32 +19,29 @@
 #define KUDU_RPC_TRANSFER_H
 
 #include <array>
-#include <boost/intrusive/list.hpp>
-#include <gflags/gflags.h>
-#include <set>
-#include <stdint.h>
+#include <cstddef>
+#include <cstdint>
+#include <memory>
 #include <string>
-#include <vector>
 
+#include <boost/intrusive/list_hook.hpp>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+
+#include "kudu/gutil/macros.h"
 #include "kudu/rpc/constants.h"
-#include "kudu/util/net/sockaddr.h"
+#include "kudu/util/faststring.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 
 DECLARE_int32(rpc_max_message_size);
 
-namespace google {
-namespace protobuf {
-class Message;
-} // namespace protobuf
-} // namespace google
-
 namespace kudu {
 
 class Socket;
 
 namespace rpc {
 
-class Messenger;
 class OutboundCall;
 struct TransferCallbacks;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/user_credentials.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/user_credentials.cc b/src/kudu/rpc/user_credentials.cc
index 0debd01..059b87a 100644
--- a/src/kudu/rpc/user_credentials.cc
+++ b/src/kudu/rpc/user_credentials.cc
@@ -17,9 +17,11 @@
 
 #include "kudu/rpc/user_credentials.h"
 
+#include <algorithm>
+#include <cstddef>
 #include <string>
 
-#include <boost/functional/hash.hpp>
+#include <boost/functional/hash/hash.hpp>
 
 #include "kudu/gutil/strings/substitute.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/rpc/user_credentials.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/user_credentials.h b/src/kudu/rpc/user_credentials.h
index 8cb68cc..ae507a2 100644
--- a/src/kudu/rpc/user_credentials.h
+++ b/src/kudu/rpc/user_credentials.h
@@ -16,6 +16,7 @@
 // under the License.
 #pragma once
 
+#include <cstddef>
 #include <string>
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/ca/cert_management-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/ca/cert_management-test.cc b/src/kudu/security/ca/cert_management-test.cc
index 6e4662d..97f423c 100644
--- a/src/kudu/security/ca/cert_management-test.cc
+++ b/src/kudu/security/ca/cert_management-test.cc
@@ -24,6 +24,7 @@
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/strings/util.h"
 #include "kudu/security/cert.h"
+#include "kudu/security/crypto.h"
 #include "kudu/security/openssl_util.h"
 #include "kudu/security/security-test-util.h"
 #include "kudu/security/test/test_certs.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/ca/cert_management.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/ca/cert_management.cc b/src/kudu/security/ca/cert_management.cc
index 09e59cd..3647e8c 100644
--- a/src/kudu/security/ca/cert_management.cc
+++ b/src/kudu/security/ca/cert_management.cc
@@ -17,14 +17,11 @@
 
 #include "kudu/security/ca/cert_management.h"
 
+#include <algorithm>
 #include <cstdio>
-#include <cstdlib>
-#include <functional>
-#include <iostream>
 #include <memory>
-#include <sstream>
+#include <mutex>
 #include <string>
-#include <type_traits>
 
 #include <glog/logging.h>
 #include <openssl/conf.h>
@@ -37,14 +34,14 @@
 
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/security/cert.h"
-#include "kudu/security/init.h"
+#include "kudu/security/crypto.h"
 #include "kudu/security/openssl_util.h"
+#include "kudu/util/net/socket.h"
 #include "kudu/util/scoped_cleanup.h"
 #include "kudu/util/status.h"
 
 using std::lock_guard;
 using std::move;
-using std::ostringstream;
 using std::string;
 using strings::Substitute;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/ca/cert_management.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/ca/cert_management.h b/src/kudu/security/ca/cert_management.h
index 919caff..9e43725 100644
--- a/src/kudu/security/ca/cert_management.h
+++ b/src/kudu/security/ca/cert_management.h
@@ -17,18 +17,16 @@
 
 #pragma once
 
-#include <functional>
-#include <map>
+#include <cstdint>
 #include <memory>
-#include <mutex>
 #include <string>
-#include <vector>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
+#include <glog/logging.h>
 
 #include "kudu/gutil/macros.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/stringpiece.h"
-#include "kudu/security/crypto.h"
 #include "kudu/security/openssl_util.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/monotime.h"
@@ -41,13 +39,16 @@ typedef struct env_md_st EVP_MD;
 typedef struct rsa_st RSA;
 typedef struct x509_st X509;
 typedef struct X509_req_st X509_REQ;
-struct stack_st_X509_EXTENSION; // STACK_OF(X509_EXTENSION)
+
+// STACK_OF(X509_EXTENSION)
+struct stack_st_X509_EXTENSION; // IWYU pragma: keep
 
 namespace kudu {
 namespace security {
 
 class Cert;
 class CertSignRequest;
+class PrivateKey;
 
 namespace ca {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/cert.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/cert.cc b/src/kudu/security/cert.cc
index 61e765c..6fef349 100644
--- a/src/kudu/security/cert.cc
+++ b/src/kudu/security/cert.cc
@@ -17,20 +17,21 @@
 
 #include "kudu/security/cert.h"
 
+#include <memory>
 #include <mutex>
+#include <ostream>
 #include <string>
 
+#include <boost/optional/optional.hpp>
+#include <glog/logging.h>
 #include <openssl/evp.h>
-#include <openssl/pem.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
-#include <boost/optional.hpp>
-
+#include "kudu/gutil/macros.h"
 #include "kudu/security/crypto.h"
 #include "kudu/security/openssl_util.h"
 #include "kudu/security/openssl_util_bio.h"
-#include "kudu/util/scoped_cleanup.h"
 #include "kudu/util/status.h"
 
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/cert.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/cert.h b/src/kudu/security/cert.h
index 4d93d1b..a64b8b8 100644
--- a/src/kudu/security/cert.h
+++ b/src/kudu/security/cert.h
@@ -17,13 +17,22 @@
 
 #pragma once
 
+#include <memory>
 #include <string>
 #include <vector>
 
-#include <boost/optional/optional_fwd.hpp>
+#include <openssl/asn1.h>
 
+#include "kudu/gutil/port.h"
 #include "kudu/security/openssl_util.h"
 
+typedef struct X509_name_st X509_NAME;
+
+namespace boost {
+template <class T>
+class optional;
+}
+
 namespace kudu {
 
 class Status;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/crypto.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/crypto.cc b/src/kudu/security/crypto.cc
index e7d5db6..526dda1 100644
--- a/src/kudu/security/crypto.cc
+++ b/src/kudu/security/crypto.cc
@@ -17,15 +17,21 @@
 
 #include "kudu/security/crypto.h"
 
-#include <cstdio>
-#include <cstdlib>
+#include <memory>
+#include <ostream>
 #include <string>
 
 #include <glog/logging.h>
 #include <openssl/bio.h>
+#include <openssl/bn.h>
+#include <openssl/err.h>
 #include <openssl/evp.h>
+#include <openssl/opensslv.h>
+#include <openssl/ossl_typ.h>
 #include <openssl/pem.h>
 #include <openssl/rand.h>
+#include <openssl/rsa.h>
+#include <openssl/x509.h>
 
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/security/openssl_util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/crypto.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/crypto.h b/src/kudu/security/crypto.h
index fe3ecb4..145c405 100644
--- a/src/kudu/security/crypto.h
+++ b/src/kudu/security/crypto.h
@@ -17,8 +17,13 @@
 
 #pragma once
 
+#include <cstddef>
 #include <string>
 
+#include <openssl/bio.h>
+#include <openssl/rsa.h>
+
+#include "kudu/gutil/port.h"
 #include "kudu/security/openssl_util.h"
 
 // Forward declarations for the OpenSSL typedefs.

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/init.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/init.cc b/src/kudu/security/init.cc
index 721c16f..deffa2f 100644
--- a/src/kudu/security/init.cc
+++ b/src/kudu/security/init.cc
@@ -17,27 +17,37 @@
 
 #include "kudu/security/init.h"
 
-#include <ctype.h>
-#include <krb5/krb5.h>
-
 #include <algorithm>
+#include <cctype>
+#include <cstdint>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
 #include <functional>
 #include <memory>
 #include <mutex>
+#include <ostream>
 #include <random>
 #include <string>
+#include <type_traits>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
+#include <gflags/gflags.h>
+#include <glog/logging.h>
+#include <krb5/krb5.h>
 
+#include "kudu/gutil/macros.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/strings/util.h"
 #include "kudu/util/env.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/flag_validators.h"
-#include "kudu/util/flags.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/net/net_util.h"
 #include "kudu/util/rw_mutex.h"
 #include "kudu/util/scoped_cleanup.h"
+#include "kudu/util/status.h"
 #include "kudu/util/thread.h"
 
 DEFINE_string(keytab_file, "",

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/init.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/init.h b/src/kudu/security/init.h
index 61c9577..e2b7376 100644
--- a/src/kudu/security/init.h
+++ b/src/kudu/security/init.h
@@ -18,7 +18,10 @@
 
 #include <string>
 
-#include <boost/optional/optional_fwd.hpp>
+namespace boost {
+template <class T>
+class optional;
+}
 
 namespace kudu {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/kerberos_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/kerberos_util.cc b/src/kudu/security/kerberos_util.cc
index 09f1b82..5e6d9b8 100644
--- a/src/kudu/security/kerberos_util.cc
+++ b/src/kudu/security/kerberos_util.cc
@@ -17,6 +17,7 @@
 
 #include "kudu/security/kerberos_util.h"
 #include "kudu/gutil/strings/split.h"
+#include "kudu/gutil/strings/stringpiece.h"
 
 #include <array>
 #include <utility>

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/krb5_realm_override.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/krb5_realm_override.cc b/src/kudu/security/krb5_realm_override.cc
index 3f875f1..05e8af8 100644
--- a/src/kudu/security/krb5_realm_override.cc
+++ b/src/kudu/security/krb5_realm_override.cc
@@ -34,9 +34,10 @@
 // referenced.
 
 #include <dlfcn.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+
+#include <cerrno>
+#include <cstdlib>
+#include <cstring>
 
 #include <krb5/krb5.h>
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/openssl_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/openssl_util.cc b/src/kudu/security/openssl_util.cc
index 861fff4..98ee245 100644
--- a/src/kudu/security/openssl_util.cc
+++ b/src/kudu/security/openssl_util.cc
@@ -17,27 +17,27 @@
 
 #include "kudu/security/openssl_util.h"
 
+#include <cerrno>
+#include <cstdint>
 #include <cstdio>
-#include <cstdlib>
 #include <mutex>
-#include <sstream>
 #include <string>
 #include <vector>
 
 #include <glog/logging.h>
+#include <openssl/crypto.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
-#include <openssl/ssl.h>
 
 #include "kudu/gutil/strings/split.h"
 #include "kudu/gutil/strings/strip.h"
+#include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/debug/leakcheck_disabler.h"
 #include "kudu/util/errno.h"
 #include "kudu/util/mutex.h"
 #include "kudu/util/scoped_cleanup.h"
 #include "kudu/util/status.h"
 #include "kudu/util/subprocess.h"
-#include "kudu/util/thread.h"
 
 using std::ostringstream;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/openssl_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/openssl_util.h b/src/kudu/security/openssl_util.h
index 04fb7cc..00c4ebf 100644
--- a/src/kudu/security/openssl_util.h
+++ b/src/kudu/security/openssl_util.h
@@ -19,14 +19,16 @@
 
 #include <functional>
 #include <memory>
+#include <ostream>
 #include <string>
 
+#include <glog/logging.h>
 #include <openssl/err.h>
 #include <openssl/pem.h>
 #include <openssl/ssl.h>
 #include <openssl/x509.h>
 
-#include "kudu/gutil/strings/substitute.h"
+#include "kudu/gutil/port.h"
 #include "kudu/util/status.h"
 
 // Forward declarations for the OpenSSL typedefs.

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/security-test-util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/security-test-util.cc b/src/kudu/security/security-test-util.cc
index 88ef2f8..eca7509 100644
--- a/src/kudu/security/security-test-util.cc
+++ b/src/kudu/security/security-test-util.cc
@@ -17,14 +17,16 @@
 
 #include "kudu/security/security-test-util.h"
 
-#include <glog/logging.h>
+#include <cstdint>
+#include <string>
+
+#include <boost/optional/optional.hpp>
 
 #include "kudu/security/ca/cert_management.h"
 #include "kudu/security/cert.h"
 #include "kudu/security/crypto.h"
 #include "kudu/security/test/test_certs.h"
 #include "kudu/security/tls_context.h"
-#include "kudu/util/path_util.h"
 #include "kudu/util/test_util.h"
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/security-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/security-test-util.h b/src/kudu/security/security-test-util.h
index 1af3349..5862bec 100644
--- a/src/kudu/security/security-test-util.h
+++ b/src/kudu/security/security-test-util.h
@@ -18,9 +18,7 @@
 #pragma once
 
 #include <ostream>
-#include <string>
 
-#include "kudu/util/env.h"
 #include "kudu/util/status.h"
 
 namespace kudu {
@@ -28,7 +26,6 @@ namespace security {
 
 class Cert;
 class PrivateKey;
-class PublicKey;
 class TlsContext;
 
 Status GenerateSelfSignedCAForTests(PrivateKey* ca_key, Cert* ca_cert);

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/simple_acl.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/simple_acl.cc b/src/kudu/security/simple_acl.cc
index f7d0b14..3b6aa37 100644
--- a/src/kudu/security/simple_acl.cc
+++ b/src/kudu/security/simple_acl.cc
@@ -17,8 +17,9 @@
 
 #include "kudu/security/simple_acl.h"
 
-#include <ctype.h>
-
+#include <algorithm>
+#include <cctype>
+#include <cstring>
 #include <vector>
 
 #include "kudu/gutil/map-util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/simple_acl.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/simple_acl.h b/src/kudu/security/simple_acl.h
index 96ca598..e27a8ca 100644
--- a/src/kudu/security/simple_acl.h
+++ b/src/kudu/security/simple_acl.h
@@ -16,8 +16,6 @@
 // under the License.
 #pragma once
 
-#include "kudu/gutil/macros.h"
-
 #include <set>
 #include <string>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/test/mini_kdc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/test/mini_kdc-test.cc b/src/kudu/security/test/mini_kdc-test.cc
index 01ed84d..08f493c 100644
--- a/src/kudu/security/test/mini_kdc-test.cc
+++ b/src/kudu/security/test/mini_kdc-test.cc
@@ -17,13 +17,14 @@
 
 #include <string>
 
-#include <boost/optional.hpp>
-#include <gflags/gflags.h>
+#include <boost/optional/optional.hpp>
+#include <gflags/gflags_declare.h>
 #include <gtest/gtest.h>
 
 #include "kudu/security/init.h"
 #include "kudu/security/test/mini_kdc.h"
-#include "kudu/util/env.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/test/mini_kdc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/test/mini_kdc.cc b/src/kudu/security/test/mini_kdc.cc
index 1b082c3..72eed29 100644
--- a/src/kudu/security/test/mini_kdc.cc
+++ b/src/kudu/security/test/mini_kdc.cc
@@ -18,7 +18,7 @@
 #include "kudu/security/test/mini_kdc.h"
 
 #include <csignal>
-#include <stdlib.h>
+#include <cstdlib>
 
 #include <map>
 #include <memory>
@@ -32,6 +32,7 @@
 #include "kudu/util/env.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/path_util.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/stopwatch.h"
 #include "kudu/util/subprocess.h"
 #include "kudu/util/test_util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/test/mini_kdc.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/test/mini_kdc.h b/src/kudu/security/test/mini_kdc.h
index 760c74b..c0d3151 100644
--- a/src/kudu/security/test/mini_kdc.h
+++ b/src/kudu/security/test/mini_kdc.h
@@ -17,18 +17,20 @@
 
 #pragma once
 
+#include <cstdint>
 #include <map>
 #include <memory>
+#include <ostream>
 #include <string>
 #include <vector>
 
 #include <glog/logging.h>
 
+#include "kudu/gutil/port.h"
 #include "kudu/util/status.h"
 
 namespace kudu {
 
-class Env;
 class Subprocess;
 
 struct MiniKdcOptions {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/tls_context.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/tls_context.cc b/src/kudu/security/tls_context.cc
index 69ef67c..3ab0131 100644
--- a/src/kudu/security/tls_context.cc
+++ b/src/kudu/security/tls_context.cc
@@ -17,17 +17,22 @@
 
 #include "kudu/security/tls_context.h"
 
+#include <algorithm>
 #include <mutex>
+#include <ostream>
 #include <string>
 #include <vector>
 
 #include <boost/algorithm/string/predicate.hpp>
 #include <gflags/gflags.h>
+#include <glog/logging.h>
 #include <openssl/err.h>
 #include <openssl/ssl.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
+#include "kudu/gutil/basictypes.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/security/ca/cert_management.h"
 #include "kudu/security/cert.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/tls_context.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/tls_context.h b/src/kudu/security/tls_context.h
index 1785471..33ca403 100644
--- a/src/kudu/security/tls_context.h
+++ b/src/kudu/security/tls_context.h
@@ -17,15 +17,16 @@
 
 #pragma once
 
-#include <functional>
+#include <cstdint>
+#include <memory>
 #include <string>
 #include <vector>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
 
-#include "kudu/security/cert.h"
+#include "kudu/gutil/port.h"
+#include "kudu/security/openssl_util.h"
 #include "kudu/security/tls_handshake.h"
-#include "kudu/util/atomic.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/rw_mutex.h"
 #include "kudu/util/status.h"
@@ -34,6 +35,7 @@ namespace kudu {
 namespace security {
 
 class Cert;
+class CertSignRequest;
 class PrivateKey;
 
 // TlsContext wraps data required by the OpenSSL library for creating and

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/tls_handshake-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/tls_handshake-test.cc b/src/kudu/security/tls_handshake-test.cc
index 60b1b91..9dd038f 100644
--- a/src/kudu/security/tls_handshake-test.cc
+++ b/src/kudu/security/tls_handshake-test.cc
@@ -33,6 +33,7 @@
 #include "kudu/security/security-test-util.h"
 #include "kudu/security/tls_context.h"
 #include "kudu/util/scoped_cleanup.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/tls_handshake.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/tls_handshake.cc b/src/kudu/security/tls_handshake.cc
index b5f4651..57f9c7c 100644
--- a/src/kudu/security/tls_handshake.cc
+++ b/src/kudu/security/tls_handshake.cc
@@ -20,7 +20,6 @@
 #include <memory>
 #include <string>
 
-#include <openssl/err.h>
 #include <openssl/ssl.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
@@ -28,7 +27,7 @@
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/security/cert.h"
 #include "kudu/security/tls_socket.h"
-#include "kudu/util/net/sockaddr.h"
+#include "kudu/util/net/socket.h"
 #include "kudu/util/status.h"
 #include "kudu/util/trace.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/tls_handshake.h
----------------------------------------------------------------------
diff --git a/src/kudu/security/tls_handshake.h b/src/kudu/security/tls_handshake.h
index cd3cb7c..f71771a 100644
--- a/src/kudu/security/tls_handshake.h
+++ b/src/kudu/security/tls_handshake.h
@@ -17,14 +17,15 @@
 
 #pragma once
 
+#include <algorithm>
 #include <memory>
 #include <string>
 
 #include <glog/logging.h>
 
+#include "kudu/gutil/port.h"
 #include "kudu/security/cert.h"
 #include "kudu/security/openssl_util.h"
-#include "kudu/util/net/socket.h"
 #include "kudu/util/status.h"
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/security/tls_socket.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/tls_socket.cc b/src/kudu/security/tls_socket.cc
index 7aeca31..58addfc 100644
--- a/src/kudu/security/tls_socket.cc
+++ b/src/kudu/security/tls_socket.cc
@@ -17,12 +17,15 @@
 
 #include "kudu/security/tls_socket.h"
 
+#include <sys/uio.h>
+
+#include <algorithm>
+#include <cerrno>
+
+#include <glog/logging.h>
 #include <openssl/err.h>
-#include <openssl/ssl.h>
-#include <openssl/x509.h>
 
 #include "kudu/gutil/basictypes.h"
-#include "kudu/security/cert.h"
 #include "kudu/security/openssl_util.h"
 #include "kudu/util/errno.h"
 


Mime
View raw message