kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [1/2] kudu git commit: [iwyu] update std::move
Date Wed, 20 Sep 2017 19:27:29 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 02ba0ec6c -> 3e6e12a9f


http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/tablet_bootstrap.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_bootstrap.cc b/src/kudu/tablet/tablet_bootstrap.cc
index 1eb6533..d5c8a3c 100644
--- a/src/kudu/tablet/tablet_bootstrap.cc
+++ b/src/kudu/tablet/tablet_bootstrap.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/tablet/tablet_bootstrap.h"
 
-#include <algorithm>
 #include <cstdint>
 #include <iterator>
 #include <map>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/tablet_history_gc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_history_gc-test.cc b/src/kudu/tablet/tablet_history_gc-test.cc
index d12bba7..7aec88a 100644
--- a/src/kudu/tablet/tablet_history_gc-test.cc
+++ b/src/kudu/tablet/tablet_history_gc-test.cc
@@ -32,6 +32,7 @@
 #include "kudu/clock/clock.h"
 #include "kudu/clock/hybrid_clock.h"
 #include "kudu/clock/mock_ntp.h"
+#include "kudu/clock/time_service.h"
 #include "kudu/common/common.pb.h"
 #include "kudu/common/partial_row.h"
 #include "kudu/common/schema.h"
@@ -39,6 +40,7 @@
 #include "kudu/gutil/casts.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/gutil/walltime.h"
 #include "kudu/tablet/compaction.h"
@@ -51,7 +53,7 @@
 #include "kudu/tablet/tablet.h"
 #include "kudu/tablet/tablet_metadata.h"
 #include "kudu/tablet/tablet_metrics.h"
-#include "kudu/util/make_shared.h"
+#include "kudu/util/metrics.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/status.h"
 #include "kudu/util/test_macros.h"
@@ -65,17 +67,6 @@ using std::string;
 using std::vector;
 using strings::Substitute;
 
-// Specify row regex to match on. Empty string means don't match anything.
-#define ASSERT_DEBUG_DUMP_ROWS_MATCH(pattern) do { \
-  const std::string& _pat = (pattern); \
-  vector<string> _rows; \
-  ASSERT_OK(tablet()->DebugDump(&_rows)); \
-  /* Ignore the non-data (formattting) lines in the output. */ \
-  std::string _base_pat = R"(^Dumping|^-|^MRS|^RowSet)"; \
-  if (!_pat.empty()) _base_pat += "|"; \
-  ASSERT_STRINGS_ALL_MATCH(_rows, _base_pat + _pat); \
-} while (0)
-
 namespace kudu {
 namespace tablet {
 
@@ -113,6 +104,8 @@ class TabletHistoryGcTest : public TabletTestBase<IntKeyTestSetup<INT64>> {
     uint64_t new_time = now + delta.ToMicroseconds();
     SetMockTime(new_time);
   }
+  // Specify row regex to match on. Empty string means don't match anything.
+  void VerifyDebugDumpRowsMatch(const string& pattern) const;
 
   int64_t TotalNumRows() const { return num_rowsets_ * rows_per_rowset_; }
 
@@ -126,7 +119,7 @@ class TabletHistoryGcTest : public TabletTestBase<IntKeyTestSetup<INT64>> {
 
   const int kStartRow = 0;
   int num_rowsets_ = 3;
-  int rows_per_rowset_ = 300;
+  int64_t rows_per_rowset_ = 300;
 };
 
 void TabletHistoryGcTest::InsertOriginalRows(int64_t num_rowsets, int64_t rows_per_rowset) {
@@ -146,6 +139,17 @@ void TabletHistoryGcTest::UpdateOriginalRows(int64_t num_rowsets, int64_t rows_p
   ASSERT_EQ(num_rowsets, tablet()->num_rowsets());
 }
 
+void TabletHistoryGcTest::VerifyDebugDumpRowsMatch(const string& pattern) const {
+  vector<string> rows;
+  ASSERT_OK(tablet()->DebugDump(&rows)); \
+  // Ignore the non-data (formattting) lines in the output.
+  std::string base_pattern = R"(^Dumping|^-|^MRS|^RowSet)";
+  if (!pattern.empty()) {
+    base_pattern += "|";
+  }
+  ASSERT_STRINGS_ALL_MATCH(rows, base_pattern + pattern);
+}
+
 // Test that we do not generate undos for redo operations that are older than
 // the AHM during major delta compaction.
 TEST_F(TabletHistoryGcTest, TestNoGenerateUndoOnMajorDeltaCompaction) {
@@ -191,8 +195,9 @@ TEST_F(TabletHistoryGcTest, TestNoGenerateUndoOnMajorDeltaCompaction) {
 
   // Now, we should have base data = 2 with no other historical values.
   // Major delta compaction will not remove UNDOs, so we expect a single UNDO DELETE as well.
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(R"(int32 val=2\); Undo Mutations: \[@[[:digit:]]+\(DELETE\)\]; )"
-                               R"(Redo Mutations: \[\];$)");
+  NO_FATALS(VerifyDebugDumpRowsMatch(
+      R"(int32 val=2\); Undo Mutations: \[@[[:digit:]]+\(DELETE\)\]; )"
+      R"(Redo Mutations: \[\];$)"));
 }
 
 // Test that major delta compaction works when run on a subset of columns:
@@ -233,8 +238,9 @@ TEST_F(TabletHistoryGcTest, TestMajorDeltaCompactionOnSubsetOfColumns) {
                                                         tablet()->GetHistoryGcOpts()));
   }
 
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(R"(int32 val=2\); Undo Mutations: \[@[[:digit:]]+\(DELETE\)\]; )"
-                               R"(Redo Mutations: \[@[[:digit:]]+\(SET key_idx=1\)\];$)");
+  NO_FATALS(VerifyDebugDumpRowsMatch(
+      R"(int32 val=2\); Undo Mutations: \[@[[:digit:]]+\(DELETE\)\]; )"
+      R"(Redo Mutations: \[@[[:digit:]]+\(SET key_idx=1\)\];$)"));
 
   vector<string> rows;
   ASSERT_OK(IterateToStringList(&rows));
@@ -272,7 +278,7 @@ TEST_F(TabletHistoryGcTest, TestNoGenerateUndoOnMRSFlush) {
 
   // Now flush the MRS. No trace should remain after this.
   ASSERT_OK(tablet()->Flush());
-  ASSERT_DEBUG_DUMP_ROWS_MATCH("");
+  NO_FATALS(VerifyDebugDumpRowsMatch(""));
 
   for (const auto& rsmd : tablet()->metadata()->rowsets()) {
     ASSERT_EQ(0, rsmd->undo_delta_blocks().size());
@@ -290,7 +296,8 @@ TEST_F(TabletHistoryGcTest, TestNoGenerateUndoOnMRSFlush) {
     ASSERT_EQ(0, rsmd->undo_delta_blocks().size());
   }
   NO_FATALS(VerifyTestRowsWithTimestampAndVerifier(kStartRow, 1, Timestamp(0), kRowsEqual0));
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(R"(int32 val=0\); Undo Mutations: \[\]; Redo Mutations: \[\];$)");
+  NO_FATALS(VerifyDebugDumpRowsMatch(
+      R"(int32 val=0\); Undo Mutations: \[\]; Redo Mutations: \[\];$)"));
 }
 
 // Test that undos get GCed on a merge compaction.
@@ -312,7 +319,8 @@ TEST_F(TabletHistoryGcTest, TestUndoGCOnMergeCompaction) {
   // Now the only thing we can see is the base data.
   NO_FATALS(VerifyTestRowsWithTimestampAndVerifier(kStartRow, TotalNumRows(), time_before_insert,
                                                    kRowsEqual0));
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(R"(int32 val=0\); Undo Mutations: \[\]; Redo Mutations: \[\];$)");
+  NO_FATALS(VerifyDebugDumpRowsMatch(
+      R"(int32 val=0\); Undo Mutations: \[\]; Redo Mutations: \[\];$)"));
 }
 
 // Test that we GC the history and existence of entire deleted rows on a merge compaction.
@@ -332,15 +340,16 @@ TEST_F(TabletHistoryGcTest, TestRowRemovalGCOnMergeCompaction) {
     ASSERT_OK(DeleteTestRow(&writer, row_idx));
   }
   ASSERT_OK(tablet()->Flush());
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(
+  NO_FATALS(VerifyDebugDumpRowsMatch(
       R"(int32 val=0\); Undo Mutations: \[@[[:digit:]]+\(DELETE\)\]; )"
-      R"(Redo Mutations: \[@[[:digit:]]+\(DELETE\)\];$)");
+      R"(Redo Mutations: \[@[[:digit:]]+\(DELETE\)\];$)"));
 
   // Compaction at this time will only remove the initial UNDO records. The
   // DELETE REDOs are too recent.
   ASSERT_OK(tablet()->Compact(Tablet::FORCE_COMPACT_ALL));
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(R"(int32 val=0\); Undo Mutations: \[\]; Redo Mutations: )"
-                               R"(\[@[[:digit:]]+\(DELETE\)\];$)");
+  NO_FATALS(VerifyDebugDumpRowsMatch(
+      R"(int32 val=0\); Undo Mutations: \[\]; Redo Mutations: )"
+      R"(\[@[[:digit:]]+\(DELETE\)\];$)"));
 
   // Move the AHM so that the delete is now prior to it.
   NO_FATALS(AddTimeToHybridClock(MonoDelta::FromSeconds(200)));
@@ -348,7 +357,7 @@ TEST_F(TabletHistoryGcTest, TestRowRemovalGCOnMergeCompaction) {
   // Now that even the deletion is prior to the AHM, all of the on-disk data
   // will be GCed.
   ASSERT_OK(tablet()->Compact(Tablet::FORCE_COMPACT_ALL));
-  ASSERT_DEBUG_DUMP_ROWS_MATCH("");
+  NO_FATALS(VerifyDebugDumpRowsMatch(""));
   NO_FATALS(VerifyTestRowsWithTimestampAndVerifier(kStartRow, 0, prev_time, boost::none));
   ASSERT_EQ(0, tablet()->OnDiskDataSize());
 }
@@ -383,8 +392,9 @@ TEST_F(TabletHistoryGcTest, TestNoUndoGCUntilAncientHistoryMark) {
   // Still read 0 from the past.
   NO_FATALS(VerifyTestRowsWithTimestampAndVerifier(kStartRow, TotalNumRows(), prev_time,
                                                    kRowsEqual0));
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(R"(int32 val=1\); Undo Mutations: \[@[[:digit:]]+\(SET val=0\), )"
-                               R"(@[[:digit:]]+\(DELETE\)\]; Redo Mutations: \[\];$)");
+  NO_FATALS(VerifyDebugDumpRowsMatch(
+      R"(int32 val=1\); Undo Mutations: \[@[[:digit:]]+\(SET val=0\), )"
+      R"(@[[:digit:]]+\(DELETE\)\]; Redo Mutations: \[\];$)"));
 }
 
 // Test that "ghost" rows (deleted on one rowset, reinserted on another) don't
@@ -410,7 +420,8 @@ TEST_F(TabletHistoryGcTest, TestGhostRowsNotRevived) {
 
   // We should end up with a single row as base data.
   NO_FATALS(VerifyTestRows(0, 1));
-  ASSERT_DEBUG_DUMP_ROWS_MATCH(R"(int32 val=3\); Undo Mutations: \[\]; Redo Mutations: \[\];)");
+  NO_FATALS(VerifyDebugDumpRowsMatch(
+      R"(int32 val=3\); Undo Mutations: \[\]; Redo Mutations: \[\];)"));
 }
 
 // Test to ensure that nothing bad happens when we partially GC different rows

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/tablet_metadata.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_metadata.h b/src/kudu/tablet/tablet_metadata.h
index a58292f..447e6ce 100644
--- a/src/kudu/tablet/tablet_metadata.h
+++ b/src/kudu/tablet/tablet_metadata.h
@@ -17,12 +17,12 @@
 #ifndef KUDU_TABLET_TABLET_METADATA_H
 #define KUDU_TABLET_TABLET_METADATA_H
 
-#include <algorithm>
 #include <atomic>
 #include <cstdint>
 #include <memory>
 #include <string>
 #include <unordered_set>
+#include <utility>
 #include <vector>
 
 #include <boost/optional/optional.hpp>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/tablet_mm_ops.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_mm_ops.cc b/src/kudu/tablet/tablet_mm_ops.cc
index 3f6f949..3af1042 100644
--- a/src/kudu/tablet/tablet_mm_ops.cc
+++ b/src/kudu/tablet/tablet_mm_ops.cc
@@ -17,8 +17,8 @@
 
 #include "kudu/tablet/tablet_mm_ops.h"
 
-#include <algorithm>
 #include <mutex>
+#include <utility>
 
 #include <gflags/gflags.h>
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/tablet_replica-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_replica-test.cc b/src/kudu/tablet/tablet_replica-test.cc
index a3c6b80..f6b2143 100644
--- a/src/kudu/tablet/tablet_replica-test.cc
+++ b/src/kudu/tablet/tablet_replica-test.cc
@@ -15,11 +15,11 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <algorithm>
 #include <cstdint>
 #include <memory>
 #include <ostream>
 #include <string>
+#include <utility>
 
 #include <boost/optional/optional.hpp>
 #include <gflags/gflags.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/transactions/alter_schema_transaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/alter_schema_transaction.cc b/src/kudu/tablet/transactions/alter_schema_transaction.cc
index eea0417..c9f3a70 100644
--- a/src/kudu/tablet/transactions/alter_schema_transaction.cc
+++ b/src/kudu/tablet/transactions/alter_schema_transaction.cc
@@ -17,8 +17,8 @@
 
 #include "kudu/tablet/transactions/alter_schema_transaction.h"
 
-#include <algorithm>
 #include <memory>
+#include <utility>
 
 #include <glog/logging.h>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/transactions/transaction_driver.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/transaction_driver.cc b/src/kudu/tablet/transactions/transaction_driver.cc
index 986e925..11db58a 100644
--- a/src/kudu/tablet/transactions/transaction_driver.cc
+++ b/src/kudu/tablet/transactions/transaction_driver.cc
@@ -17,12 +17,12 @@
 
 #include "kudu/tablet/transactions/transaction_driver.h"
 
-#include <algorithm>
 #include <functional>
 #include <memory>
 #include <mutex>
 #include <ostream>
 #include <type_traits>
+#include <utility>
 
 #include <glog/logging.h>
 #include <google/protobuf/descriptor.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tablet/transactions/transaction_tracker-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/transaction_tracker-test.cc b/src/kudu/tablet/transactions/transaction_tracker-test.cc
index 14d0e13..2929e38 100644
--- a/src/kudu/tablet/transactions/transaction_tracker-test.cc
+++ b/src/kudu/tablet/transactions/transaction_tracker-test.cc
@@ -16,14 +16,14 @@
 // under the License.
 
 #include <cstdint>
+#include <memory>
 #include <ostream>
 #include <string>
-#include <memory>
 #include <vector>
 
 #include <gflags/gflags_declare.h>
 #include <glog/logging.h>
-#include <google/protobuf/message.h>
+#include <google/protobuf/message.h>  // IWYU pragma: keep
 #include <gtest/gtest.h>
 
 #include "kudu/consensus/consensus.pb.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tools/ksck_remote.h
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck_remote.h b/src/kudu/tools/ksck_remote.h
index fbe3cb4..37bac80 100644
--- a/src/kudu/tools/ksck_remote.h
+++ b/src/kudu/tools/ksck_remote.h
@@ -18,9 +18,9 @@
 #ifndef KUDU_TOOLS_KSCK_REMOTE_H
 #define KUDU_TOOLS_KSCK_REMOTE_H
 
-#include <algorithm>
 #include <memory>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "kudu/client/shared_ptr.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tools/tool_action-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action-test.cc b/src/kudu/tools/tool_action-test.cc
index 4b2803f..b84c300 100644
--- a/src/kudu/tools/tool_action-test.cc
+++ b/src/kudu/tools/tool_action-test.cc
@@ -15,10 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <algorithm>
 #include <memory>
 #include <ostream>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include <gflags/gflags.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tools/tool_action_local_replica.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_local_replica.cc b/src/kudu/tools/tool_action_local_replica.cc
index 97efa49..b654578 100644
--- a/src/kudu/tools/tool_action_local_replica.cc
+++ b/src/kudu/tools/tool_action_local_replica.cc
@@ -19,16 +19,20 @@
 
 #include <algorithm>
 #include <cstddef>
+#include <cstdint>
 #include <iostream>
 #include <list>
 #include <map>
 #include <memory>
 #include <string>
+#include <unordered_map>
 #include <utility>
 #include <vector>
 
-#include <boost/none.hpp>
+#include <boost/container/flat_map.hpp>
+#include <boost/optional/optional.hpp>
 #include <gflags/gflags.h>
+#include <glog/logging.h>
 
 #include "kudu/cfile/cfile.pb.h"
 #include "kudu/cfile/cfile_reader.h"
@@ -39,8 +43,10 @@
 #include "kudu/common/rowblock.h"
 #include "kudu/common/schema.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/log.pb.h"
 #include "kudu/consensus/log_index.h"
 #include "kudu/consensus/log_reader.h"
 #include "kudu/consensus/log_util.h"
@@ -54,7 +60,9 @@
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/human_readable.h"
 #include "kudu/gutil/strings/join.h"
+#include "kudu/gutil/strings/numbers.h"
 #include "kudu/gutil/strings/split.h"
+#include "kudu/gutil/strings/stringpiece.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/strings/util.h"
 #include "kudu/master/sys_catalog.h"
@@ -68,6 +76,7 @@
 #include "kudu/tablet/mvcc.h"
 #include "kudu/tablet/rowset_metadata.h"
 #include "kudu/tablet/tablet_metadata.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tools/tool_action_common.h"
 #include "kudu/tserver/tablet_copy_client.h"
 #include "kudu/tserver/ts_tablet_manager.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tools/tool_action_pbc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_pbc.cc b/src/kudu/tools/tool_action_pbc.cc
index a977244..5a6acc0 100644
--- a/src/kudu/tools/tool_action_pbc.cc
+++ b/src/kudu/tools/tool_action_pbc.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/tools/tool_action.h"
 
-#include <algorithm>
 #include <cstdlib>
 #include <exception>
 #include <fstream>  // IWYU pragma: keep
@@ -25,6 +24,7 @@
 #include <memory>
 #include <string>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include <gflags/gflags.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tools/tool_action_table.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_table.cc b/src/kudu/tools/tool_action_table.cc
index 95f2d51..e2df70b 100644
--- a/src/kudu/tools/tool_action_table.cc
+++ b/src/kudu/tools/tool_action_table.cc
@@ -17,11 +17,11 @@
 
 #include "kudu/tools/tool_action.h"
 
-#include <algorithm>
 #include <iostream>
 #include <memory>
 #include <string>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include <gflags/gflags.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tools/tool_action_tablet.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_tablet.cc b/src/kudu/tools/tool_action_tablet.cc
index b16eb3b..3677cf9 100644
--- a/src/kudu/tools/tool_action_tablet.cc
+++ b/src/kudu/tools/tool_action_tablet.cc
@@ -17,13 +17,13 @@
 
 #include "kudu/tools/tool_action.h"
 
-#include <algorithm>
 #include <cstdint>
 #include <fstream>  // IWYU pragma: keep
 #include <iostream>
 #include <memory>
 #include <string>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include <boost/optional/optional.hpp>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tools/tool_action_wal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_wal.cc b/src/kudu/tools/tool_action_wal.cc
index 434f144..0c2a600 100644
--- a/src/kudu/tools/tool_action_wal.cc
+++ b/src/kudu/tools/tool_action_wal.cc
@@ -17,10 +17,10 @@
 
 #include "kudu/tools/tool_action.h"
 
-#include <algorithm>
 #include <memory>
 #include <string>
 #include <unordered_map>
+#include <utility>
 
 #include "kudu/consensus/log_util.h"
 #include "kudu/gutil/map-util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tserver/tablet_copy_client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_client.cc b/src/kudu/tserver/tablet_copy_client.cc
index f60cc46..6cab0f7 100644
--- a/src/kudu/tserver/tablet_copy_client.cc
+++ b/src/kudu/tserver/tablet_copy_client.cc
@@ -17,10 +17,10 @@
 
 #include "kudu/tserver/tablet_copy_client.h"
 
-#include <algorithm>
 #include <cstdint>
 #include <memory>
 #include <ostream>
+#include <utility>
 
 #include <boost/optional/optional.hpp>
 #include <gflags/gflags.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tserver/tablet_copy_service-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_service-test.cc b/src/kudu/tserver/tablet_copy_service-test.cc
index cb5a7e0..7dd409f 100644
--- a/src/kudu/tserver/tablet_copy_service-test.cc
+++ b/src/kudu/tserver/tablet_copy_service-test.cc
@@ -33,7 +33,6 @@
 #include "kudu/consensus/log.pb.h"
 #include "kudu/consensus/log_reader.h"
 #include "kudu/consensus/log_util.h"
-#include "kudu/consensus/opid_util.h"
 #include "kudu/fs/block_id.h"
 #include "kudu/fs/fs.pb.h"
 #include "kudu/gutil/gscoped_ptr.h"
@@ -49,36 +48,29 @@
 #include "kudu/tserver/tablet_server.h"
 #include "kudu/util/env.h"
 #include "kudu/util/faststring.h"
-#include "kudu/util/make_shared.h"
 #include "kudu/util/monotime.h"
+#include "kudu/util/net/sockaddr.h"
 #include "kudu/util/pb_util.h"
 #include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 #include "kudu/util/test_macros.h"
 
-#define ASSERT_REMOTE_ERROR(status, err, code, str) \
-    ASSERT_NO_FATAL_FAILURE(AssertRemoteError(status, err, code, str))
-
 DECLARE_uint64(tablet_copy_idle_timeout_sec);
 DECLARE_uint64(tablet_copy_timeout_poll_period_ms);
 
+using kudu::log::ReadableLogSegment;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
+using kudu::rpc::ErrorStatusPB;
+using kudu::rpc::RpcController;
+using std::atomic;
 using std::string;
+using std::thread;
+using std::vector;
 
 namespace kudu {
 namespace tserver {
 
-using consensus::MaximumOpId;
-using consensus::MinimumOpId;
-using consensus::OpIdEquals;
-using log::ReadableLogSegment;
-using pb_util::SecureDebugString;
-using pb_util::SecureShortDebugString;
-using rpc::ErrorStatusPB;
-using rpc::RpcController;
-using std::atomic;
-using std::thread;
-using std::vector;
-
 class TabletCopyServiceTest : public TabletCopyTest {
  public:
   TabletCopyServiceTest() {
@@ -278,9 +270,7 @@ TEST_F(TabletCopyServiceTest, TestBeginConcurrently) {
 
 // Test bad session id error condition.
 TEST_F(TabletCopyServiceTest, TestInvalidSessionId) {
-  vector<string> bad_session_ids;
-  bad_session_ids.emplace_back("hodor");
-  bad_session_ids.push_back(GetLocalUUID());
+  const vector<string> bad_session_ids = { "hodor", GetLocalUUID() };
 
   // Fetch a block for a non-existent session.
   for (const string& session_id : bad_session_ids) {
@@ -290,8 +280,9 @@ TEST_F(TabletCopyServiceTest, TestInvalidSessionId) {
     data_id.set_type(DataIdPB::BLOCK);
     data_id.mutable_block_id()->set_id(1);
     Status status = DoFetchData(session_id, data_id, nullptr, nullptr, &resp, &controller);
-    ASSERT_REMOTE_ERROR(status, controller.error_response(), TabletCopyErrorPB::NO_SESSION,
-                        Status::NotFound("").CodeAsString());
+    NO_FATALS(AssertRemoteError(
+        status, controller.error_response(), TabletCopyErrorPB::NO_SESSION,
+        Status::NotFound("").CodeAsString()));
   }
 
   // End a non-existent session.
@@ -299,8 +290,8 @@ TEST_F(TabletCopyServiceTest, TestInvalidSessionId) {
     EndTabletCopySessionResponsePB resp;
     RpcController controller;
     Status status = DoEndTabletCopySession(session_id, true, nullptr, &resp, &controller);
-    ASSERT_REMOTE_ERROR(status, controller.error_response(), TabletCopyErrorPB::NO_SESSION,
-                        Status::NotFound("").CodeAsString());
+    NO_FATALS(AssertRemoteError(status, controller.error_response(),
+        TabletCopyErrorPB::NO_SESSION, Status::NotFound("").CodeAsString()));
   }
 }
 
@@ -308,10 +299,10 @@ TEST_F(TabletCopyServiceTest, TestInvalidSessionId) {
 TEST_F(TabletCopyServiceTest, TestInvalidTabletId) {
   BeginTabletCopySessionResponsePB resp;
   RpcController controller;
-  Status status =
-      DoBeginTabletCopySession("some-unknown-tablet", GetLocalUUID(), &resp, &controller);
-  ASSERT_REMOTE_ERROR(status, controller.error_response(), TabletCopyErrorPB::TABLET_NOT_FOUND,
-                      Status::NotFound("").CodeAsString());
+  Status status = DoBeginTabletCopySession(
+      "some-unknown-tablet", GetLocalUUID(), &resp, &controller);
+  NO_FATALS(AssertRemoteError(status, controller.error_response(),
+      TabletCopyErrorPB::TABLET_NOT_FOUND, Status::NotFound("").CodeAsString()));
 }
 
 // Test DataIdPB validation.
@@ -327,9 +318,8 @@ TEST_F(TabletCopyServiceTest, TestInvalidBlockOrOpId) {
     data_id.set_type(DataIdPB::BLOCK);
     data_id.mutable_block_id()->set_id(1);
     Status status = DoFetchData(session_id, data_id, nullptr, nullptr, &resp, &controller);
-    ASSERT_REMOTE_ERROR(status, controller.error_response(),
-                        TabletCopyErrorPB::BLOCK_NOT_FOUND,
-                        Status::NotFound("").CodeAsString());
+    NO_FATALS(AssertRemoteError(status, controller.error_response(),
+        TabletCopyErrorPB::BLOCK_NOT_FOUND, Status::NotFound("").CodeAsString()));
   }
 
   // Invalid Segment Sequence Number for log fetch.
@@ -340,9 +330,8 @@ TEST_F(TabletCopyServiceTest, TestInvalidBlockOrOpId) {
     data_id.set_type(DataIdPB::LOG_SEGMENT);
     data_id.set_wal_segment_seqno(31337);
     Status status = DoFetchData(session_id, data_id, nullptr, nullptr, &resp, &controller);
-    ASSERT_REMOTE_ERROR(status, controller.error_response(),
-                        TabletCopyErrorPB::WAL_SEGMENT_NOT_FOUND,
-                        Status::NotFound("").CodeAsString());
+    NO_FATALS(AssertRemoteError(status, controller.error_response(),
+        TabletCopyErrorPB::WAL_SEGMENT_NOT_FOUND, Status::NotFound("").CodeAsString()));
   }
 
   // Empty data type with BlockId.
@@ -367,9 +356,9 @@ TEST_F(TabletCopyServiceTest, TestInvalidBlockOrOpId) {
     DataIdPB data_id;
     data_id.set_type(DataIdPB::LOG_SEGMENT);
     Status status = DoFetchData(session_id, data_id, nullptr, nullptr, &resp, &controller);
-    ASSERT_REMOTE_ERROR(status, controller.error_response(),
-                        TabletCopyErrorPB::INVALID_TABLET_COPY_REQUEST,
-                        Status::InvalidArgument("").CodeAsString());
+    NO_FATALS(AssertRemoteError(status, controller.error_response(),
+        TabletCopyErrorPB::INVALID_TABLET_COPY_REQUEST,
+        Status::InvalidArgument("").CodeAsString()));
   }
 
   // Both BlockId and Segment Sequence Number in the same "union" PB (illegal).
@@ -381,9 +370,9 @@ TEST_F(TabletCopyServiceTest, TestInvalidBlockOrOpId) {
     data_id.mutable_block_id()->set_id(1);
     data_id.set_wal_segment_seqno(0);
     Status status = DoFetchData(session_id, data_id, nullptr, nullptr, &resp, &controller);
-    ASSERT_REMOTE_ERROR(status, controller.error_response(),
-                        TabletCopyErrorPB::INVALID_TABLET_COPY_REQUEST,
-                        Status::InvalidArgument("").CodeAsString());
+    NO_FATALS(AssertRemoteError(status, controller.error_response(),
+        TabletCopyErrorPB::INVALID_TABLET_COPY_REQUEST,
+        Status::InvalidArgument("").CodeAsString()));
   }
 }
 
@@ -399,9 +388,9 @@ TEST_F(TabletCopyServiceTest, TestFetchInvalidBlockOffset) {
   uint64_t offset = std::numeric_limits<uint64_t>::max();
   Status status = DoFetchData(session_id, AsDataTypeId(FirstColumnBlockId(superblock)),
                               &offset, nullptr, &resp, &controller);
-  ASSERT_REMOTE_ERROR(status, controller.error_response(),
-                      TabletCopyErrorPB::INVALID_TABLET_COPY_REQUEST,
-                      Status::InvalidArgument("").CodeAsString());
+  NO_FATALS(AssertRemoteError(status, controller.error_response(),
+      TabletCopyErrorPB::INVALID_TABLET_COPY_REQUEST,
+      Status::InvalidArgument("").CodeAsString()));
 }
 
 // Test that we are able to fetch an entire block.

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tserver/tablet_copy_source_session-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_source_session-test.cc b/src/kudu/tserver/tablet_copy_source_session-test.cc
index 04e7485..f0cd053 100644
--- a/src/kudu/tserver/tablet_copy_source_session-test.cc
+++ b/src/kudu/tserver/tablet_copy_source_session-test.cc
@@ -16,11 +16,11 @@
 // under the License.
 #include "kudu/tablet/tablet-test-util.h"
 
-#include <algorithm>
 #include <cstdint>
 #include <memory>
 #include <ostream>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tserver/tablet_copy_source_session.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_source_session.h b/src/kudu/tserver/tablet_copy_source_session.h
index c81281f..324a8d0 100644
--- a/src/kudu/tserver/tablet_copy_source_session.h
+++ b/src/kudu/tserver/tablet_copy_source_session.h
@@ -17,11 +17,11 @@
 
 #pragma once
 
-#include <algorithm>
 #include <cstdint>
 #include <memory>
 #include <string>
 #include <unordered_map>
+#include <utility>
 
 #include <glog/logging.h>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/tserver/tablet_server.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server.cc b/src/kudu/tserver/tablet_server.cc
index bd3cde9..2beea2b 100644
--- a/src/kudu/tserver/tablet_server.cc
+++ b/src/kudu/tserver/tablet_server.cc
@@ -17,10 +17,10 @@
 
 #include "kudu/tserver/tablet_server.h"
 
-#include <algorithm>
 #include <cstddef>
 #include <ostream>
 #include <type_traits>
+#include <utility>
 
 #include <glog/logging.h>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/twitter-demo/ingest_firehose.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/ingest_firehose.cc b/src/kudu/twitter-demo/ingest_firehose.cc
index 6ecab3f..cfb3086 100644
--- a/src/kudu/twitter-demo/ingest_firehose.cc
+++ b/src/kudu/twitter-demo/ingest_firehose.cc
@@ -15,11 +15,11 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <algorithm>
 #include <fstream>  // IWYU pragma: keep
 #include <iostream>
 #include <string>
 #include <type_traits>
+#include <utility>
 
 #include <gflags/gflags.h>
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/twitter-demo/insert_consumer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/insert_consumer.cc b/src/kudu/twitter-demo/insert_consumer.cc
index d09800e..946f3dc 100644
--- a/src/kudu/twitter-demo/insert_consumer.cc
+++ b/src/kudu/twitter-demo/insert_consumer.cc
@@ -17,9 +17,9 @@
 
 #include "kudu/twitter-demo/insert_consumer.h"
 
-#include <algorithm>
 #include <ostream>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/async_logger.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/async_logger.h b/src/kudu/util/async_logger.h
index 68fc369..aedbdde 100644
--- a/src/kudu/util/async_logger.h
+++ b/src/kudu/util/async_logger.h
@@ -18,12 +18,12 @@
 
 #include "kudu/gutil/macros.h"
 
-#include <algorithm>
 #include <cstdint>
 #include <ctime>
 #include <memory>
 #include <string>
 #include <thread>
+#include <utility>
 #include <vector>
 
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/callback_bind-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/callback_bind-test.cc b/src/kudu/util/callback_bind-test.cc
index 9bb5e5f..db4d079 100644
--- a/src/kudu/util/callback_bind-test.cc
+++ b/src/kudu/util/callback_bind-test.cc
@@ -15,10 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <algorithm>
 #include <ostream>
 #include <string>
 #include <type_traits>
+#include <utility>
 
 #include <glog/logging.h>
 #include <gtest/gtest.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/env-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env-test.cc b/src/kudu/util/env-test.cc
index 3e67230..4549207 100644
--- a/src/kudu/util/env-test.cc
+++ b/src/kudu/util/env-test.cc
@@ -52,6 +52,7 @@
 #include "kudu/gutil/strings/human_readable.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/gutil/strings/util.h"
+#include "kudu/util/array_view.h" // IWYU pragma: keep
 #include "kudu/util/env.h"
 #include "kudu/util/env_util.h"
 #include "kudu/util/faststring.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/env.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/env.h b/src/kudu/util/env.h
index 6ba96c8..e3eb82a 100644
--- a/src/kudu/util/env.h
+++ b/src/kudu/util/env.h
@@ -22,7 +22,6 @@
 
 #include "kudu/gutil/callback_forward.h"
 #include "kudu/gutil/macros.h"
-#include "kudu/util/array_view.h"
 #include "kudu/util/status.h"
 
 namespace kudu {
@@ -39,6 +38,9 @@ struct RandomAccessFileOptions;
 struct RWFileOptions;
 struct WritableFileOptions;
 
+template <typename T>
+class ArrayView;
+
 // Returned by Env::GetSpaceInfo().
 struct SpaceInfo {
   int64_t capacity_bytes; // Capacity of a filesystem, in bytes.

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/env_util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_util-test.cc b/src/kudu/util/env_util-test.cc
index 1298646..b919b4a 100644
--- a/src/kudu/util/env_util-test.cc
+++ b/src/kudu/util/env_util-test.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <sys/statvfs.h>
 #include <sys/time.h>
 #include <unistd.h>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/file_cache-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/file_cache-stress-test.cc b/src/kudu/util/file_cache-stress-test.cc
index 9c68f2c..0ddaaef 100644
--- a/src/kudu/util/file_cache-stress-test.cc
+++ b/src/kudu/util/file_cache-stress-test.cc
@@ -31,10 +31,10 @@
 #include <vector>
 
 #include <gflags/gflags.h>
+#include <gflags/gflags_declare.h>
 #include <glog/logging.h>
 #include <gtest/gtest.h>
 
-#include "kudu/gutil/integral_types.h"
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/strings/split.h"
@@ -53,23 +53,6 @@
 #include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
-// Like CHECK_OK(), but dumps the contents of the cache before failing.
-//
-// The output of ToDebugString() tends to be long enough that LOG() truncates
-// it, so we must split it ourselves before logging.
-#define TEST_CHECK_OK(to_call) do {                                       \
-    const Status& _s = (to_call);                                         \
-    if (!_s.ok()) {                                                       \
-      LOG(INFO) << "Dumping cache contents";                              \
-      vector<string> lines = strings::Split(cache_->ToDebugString(), "\n", \
-                                            strings::SkipEmpty());        \
-      for (const auto& l : lines) {                                       \
-        LOG(INFO) << l;                                                   \
-      }                                                                   \
-    }                                                                     \
-    CHECK(_s.ok()) << "Bad status: " << _s.ToString();                    \
-  } while (0);
-
 DEFINE_int32(test_num_producer_threads, 1, "Number of producer threads");
 DEFINE_int32(test_num_consumer_threads, 4, "Number of consumer threads");
 DEFINE_int32(test_duration_secs, 2, "Number of seconds to run the test");
@@ -92,6 +75,24 @@ static const int kTestMaxOpenFiles = 100;
 
 template <class FileType>
 class FileCacheStressTest : public KuduTest {
+
+// Like CHECK_OK(), but dumps the contents of the cache before failing.
+//
+// The output of ToDebugString() tends to be long enough that LOG() truncates
+// it, so we must split it ourselves before logging.
+#define TEST_CHECK_OK(to_call) do {                                       \
+    const Status& _s = (to_call);                                         \
+    if (!_s.ok()) {                                                       \
+      LOG(INFO) << "Dumping cache contents";                              \
+      vector<string> lines = strings::Split(cache_->ToDebugString(), "\n",\
+                                            strings::SkipEmpty());        \
+      for (const auto& l : lines) {                                       \
+        LOG(INFO) << l;                                                   \
+      }                                                                   \
+    }                                                                     \
+    CHECK(_s.ok()) << "Bad status: " << _s.ToString();                    \
+  } while (0);
+
  public:
   typedef unordered_map<string, unordered_map<string, int>> MetricMap;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/jsonreader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/jsonreader.cc b/src/kudu/util/jsonreader.cc
index 826449d..f65a9f3 100644
--- a/src/kudu/util/jsonreader.cc
+++ b/src/kudu/util/jsonreader.cc
@@ -17,7 +17,7 @@
 
 #include "kudu/util/jsonreader.h"
 
-#include <algorithm>
+#include <utility>
 
 #include "kudu/gutil/port.h"
 #include "kudu/gutil/strings/substitute.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/logging.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/logging.cc b/src/kudu/util/logging.cc
index 64ada87..f53ee64 100644
--- a/src/kudu/util/logging.cc
+++ b/src/kudu/util/logging.cc
@@ -18,12 +18,11 @@
 
 #include <unistd.h>
 
-#include <algorithm>
 #include <cstdio>
 #include <cstdlib>
 #include <fstream>
 #include <mutex>
-#include <type_traits> // IWYU pragma: keep
+#include <utility>
 
 #include <boost/uuid/random_generator.hpp>
 #include <boost/uuid/uuid_io.hpp>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/maintenance_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/maintenance_manager.h b/src/kudu/util/maintenance_manager.h
index cfbc287..888dc39 100644
--- a/src/kudu/util/maintenance_manager.h
+++ b/src/kudu/util/maintenance_manager.h
@@ -18,14 +18,13 @@
 #pragma once
 
 #include <cstdint>
-
-#include <algorithm>
 #include <functional>
 #include <map>
 #include <memory>
 #include <mutex>
 #include <string>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/mem_tracker.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker.h b/src/kudu/util/mem_tracker.h
index 0a5af4f..ed06dc0 100644
--- a/src/kudu/util/mem_tracker.h
+++ b/src/kudu/util/mem_tracker.h
@@ -17,11 +17,11 @@
 #ifndef KUDU_UTIL_MEM_TRACKER_H
 #define KUDU_UTIL_MEM_TRACKER_H
 
-#include <algorithm>
 #include <cstdint>
 #include <list>
 #include <memory>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/metrics.cc b/src/kudu/util/metrics.cc
index 06fca86..a053d55 100644
--- a/src/kudu/util/metrics.cc
+++ b/src/kudu/util/metrics.cc
@@ -16,7 +16,6 @@
 // under the License.
 #include "kudu/util/metrics.h"
 
-#include <algorithm>
 #include <cstdlib>
 #include <iostream>
 #include <map>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/net/net_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/net/net_util.cc b/src/kudu/util/net/net_util.cc
index e5918b0..3f9273b 100644
--- a/src/kudu/util/net/net_util.cc
+++ b/src/kudu/util/net/net_util.cc
@@ -22,7 +22,6 @@
 #include <netinet/in.h>
 #include <unistd.h>
 
-#include <algorithm>
 #include <cerrno>
 #include <cstring>
 #include <functional>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/pb_util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/pb_util-test.cc b/src/kudu/util/pb_util-test.cc
index 3d13a3c..52e1cc9 100644
--- a/src/kudu/util/pb_util-test.cc
+++ b/src/kudu/util/pb_util-test.cc
@@ -15,22 +15,22 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <algorithm>
 #include <cstdint>
-#include <ostream>
 #include <memory>
+#include <ostream>
 #include <string>
+#include <utility>
 #include <vector>
 
+#include <gflags/gflags.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/descriptor.pb.h>
-#include <gflags/gflags.h>
 #include <gtest/gtest.h>
 
 #include "kudu/gutil/port.h"
-#include "kudu/util/faststring.h"
 #include "kudu/util/env.h"
 #include "kudu/util/env_util.h"
+#include "kudu/util/faststring.h"
 #include "kudu/util/pb_util-internal.h"
 #include "kudu/util/pb_util.h"
 #include "kudu/util/pb_util_test.pb.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/pb_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/pb_util.cc b/src/kudu/util/pb_util.cc
index abe3cec..2824690 100644
--- a/src/kudu/util/pb_util.cc
+++ b/src/kudu/util/pb_util.cc
@@ -23,15 +23,15 @@
 
 #include "kudu/util/pb_util.h"
 
-#include <algorithm>
 #include <cstddef>
 #include <deque>
 #include <initializer_list>
 #include <memory>
 #include <mutex>
-#include <ostream>  // IWYU pragma: keep
+#include <ostream>
 #include <string>
 #include <unordered_set>
+#include <utility>
 #include <vector>
 
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/process_memory.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/process_memory.cc b/src/kudu/util/process_memory.cc
index 7c0d4ee..090e012 100644
--- a/src/kudu/util/process_memory.cc
+++ b/src/kudu/util/process_memory.cc
@@ -16,13 +16,12 @@
 // under the License.
 
 #include <cstddef>
-#include <memory>
 #include <ostream>
 #include <string>
 
 #include <gflags/gflags.h>
 #include <glog/logging.h>
-#include <gperftools/malloc_extension.h>
+#include <gperftools/malloc_extension.h>  // IWYU pragma: keep
 
 #include "kudu/gutil/atomicops.h"
 #include "kudu/gutil/macros.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/rolling_log.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rolling_log.cc b/src/kudu/util/rolling_log.cc
index cc24b8a..9f8d10f 100644
--- a/src/kudu/util/rolling_log.cc
+++ b/src/kudu/util/rolling_log.cc
@@ -19,12 +19,12 @@
 
 #include <unistd.h>
 
-#include <algorithm>
 #include <ctime>
 #include <iomanip>
 #include <memory>
 #include <ostream>
 #include <string>
+#include <utility>
 
 #include <gflags/gflags.h>
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/status-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/status-test.cc b/src/kudu/util/status-test.cc
index 0112a26..d4c5b54 100644
--- a/src/kudu/util/status-test.cc
+++ b/src/kudu/util/status-test.cc
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <algorithm>
 #include <cerrno>
 #include <string>
+#include <utility>
 
 #include <gtest/gtest.h>
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/subprocess.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/subprocess.cc b/src/kudu/util/subprocess.cc
index 18866be..9518ca8 100644
--- a/src/kudu/util/subprocess.cc
+++ b/src/kudu/util/subprocess.cc
@@ -26,7 +26,6 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
-#include <algorithm>
 #include <cerrno>
 #include <cstdint>
 #include <cstdlib>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/test_graph.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/test_graph.h b/src/kudu/util/test_graph.h
index aa4344a..41df430 100644
--- a/src/kudu/util/test_graph.h
+++ b/src/kudu/util/test_graph.h
@@ -17,10 +17,10 @@
 #ifndef KUDU_TEST_GRAPH_COLLECTOR_H
 #define KUDU_TEST_GRAPH_COLLECTOR_H
 
-#include <algorithm>
 #include <memory>
 #include <string>
 #include <unordered_map>
+#include <utility>
 
 #include "kudu/gutil/ref_counted.h"
 #include "kudu/gutil/macros.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/thread.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/thread.h b/src/kudu/util/thread.h
index 17f67fa..c8b5191 100644
--- a/src/kudu/util/thread.h
+++ b/src/kudu/util/thread.h
@@ -28,9 +28,9 @@
 #endif
 #include <unistd.h>
 
-#include <algorithm>
 #include <cstdint>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include <boost/bind.hpp>     // IWYU pragma: keep

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/threadpool-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/threadpool-test.cc b/src/kudu/util/threadpool-test.cc
index f2f4a28..3435555 100644
--- a/src/kudu/util/threadpool-test.cc
+++ b/src/kudu/util/threadpool-test.cc
@@ -17,7 +17,6 @@
 
 #include <unistd.h>
 
-#include <algorithm>
 #include <atomic>
 #include <cstdint>
 #include <iterator>
@@ -27,6 +26,7 @@
 #include <ostream>
 #include <string>
 #include <thread>
+#include <utility>
 #include <vector>
 
 #include <boost/bind.hpp> // IWYU pragma: keep

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/src/kudu/util/threadpool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/threadpool.cc b/src/kudu/util/threadpool.cc
index a211c34..2203bf7 100644
--- a/src/kudu/util/threadpool.cc
+++ b/src/kudu/util/threadpool.cc
@@ -17,13 +17,13 @@
 
 #include "kudu/util/threadpool.h"
 
-#include <algorithm>
 #include <cstdint>
 #include <deque>
 #include <limits>
 #include <memory>
 #include <ostream>
 #include <string>
+#include <utility>
 
 #include <boost/function.hpp> // IWYU pragma: keep
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/thirdparty/download-thirdparty.sh
----------------------------------------------------------------------
diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh
index e7a27e4..7519485 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -211,8 +211,16 @@ if [ ! -d $MUSTACHE_SOURCE ]; then
   fetch_and_expand mustache-${MUSTACHE_VERSION}.tar.gz
 fi
 
+GSG_PATCHLEVEL=1
+delete_if_wrong_patchlevel $GSG_SOURCE $GSG_PATCHLEVEL
 if [ ! -d $GSG_SOURCE ]; then
   fetch_and_expand google-styleguide-${GSG_VERSION}.tar.gz
+
+  pushd $GSG_SOURCE
+  patch -p1 < $TP_DIR/patches/google-styleguide-cpplint.patch
+  touch patchlevel-$GSG_PATCHLEVEL
+  popd
+  echo
 fi
 
 if [ ! -d $GCOVR_SOURCE ]; then

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e6e12a9/thirdparty/patches/google-styleguide-cpplint.patch
----------------------------------------------------------------------
diff --git a/thirdparty/patches/google-styleguide-cpplint.patch b/thirdparty/patches/google-styleguide-cpplint.patch
new file mode 100644
index 0000000..b8212cf
--- /dev/null
+++ b/thirdparty/patches/google-styleguide-cpplint.patch
@@ -0,0 +1,21 @@
+--- a/cpplint/cpplint.py	2017-09-19 22:24:22.000000000 -0700
++++ b/cpplint/cpplint.py	2017-09-19 22:24:52.000000000 -0700
+@@ -5488,7 +5488,7 @@
+     ('<stack>', ('stack',)),
+     ('<string>', ('char_traits', 'basic_string',)),
+     ('<tuple>', ('tuple',)),
+-    ('<utility>', ('pair',)),
++    ('<utility>', ('pair', 'swap',)),
+     ('<vector>', ('vector',)),
+ 
+     # gcc extensions.
+@@ -5501,8 +5501,7 @@
+ _RE_PATTERN_STRING = re.compile(r'\bstring\b')
+ 
+ _re_pattern_algorithm_header = []
+-for _template in ('copy', 'max', 'min', 'min_element', 'sort', 'swap',
+-                  'transform'):
++for _template in ('copy', 'max', 'min', 'min_element', 'sort', 'transform'):
+   # Match max<type>(..., ...), max(..., ...), but not foo->max, foo.max or
+   # type::max().
+   _re_pattern_algorithm_header.append(


Mime
View raw message