kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [10/14] kudu git commit: [iwyu] first pass
Date Mon, 21 Aug 2017 21:03:57 GMT
http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log-test.cc b/src/kudu/consensus/log-test.cc
index dd5c69b..4e2dec9 100644
--- a/src/kudu/consensus/log-test.cc
+++ b/src/kudu/consensus/log-test.cc
@@ -16,23 +16,49 @@
 // under the License.
 
 #include <algorithm>
+#include <cerrno>
+#include <cstddef>
+#include <cstdint>
 #include <limits>
 #include <memory>
+#include <ostream>
 #include <string>
+#include <type_traits>
 #include <vector>
 
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
+#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
 #include <glog/stl_logging.h>
+#include <gtest/gtest.h>
 
-#include "kudu/consensus/consensus-test-util.h"
+#include "kudu/common/wire_protocol-test-util.h"
+#include "kudu/common/wire_protocol.h"
+#include "kudu/consensus/consensus.pb.h"
 #include "kudu/consensus/log-test-base.h"
+#include "kudu/consensus/log.h"
+#include "kudu/consensus/log.pb.h"
+#include "kudu/consensus/log_anchor_registry.h"
 #include "kudu/consensus/log_index.h"
+#include "kudu/consensus/log_reader.h"
+#include "kudu/consensus/log_util.h"
+#include "kudu/consensus/opid.pb.h"
 #include "kudu/consensus/opid_util.h"
+#include "kudu/fs/fs_manager.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/move.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/tablet/mvcc.h"
+#include "kudu/util/async_util.h"
+#include "kudu/util/compression/compression.pb.h"
+#include "kudu/util/env.h"
+#include "kudu/util/metrics.h"
 #include "kudu/util/random.h"
+#include "kudu/util/status.h"
+#include "kudu/util/stopwatch.h"
+#include "kudu/util/test_macros.h"
+#include "kudu/util/test_util.h"
 
 DEFINE_int32(num_batches, 10000,
              "Number of batches to write to/read from the Log in TestWriteManyBatches");

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log.cc b/src/kudu/consensus/log.cc
index 6b22733..1df37d9 100644
--- a/src/kudu/consensus/log.cc
+++ b/src/kudu/consensus/log.cc
@@ -18,39 +18,47 @@
 #include "kudu/consensus/log.h"
 
 #include <algorithm>
-#include <limits>
+#include <cerrno>
+#include <cstdint>
 #include <memory>
 #include <mutex>
+#include <ostream>
 
 #include <boost/range/adaptor/reversed.hpp>
+#include <gflags/gflags.h>
 
 #include "kudu/common/wire_protocol.h"
 #include "kudu/consensus/log_index.h"
 #include "kudu/consensus/log_metrics.h"
 #include "kudu/consensus/log_reader.h"
 #include "kudu/consensus/log_util.h"
+#include "kudu/consensus/opid_util.h"
 #include "kudu/fs/fs_manager.h"
-#include "kudu/gutil/map-util.h"
+#include "kudu/gutil/atomicops.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/bind_helpers.h"
+#include "kudu/gutil/dynamic_annotations.h"
+#include "kudu/gutil/port.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/util/coding.h"
+#include "kudu/util/async_util.h"
+#include "kudu/util/compression/compression.pb.h"
 #include "kudu/util/compression/compression_codec.h"
-#include "kudu/util/countdown_latch.h"
 #include "kudu/util/debug/trace_event.h"
+#include "kudu/util/env.h"
 #include "kudu/util/env_util.h"
 #include "kudu/util/fault_injection.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/kernel_stack_watchdog.h"
 #include "kudu/util/logging.h"
 #include "kudu/util/metrics.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/path_util.h"
 #include "kudu/util/pb_util.h"
 #include "kudu/util/random.h"
 #include "kudu/util/scoped_cleanup.h"
 #include "kudu/util/stopwatch.h"
-#include "kudu/util/thread.h"
 #include "kudu/util/threadpool.h"
 #include "kudu/util/trace.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log.h b/src/kudu/consensus/log.h
index c4d16a3..9f4d77c 100644
--- a/src/kudu/consensus/log.h
+++ b/src/kudu/consensus/log.h
@@ -18,30 +18,43 @@
 #ifndef KUDU_CONSENSUS_LOG_H_
 #define KUDU_CONSENSUS_LOG_H_
 
+#include <cstddef>
+#include <cstdint>
 #include <limits>
 #include <map>
 #include <memory>
 #include <string>
 #include <vector>
 
+#include <glog/logging.h>
+#include <gtest/gtest_prod.h>
+
 #include "kudu/common/schema.h"
+#include "kudu/consensus/consensus.pb.h"
+#include "kudu/consensus/log.pb.h"
 #include "kudu/consensus/log_util.h"
-#include "kudu/consensus/opid_util.h"
+#include "kudu/consensus/opid.pb.h"
 #include "kudu/consensus/ref_counted_replicate.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/gutil/spinlock.h"
-#include "kudu/util/async_util.h"
 #include "kudu/util/blocking_queue.h"
+#include "kudu/util/faststring.h"
 #include "kudu/util/locks.h"
-#include "kudu/util/rw_mutex.h"
 #include "kudu/util/promise.h"
+#include "kudu/util/rw_mutex.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/status.h"
+#include "kudu/util/status_callback.h"
 
 namespace kudu {
 
+class CompressionCodec;
 class FsManager;
 class MetricEntity;
 class ThreadPool;
+class WritableFile;
+struct WritableFileOptions;
 
 namespace log {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_anchor_registry-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_anchor_registry-test.cc b/src/kudu/consensus/log_anchor_registry-test.cc
index f6d255c..a824152 100644
--- a/src/kudu/consensus/log_anchor_registry-test.cc
+++ b/src/kudu/consensus/log_anchor_registry-test.cc
@@ -17,10 +17,16 @@
 
 #include "kudu/consensus/log_anchor_registry.h"
 
-#include <glog/logging.h>
+#include <cstdint>
+#include <string>
+
 #include <gtest/gtest.h>
 
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/util/monotime.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/consensus/log_anchor_registry.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_anchor_registry.cc b/src/kudu/consensus/log_anchor_registry.cc
index 0243d54..04c0928 100644
--- a/src/kudu/consensus/log_anchor_registry.cc
+++ b/src/kudu/consensus/log_anchor_registry.cc
@@ -16,11 +16,16 @@
 // under the License.
 
 #include "kudu/consensus/log_anchor_registry.h"
-#include "kudu/consensus/opid_util.h"
 
 #include <mutex>
+#include <ostream>
 #include <string>
+#include <utility>
+
+#include <glog/logging.h>
 
+#include "kudu/consensus/opid_util.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_anchor_registry.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_anchor_registry.h b/src/kudu/consensus/log_anchor_registry.h
index 42fbc91..56857d7 100644
--- a/src/kudu/consensus/log_anchor_registry.h
+++ b/src/kudu/consensus/log_anchor_registry.h
@@ -17,10 +17,13 @@
 #ifndef KUDU_CONSENSUS_LOG_ANCHOR_REGISTRY_
 #define KUDU_CONSENSUS_LOG_ANCHOR_REGISTRY_
 
-#include <gtest/gtest_prod.h>
+#include <cstddef>
+#include <cstdint>
 #include <map>
 #include <string>
 
+#include <gtest/gtest_prod.h>
+
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/locks.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_cache-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_cache-test.cc b/src/kudu/consensus/log_cache-test.cc
index 3ac9dcd..4c16efa 100644
--- a/src/kudu/consensus/log_cache-test.cc
+++ b/src/kudu/consensus/log_cache-test.cc
@@ -15,20 +15,39 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <gtest/gtest.h>
+#include <cstddef>
+#include <cstdint>
 #include <memory>
+#include <ostream>
 #include <string>
+#include <vector>
+
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
 
+#include "kudu/clock/clock.h"
 #include "kudu/clock/hybrid_clock.h"
+#include "kudu/common/schema.h"
 #include "kudu/common/wire_protocol-test-util.h"
 #include "kudu/consensus/consensus-test-util.h"
+#include "kudu/consensus/consensus.pb.h"
 #include "kudu/consensus/log.h"
 #include "kudu/consensus/log_cache.h"
+#include "kudu/consensus/log_util.h"
+#include "kudu/consensus/opid.pb.h"
+#include "kudu/consensus/opid_util.h"
+#include "kudu/consensus/ref_counted_replicate.h"
 #include "kudu/fs/fs_manager.h"
-#include "kudu/gutil/bind_helpers.h"
-#include "kudu/gutil/stl_util.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/ref_counted.h"
+#include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/metrics.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
 using std::shared_ptr;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_cache.cc b/src/kudu/consensus/log_cache.cc
index 060b03a..7660918 100644
--- a/src/kudu/consensus/log_cache.cc
+++ b/src/kudu/consensus/log_cache.cc
@@ -17,26 +17,33 @@
 
 #include "kudu/consensus/log_cache.h"
 
-#include <algorithm>
-#include <gflags/gflags.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/wire_format_lite_inl.h>
 #include <map>
 #include <mutex>
 #include <vector>
+#include <ostream>
+#include <utility>
+
+#include <gflags/gflags.h>
+#include <glog/logging.h>
+#include <google/protobuf/wire_format_lite.h>
+#include <google/protobuf/wire_format_lite_inl.h>
 
+#include "kudu/consensus/consensus.pb.h"
 #include "kudu/consensus/log.h"
 #include "kudu/consensus/log_reader.h"
+#include "kudu/consensus/opid.pb.h"
+#include "kudu/consensus/opid_util.h"
 #include "kudu/consensus/ref_counted_replicate.h"
 #include "kudu/gutil/bind.h"
+#include "kudu/gutil/bind_helpers.h"
 #include "kudu/gutil/map-util.h"
-#include "kudu/gutil/stl_util.h"
+#include "kudu/gutil/mathlimits.h"
 #include "kudu/gutil/strings/human_readable.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/util/debug-util.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/logging.h"
+#include "kudu/util/make_shared.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/pb_util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_cache.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_cache.h b/src/kudu/consensus/log_cache.h
index b056230..5ff8399 100644
--- a/src/kudu/consensus/log_cache.h
+++ b/src/kudu/consensus/log_cache.h
@@ -17,34 +17,34 @@
 #ifndef KUDU_CONSENSUS_LOG_CACHE_H
 #define KUDU_CONSENSUS_LOG_CACHE_H
 
+#include <cstdint>
+#include <iosfwd>
 #include <map>
 #include <memory>
 #include <string>
 #include <vector>
 
-#include "kudu/consensus/consensus.pb.h"
-#include "kudu/consensus/opid_util.h"
+#include <gtest/gtest_prod.h>
+
 #include "kudu/consensus/ref_counted_replicate.h"
-#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/macros.h"
-#include "kudu/util/async_util.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/status.h"
+#include "kudu/util/status_callback.h"
 
 namespace kudu {
 
-class MetricEntity;
 class MemTracker;
 
 namespace log {
 class Log;
-class LogReader;
 } // namespace log
 
 namespace consensus {
 
-class ReplicateMsg;
+class OpId;
 
 // Write-through cache for the log.
 //

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_index-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_index-test.cc b/src/kudu/consensus/log_index-test.cc
index 7bbafea..310e329 100644
--- a/src/kudu/consensus/log_index-test.cc
+++ b/src/kudu/consensus/log_index-test.cc
@@ -15,10 +15,18 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "kudu/consensus/log_index.h"
+#include <cstdint>
+#include <string>
+
+#include <gtest/gtest.h>
 
+#include "kudu/consensus/log_index.h"
+#include "kudu/consensus/opid.pb.h"
 #include "kudu/consensus/opid_util.h"
-#include "kudu/fs/fs_manager.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/ref_counted.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_index.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_index.cc b/src/kudu/consensus/log_index.cc
index e3d743f..7a77e90 100644
--- a/src/kudu/consensus/log_index.cc
+++ b/src/kudu/consensus/log_index.cc
@@ -29,20 +29,27 @@
 #include "kudu/consensus/log_index.h"
 
 #include <fcntl.h>
-#include <mutex>
-#include <string>
 #include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
+
+#include <cerrno>
+#include <cinttypes>
+#include <cstdint>
+#include <cstring>
+#include <mutex>
+#include <ostream>
+#include <string>
+#include <utility>
 #include <vector>
 
+#include <glog/logging.h>
+
 #include "kudu/consensus/opid_util.h"
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/errno.h"
-#include "kudu/util/locks.h"
 
 using std::string;
 using std::vector;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_index.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_index.h b/src/kudu/consensus/log_index.h
index 7d12ecd..1f9ce31 100644
--- a/src/kudu/consensus/log_index.h
+++ b/src/kudu/consensus/log_index.h
@@ -17,10 +17,11 @@
 #ifndef KUDU_CONSENSUS_LOG_INDEX_H
 #define KUDU_CONSENSUS_LOG_INDEX_H
 
+#include <cstdint>
 #include <string>
 #include <map>
 
-#include "kudu/consensus/consensus.pb.h"
+#include "kudu/consensus/opid.pb.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/locks.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_metrics.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_metrics.h b/src/kudu/consensus/log_metrics.h
index 30dfcde..cfedc20 100644
--- a/src/kudu/consensus/log_metrics.h
+++ b/src/kudu/consensus/log_metrics.h
@@ -17,16 +17,10 @@
 #ifndef KUDU_CONSENSUS_LOG_METRICS_H
 #define KUDU_CONSENSUS_LOG_METRICS_H
 
-#include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/util/monotime.h"
+#include "kudu/util/metrics.h"
 
 namespace kudu {
-
-class Counter;
-class Histogram;
-class MetricEntity;
-
 namespace log {
 
 struct LogMetrics {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_reader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_reader.cc b/src/kudu/consensus/log_reader.cc
index 5057b06..330d658 100644
--- a/src/kudu/consensus/log_reader.cc
+++ b/src/kudu/consensus/log_reader.cc
@@ -19,16 +19,22 @@
 
 #include <algorithm>
 #include <mutex>
+#include <ostream>
 
+#include <glog/logging.h>
+
+#include "kudu/consensus/consensus.pb.h"
+#include "kudu/consensus/log.pb.h"
 #include "kudu/consensus/log_index.h"
-#include "kudu/consensus/opid_util.h"
-#include "kudu/gutil/map-util.h"
+#include "kudu/consensus/opid.pb.h"
+#include "kudu/fs/fs_manager.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/stl_util.h"
-#include "kudu/gutil/strings/util.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/util/coding.h"
-#include "kudu/util/env_util.h"
-#include "kudu/util/hexdump.h"
+#include "kudu/gutil/strings/util.h"
+#include "kudu/util/env.h"
+#include "kudu/util/faststring.h"
+#include "kudu/util/make_shared.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/path_util.h"
 #include "kudu/util/pb_util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_reader.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_reader.h b/src/kudu/consensus/log_reader.h
index ecd9cd3..312868f 100644
--- a/src/kudu/consensus/log_reader.h
+++ b/src/kudu/consensus/log_reader.h
@@ -17,26 +17,37 @@
 #ifndef KUDU_LOG_LOG_READER_H_
 #define KUDU_LOG_LOG_READER_H_
 
-#include <gtest/gtest.h>
-#include <map>
+#include <cstdint>
 #include <memory>
 #include <string>
-#include <utility>
 #include <vector>
 
-#include "kudu/consensus/log_metrics.h"
+#include <gtest/gtest_prod.h>
+
 #include "kudu/consensus/log_util.h"
-#include "kudu/consensus/opid_util.h"
-#include "kudu/fs/fs_manager.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/gutil/spinlock.h"
-#include "kudu/util/make_shared.h"
 #include "kudu/util/locks.h"
+#include "kudu/util/make_shared.h"
+#include "kudu/util/status.h"
 
 namespace kudu {
+
+class Counter;
+class FsManager;
+class Histogram;
+class MetricEntity;
+class faststring;
+
+namespace consensus {
+class OpId;
+class ReplicateMsg;
+} // namespace consensus
+
 namespace log {
-class Log;
 class LogIndex;
+class LogEntryBatchPB;
 struct LogIndexEntry;
 
 // Reads a set of segments from a given path. Segment headers and footers

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_util.cc b/src/kudu/consensus/log_util.cc
index 497e22e..b77df66 100644
--- a/src/kudu/consensus/log_util.cc
+++ b/src/kudu/consensus/log_util.cc
@@ -18,23 +18,23 @@
 #include "kudu/consensus/log_util.h"
 
 #include <algorithm>
+#include <cstring>
 #include <iostream>
-#include <limits>
-#include <utility>
 
 #include <gflags/gflags.h>
 #include <glog/logging.h>
 
+#include "kudu/consensus/consensus.pb.h"
 #include "kudu/consensus/opid_util.h"
 #include "kudu/consensus/ref_counted_replicate.h"
 #include "kudu/fs/fs_manager.h"
-#include "kudu/gutil/map-util.h"
-#include "kudu/gutil/stl_util.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/split.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/strings/util.h"
 #include "kudu/util/coding-inl.h"
 #include "kudu/util/coding.h"
+#include "kudu/util/compression/compression.pb.h"
 #include "kudu/util/compression/compression_codec.h"
 #include "kudu/util/crc.h"
 #include "kudu/util/debug/trace_event.h"
@@ -42,8 +42,8 @@
 #include "kudu/util/fault_injection.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/logging.h"
+#include "kudu/util/make_shared.h"
 #include "kudu/util/pb_util.h"
-#include "kudu/util/scoped_cleanup.h"
 
 DEFINE_int32(log_segment_size_mb, 8,
              "The default size for log segments, in MB");

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/log_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_util.h b/src/kudu/consensus/log_util.h
index eb254a8..af81c82 100644
--- a/src/kudu/consensus/log_util.h
+++ b/src/kudu/consensus/log_util.h
@@ -18,21 +18,28 @@
 #ifndef KUDU_CONSENSUS_LOG_UTIL_H_
 #define KUDU_CONSENSUS_LOG_UTIL_H_
 
+#include <cstddef>
+#include <cstdint>
 #include <deque>
-#include <gtest/gtest.h>
-#include <iosfwd>
-#include <map>
 #include <memory>
 #include <string>
-#include <utility>
 #include <vector>
 
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest_prod.h>
+
 #include "kudu/consensus/log.pb.h"
+#include "kudu/consensus/opid.pb.h"
 #include "kudu/consensus/ref_counted_replicate.h"
+#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/atomic.h"
 #include "kudu/util/env.h"
+#include "kudu/util/faststring.h"
+#include "kudu/util/slice.h"
+#include "kudu/util/status.h"
 
 // Used by other classes, now part of the API.
 DECLARE_bool(log_force_fsync_all);
@@ -41,10 +48,6 @@ namespace kudu {
 
 class CompressionCodec;
 
-namespace consensus {
-struct OpIdBiggerThanFunctor;
-} // namespace consensus
-
 namespace log {
 
 // Each log entry is prefixed by a header. See DecodeEntryHeader()

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/mt-log-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/mt-log-test.cc b/src/kudu/consensus/mt-log-test.cc
index 133a895..b5502e6 100644
--- a/src/kudu/consensus/mt-log-test.cc
+++ b/src/kudu/consensus/mt-log-test.cc
@@ -15,21 +15,50 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "kudu/consensus/log-test-base.h"
-
 #include <algorithm>
 #include <atomic>
+#include <cstdint>
+#include <map>
 #include <memory>
 #include <mutex>
+#include <ostream>
 #include <thread>
 #include <vector>
 
+#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
+
+#include "kudu/clock/clock.h"
+#include "kudu/common/timestamp.h"
+#include "kudu/common/wire_protocol-test-util.h"
+#include "kudu/common/wire_protocol.pb.h"
+#include "kudu/consensus/consensus.pb.h"
+#include "kudu/consensus/log-test-base.h"
+#include "kudu/consensus/log.h"
 #include "kudu/consensus/log_index.h"
+#include "kudu/consensus/log_reader.h"
+#include "kudu/consensus/log_util.h"
+#include "kudu/consensus/opid.pb.h"
+#include "kudu/consensus/ref_counted_replicate.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/bind_helpers.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/tserver/tserver.pb.h"
+#include "kudu/util/countdown_latch.h"
 #include "kudu/util/fault_injection.h"
 #include "kudu/util/locks.h"
+#include "kudu/util/metrics.h"
 #include "kudu/util/random.h"
+#include "kudu/util/status.h"
+#include "kudu/util/status_callback.h"
+#include "kudu/util/stopwatch.h"
+#include "kudu/util/test_macros.h"
+#include "kudu/util/test_util.h"
 #include "kudu/util/thread.h"
 
 DEFINE_int32(num_writer_threads, 4, "Number of threads writing to the log");

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/opid_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/opid_util.cc b/src/kudu/consensus/opid_util.cc
index c39cb51..a64e852 100644
--- a/src/kudu/consensus/opid_util.cc
+++ b/src/kudu/consensus/opid_util.cc
@@ -17,11 +17,13 @@
 
 #include "kudu/consensus/opid_util.h"
 
-#include <algorithm>
-#include <glog/logging.h>
 #include <limits>
+#include <utility>
+
+#include <glog/logging.h>
 
 #include "kudu/consensus/consensus.pb.h"
+#include "kudu/consensus/opid.pb.h"
 #include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/opid_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/opid_util.h b/src/kudu/consensus/opid_util.h
index 7c1a40e..507b369 100644
--- a/src/kudu/consensus/opid_util.h
+++ b/src/kudu/consensus/opid_util.h
@@ -18,11 +18,10 @@
 #ifndef KUDU_CONSENSUS_OPID_UTIL_H_
 #define KUDU_CONSENSUS_OPID_UTIL_H_
 
-#include <stdint.h>
-
+#include <cstddef>
+#include <cstdint>
 #include <iosfwd>
 #include <string>
-#include <utility>
 
 namespace kudu {
 namespace consensus {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/peer_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/peer_manager.cc b/src/kudu/consensus/peer_manager.cc
index 0dde6a6..55668d5 100644
--- a/src/kudu/consensus/peer_manager.cc
+++ b/src/kudu/consensus/peer_manager.cc
@@ -19,14 +19,21 @@
 
 #include <memory>
 #include <mutex>
+#include <ostream>
+#include <type_traits>
+#include <utility>
+
+#include <glog/logging.h>
 
 #include "kudu/consensus/consensus_peers.h"
 #include "kudu/consensus/log.h"
+#include "kudu/consensus/metadata.pb.h"
+#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/map-util.h"
-#include "kudu/gutil/stl_util.h"
+#include "kudu/gutil/move.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/pb_util.h"
-#include "kudu/util/threadpool.h"
 
 using kudu::log::Log;
 using kudu::pb_util::SecureShortDebugString;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/peer_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/peer_manager.h b/src/kudu/consensus/peer_manager.h
index 9825dea..6b7058a 100644
--- a/src/kudu/consensus/peer_manager.h
+++ b/src/kudu/consensus/peer_manager.h
@@ -21,7 +21,6 @@
 #include <string>
 #include <unordered_map>
 
-#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/locks.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/pending_rounds.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/pending_rounds.cc b/src/kudu/consensus/pending_rounds.cc
index 6484183..f334be8 100644
--- a/src/kudu/consensus/pending_rounds.cc
+++ b/src/kudu/consensus/pending_rounds.cc
@@ -17,13 +17,23 @@
 
 #include "kudu/consensus/pending_rounds.h"
 
+#include <ostream>
+#include <utility>
+
+#include <glog/logging.h>
+
+#include "kudu/consensus/consensus.pb.h"
+#include "kudu/consensus/opid_util.h"
 #include "kudu/consensus/raft_consensus.h"
 #include "kudu/consensus/time_manager.h"
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/util/debug-util.h"
 #include "kudu/util/logging.h"
 #include "kudu/util/pb_util.h"
 #include "kudu/util/status.h"
+#include "kudu/util/thread_restrictions.h"
 
 using kudu::pb_util::SecureShortDebugString;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/pending_rounds.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/pending_rounds.h b/src/kudu/consensus/pending_rounds.h
index ccc9cd4..c1043b6 100644
--- a/src/kudu/consensus/pending_rounds.h
+++ b/src/kudu/consensus/pending_rounds.h
@@ -17,11 +17,11 @@
 
 #pragma once
 
+#include <cstdint>
 #include <map>
 #include <string>
 
 #include "kudu/consensus/opid.pb.h"
-#include "kudu/consensus/opid_util.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/quorum_util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/quorum_util-test.cc b/src/kudu/consensus/quorum_util-test.cc
index 70e361c..87b30cd 100644
--- a/src/kudu/consensus/quorum_util-test.cc
+++ b/src/kudu/consensus/quorum_util-test.cc
@@ -15,11 +15,15 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <glog/logging.h>
-#include "kudu/consensus/quorum_util.h"
+#include <string>
+
+#include <gtest/gtest.h>
 
-#include "kudu/consensus/opid_util.h"
-#include "kudu/util/test_util.h"
+#include "kudu/common/common.pb.h"
+#include "kudu/consensus/metadata.pb.h"
+#include "kudu/consensus/quorum_util.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
 
 namespace kudu {
 namespace consensus {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/quorum_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/quorum_util.cc b/src/kudu/consensus/quorum_util.cc
index a433ec9..f4e88d2 100644
--- a/src/kudu/consensus/quorum_util.cc
+++ b/src/kudu/consensus/quorum_util.cc
@@ -22,6 +22,9 @@
 #include <utility>
 #include <vector>
 
+#include <glog/logging.h>
+
+#include "kudu/common/common.pb.h"
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/substitute.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/quorum_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/quorum_util.h b/src/kudu/consensus/quorum_util.h
index 2a8aa61..d502037 100644
--- a/src/kudu/consensus/quorum_util.h
+++ b/src/kudu/consensus/quorum_util.h
@@ -21,9 +21,9 @@
 #include <string>
 
 #include "kudu/consensus/metadata.pb.h"
+#include "kudu/util/status.h"
 
 namespace kudu {
-class Status;
 
 namespace consensus {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/raft_consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index a7140ce..2c900a5 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -18,27 +18,46 @@
 #include "kudu/consensus/raft_consensus.h"
 
 #include <algorithm>
+#include <cmath>
+#include <cstdint>
+#include <functional>
 #include <memory>
 #include <mutex>
 #include <ostream>
+#include <unordered_set>
+#include <type_traits>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
 #include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
 
-#include "kudu/clock/clock.h"
+#include "kudu/common/timestamp.h"
 #include "kudu/common/wire_protocol.h"
 #include "kudu/consensus/consensus.pb.h"
+#include "kudu/consensus/consensus_meta.h"
 #include "kudu/consensus/consensus_meta_manager.h"
 #include "kudu/consensus/consensus_peers.h"
 #include "kudu/consensus/leader_election.h"
 #include "kudu/consensus/log.h"
 #include "kudu/consensus/metadata.pb.h"
+#include "kudu/consensus/opid_util.h"
 #include "kudu/consensus/peer_manager.h"
+#include "kudu/consensus/pending_rounds.h"
 #include "kudu/consensus/quorum_util.h"
+#include "kudu/gutil/basictypes.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/bind_helpers.h"
+#include "kudu/gutil/integral_types.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/stringprintf.h"
+#include "kudu/gutil/strings/stringpiece.h"
+#include "kudu/gutil/strings/substitute.h"
+#include "kudu/util/async_util.h"
 #include "kudu/util/debug/trace_event.h"
+#include "kudu/util/failure_detector.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/logging.h"
 #include "kudu/util/metrics.h"
@@ -46,6 +65,8 @@
 #include "kudu/util/process_memory.h"
 #include "kudu/util/random.h"
 #include "kudu/util/random_util.h"
+#include "kudu/util/status.h"
+#include "kudu/util/thread_restrictions.h"
 #include "kudu/util/threadpool.h"
 #include "kudu/util/trace.h"
 #include "kudu/util/url-coding.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/raft_consensus.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.h b/src/kudu/consensus/raft_consensus.h
index 0eb3652..4ecb25e 100644
--- a/src/kudu/consensus/raft_consensus.h
+++ b/src/kudu/consensus/raft_consensus.h
@@ -17,62 +17,67 @@
 
 #pragma once
 
+#include <algorithm>
+#include <cstdint>
 #include <iosfwd>
 #include <memory>
 #include <mutex>
 #include <string>
-#include <utility>
 #include <vector>
 
-#include <boost/optional/optional_fwd.hpp>
+#include <glog/logging.h>
+#include <gtest/gtest_prod.h>
 
 #include "kudu/consensus/consensus.pb.h"
-#include "kudu/consensus/consensus_meta.h"
+#include "kudu/consensus/consensus_meta.h"  // IWYU pragma: keep
 #include "kudu/consensus/consensus_queue.h"
-#include "kudu/consensus/peer_manager.h"
-#include "kudu/consensus/pending_rounds.h"
+#include "kudu/consensus/log.h"
+#include "kudu/consensus/metadata.pb.h"
+#include "kudu/consensus/opid.pb.h"
+#include "kudu/consensus/ref_counted_replicate.h"
 #include "kudu/consensus/time_manager.h"
+#include "kudu/gutil/callback.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/macros.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/ref_counted.h"
+#include "kudu/tserver/tserver.pb.h"
 #include "kudu/util/atomic.h"
-#include "kudu/util/failure_detector.h"
+#include "kudu/util/locks.h"
+#include "kudu/util/metrics.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/random.h"
 #include "kudu/util/status_callback.h"
 
+namespace boost {
+template <class T>
+class optional;
+}
+
 namespace kudu {
 
-class Counter;
 class FailureDetector;
-class HostPort;
-class MonoDelta;
+class RandomizedFailureMonitor;
+
+typedef std::lock_guard<simple_spinlock> Lock;
+typedef gscoped_ptr<Lock> ScopedLock;
+
 class ThreadPool;
 class ThreadPoolToken;
 class Status;
 
-namespace log {
-class Log;
-struct RetentionIndexes;
-}
-
-namespace rpc {
-class Messenger;
-}
-
-namespace server {
-class Clock;
-}
-
-namespace tserver {
-class TabletServerErrorPB;
-}
+template <typename Sig>
+class Callback;
 
 namespace consensus {
 
 class ConsensusMetadata;
+class ConsensusMetadataManager;
 class ConsensusRound;
-class Peer;
 class PeerProxyFactory;
 class PeerManager;
+class PendingRounds;
 class ReplicaTransactionFactory;
-class TimeManager;
 
 struct ConsensusBootstrapInfo;
 struct ElectionResult;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/raft_consensus_quorum-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus_quorum-test.cc b/src/kudu/consensus/raft_consensus_quorum-test.cc
index 43816b4..0790993 100644
--- a/src/kudu/consensus/raft_consensus_quorum-test.cc
+++ b/src/kudu/consensus/raft_consensus_quorum-test.cc
@@ -15,33 +15,62 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <gtest/gtest.h>
+#include <algorithm>
+#include <cstdint>
 #include <memory>
+#include <ostream>
+#include <string>
+#include <type_traits>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
 
+#include "kudu/clock/clock.h"
 #include "kudu/clock/logical_clock.h"
+#include "kudu/common/common.pb.h"
 #include "kudu/common/schema.h"
+#include "kudu/common/timestamp.h"
 #include "kudu/common/wire_protocol-test-util.h"
+#include "kudu/common/wire_protocol.pb.h"
 #include "kudu/consensus/consensus-test-util.h"
 #include "kudu/consensus/consensus.pb.h"
-#include "kudu/consensus/consensus.proxy.h"
+#include "kudu/consensus/consensus_meta.h"
 #include "kudu/consensus/consensus_meta_manager.h"
+#include "kudu/consensus/consensus_peers.h"
+#include "kudu/consensus/consensus_queue.h"
 #include "kudu/consensus/log.h"
+#include "kudu/consensus/log.pb.h"
 #include "kudu/consensus/log_index.h"
 #include "kudu/consensus/log_reader.h"
 #include "kudu/consensus/log_util.h"
 #include "kudu/consensus/metadata.pb.h"
+#include "kudu/consensus/opid.pb.h"
 #include "kudu/consensus/opid_util.h"
-#include "kudu/consensus/peer_manager.h"
 #include "kudu/consensus/quorum_util.h"
 #include "kudu/consensus/raft_consensus.h"
+#include "kudu/consensus/time_manager.h"
+#include "kudu/fs/fs_manager.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/casts.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/map-util.h"
+#include "kudu/gutil/move.h"
+#include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/strcat.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/rpc/rpc_context.h"
-#include "kudu/util/auto_release_pool.h"
+#include "kudu/util/async_util.h"
+#include "kudu/util/make_shared.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/metrics.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/pb_util.h"
+#include "kudu/util/status.h"
+#include "kudu/util/status_callback.h"
 #include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 #include "kudu/util/threadpool.h"
@@ -67,11 +96,6 @@ using strings::Substitute;
 using strings::SubstituteAndAppend;
 
 namespace kudu {
-
-namespace rpc {
-class RpcContext;
-}
-
 namespace consensus {
 
 const char* kTestTablet = "TestTablet";

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/time_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/time_manager-test.cc b/src/kudu/consensus/time_manager-test.cc
index 5bed655..66075d6 100644
--- a/src/kudu/consensus/time_manager-test.cc
+++ b/src/kudu/consensus/time_manager-test.cc
@@ -15,16 +15,24 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <gtest/gtest.h>
+#include <memory>
 #include <thread>
+#include <vector>
+
+#include <glog/logging.h>
+#include <gtest/gtest.h>
 
 #include "kudu/clock/clock.h"
 #include "kudu/clock/hybrid_clock.h"
-#include "kudu/clock/logical_clock.h"
+#include "kudu/common/timestamp.h"
 #include "kudu/consensus/consensus.pb.h"
 #include "kudu/consensus/time_manager.h"
+#include "kudu/gutil/ref_counted.h"
+#include "kudu/util/countdown_latch.h"
+#include "kudu/util/monotime.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
-#include "kudu/util/thread.h"
 
 namespace kudu {
 namespace consensus {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/time_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/time_manager.cc b/src/kudu/consensus/time_manager.cc
index c9444cb..7a5083d 100644
--- a/src/kudu/consensus/time_manager.cc
+++ b/src/kudu/consensus/time_manager.cc
@@ -15,12 +15,22 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <algorithm>
+#include <cstdint>
 #include <mutex>
+#include <ostream>
+
 #include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
 
 #include "kudu/consensus/consensus.pb.h"
 #include "kudu/consensus/time_manager.h"
+#include "kudu/gutil/macros.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/tserver/tserver.pb.h"
+#include "kudu/util/countdown_latch.h"
 #include "kudu/util/flag_tags.h"
 
 DEFINE_bool(safe_time_advancement_without_writes, true,

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/consensus/time_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/time_manager.h b/src/kudu/consensus/time_manager.h
index a54916a..966b791 100644
--- a/src/kudu/consensus/time_manager.h
+++ b/src/kudu/consensus/time_manager.h
@@ -16,17 +16,23 @@
 // under the License.
 #pragma once
 
-#include <algorithm>
 #include <string>
 #include <vector>
 
+#include <gtest/gtest_prod.h>
+
 #include "kudu/clock/clock.h"
+#include "kudu/common/common.pb.h"
 #include "kudu/common/timestamp.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/locks.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/status.h"
 
 namespace kudu {
+
+class CountDownLatch;
+
 namespace consensus {
 class ReplicateMsg;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/experiments/merge-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/experiments/merge-test.cc b/src/kudu/experiments/merge-test.cc
index efe513f..880239a 100644
--- a/src/kudu/experiments/merge-test.cc
+++ b/src/kudu/experiments/merge-test.cc
@@ -15,12 +15,15 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <gflags/gflags.h>
-#include <glog/logging.h>
-#include <algorithm>
+#include <cstdlib>
+#include <memory>
+#include <queue>
 #include <string>
 #include <vector>
 
+#include <gflags/gflags.h>
+
+#include "kudu/util/make_shared.h"
 #include "kudu/util/stopwatch.h"
 
 DEFINE_int32(num_lists, 3, "Number of lists to merge");

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/experiments/rwlock-perf.cc
----------------------------------------------------------------------
diff --git a/src/kudu/experiments/rwlock-perf.cc b/src/kudu/experiments/rwlock-perf.cc
index a419c32..d51cb9a 100644
--- a/src/kudu/experiments/rwlock-perf.cc
+++ b/src/kudu/experiments/rwlock-perf.cc
@@ -15,16 +15,24 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/smart_ptr/detail/spinlock.hpp>
-#include <gflags/gflags.h>
-#include <glog/logging.h>
+
+#include <sched.h>
+
+#include <cinttypes>
+#include <cstdint>
+#include <cstdio>
 #include <iostream>
 #include <mutex>
-#include <stdio.h>
 #include <thread>
-#include <unistd.h>
+#include <vector>
+
+#include <boost/smart_ptr/detail/spinlock.hpp>
+#include <gflags/gflags.h>
+#include <glog/logging.h>
 
 #include "kudu/gutil/macros.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/sysinfo.h"
 #include "kudu/gutil/walltime.h"
 #include "kudu/util/flags.h"
 #include "kudu/util/locks.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_id.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_id.h b/src/kudu/fs/block_id.h
index 847ab4c..bbfba6c 100644
--- a/src/kudu/fs/block_id.h
+++ b/src/kudu/fs/block_id.h
@@ -17,26 +17,20 @@
 #ifndef KUDU_FS_BLOCK_ID_H
 #define KUDU_FS_BLOCK_ID_H
 
+#include <cinttypes>
+#include <cstddef>
+#include <cstdint>
 #include <iosfwd>
 #include <string>
 #include <unordered_set>
 #include <vector>
 
-#include <glog/logging.h>
-
-#include "kudu/gutil/macros.h"
 #include "kudu/gutil/stringprintf.h"
 
 namespace kudu {
 
 class BlockIdPB;
 
-namespace fs {
-namespace internal {
-class FileBlockLocation;
-} // namespace internal
-} // namespace fs
-
 class BlockId {
  public:
   BlockId()

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager-stress-test.cc b/src/kudu/fs/block_manager-stress-test.cc
index 876602d..4d1e919 100644
--- a/src/kudu/fs/block_manager-stress-test.cc
+++ b/src/kudu/fs/block_manager-stress-test.cc
@@ -15,26 +15,49 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <algorithm>
 #include <cmath>
+#include <cstdint>
+#include <cstring>
+#include <iterator>
+#include <memory>
 #include <mutex>
+#include <ostream>
 #include <string>
 #include <unordered_map>
 #include <vector>
 
+#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest.h>
+
+#include "kudu/fs/block_id.h"
+#include "kudu/fs/block_manager.h"
+#include "kudu/fs/data_dirs.h"
 #include "kudu/fs/error_manager.h"
-#include "kudu/fs/file_block_manager.h"
+#include "kudu/fs/file_block_manager.h" // IWYU pragma: keep
 #include "kudu/fs/fs.pb.h"
 #include "kudu/fs/fs_report.h"
+#include "kudu/fs/log_block_manager.h"  // IWYU pragma: keep
 #include "kudu/fs/log_block_manager-test-util.h"
-#include "kudu/fs/log_block_manager.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/gutil/stl_util.h"
 #include "kudu/gutil/strings/split.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/atomic.h"
+#include "kudu/util/countdown_latch.h"
+#include "kudu/util/env.h"
+#include "kudu/util/faststring.h"
 #include "kudu/util/file_cache-test-util.h"
-#include "kudu/util/metrics.h"
+#include "kudu/util/locks.h"
+#include "kudu/util/monotime.h"
 #include "kudu/util/random.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"
 
@@ -73,6 +96,9 @@ using strings::Substitute;
 namespace kudu {
 namespace fs {
 
+class FileBlockManager;
+class LogBlockManager;
+
 // This test attempts to simulate how a TS might use the block manager:
 //
 // writing threads (default 2) that do the following in a tight loop:

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager-test.cc b/src/kudu/fs/block_manager-test.cc
index 47f4c07..b02407b 100644
--- a/src/kudu/fs/block_manager-test.cc
+++ b/src/kudu/fs/block_manager-test.cc
@@ -16,29 +16,46 @@
 // under the License.
 
 #include <algorithm>
+#include <cstddef>
+#include <cstdint>
 #include <memory>
+#include <ostream>
 #include <string>
+#include <unordered_set>
 #include <vector>
 
+#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
 #include <google/protobuf/util/message_differencer.h>
+#include <gtest/gtest.h>
 
-#include "kudu/fs/data_dirs.h"
-#include "kudu/fs/error_manager.h"
+#include "kudu/fs/block_id.h"
+#include "kudu/fs/block_manager.h"
 #include "kudu/fs/file_block_manager.h"
 #include "kudu/fs/fs.pb.h"
 #include "kudu/fs/fs_report.h"
+#include "kudu/fs/data_dirs.h"
+#include "kudu/fs/error_manager.h"
 #include "kudu/fs/log_block_manager.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/casts.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/gutil/stl_util.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/gutil/strings/util.h"
+#include "kudu/util/env.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/path_util.h"
 #include "kudu/util/pb_util.h"
 #include "kudu/util/random.h"
+#include "kudu/util/slice.h"
+#include "kudu/util/status.h"
 #include "kudu/util/stopwatch.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 #include "kudu/util/thread.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager.cc b/src/kudu/fs/block_manager.cc
index 8034fd4..48aea93 100644
--- a/src/kudu/fs/block_manager.cc
+++ b/src/kudu/fs/block_manager.cc
@@ -18,10 +18,12 @@
 #include "kudu/fs/block_manager.h"
 
 #include <mutex>
+#include <ostream>
 
+#include <gflags/gflags.h>
 #include <glog/logging.h>
 
-#include "kudu/gutil/integral_types.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/env.h"
 #include "kudu/util/flag_tags.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager.h b/src/kudu/fs/block_manager.h
index 1e9ed47..aa13a97 100644
--- a/src/kudu/fs/block_manager.h
+++ b/src/kudu/fs/block_manager.h
@@ -23,14 +23,14 @@
 #include <string>
 #include <vector>
 
+#include <glog/logging.h>
+
 #include "kudu/fs/block_id.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/status.h"
 
-DECLARE_bool(block_coalesce_close);
-
 namespace kudu {
 
 class Env;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager_metrics.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager_metrics.h b/src/kudu/fs/block_manager_metrics.h
index 926b9c7..760f98b 100644
--- a/src/kudu/fs/block_manager_metrics.h
+++ b/src/kudu/fs/block_manager_metrics.h
@@ -17,17 +17,12 @@
 #ifndef KUDU_FS_BLOCK_MANAGER_METRICS_H
 #define KUDU_FS_BLOCK_MANAGER_METRICS_H
 
-#include <stdint.h>
+#include <cstdint>
 
 #include "kudu/gutil/ref_counted.h"
+#include "kudu/util/metrics.h"
 
 namespace kudu {
-
-class Counter;
-template<class T>
-class AtomicGauge;
-class MetricEntity;
-
 namespace fs {
 namespace internal {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager_util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager_util-test.cc b/src/kudu/fs/block_manager_util-test.cc
index f44cbca..0a73afb 100644
--- a/src/kudu/fs/block_manager_util-test.cc
+++ b/src/kudu/fs/block_manager_util-test.cc
@@ -14,18 +14,28 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-#include "kudu/fs/block_manager_util.h"
 
+#include <algorithm>
+#include <memory>
+#include <ostream>
 #include <string>
+#include <type_traits>
 #include <vector>
 
+#include <glog/logging.h>
 #include <google/protobuf/repeated_field.h>
 #include <gtest/gtest.h>
 
+#include "kudu/fs/block_manager_util.h"
 #include "kudu/fs/fs.pb.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/move.h"
 #include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/substitute.h"
+#include "kudu/util/env.h"
 #include "kudu/util/path_util.h"
+#include "kudu/util/status.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager_util.cc b/src/kudu/fs/block_manager_util.cc
index 6dae6fe..a6f2d11 100644
--- a/src/kudu/fs/block_manager_util.cc
+++ b/src/kudu/fs/block_manager_util.cc
@@ -16,14 +16,19 @@
 // under the License.
 #include "kudu/fs/block_manager_util.h"
 
+#include <algorithm>
+#include <cstdint>
+#include <ostream>
 #include <set>
+#include <type_traits>
 #include <unordered_map>
-#include <utility>
 
-#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
 
 #include "kudu/fs/fs.pb.h"
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/move.h"
 #include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/env.h"
@@ -125,6 +130,11 @@ Status PathInstanceMetadataFile::Unlock() {
   return Status::OK();
 }
 
+void PathInstanceMetadataFile::SetMetadataForTests(
+    gscoped_ptr<PathInstanceMetadataPB> metadata) {
+  metadata_ = std::move(metadata);
+}
+
 Status PathInstanceMetadataFile::CheckIntegrity(
     const vector<PathInstanceMetadataFile*>& instances) {
   CHECK(!instances.empty());

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/block_manager_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager_util.h b/src/kudu/fs/block_manager_util.h
index 099a23c..4a20482 100644
--- a/src/kudu/fs/block_manager_util.h
+++ b/src/kudu/fs/block_manager_util.h
@@ -67,9 +67,7 @@ class PathInstanceMetadataFile {
   // Unlocks the instance metadata file. Must have been locked to begin with.
   Status Unlock();
 
-  void SetMetadataForTests(gscoped_ptr<PathInstanceMetadataPB> metadata) {
-    metadata_ = std::move(metadata);
-  }
+  void SetMetadataForTests(gscoped_ptr<PathInstanceMetadataPB> metadata);
 
   std::string path() const { return DirName(filename_); }
   PathInstanceMetadataPB* const metadata() const { return metadata_.get(); }

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/data_dirs-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/data_dirs-test.cc b/src/kudu/fs/data_dirs-test.cc
index c1c4f47..81a4036 100644
--- a/src/kudu/fs/data_dirs-test.cc
+++ b/src/kudu/fs/data_dirs-test.cc
@@ -27,6 +27,7 @@
 #include "kudu/fs/data_dirs.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/metrics.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 #include "kudu/gutil/map-util.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/data_dirs.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/data_dirs.cc b/src/kudu/fs/data_dirs.cc
index 2fbec20..99177cf 100644
--- a/src/kudu/fs/data_dirs.cc
+++ b/src/kudu/fs/data_dirs.cc
@@ -19,32 +19,35 @@
 
 #include <algorithm>
 #include <cerrno>
+#include <cstdint>
 #include <deque>
 #include <memory>
 #include <mutex>
 #include <numeric>
+#include <ostream>
+#include <random>
 #include <string>
 #include <unordered_map>
 #include <unordered_set>
 #include <utility>
 #include <vector>
 
-#include <boost/optional.hpp>
 #include <gflags/gflags.h>
 #include <glog/logging.h>
 
 #include "kudu/fs/block_manager.h"
 #include "kudu/fs/block_manager_util.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/util/atomic.h"
 #include "kudu/util/env.h"
 #include "kudu/util/env_util.h"
 #include "kudu/util/flag_tags.h"
-#include "kudu/util/locks.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/oid_generator.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/data_dirs.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/data_dirs.h b/src/kudu/fs/data_dirs.h
index 5cb17cc..4334e78 100644
--- a/src/kudu/fs/data_dirs.h
+++ b/src/kudu/fs/data_dirs.h
@@ -17,6 +17,8 @@
 
 #pragma once
 
+#include <algorithm>
+#include <cstdint>
 #include <memory>
 #include <mutex>
 #include <string>
@@ -24,33 +26,29 @@
 #include <set>
 #include <vector>
 
-#include <boost/optional.hpp>
+#include <glog/logging.h>
 #include <gtest/gtest_prod.h>
 
 #include "kudu/fs/fs.pb.h"
-#include "kudu/gutil/callback_forward.h"
+#include "kudu/gutil/callback.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/macros.h"
-#include "kudu/util/atomic.h"
+#include "kudu/gutil/map-util.h"
 #include "kudu/util/locks.h"
+#include "kudu/util/metrics.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/random.h"
 #include "kudu/util/status.h"
 
 namespace kudu {
-template<typename T>
-class AtomicGauge;
 class Env;
-class MetricEntity;
 class ThreadPool;
-class DataDirGroupPB;
 
 namespace fs {
 
 typedef std::unordered_map<uint16_t, std::string> UuidByUuidIndexMap;
 typedef std::unordered_map<std::string, uint16_t> UuidIndexByUuidMap;
 
-class DataDirManager;
 class PathInstanceMetadataFile;
 struct CreateBlockOptions;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/error_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/error_manager.h b/src/kudu/fs/error_manager.h
index 7724e4b..cf0fdf7 100644
--- a/src/kudu/fs/error_manager.h
+++ b/src/kudu/fs/error_manager.h
@@ -22,6 +22,7 @@
 
 #include "kudu/fs/block_manager_util.h"
 #include "kudu/fs/data_dirs.h"
+#include "kudu/gutil/bind.h"
 #include "kudu/gutil/callback_forward.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/fault_injection.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/file_block_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/file_block_manager.cc b/src/kudu/fs/file_block_manager.cc
index 8744e6a..3d5f8ef 100644
--- a/src/kudu/fs/file_block_manager.cc
+++ b/src/kudu/fs/file_block_manager.cc
@@ -17,15 +17,27 @@
 
 #include "kudu/fs/file_block_manager.h"
 
+#include <cstddef>
 #include <memory>
+#include <mutex>
 #include <numeric>
+#include <ostream>
 #include <string>
+#include <utility>
 #include <vector>
 
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+
+#include "kudu/fs/block_id.h"
 #include "kudu/fs/block_manager_metrics.h"
 #include "kudu/fs/data_dirs.h"
 #include "kudu/fs/error_manager.h"
 #include "kudu/fs/fs_report.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/ref_counted.h"
+#include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/numbers.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/util/atomic.h"
@@ -33,10 +45,12 @@
 #include "kudu/util/env_util.h"
 #include "kudu/util/file_cache.h"
 #include "kudu/util/malloc.h"
+#include "kudu/util/make_shared.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/path_util.h"
 #include "kudu/util/random_util.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 
 using std::accumulate;
@@ -46,8 +60,9 @@ using std::unique_ptr;
 using std::vector;
 using strings::Substitute;
 
-DECLARE_bool(enable_data_block_fsync);
+DECLARE_bool(block_coalesce_close);
 DECLARE_bool(block_manager_lock_dirs);
+DECLARE_bool(enable_data_block_fsync);
 
 namespace kudu {
 namespace fs {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/file_block_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/file_block_manager.h b/src/kudu/fs/file_block_manager.h
index ad3886e..afd02c7 100644
--- a/src/kudu/fs/file_block_manager.h
+++ b/src/kudu/fs/file_block_manager.h
@@ -18,26 +18,27 @@
 #ifndef KUDU_FS_FILE_BLOCK_MANAGER_H
 #define KUDU_FS_FILE_BLOCK_MANAGER_H
 
+#include <cstdint>
 #include <memory>
 #include <string>
 #include <unordered_set>
 #include <vector>
 
-#include "kudu/fs/block_id.h"
 #include "kudu/fs/block_manager.h"
 #include "kudu/fs/data_dirs.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/util/atomic.h"
 #include "kudu/util/file_cache.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/random.h"
+#include "kudu/util/status.h"
 
 namespace kudu {
 
+class BlockId;
 class Env;
 class MemTracker;
-class MetricEntity;
 class RandomAccessFile;
-class WritableFile;
 
 namespace fs {
 class FsErrorManager;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/fs_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_manager-test.cc b/src/kudu/fs/fs_manager-test.cc
index 1764671..f0e34e0 100644
--- a/src/kudu/fs/fs_manager-test.cc
+++ b/src/kudu/fs/fs_manager-test.cc
@@ -18,22 +18,32 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include <cstdint>
+#include <iostream>
 #include <memory>
+#include <string>
 #include <unordered_set>
+#include <vector>
 
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 #include <glog/stl_logging.h>
 #include <gtest/gtest.h>
 
 #include "kudu/fs/block_manager.h"
 #include "kudu/fs/fs_manager.h"
+#include "kudu/gutil/gscoped_ptr.h"
+#include "kudu/gutil/port.h"
 #include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/strings/util.h"
+#include "kudu/util/env.h"
 #include "kudu/util/env_util.h"
 #include "kudu/util/flags.h"
-#include "kudu/util/metrics.h"
 #include "kudu/util/oid_generator.h"
+#include "kudu/util/path_util.h"
+#include "kudu/util/slice.h"
+#include "kudu/util/status.h"
 #include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/fs_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_manager.cc b/src/kudu/fs/fs_manager.cc
index 846be68..5859476 100644
--- a/src/kudu/fs/fs_manager.cc
+++ b/src/kudu/fs/fs_manager.cc
@@ -17,36 +17,38 @@
 
 #include "kudu/fs/fs_manager.h"
 
+#include <algorithm>
+#include <cinttypes>
+#include <ctime>
 #include <deque>
 #include <iostream>
 #include <map>
 #include <stack>
 #include <unordered_set>
 
-#include <boost/optional.hpp>
+#include <boost/optional/optional.hpp>
+#include <gflags/gflags.h>
 #include <glog/logging.h>
 #include <glog/stl_logging.h>
-#include <google/protobuf/message.h>
 
 #include "kudu/fs/block_id.h"
+#include "kudu/fs/block_manager.h"
 #include "kudu/fs/error_manager.h"
 #include "kudu/fs/file_block_manager.h"
 #include "kudu/fs/fs.pb.h"
 #include "kudu/fs/log_block_manager.h"
 #include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/stringprintf.h"
 #include "kudu/gutil/strings/join.h"
-#include "kudu/gutil/strings/numbers.h"
 #include "kudu/gutil/strings/split.h"
+#include "kudu/gutil/strings/strcat.h"
 #include "kudu/gutil/strings/strip.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/strings/util.h"
-#include "kudu/gutil/strtoint.h"
 #include "kudu/gutil/walltime.h"
 #include "kudu/util/env_util.h"
-#include "kudu/util/errno.h"
-#include "kudu/util/flags.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/net/net_util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/fs_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_manager.h b/src/kudu/fs/fs_manager.h
index 386e4c5..c5899f4 100644
--- a/src/kudu/fs/fs_manager.h
+++ b/src/kudu/fs/fs_manager.h
@@ -18,25 +18,27 @@
 #ifndef KUDU_FS_FS_MANAGER_H
 #define KUDU_FS_FS_MANAGER_H
 
-#include <boost/none.hpp>
-#include <boost/optional/optional.hpp>
-#include <gtest/gtest_prod.h>
+#include <cstddef>
+#include <cstdint>
 #include <iosfwd>
 #include <memory>
 #include <set>
 #include <string>
 #include <vector>
 
+#include <boost/optional/optional.hpp>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+#include <gtest/gtest_prod.h>
+
 #include "kudu/fs/error_manager.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/env.h"
 #include "kudu/util/path_util.h"
+#include "kudu/util/status.h"
 
-namespace google {
-namespace protobuf {
-class Message;
-} // namespace protobuf
-} // namespace google
+DECLARE_bool(enable_data_block_fsync);
 
 namespace kudu {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/fs_report.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_report.cc b/src/kudu/fs/fs_report.cc
index dd353c5..6c3dd6e 100644
--- a/src/kudu/fs/fs_report.cc
+++ b/src/kudu/fs/fs_report.cc
@@ -17,11 +17,13 @@
 #include "kudu/fs/fs_report.h"
 
 #include <iostream>
-#include <map>
 #include <string>
 #include <utility>
+#include <unordered_map>
 #include <vector>
 
+#include <glog/logging.h>
+
 #include "kudu/fs/fs.pb.h"
 #include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/substitute.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/fs_report.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_report.h b/src/kudu/fs/fs_report.h
index c656edd..1c72425 100644
--- a/src/kudu/fs/fs_report.h
+++ b/src/kudu/fs/fs_report.h
@@ -16,6 +16,7 @@
 // under the License.
 #pragma once
 
+#include <cstdint>
 #include <string>
 #include <vector>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/log_block_manager-test-util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager-test-util.cc b/src/kudu/fs/log_block_manager-test-util.cc
index 1a36fd5..8f6d984 100644
--- a/src/kudu/fs/log_block_manager-test-util.cc
+++ b/src/kudu/fs/log_block_manager-test-util.cc
@@ -18,24 +18,27 @@
 #include "kudu/fs/log_block_manager-test-util.h"
 
 #include <algorithm>
-#include <iterator>
+#include <cstring>
 #include <memory>
+#include <ostream>
 #include <string>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 
+#include "kudu/fs/block_id.h"
 #include "kudu/fs/fs.pb.h"
 #include "kudu/fs/log_block_manager.h"
 #include "kudu/gutil/integral_types.h"
-#include "kudu/gutil/map-util.h"
 #include "kudu/gutil/strings/strcat.h"
 #include "kudu/gutil/strings/strip.h"
 #include "kudu/util/env.h"
 #include "kudu/util/path_util.h"
 #include "kudu/util/pb_util.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 
 DECLARE_uint64(log_container_max_size);

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/log_block_manager-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager-test-util.h b/src/kudu/fs/log_block_manager-test-util.h
index fa260eb..7cafbec 100644
--- a/src/kudu/fs/log_block_manager-test-util.h
+++ b/src/kudu/fs/log_block_manager-test-util.h
@@ -16,11 +16,11 @@
 // under the License.
 #pragma once
 
+#include <cstdint>
 #include <memory>
 #include <string>
 #include <vector>
 
-#include "kudu/fs/block_id.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/util/env.h"
 #include "kudu/util/oid_generator.h"
@@ -29,6 +29,8 @@
 
 namespace kudu {
 
+class BlockId;
+
 namespace pb_util {
 class WritablePBContainerFile;
 } // namespace pb_util

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/log_block_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager-test.cc b/src/kudu/fs/log_block_manager-test.cc
index cf0cbb9..d022ff7 100644
--- a/src/kudu/fs/log_block_manager-test.cc
+++ b/src/kudu/fs/log_block_manager-test.cc
@@ -35,6 +35,7 @@
 #include "kudu/util/path_util.h"
 #include "kudu/util/pb_util.h"
 #include "kudu/util/random.h"
+#include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
 using kudu::pb_util::ReadablePBContainerFile;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/log_block_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager.cc b/src/kudu/fs/log_block_manager.cc
index c1bba27..273a18c 100644
--- a/src/kudu/fs/log_block_manager.cc
+++ b/src/kudu/fs/log_block_manager.cc
@@ -18,22 +18,37 @@
 #include "kudu/fs/log_block_manager.h"
 
 #include <algorithm>
+#include <cerrno>
+#include <cstddef>
+#include <cstdint>
 #include <map>
 #include <memory>
 #include <mutex>
+#include <numeric>
+#include <ostream>
+#include <set>
 #include <unordered_map>
 #include <unordered_set>
 #include <vector>
 
+#include <boost/optional/optional.hpp>
+#include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
+#include <glog/logging.h>
+
 #include "kudu/fs/block_manager_metrics.h"
 #include "kudu/fs/block_manager_util.h"
 #include "kudu/fs/data_dirs.h"
 #include "kudu/fs/error_manager.h"
 #include "kudu/fs/fs.pb.h"
 #include "kudu/fs/fs_report.h"
+#include "kudu/gutil/bind.h"
+#include "kudu/gutil/bind_helpers.h"
 #include "kudu/gutil/callback.h"
 #include "kudu/gutil/integral_types.h"
 #include "kudu/gutil/map-util.h"
+#include "kudu/gutil/port.h"
+#include "kudu/gutil/stl_util.h"
 #include "kudu/gutil/strings/numbers.h"
 #include "kudu/gutil/strings/strcat.h"
 #include "kudu/gutil/strings/strip.h"
@@ -47,21 +62,22 @@
 #include "kudu/util/file_cache.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/locks.h"
+#include "kudu/util/make_shared.h"
 #include "kudu/util/malloc.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/monotime.h"
-#include "kudu/util/mutex.h"
 #include "kudu/util/path_util.h"
 #include "kudu/util/pb_util.h"
+#include "kudu/util/random.h"
 #include "kudu/util/random_util.h"
 #include "kudu/util/scoped_cleanup.h"
-#include "kudu/util/stopwatch.h"
+#include "kudu/util/slice.h"
 #include "kudu/util/test_util_prod.h"
-#include "kudu/util/threadpool.h"
 #include "kudu/util/trace.h"
 
-DECLARE_bool(enable_data_block_fsync);
 DECLARE_bool(block_manager_lock_dirs);
+DECLARE_bool(block_coalesce_close);
+DECLARE_bool(enable_data_block_fsync);
 
 // TODO(unknown): How should this be configured? Should provide some guidance.
 DEFINE_uint64(log_container_max_size, 10LU * 1024 * 1024 * 1024,

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/fs/log_block_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager.h b/src/kudu/fs/log_block_manager.h
index 530c493..3c52602 100644
--- a/src/kudu/fs/log_block_manager.h
+++ b/src/kudu/fs/log_block_manager.h
@@ -17,6 +17,7 @@
 
 #pragma once
 
+#include <cstdint>
 #include <deque>
 #include <map>
 #include <memory>
@@ -26,31 +27,27 @@
 #include <utility>
 #include <vector>
 
-#include <boost/optional/optional.hpp>
-#include <gtest/gtest_prod.h>
+#include <boost/optional/optional.hpp>  // IWYU pragma: keep
 #include <sparsehash/sparse_hash_map>
+#include <gtest/gtest_prod.h>
 
 #include "kudu/fs/block_id.h"
 #include "kudu/fs/block_manager.h"
 #include "kudu/fs/data_dirs.h"
-#include "kudu/fs/fs.pb.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/util/atomic.h"
 #include "kudu/util/file_cache.h"
+#include "kudu/util/locks.h"
 #include "kudu/util/mem_tracker.h"
 #include "kudu/util/oid_generator.h"
-#include "kudu/util/random.h"
+#include "kudu/util/status.h"
 
 namespace kudu {
+
+class BlockRecordPB;
 class Env;
-class MetricEntity;
 class RWFile;
-class ThreadPool;
-class FsManager;
-
-namespace pb_util {
-class WritablePBContainerFile;
-} // namespace pb_util
 
 namespace fs {
 class FsErrorManager;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/atomicops-internals-macosx.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/atomicops-internals-macosx.h b/src/kudu/gutil/atomicops-internals-macosx.h
index 15efaef..d141d1d 100644
--- a/src/kudu/gutil/atomicops-internals-macosx.h
+++ b/src/kudu/gutil/atomicops-internals-macosx.h
@@ -5,6 +5,7 @@
 // Implementation of atomic operations for Mac OS X.  This file should not
 // be included directly.  Clients should instead include
 // "base/atomicops.h".
+// IWYU pragma: private, include "kudu/gutil/atomicops.h"
 
 #ifndef BASE_AUXILIARY_ATOMICOPS_INTERNALS_MACOSX_H_
 #define BASE_AUXILIARY_ATOMICOPS_INTERNALS_MACOSX_H_

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/atomicops-internals-powerpc.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/atomicops-internals-powerpc.h b/src/kudu/gutil/atomicops-internals-powerpc.h
index 0e56475..18eaa1f 100644
--- a/src/kudu/gutil/atomicops-internals-powerpc.h
+++ b/src/kudu/gutil/atomicops-internals-powerpc.h
@@ -23,6 +23,7 @@
 // Implementation of atomic operations for PowerPC.  This file should not
 // be included directly.  Clients should instead include
 // "base/atomicops.h".
+// IWYU pragma: private, include "kudu/gutil/atomicops.h"
 
 // *** WARNING EXPERIMENTAL CODE ***
 // This is not tested and may contain bugs.  Until we have bootstrapped

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/atomicops-internals-tsan.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/atomicops-internals-tsan.h b/src/kudu/gutil/atomicops-internals-tsan.h
index be9c144..dea45b0 100644
--- a/src/kudu/gutil/atomicops-internals-tsan.h
+++ b/src/kudu/gutil/atomicops-internals-tsan.h
@@ -4,6 +4,7 @@
 
 // This file is an internal atomic implementation for compiler-based
 // ThreadSanitizer. Use base/atomicops.h instead.
+// IWYU pragma: private, include "kudu/gutil/atomicops.h"
 
 #ifndef BASE_ATOMICOPS_INTERNALS_TSAN_H_
 #define BASE_ATOMICOPS_INTERNALS_TSAN_H_

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/atomicops-internals-x86.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/atomicops-internals-x86.cc b/src/kudu/gutil/atomicops-internals-x86.cc
index 541429e..92e1e58 100644
--- a/src/kudu/gutil/atomicops-internals-x86.cc
+++ b/src/kudu/gutil/atomicops-internals-x86.cc
@@ -28,7 +28,7 @@
 #include <string.h>
 
 #include <glog/logging.h>
-#include "kudu/gutil/logging-inl.h"
+
 #include "kudu/gutil/integral_types.h"
 
 // This file only makes sense with atomicops-internals-x86.h -- it

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/atomicops-internals-x86.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/atomicops-internals-x86.h b/src/kudu/gutil/atomicops-internals-x86.h
index 1d2a5c4..c209b78 100644
--- a/src/kudu/gutil/atomicops-internals-x86.h
+++ b/src/kudu/gutil/atomicops-internals-x86.h
@@ -19,15 +19,16 @@
 //
 // All Rights Reserved.
 //
-//
 // Implementation of atomic operations for x86.  This file should not
 // be included directly.  Clients should instead include
 // "base/atomicops.h".
+// IWYU pragma: private, include "kudu/gutil/atomicops.h"
 
 #ifndef GUTIL_ATOMICOPS_INTERNALS_X86_H_
 #define GUTIL_ATOMICOPS_INTERNALS_X86_H_
 
-#include <stdint.h>
+#include <cstdint>
+#include <ostream>
 
 #include <glog/logging.h>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/atomicops.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/atomicops.h b/src/kudu/gutil/atomicops.h
index fa4c44c..c29a02f 100644
--- a/src/kudu/gutil/atomicops.h
+++ b/src/kudu/gutil/atomicops.h
@@ -51,7 +51,7 @@
 #ifndef THREAD_ATOMICOPS_H_
 #define THREAD_ATOMICOPS_H_
 
-#include <stdint.h>
+#include <cstdint>
 
 // ------------------------------------------------------------------------
 // Include the platform specific implementations of the types
@@ -71,19 +71,19 @@
 
 // ThreadSanitizer provides own implementation of atomicops.
 #if defined(THREAD_SANITIZER)
-#include "kudu/gutil/atomicops-internals-tsan.h"
+#include "kudu/gutil/atomicops-internals-tsan.h" // IWYU pragma: export
 #elif defined(__APPLE__)
-#include "kudu/gutil/atomicops-internals-macosx.h"
+#include "kudu/gutil/atomicops-internals-macosx.h" // IWYU pragma: export
 #elif defined(__GNUC__) && defined(ARMV6)
-#include "kudu/gutil/atomicops-internals-arm-v6plus.h"
+#include "kudu/gutil/atomicops-internals-arm-v6plus.h" // IWYU pragma: export
 #elif defined(ARMV3)
-#include "kudu/gutil/atomicops-internals-arm-generic.h"
+#include "kudu/gutil/atomicops-internals-arm-generic.h" // IWYU pragma: export
 #elif defined(__GNUC__) && (defined(__i386) || defined(__x86_64__))
-#include "kudu/gutil/atomicops-internals-x86.h"
+#include "kudu/gutil/atomicops-internals-x86.h" // IWYU pragma: export
 #elif defined(__GNUC__) && defined(ARCH_POWERPC64)
-#include "kudu/gutil/atomicops-internals-powerpc.h"
+#include "kudu/gutil/atomicops-internals-powerpc.h" // IWYU pragma: export
 #elif defined(OS_WINDOWS)
-#include "kudu/gutil/atomicops-internals-windows.h"
+#include "kudu/gutil/atomicops-internals-windows.h" // IWYU pragma: export
 #else
 #error You need to implement atomic operations for this architecture
 #endif

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/bits.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/bits.h b/src/kudu/gutil/bits.h
index 639186e..b4a4327 100644
--- a/src/kudu/gutil/bits.h
+++ b/src/kudu/gutil/bits.h
@@ -2,11 +2,7 @@
 //
 // A collection of useful (static) bit-twiddling functions.
 
-#include <glog/logging.h>
-
-#include "kudu/gutil/basictypes.h"
 #include "kudu/gutil/integral_types.h"
-#include "kudu/gutil/logging-inl.h"
 #include "kudu/gutil/macros.h"
 
 #ifndef _BITS_H_

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/callback_internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/callback_internal.cc b/src/kudu/gutil/callback_internal.cc
index 05b9e8f..1ed1af3 100644
--- a/src/kudu/gutil/callback_internal.cc
+++ b/src/kudu/gutil/callback_internal.cc
@@ -4,6 +4,8 @@
 
 #include "kudu/gutil/callback_internal.h"
 
+#include <glog/logging.h>
+
 namespace kudu {
 namespace internal {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/callback_internal.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/callback_internal.h b/src/kudu/gutil/callback_internal.h
index 47b5655..f409c87 100644
--- a/src/kudu/gutil/callback_internal.h
+++ b/src/kudu/gutil/callback_internal.h
@@ -8,13 +8,11 @@
 #ifndef KUDU_GUTIL_CALLBACK_INTERNAL_H_
 #define KUDU_GUTIL_CALLBACK_INTERNAL_H_
 
-#include <stddef.h>
+#include <cstddef>
 
-#include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/ref_counted.h"
-
-template <typename T>
-class ScopedVector;
+#include "kudu/gutil/template_util.h"
+#include "kudu/gutil/type_traits.h"
 
 namespace kudu {
 namespace internal {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/cpu.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/cpu.cc b/src/kudu/gutil/cpu.cc
index f4c3885a..cd2b16c 100644
--- a/src/kudu/gutil/cpu.cc
+++ b/src/kudu/gutil/cpu.cc
@@ -4,13 +4,10 @@
 
 #include "kudu/gutil/cpu.h"
 
-#include <stdlib.h>
-#include <string.h>
-
+#include <cstring>
 #include <algorithm>
 
-#include "kudu/gutil/basictypes.h"
-#include "kudu/gutil/strings/stringpiece.h"
+#include "kudu/gutil/integral_types.h"
 
 #if defined(__x86_64__)
 #if defined(_MSC_VER)

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/hash/builtin_type_hash.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/hash/builtin_type_hash.h b/src/kudu/gutil/hash/builtin_type_hash.h
index c979eb2..0e8a183 100644
--- a/src/kudu/gutil/hash/builtin_type_hash.h
+++ b/src/kudu/gutil/hash/builtin_type_hash.h
@@ -7,8 +7,8 @@
 #ifndef UTIL_HASH_BUILTIN_TYPE_HASH_H_
 #define UTIL_HASH_BUILTIN_TYPE_HASH_H_
 
-#include <stddef.h>
-#include <stdint.h>
+#include <cstddef>
+#include <cstdint>
 
 #include "kudu/gutil/casts.h"
 #include "kudu/gutil/integral_types.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/hash/city.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/hash/city.cc b/src/kudu/gutil/hash/city.cc
index cc00ff7..e3ff7fc 100644
--- a/src/kudu/gutil/hash/city.cc
+++ b/src/kudu/gutil/hash/city.cc
@@ -18,22 +18,26 @@
 
 #include <sys/types.h>
 #include <algorithm>
+#include <iterator>
+#include <utility>
+#include <vector>
+
+#include <glog/logging.h>
+
+#include "kudu/gutil/endian.h"
+#include "kudu/gutil/int128.h"
+#include "kudu/gutil/integral_types.h"
+#include "kudu/gutil/hash/hash128to64.h"
+#include "kudu/gutil/port.h"
+
 using std::copy;
+using std::make_pair;
 using std::max;
 using std::min;
+using std::pair;
 using std::reverse;
 using std::sort;
 using std::swap;
-#include <utility>
-using std::make_pair;
-using std::pair;
-
-#include "kudu/gutil/int128.h"
-#include "kudu/gutil/integral_types.h"
-#include <glog/logging.h>
-#include "kudu/gutil/logging-inl.h"
-#include "kudu/gutil/hash/hash128to64.h"
-#include "kudu/gutil/endian.h"
 
 namespace util_hash {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/hash/hash.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/hash/hash.cc b/src/kudu/gutil/hash/hash.cc
index 24fc310..c708da3 100644
--- a/src/kudu/gutil/hash/hash.cc
+++ b/src/kudu/gutil/hash/hash.cc
@@ -9,9 +9,9 @@
 
 #include "kudu/gutil/hash/hash.h"
 
-#include "kudu/gutil/integral_types.h"
 #include <glog/logging.h>
-#include "kudu/gutil/logging-inl.h"
+
+#include "kudu/gutil/integral_types.h"
 #include "kudu/gutil/hash/jenkins.h"
 #include "kudu/gutil/hash/jenkins_lookup2.h"
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/hash/hash.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/hash/hash.h b/src/kudu/gutil/hash/hash.h
index 299a8e2..6d4c6fc 100644
--- a/src/kudu/gutil/hash/hash.h
+++ b/src/kudu/gutil/hash/hash.h
@@ -73,21 +73,15 @@
 #ifndef UTIL_HASH_HASH_H_
 #define UTIL_HASH_HASH_H_
 
-#include <stddef.h>
-#include <stdint.h>     // for uintptr_t
-#include <string.h>
-#include <algorithm>
-#include <unordered_map>
-#include <unordered_set>
+#include <cstddef>
+#include <cstring>
 #include <string>
+#include <unordered_map>
 #include <utility>
 
-#include "kudu/gutil/casts.h"
 #include "kudu/gutil/int128.h"
 #include "kudu/gutil/integral_types.h"
-#include "kudu/gutil/macros.h"
-#include "kudu/gutil/port.h"
-#include "kudu/gutil/hash/city.h"
+#include "kudu/gutil/hash/builtin_type_hash.h"
 #include "kudu/gutil/hash/hash128to64.h"
 #include "kudu/gutil/hash/jenkins.h"
 #include "kudu/gutil/hash/jenkins_lookup2.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/hash/jenkins.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/hash/jenkins.cc b/src/kudu/gutil/hash/jenkins.cc
index 70a7e30..2c5e580 100644
--- a/src/kudu/gutil/hash/jenkins.cc
+++ b/src/kudu/gutil/hash/jenkins.cc
@@ -18,9 +18,9 @@
 
 #include "kudu/gutil/hash/jenkins.h"
 
-#include "kudu/gutil/integral_types.h"
 #include <glog/logging.h>
-#include "kudu/gutil/logging-inl.h"
+
+#include "kudu/gutil/integral_types.h"
 #include "kudu/gutil/hash/jenkins_lookup2.h"
 
 static inline uint32 char2unsigned(char c) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/mathlimits.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/mathlimits.h b/src/kudu/gutil/mathlimits.h
index 9d69733..6b09aa0 100644
--- a/src/kudu/gutil/mathlimits.h
+++ b/src/kudu/gutil/mathlimits.h
@@ -31,8 +31,6 @@
 #ifndef UTIL_MATH_MATHLIMITS_H__
 #define UTIL_MATH_MATHLIMITS_H__
 
-#include <math.h>
-#include <string.h>
 #include <cfloat>
 #include <cmath>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/once.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/once.cc b/src/kudu/gutil/once.cc
index 1b97f8f..34787c6 100644
--- a/src/kudu/gutil/once.cc
+++ b/src/kudu/gutil/once.cc
@@ -1,9 +1,14 @@
 // Copyright 2008 Google Inc. All Rights Reserved.
 
+#include <ostream>
+
 #include <glog/logging.h>
+
+#include "kudu/gutil/atomicops.h"
+#include "kudu/gutil/dynamic_annotations.h"
+#include "kudu/gutil/integral_types.h"
 #include "kudu/gutil/logging-inl.h"
 #include "kudu/gutil/once.h"
-#include "kudu/gutil/dynamic_annotations.h"
 #include "kudu/gutil/spinlock_internal.h"
 
 // All modifications to a GoogleOnceType occur inside GoogleOnceInternalInit.

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/once.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/once.h b/src/kudu/gutil/once.h
index ff161c5..460a2ec 100644
--- a/src/kudu/gutil/once.h
+++ b/src/kudu/gutil/once.h
@@ -25,7 +25,6 @@
 #define BASE_ONCE_H_
 
 #include "kudu/gutil/atomicops.h"
-#include "kudu/gutil/integral_types.h"
 #include "kudu/gutil/dynamic_annotations.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/port.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/ref_counted.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/ref_counted.cc b/src/kudu/gutil/ref_counted.cc
index a15a1e2..500752e 100644
--- a/src/kudu/gutil/ref_counted.cc
+++ b/src/kudu/gutil/ref_counted.cc
@@ -2,10 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "kudu/gutil/ref_counted.h"
+#include <ostream>
 
 #include <glog/logging.h>
-#include "kudu/gutil/threading/thread_collision_warner.h"
+
+#include "kudu/gutil/atomic_refcount.h"
+#include "kudu/gutil/ref_counted.h"
 
 namespace kudu {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/ref_counted.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/ref_counted.h b/src/kudu/gutil/ref_counted.h
index 8b6a553..66cdac9 100644
--- a/src/kudu/gutil/ref_counted.h
+++ b/src/kudu/gutil/ref_counted.h
@@ -6,9 +6,10 @@
 #define BASE_MEMORY_REF_COUNTED_H_
 
 #include <cassert>
+#include <cstddef>
 
-#include "kudu/gutil/atomic_refcount.h"
-#include "kudu/gutil/port.h"
+#include "kudu/gutil/atomicops.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/threading/thread_collision_warner.h"
 
 namespace kudu {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/ref_counted_memory.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/ref_counted_memory.cc b/src/kudu/gutil/ref_counted_memory.cc
index 1d695d9..babd0ff 100644
--- a/src/kudu/gutil/ref_counted_memory.cc
+++ b/src/kudu/gutil/ref_counted_memory.cc
@@ -4,7 +4,9 @@
 
 #include "kudu/gutil/ref_counted_memory.h"
 
-#include <stdlib.h>
+#include <algorithm>
+#include <cstdlib>
+#include <cstring>
 
 #include <glog/logging.h>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/ref_counted_memory.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/ref_counted_memory.h b/src/kudu/gutil/ref_counted_memory.h
index 550a142..d180db9 100644
--- a/src/kudu/gutil/ref_counted_memory.h
+++ b/src/kudu/gutil/ref_counted_memory.h
@@ -5,12 +5,15 @@
 #ifndef KUDU_GUTIL_REF_COUNTED_MEMORY_H_
 #define KUDU_GUTIL_REF_COUNTED_MEMORY_H_
 
+#include <cstddef>
+
 #include <string>
 #include <vector>
 
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/port.h"
+#include "kudu/gutil/threading/thread_collision_warner.h"
 
 #ifndef BASE_EXPORT
 #define BASE_EXPORT

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/spinlock.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/spinlock.cc b/src/kudu/gutil/spinlock.cc
index 63b8513..9d1256a 100644
--- a/src/kudu/gutil/spinlock.cc
+++ b/src/kudu/gutil/spinlock.cc
@@ -33,10 +33,10 @@
  */
 
 #include "kudu/gutil/spinlock.h"
-#include "kudu/gutil/synchronization_profiling.h"
 #include "kudu/gutil/spinlock_internal.h"
-#include "kudu/gutil/walltime.h"
+#include "kudu/gutil/synchronization_profiling.h"
 #include "kudu/gutil/sysinfo.h"   /* for NumCPUs() */
+#include "kudu/gutil/walltime.h"
 
 namespace base {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/spinlock.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/spinlock.h b/src/kudu/gutil/spinlock.h
index fcd6287..eced3ef 100644
--- a/src/kudu/gutil/spinlock.h
+++ b/src/kudu/gutil/spinlock.h
@@ -40,8 +40,9 @@
 #define BASE_SPINLOCK_H_
 
 #include "kudu/gutil/atomicops.h"
-#include "kudu/gutil/basictypes.h"
 #include "kudu/gutil/dynamic_annotations.h"
+#include "kudu/gutil/integral_types.h"
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/thread_annotations.h"
 
 // This isn't originally in the base:: namespace in tcmalloc,

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/spinlock_internal.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/spinlock_internal.h b/src/kudu/gutil/spinlock_internal.h
index c235893..55a4eba 100644
--- a/src/kudu/gutil/spinlock_internal.h
+++ b/src/kudu/gutil/spinlock_internal.h
@@ -36,8 +36,8 @@
 #ifndef BASE_SPINLOCK_INTERNAL_H_
 #define BASE_SPINLOCK_INTERNAL_H_
 
-#include "kudu/gutil/basictypes.h"
 #include "kudu/gutil/atomicops.h"
+#include "kudu/gutil/integral_types.h"
 
 namespace base {
 namespace internal {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0f6dcf83/src/kudu/gutil/stringprintf.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/stringprintf.cc b/src/kudu/gutil/stringprintf.cc
index 45a0cde..f083f2b 100644
--- a/src/kudu/gutil/stringprintf.cc
+++ b/src/kudu/gutil/stringprintf.cc
@@ -2,12 +2,13 @@
 
 #include "kudu/gutil/stringprintf.h"
 
-#include <errno.h>
-#include <stdarg.h> // For va_list and related operations
-#include <stdio.h> // MSVC requires this for _vsnprintf
+#include <cstdio> // MSVC requires this for _vsnprintf
+#include <memory>
+#include <ostream>
 #include <vector>
+
 #include <glog/logging.h>
-#include "kudu/gutil/logging-inl.h"
+
 #include "kudu/gutil/macros.h"
 
 using std::string;


Mime
View raw message