kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [1/6] incubator-kudu git commit: Replace BOOST_FOREACH with c++11 range syntax
Date Fri, 15 Jan 2016 20:00:06 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 3eafca50f -> 9daafa5e7


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index 5241d2b..4bcd25a 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -1071,7 +1071,7 @@ void TabletServiceImpl::ListTablets(const ListTabletsRequestPB* req,
   vector<scoped_refptr<TabletPeer> > peers;
   server_->tablet_manager()->GetTabletPeers(&peers);
   RepeatedPtrField<StatusAndSchemaPB>* peer_status = resp->mutable_status_and_schema();
-  BOOST_FOREACH(const scoped_refptr<TabletPeer>& peer, peers) {
+  for (const scoped_refptr<TabletPeer>& peer : peers) {
     StatusAndSchemaPB* status = peer_status->Add();
     peer->GetTabletStatusPB(status->mutable_tablet_status());
     CHECK_OK(SchemaToPB(peer->status_listener()->schema(),
@@ -1238,7 +1238,7 @@ static Status SetupScanSpec(const NewScanRequestPB& scan_pb,
   unordered_set<string> missing_col_names;
 
   // First the column range predicates.
-  BOOST_FOREACH(const ColumnRangePredicatePB& pred_pb, scan_pb.range_predicates()) {
+  for (const ColumnRangePredicatePB& pred_pb : scan_pb.range_predicates()) {
     if (!pred_pb.has_lower_bound() && !pred_pb.has_upper_bound()) {
       return Status::InvalidArgument(
         string("Invalid predicate ") + pred_pb.ShortDebugString() +
@@ -1369,10 +1369,10 @@ Status TabletServiceImpl::HandleNewScanRequest(TabletPeer* tablet_peer,
   // sure to set whether the column is a key column appropriately.
   SchemaBuilder projection_builder;
   vector<ColumnSchema> projection_columns = projection.columns();
-  BOOST_FOREACH(const ColumnSchema& col, missing_cols) {
+  for (const ColumnSchema& col : missing_cols) {
     projection_columns.push_back(col);
   }
-  BOOST_FOREACH(const ColumnSchema& col, projection_columns) {
+  for (const ColumnSchema& col : projection_columns) {
     CHECK_OK(projection_builder.AddColumn(col, tablet_schema.is_key_column(col.name())));
   }
   projection = projection_builder.BuildWithoutIds();
@@ -1575,7 +1575,7 @@ Status TabletServiceImpl::HandleContinueScanRequest(const ScanRequestPB* req,
   vector<IteratorStats> stats_by_col;
   scanner->GetIteratorStats(&stats_by_col);
   IteratorStats total_stats;
-  BOOST_FOREACH(const IteratorStats& stats, stats_by_col) {
+  for (const IteratorStats& stats : stats_by_col) {
     total_stats.AddStats(stats);
   }
   IteratorStats delta_stats = total_stats;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/tserver/ts_tablet_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager-test.cc b/src/kudu/tserver/ts_tablet_manager-test.cc
index c99f3aa..ea1876f 100644
--- a/src/kudu/tserver/ts_tablet_manager-test.cc
+++ b/src/kudu/tserver/ts_tablet_manager-test.cc
@@ -129,7 +129,7 @@ static void AssertReportHasUpdatedTablet(const TabletReportPB& report,
                                          const string& tablet_id) {
   ASSERT_GE(report.updated_tablets_size(), 0);
   bool found_tablet = false;
-  BOOST_FOREACH(ReportedTabletPB reported_tablet, report.updated_tablets()) {
+  for (ReportedTabletPB reported_tablet : report.updated_tablets()) {
     if (reported_tablet.tablet_id() == tablet_id) {
       found_tablet = true;
       ASSERT_TRUE(reported_tablet.has_committed_consensus_state());
@@ -212,7 +212,7 @@ TEST_F(TsTabletManagerTest, TestTabletReports) {
     tablet_manager_->GenerateIncrementalTabletReport(&report);
     ASSERT_TRUE(report.is_incremental()) << report.ShortDebugString();
     ASSERT_MONOTONIC_REPORT_SEQNO(&seqno, report) << report.ShortDebugString();
-    BOOST_FOREACH(const ReportedTabletPB& reported_tablet, report.updated_tablets()) {
+    for (const ReportedTabletPB& reported_tablet : report.updated_tablets()) {
       if (reported_tablet.tablet_id() == "tablet-2") {
         found_tablet_2  = true;
         break;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/tserver/ts_tablet_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.cc b/src/kudu/tserver/ts_tablet_manager.cc
index 409d8af..e4f5ce9 100644
--- a/src/kudu/tserver/ts_tablet_manager.cc
+++ b/src/kudu/tserver/ts_tablet_manager.cc
@@ -190,7 +190,7 @@ Status TSTabletManager::Init() {
   // First, load all of the tablet metadata. We do this before we start
   // submitting the actual OpenTablet() tasks so that we don't have to compete
   // for disk resources, etc, with bootstrap processes and running tablets.
-  BOOST_FOREACH(const string& tablet_id, tablet_ids) {
+  for (const string& tablet_id : tablet_ids) {
     scoped_refptr<TabletMetadata> meta;
     RETURN_NOT_OK_PREPEND(OpenTabletMeta(tablet_id, &meta),
                           "Failed to open tablet metadata for tablet: " + tablet_id);
@@ -202,7 +202,7 @@ Status TSTabletManager::Init() {
   }
 
   // Now submit the "Open" task for each.
-  BOOST_FOREACH(const scoped_refptr<TabletMetadata>& meta, metas) {
+  for (const scoped_refptr<TabletMetadata>& meta : metas) {
     scoped_refptr<TransitionInProgressDeleter> deleter;
     {
       boost::lock_guard<rw_spinlock> lock(lock_);
@@ -230,7 +230,7 @@ Status TSTabletManager::WaitForAllBootstrapsToFinish() {
   Status s = Status::OK();
 
   boost::shared_lock<rw_spinlock> shared_lock(lock_);
-  BOOST_FOREACH(const TabletMap::value_type& entry, tablet_map_) {
+  for (const TabletMap::value_type& entry : tablet_map_) {
     if (entry.second->state() == tablet::FAILED) {
       if (s.ok()) {
         s = entry.second->error();
@@ -704,7 +704,7 @@ void TSTabletManager::Shutdown() {
   vector<scoped_refptr<TabletPeer> > peers_to_shutdown;
   GetTabletPeers(&peers_to_shutdown);
 
-  BOOST_FOREACH(const scoped_refptr<TabletPeer>& peer, peers_to_shutdown) {
+  for (const scoped_refptr<TabletPeer>& peer : peers_to_shutdown) {
     peer->Shutdown();
   }
 
@@ -837,7 +837,7 @@ void TSTabletManager::GenerateIncrementalTabletReport(TabletReportPB* report) {
   report->Clear();
   report->set_sequence_number(next_report_seq_++);
   report->set_is_incremental(true);
-  BOOST_FOREACH(const DirtyMap::value_type& dirty_entry, dirty_tablets_) {
+  for (const DirtyMap::value_type& dirty_entry : dirty_tablets_) {
     const string& tablet_id = dirty_entry.first;
     scoped_refptr<tablet::TabletPeer>* tablet_peer = FindOrNull(tablet_map_, tablet_id);
     if (tablet_peer) {
@@ -855,7 +855,7 @@ void TSTabletManager::GenerateFullTabletReport(TabletReportPB* report) {
   report->Clear();
   report->set_is_incremental(false);
   report->set_sequence_number(next_report_seq_++);
-  BOOST_FOREACH(const TabletMap::value_type& entry, tablet_map_) {
+  for (const TabletMap::value_type& entry : tablet_map_) {
     CreateReportedTabletPB(entry.first, entry.second, report->add_updated_tablets());
   }
   dirty_tablets_.clear();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/tserver/tserver-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tserver-path-handlers.cc b/src/kudu/tserver/tserver-path-handlers.cc
index a66d0e7..d5df150 100644
--- a/src/kudu/tserver/tserver-path-handlers.cc
+++ b/src/kudu/tserver/tserver-path-handlers.cc
@@ -123,7 +123,7 @@ void TabletServerPathHandlers::HandleTransactionsPage(const Webserver::WebReques
       "Total time in-flight</th><th>Description</th></tr>\n";
   }
 
-  BOOST_FOREACH(const scoped_refptr<TabletPeer>& peer, peers) {
+  for (const scoped_refptr<TabletPeer>& peer : peers) {
     vector<TransactionStatusPB> inflight;
 
     if (peer->tablet() == NULL) {
@@ -131,7 +131,7 @@ void TabletServerPathHandlers::HandleTransactionsPage(const Webserver::WebReques
     }
 
     peer->GetInFlightTransactions(trace_type, &inflight);
-    BOOST_FOREACH(const TransactionStatusPB& inflight_tx, inflight) {
+    for (const TransactionStatusPB& inflight_tx : inflight) {
       string total_time_str = Substitute("$0 us.", inflight_tx.running_for_micros());
       string description;
       if (trace_type == Transaction::TRACE_TXNS) {
@@ -190,7 +190,7 @@ void TabletServerPathHandlers::HandleTabletsPage(const Webserver::WebRequest& re
   *output << "  <tr><th>Table name</th><th>Tablet ID</th>"
       "<th>Partition</th>"
       "<th>State</th><th>On-disk size</th><th>RaftConfig</th><th>Last status</th></tr>\n";
-  BOOST_FOREACH(const scoped_refptr<TabletPeer>& peer, peers) {
+  for (const scoped_refptr<TabletPeer>& peer : peers) {
     TabletStatusPB status;
     peer->GetTabletStatusPB(&status);
     string id = status.tablet_id();
@@ -245,7 +245,7 @@ string TabletServerPathHandlers::ConsensusStatePBToHtml(const ConsensusStatePB&
   std::vector<RaftPeerPB> sorted_peers;
   sorted_peers.assign(cstate.config().peers().begin(), cstate.config().peers().end());
   std::sort(sorted_peers.begin(), sorted_peers.end(), &CompareByMemberType);
-  BOOST_FOREACH(const RaftPeerPB& peer, sorted_peers) {
+  for (const RaftPeerPB& peer : sorted_peers) {
     string peer_addr_or_uuid =
         peer.has_last_known_addr() ? peer.last_known_addr().host() : peer.permanent_uuid();
     peer_addr_or_uuid = EscapeForHtmlToString(peer_addr_or_uuid);
@@ -401,7 +401,7 @@ void TabletServerPathHandlers::HandleScansPage(const Webserver::WebRequest& req,
 
   vector<SharedScanner> scanners;
   tserver_->scanner_manager()->ListScanners(&scanners);
-  BOOST_FOREACH(const SharedScanner& scanner, scanners) {
+  for (const SharedScanner& scanner : scanners) {
     *output << ScannerToHtml(*scanner);
   }
   *output << "</table>";
@@ -444,7 +444,7 @@ string TabletServerPathHandlers::ScannerToHtml(const Scanner& scanner) const {
       range_pred_str = EncodedKey::RangeToString(spec.lower_bound_key(),
                                                  spec.exclusive_upper_bound_key());
     }
-    BOOST_FOREACH(const ColumnRangePredicate& pred, scanner.spec().predicates()) {
+    for (const ColumnRangePredicate& pred : scanner.spec().predicates()) {
       other_preds.push_back(pred.ToString());
     }
     string other_pred_str = JoinStrings(other_preds, "\n");

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/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 7f001c3..370b8cc 100644
--- a/src/kudu/twitter-demo/insert_consumer.cc
+++ b/src/kudu/twitter-demo/insert_consumer.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/twitter-demo/insert_consumer.h"
 
-#include <boost/foreach.hpp>
 #include <boost/thread/locks.hpp>
 #include <glog/logging.h>
 #include <string>
@@ -104,7 +103,7 @@ void InsertConsumer::BatchFinished(const Status& s) {
     vector<client::KuduError*> errors;
     ElementDeleter d(&errors);
     session_->GetPendingErrors(&errors, &overflow);
-    BOOST_FOREACH(const client::KuduError* error, errors) {
+    for (const client::KuduError* error : errors) {
       LOG(WARNING) << "Failed to insert row " << error->failed_op().ToString()
                    << ": " << error->status().ToString();
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/twitter-demo/oauth.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/oauth.cc b/src/kudu/twitter-demo/oauth.cc
index 3ff2879..efffcb4 100644
--- a/src/kudu/twitter-demo/oauth.cc
+++ b/src/kudu/twitter-demo/oauth.cc
@@ -20,7 +20,6 @@
 #include <algorithm>
 #include <vector>
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 extern "C" {
 #include <oauth.h>
@@ -85,7 +84,7 @@ string OAuthRequest::SignatureBaseString() const {
 
   string kvpairs;
   bool first = true;
-  BOOST_FOREACH(const StringPair& p, sorted_pairs) {
+  for (const StringPair& p : sorted_pairs) {
     if (!first) {
       kvpairs.append("&");
     }
@@ -114,7 +113,7 @@ string OAuthRequest::AuthHeader(const string& consumer_secret,
   string sig = Signature(consumer_secret, token_secret);
 
   string ret = "Authorization: OAuth realm=\"\"";
-  BOOST_FOREACH(const StringPair& p, kv_pairs_) {
+  for (const StringPair& p : kv_pairs_) {
     if (!HasPrefixString(p.first, "oauth_")) continue;
     ret.append(", ");
     ret.append(p.first).append("=\"").append(EscapeUrl(p.second)).append("\"");

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/twitter-demo/parser-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/parser-test.cc b/src/kudu/twitter-demo/parser-test.cc
index 0b56daf..1085450 100644
--- a/src/kudu/twitter-demo/parser-test.cc
+++ b/src/kudu/twitter-demo/parser-test.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/twitter-demo/parser.h"
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <gtest/gtest.h>
 
@@ -57,7 +56,7 @@ static void EnsureFileParses(const char* file, TwitterEventType expected_type) {
   CHECK_OK(LoadFile(file, &jsons));
 
   int line_number = 1;
-  BOOST_FOREACH(const string& json, jsons) {
+  for (const string& json : jsons) {
     if (json.empty()) continue;
     SCOPED_TRACE(json);
     SCOPED_TRACE(line_number);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/atomic-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/atomic-test.cc b/src/kudu/util/atomic-test.cc
index fe5fbbf..ad754f3 100644
--- a/src/kudu/util/atomic-test.cc
+++ b/src/kudu/util/atomic-test.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/util/atomic.h"
 
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 #include <limits>
 #include <vector>
@@ -54,7 +53,7 @@ typedef ::testing::Types<int32_t, int64_t, uint32_t, uint64_t> IntTypes;
 TYPED_TEST_CASE(AtomicIntTest, IntTypes);
 
 TYPED_TEST(AtomicIntTest, LoadStore) {
-  BOOST_FOREACH(const MemoryOrder mem_order, this->acquire_release_) {
+  for (const MemoryOrder mem_order : this->acquire_release_) {
     AtomicInt<TypeParam> i(0);
     EXPECT_EQ(0, i.Load(mem_order));
     i.Store(42, mem_order);
@@ -67,7 +66,7 @@ TYPED_TEST(AtomicIntTest, LoadStore) {
 }
 
 TYPED_TEST(AtomicIntTest, SetSwapExchange) {
-  BOOST_FOREACH(const MemoryOrder mem_order, this->acquire_release_) {
+  for (const MemoryOrder mem_order : this->acquire_release_) {
     AtomicInt<TypeParam> i(0);
     EXPECT_TRUE(i.CompareAndSet(0, 5, mem_order));
     EXPECT_EQ(5, i.Load(mem_order));
@@ -83,7 +82,7 @@ TYPED_TEST(AtomicIntTest, SetSwapExchange) {
 }
 
 TYPED_TEST(AtomicIntTest, MinMax) {
-  BOOST_FOREACH(const MemoryOrder mem_order, this->acquire_release_) {
+  for (const MemoryOrder mem_order : this->acquire_release_) {
     AtomicInt<TypeParam> i(0);
 
     i.StoreMax(100, mem_order);
@@ -104,7 +103,7 @@ TYPED_TEST(AtomicIntTest, MinMax) {
 }
 
 TYPED_TEST(AtomicIntTest, Increment) {
-  BOOST_FOREACH(const MemoryOrder mem_order, this->barrier_) {
+  for (const MemoryOrder mem_order : this->barrier_) {
     AtomicInt<TypeParam> i(0);
     EXPECT_EQ(1, i.Increment(mem_order));
     EXPECT_EQ(3, i.IncrementBy(2, mem_order));
@@ -114,7 +113,7 @@ TYPED_TEST(AtomicIntTest, Increment) {
 
 TEST(Atomic, AtomicBool) {
   vector<MemoryOrder> memory_orders = { kMemOrderNoBarrier, kMemOrderRelease, kMemOrderAcquire };
-  BOOST_FOREACH(const MemoryOrder mem_order, memory_orders) {
+  for (const MemoryOrder mem_order : memory_orders) {
     AtomicBool b(false);
     EXPECT_FALSE(b.Load(mem_order));
     b.Store(true, mem_order);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/blocking_queue.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/blocking_queue.h b/src/kudu/util/blocking_queue.h
index a9d4459..f20f787 100644
--- a/src/kudu/util/blocking_queue.h
+++ b/src/kudu/util/blocking_queue.h
@@ -17,7 +17,6 @@
 #ifndef KUDU_UTIL_BLOCKING_QUEUE_H
 #define KUDU_UTIL_BLOCKING_QUEUE_H
 
-#include <boost/foreach.hpp>
 #include <boost/type_traits/remove_pointer.hpp>
 #include <list>
 #include <string>
@@ -108,7 +107,7 @@ class BlockingQueue {
     while (true) {
       if (!list_.empty()) {
         out->reserve(list_.size());
-        BOOST_FOREACH(const T& elt, list_) {
+        for (const T& elt : list_) {
           out->push_back(elt);
           decrement_size_unlocked(elt);
         }
@@ -208,7 +207,7 @@ class BlockingQueue {
     std::string ret;
 
     MutexLock l(lock_);
-    BOOST_FOREACH(const T& t, list_) {
+    for (const T& t : list_) {
       ret.append(t->ToString());
       ret.append("\n");
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/cache.cc b/src/kudu/util/cache.cc
index a86fb8a..2dc12b1 100644
--- a/src/kudu/util/cache.cc
+++ b/src/kudu/util/cache.cc
@@ -19,7 +19,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file. See the AUTHORS file for names of contributors.
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <memory>
 #include <stdlib.h>
@@ -450,7 +449,7 @@ class ShardedLRUCache : public Cache {
 
   virtual void SetMetrics(const scoped_refptr<MetricEntity>& entity) OVERRIDE {
     metrics_.reset(new CacheMetrics(entity));
-    BOOST_FOREACH(LRUCache* cache, shards_) {
+    for (LRUCache* cache : shards_) {
       cache->SetMetrics(metrics_.get());
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/debug-util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/debug-util-test.cc b/src/kudu/util/debug-util-test.cc
index 2f184e5..f6bfd33 100644
--- a/src/kudu/util/debug-util-test.cc
+++ b/src/kudu/util/debug-util-test.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <glog/stl_logging.h>
 #include <signal.h>
 #include <string>
@@ -141,7 +140,7 @@ TEST_F(DebugUtilTest, TestSignalStackTrace) {
 TEST_F(DebugUtilTest, TestDumpAllThreads) {
   vector<pid_t> tids;
   ASSERT_OK(ListThreads(&tids));
-  BOOST_FOREACH(pid_t tid, tids) {
+  for (pid_t tid : tids) {
     LOG(INFO) << DumpThreadStack(tid);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/debug/trace_event_impl.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/debug/trace_event_impl.cc b/src/kudu/util/debug/trace_event_impl.cc
index 412650d..22cbe62 100644
--- a/src/kudu/util/debug/trace_event_impl.cc
+++ b/src/kudu/util/debug/trace_event_impl.cc
@@ -6,7 +6,6 @@
 #include "kudu/util/debug/trace_event_impl.h"
 
 #include <algorithm>
-#include <boost/foreach.hpp>
 #include <gflags/gflags.h>
 #include <list>
 #include <vector>
@@ -1559,7 +1558,7 @@ void TraceLog::Flush(const TraceLog::OutputCallback& cb) {
     // Holding the active threads lock ensures that no thread will exit and
     // delete its own PerThreadInfo object.
     MutexLock l(active_threads_lock_);
-    BOOST_FOREACH(const ActiveThreadMap::value_type& entry, active_threads_) {
+    for (const ActiveThreadMap::value_type& entry : active_threads_) {
       int64_t tid = entry.first;
       PerThreadInfo* thr_info = entry.second;
 
@@ -2223,7 +2222,7 @@ bool CategoryFilter::DoesCategoryGroupContainCategory(
     const char* category) const {
   DCHECK(category);
   vector<string> pieces = strings::Split(category_group, ",");
-  BOOST_FOREACH(const string& category_group_token, pieces) {
+  for (const string& category_group_token : pieces) {
     // Don't allow empty tokens, nor tokens with leading or trailing space.
     DCHECK(!CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace(
         category_group_token))
@@ -2267,7 +2266,7 @@ void CategoryFilter::Initialize(const std::string& filter_string) {
   // Tokenize list of categories, delimited by ','.
   vector<string> tokens = strings::Split(filter_string, ",");
   // Add each token to the appropriate list (included_,excluded_).
-  BOOST_FOREACH(string category, tokens) {
+  for (string category : tokens) {
     // Ignore empty categories.
     if (category.empty())
       continue;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/env-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env-test.cc b/src/kudu/util/env-test.cc
index 6c56193..d9ca45d 100644
--- a/src/kudu/util/env-test.cc
+++ b/src/kudu/util/env-test.cc
@@ -22,7 +22,6 @@
 
 #include <glog/logging.h>
 #include <gtest/gtest.h>
-#include <boost/foreach.hpp>
 
 #include "kudu/gutil/bind.h"
 #include "kudu/gutil/strings/substitute.h"
@@ -168,7 +167,7 @@ class TestEnv : public KuduTest {
         if (fast || random() % 2) {
           ASSERT_OK(file->AppendVector(input[i]));
         } else {
-          BOOST_FOREACH(const Slice& slice, input[i]) {
+          for (const Slice& slice : input[i]) {
             ASSERT_OK(file->Append(slice));
           }
         }
@@ -667,7 +666,7 @@ TEST_F(TestEnv, TestRWFile) {
 
 TEST_F(TestEnv, TestCanonicalize) {
   vector<string> synonyms = { GetTestPath("."), GetTestPath("./."), GetTestPath(".//./") };
-  BOOST_FOREACH(const string& synonym, synonyms) {
+  for (const string& synonym : synonyms) {
     string result;
     ASSERT_OK(env_->Canonicalize(synonym, &result));
     ASSERT_EQ(GetTestDataDirectory(), result);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/env_posix.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index 38d276d..1570c18 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file. See the AUTHORS file for names of contributors.
 
-#include <boost/foreach.hpp>
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/failure_detector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/failure_detector.cc b/src/kudu/util/failure_detector.cc
index a6dc022..76f2611 100644
--- a/src/kudu/util/failure_detector.cc
+++ b/src/kudu/util/failure_detector.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/util/failure_detector.h"
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <unordered_map>
 
@@ -103,14 +102,14 @@ void TimedFailureDetector::CheckForFailures(const MonoTime& now) {
   CallbackMap callbacks;
   {
     lock_guard<simple_spinlock> lock(&lock_);
-    BOOST_FOREACH(const NodeMap::value_type& entry, nodes_) {
+    for (const NodeMap::value_type& entry : nodes_) {
       if (GetNodeStatusUnlocked(entry.first, now) == DEAD) {
         InsertOrDie(&callbacks, entry.first, entry.second->callback);
       }
     }
   }
   // Invoke failure callbacks outside of lock.
-  BOOST_FOREACH(const CallbackMap::value_type& entry, callbacks) {
+  for (const CallbackMap::value_type& entry : callbacks) {
     const string& node_name = entry.first;
     const FailureDetectedCallback& callback = entry.second;
     callback.Run(node_name, Status::RemoteError(Substitute("Node '$0' failed", node_name)));
@@ -206,7 +205,7 @@ void RandomizedFailureMonitor::RunThread() {
     }
 
     MonoTime now = MonoTime::Now(MonoTime::FINE);
-    BOOST_FOREACH(const FDMap::value_type& entry, fds_copy) {
+    for (const FDMap::value_type& entry : fds_copy) {
       entry.second->CheckForFailures(now);
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/flags.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/flags.cc b/src/kudu/util/flags.cc
index dbaec62..17e6ee5 100644
--- a/src/kudu/util/flags.cc
+++ b/src/kudu/util/flags.cc
@@ -22,7 +22,6 @@
 #include <unordered_set>
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <gflags/gflags.h>
 #include <gperftools/heap-profiler.h>
 
@@ -243,7 +242,7 @@ void DumpFlagsXML() {
       "<usage>$0</usage>",
       EscapeForHtmlToString(google::ProgramUsage())) << endl;
 
-  BOOST_FOREACH(const CommandLineFlagInfo& flag, flags) {
+  for (const CommandLineFlagInfo& flag : flags) {
     cout << DescribeOneFlagInXML(flag) << std::endl;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/interval_tree-inl.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/interval_tree-inl.h b/src/kudu/util/interval_tree-inl.h
index 21a92e8..043c05e 100644
--- a/src/kudu/util/interval_tree-inl.h
+++ b/src/kudu/util/interval_tree-inl.h
@@ -86,7 +86,7 @@ void IntervalTree<Traits>::Partition(const IntervalVector &in,
   // Pick a split point which is the median of all of the interval boundaries.
   std::vector<point_type> endpoints;
   endpoints.reserve(in.size() * 2);
-  BOOST_FOREACH(const interval_type &interval, in) {
+  for (const interval_type &interval : in) {
     endpoints.push_back(Traits::get_left(interval));
     endpoints.push_back(Traits::get_right(interval));
   }
@@ -94,7 +94,7 @@ void IntervalTree<Traits>::Partition(const IntervalVector &in,
   *split_point = endpoints[endpoints.size() / 2];
 
   // Partition into the groups based on the determined split point.
-  BOOST_FOREACH(const interval_type &interval, in) {
+  for (const interval_type &interval : in) {
     if (Traits::compare(Traits::get_right(interval), *split_point) < 0) {
       //                 | split point
       // |------------|  |
@@ -226,7 +226,7 @@ void ITNode<Traits>::FindContainingPoint(const point_type &query,
 
     // Any intervals which start before the query point and overlap the split point
     // must therefore contain the query point.
-    BOOST_FOREACH(const interval_type &interval, overlapping_by_asc_left_) {
+    for (const interval_type &interval : overlapping_by_asc_left_) {
       if (Traits::compare(Traits::get_left(interval), query) <= 0) {
         results->push_back(interval);
       } else {
@@ -241,7 +241,7 @@ void ITNode<Traits>::FindContainingPoint(const point_type &query,
 
     // Any intervals which end after the query point and overlap the split point
     // must therefore contain the query point.
-    BOOST_FOREACH(const interval_type &interval, overlapping_by_desc_right_) {
+    for (const interval_type &interval : overlapping_by_desc_right_) {
       if (Traits::compare(Traits::get_right(interval), query) >= 0) {
         results->push_back(interval);
       } else {
@@ -269,7 +269,7 @@ void ITNode<Traits>::FindIntersectingInterval(const interval_type &query,
 
     // Any intervals whose left edge is <= the query interval's right edge
     // intersect the query interval.
-    BOOST_FOREACH(const interval_type &interval, overlapping_by_asc_left_) {
+    for (const interval_type &interval : overlapping_by_asc_left_) {
       if (Traits::compare(Traits::get_left(interval),Traits::get_right(query)) <= 0) {
         results->push_back(interval);
       } else {
@@ -285,7 +285,7 @@ void ITNode<Traits>::FindIntersectingInterval(const interval_type &query,
 
     // Any intervals whose right edge is >= the query interval's left edge
     // intersect the query interval.
-    BOOST_FOREACH(const interval_type &interval, overlapping_by_desc_right_) {
+    for (const interval_type &interval : overlapping_by_desc_right_) {
       if (Traits::compare(Traits::get_right(interval), Traits::get_left(query)) >= 0) {
         results->push_back(interval);
       } else {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/interval_tree-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/interval_tree-test.cc b/src/kudu/util/interval_tree-test.cc
index 89fbe96..09c3015 100644
--- a/src/kudu/util/interval_tree-test.cc
+++ b/src/kudu/util/interval_tree-test.cc
@@ -80,7 +80,7 @@ static bool CompareIntervals(const IntInterval &a, const IntInterval &b) {
 static string Stringify(const vector<IntInterval> &intervals) {
   string ret;
   bool first = true;
-  BOOST_FOREACH(const IntInterval &interval, intervals) {
+  for (const IntInterval &interval : intervals) {
     if (!first) {
       ret.append(",");
     }
@@ -93,7 +93,7 @@ static string Stringify(const vector<IntInterval> &intervals) {
 static void FindContainingBruteForce(const vector<IntInterval> &intervals,
                                      int query_point,
                                      vector<IntInterval> *results) {
-  BOOST_FOREACH(const IntInterval &i, intervals) {
+  for (const IntInterval &i : intervals) {
     if (query_point >= i.left && query_point <= i.right) {
       results->push_back(i);
     }
@@ -105,7 +105,7 @@ static void FindContainingBruteForce(const vector<IntInterval> &intervals,
 static void FindIntersectingBruteForce(const vector<IntInterval> &intervals,
                                        IntInterval query_interval,
                                        vector<IntInterval> *results) {
-  BOOST_FOREACH(const IntInterval &i, intervals) {
+  for (const IntInterval &i : intervals) {
     if (query_interval.Intersects(i)) {
       results->push_back(i);
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/interval_tree.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/interval_tree.h b/src/kudu/util/interval_tree.h
index d98d929..8a625d1 100644
--- a/src/kudu/util/interval_tree.h
+++ b/src/kudu/util/interval_tree.h
@@ -23,7 +23,6 @@
 #ifndef KUDU_UTIL_INTERVAL_TREE_H
 #define KUDU_UTIL_INTERVAL_TREE_H
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 
 #include <vector>

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/jsonreader-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/jsonreader-test.cc b/src/kudu/util/jsonreader-test.cc
index e38981e..eeae025 100644
--- a/src/kudu/util/jsonreader-test.cc
+++ b/src/kudu/util/jsonreader-test.cc
@@ -18,7 +18,6 @@
 #include <string>
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 
 #include "kudu/gutil/integral_types.h"
@@ -154,7 +153,7 @@ TEST(JsonReaderTest, NestedArray) {
   ASSERT_OK(r.ExtractObjectArray(r.root(), "foo", &foo));
   ASSERT_EQ(3, foo.size());
   int i = 0;
-  BOOST_FOREACH(const Value* v, foo) {
+  for (const Value* v : foo) {
     int32_t number;
     ASSERT_OK(r.ExtractInt32(v, "val", &number));
     ASSERT_EQ(i, number);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/jsonwriter.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/jsonwriter.cc b/src/kudu/util/jsonwriter.cc
index 1d8e4d8..bc11264 100644
--- a/src/kudu/util/jsonwriter.cc
+++ b/src/kudu/util/jsonwriter.cc
@@ -19,7 +19,6 @@
 #include <string>
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/message.h>
@@ -169,7 +168,7 @@ void JsonWriter::Protobuf(const Message& pb) {
   reflection->ListFields(pb, &fields);
 
   StartObject();
-  BOOST_FOREACH(const FieldDescriptor* field, fields) {
+  for (const FieldDescriptor* field : fields) {
     String(field->name());
     if (field->is_repeated()) {
       StartArray();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/kernel_stack_watchdog.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/kernel_stack_watchdog.cc b/src/kudu/util/kernel_stack_watchdog.cc
index 21817a4..5ec871b 100644
--- a/src/kudu/util/kernel_stack_watchdog.cc
+++ b/src/kudu/util/kernel_stack_watchdog.cc
@@ -18,7 +18,6 @@
 #include "kudu/util/kernel_stack_watchdog.h"
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <gflags/gflags.h>
 #include <string>
@@ -101,7 +100,7 @@ void KernelStackWatchdog::RunThread() {
       MutexLock l(lock_);
       MicrosecondsInt64 now = GetMonoTimeMicros();
 
-      BOOST_FOREACH(const TLSMap::value_type& map_entry, tls_by_tid_) {
+      for (const TLSMap::value_type& map_entry : tls_by_tid_) {
         pid_t p = map_entry.first;
         const TLS::Data* tls = &map_entry.second->data_;
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/knapsack_solver-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/knapsack_solver-test.cc b/src/kudu/util/knapsack_solver-test.cc
index 0d066ef..703255f 100644
--- a/src/kudu/util/knapsack_solver-test.cc
+++ b/src/kudu/util/knapsack_solver-test.cc
@@ -134,7 +134,7 @@ TEST_F(TestKnapsack, Randomized) {
     // Verify that the max_val is equal to the sum of the chosen items' values.
     double sum_val = 0;
     int sum_weight = 0;
-    BOOST_FOREACH(int i, out) {
+    for (int i : out) {
       sum_val += in[i].value;
       sum_weight += in[i].weight;
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/knapsack_solver.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/knapsack_solver.h b/src/kudu/util/knapsack_solver.h
index 565b0de..2c37065 100644
--- a/src/kudu/util/knapsack_solver.h
+++ b/src/kudu/util/knapsack_solver.h
@@ -17,7 +17,6 @@
 #ifndef KUDU_UTIL_KNAPSACK_SOLVER_H
 #define KUDU_UTIL_KNAPSACK_SOLVER_H
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <algorithm>
 #include <utility>

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/mem_tracker-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker-test.cc b/src/kudu/util/mem_tracker-test.cc
index f961feb..51529e1 100644
--- a/src/kudu/util/mem_tracker-test.cc
+++ b/src/kudu/util/mem_tracker-test.cc
@@ -23,7 +23,6 @@
 #include <vector>
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <gperftools/malloc_extension.h>
 
 #include "kudu/util/test_util.h"
@@ -227,7 +226,7 @@ TEST(MemTrackerTest, FindFunctionsTakeOwnership) {
     shared_ptr<MemTracker> m = MemTracker::CreateTracker(-1, "test");
     MemTracker::ListTrackers(&refs);
   }
-  BOOST_FOREACH(const shared_ptr<MemTracker>& r, refs) {
+  for (const shared_ptr<MemTracker>& r : refs) {
     LOG(INFO) << r->ToString();
   }
   refs.clear();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/mem_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker.cc b/src/kudu/util/mem_tracker.cc
index e892a72..84a057a 100644
--- a/src/kudu/util/mem_tracker.cc
+++ b/src/kudu/util/mem_tracker.cc
@@ -18,7 +18,6 @@
 #include "kudu/util/mem_tracker.h"
 
 #include <algorithm>
-#include <boost/foreach.hpp>
 #include <deque>
 #include <gperftools/malloc_extension.h>
 #include <limits>
@@ -226,7 +225,7 @@ bool MemTracker::FindTrackerUnlocked(const string& id,
                                      const shared_ptr<MemTracker>& parent) {
   DCHECK(parent != NULL);
   parent->child_trackers_lock_.AssertAcquired();
-  BOOST_FOREACH(MemTracker* child, parent->child_trackers_) {
+  for (MemTracker* child : parent->child_trackers_) {
     if (child->id() == id) {
       *tracker = child->shared_from_this();
       return true;
@@ -258,7 +257,7 @@ void MemTracker::ListTrackers(vector<shared_ptr<MemTracker>>* trackers) {
     trackers->push_back(t);
     {
       MutexLock l(t->child_trackers_lock_);
-      BOOST_FOREACH(MemTracker* child, t->child_trackers_) {
+      for (MemTracker* child : t->child_trackers_) {
         to_process.push_back(child->shared_from_this());
       }
     }
@@ -439,7 +438,7 @@ bool MemTracker::SoftLimitExceeded(double* current_capacity_pct) {
 }
 
 bool MemTracker::AnySoftLimitExceeded(double* current_capacity_pct) {
-  BOOST_FOREACH(MemTracker* t, limit_trackers_) {
+  for (MemTracker* t : limit_trackers_) {
     if (t->SoftLimitExceeded(current_capacity_pct)) {
       return true;
     }
@@ -572,7 +571,7 @@ void MemTracker::LogUpdate(bool is_consume, int64_t bytes) const {
 string MemTracker::LogUsage(const string& prefix,
                             const list<MemTracker*>& trackers) {
   vector<string> usage_strings;
-  BOOST_FOREACH(const MemTracker* child, trackers) {
+  for (const MemTracker* child : trackers) {
     usage_strings.push_back(child->LogUsage(prefix));
   }
   return JoinStrings(usage_strings, "\n");

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/mem_tracker.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker.h b/src/kudu/util/mem_tracker.h
index ed85c05..5a2dde7 100644
--- a/src/kudu/util/mem_tracker.h
+++ b/src/kudu/util/mem_tracker.h
@@ -73,7 +73,7 @@ class MemTracker;
 //
 // NOTE: this class has been partially ported over from Impala with
 // several changes, and as a result the style differs somewhat from
-// the Kudu style (e.g., BOOST_FOREACH is not used).
+// the Kudu style.
 //
 // Changes from Impala:
 // 1) Id a string vs. a TUniqueId

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/memcmpable_varint-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memcmpable_varint-test.cc b/src/kudu/util/memcmpable_varint-test.cc
index 8c9d581..3e5b5e0 100644
--- a/src/kudu/util/memcmpable_varint-test.cc
+++ b/src/kudu/util/memcmpable_varint-test.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <gtest/gtest.h>
 
@@ -129,15 +128,15 @@ TEST_F(TestMemcmpableVarint, TestInterestingCompositeKeys) {
   faststring buf1;
   faststring buf2;
 
-  BOOST_FOREACH(uint64_t v1, interesting_values) {
-    BOOST_FOREACH(uint64_t v2, interesting_values) {
+  for (uint64_t v1 : interesting_values) {
+    for (uint64_t v2 : interesting_values) {
       buf1.clear();
       pair<uint64_t, uint64_t> p1 = make_pair(v1, v2);
       PutMemcmpableVarint64(&buf1, p1.first);
       PutMemcmpableVarint64(&buf1, p1.second);
 
-      BOOST_FOREACH(uint64_t v3, interesting_values) {
-        BOOST_FOREACH(uint64_t v4, interesting_values) {
+      for (uint64_t v3 : interesting_values) {
+        for (uint64_t v4 : interesting_values) {
           buf2.clear();
           pair<uint64_t, uint64_t> p2 = make_pair(v3, v4);
           PutMemcmpableVarint64(&buf2, p2.first);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/memenv/memenv-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memenv/memenv-test.cc b/src/kudu/util/memenv/memenv-test.cc
index 9ba145e..28f34d5 100644
--- a/src/kudu/util/memenv/memenv-test.cc
+++ b/src/kudu/util/memenv/memenv-test.cc
@@ -5,7 +5,6 @@
 // Modified for kudu:
 // - use gtest
 
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 #include <string>
 #include <memory>
@@ -275,7 +274,7 @@ TEST_F(MemEnvTest, TempFile) {
   }
 
   // Delete the files we created.
-  BOOST_FOREACH(const string& p, paths) {
+  for (const string& p : paths) {
     ASSERT_OK(env_->DeleteFile(p));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/memenv/memenv.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memenv/memenv.cc b/src/kudu/util/memenv/memenv.cc
index 20227b9..a80bac5 100644
--- a/src/kudu/util/memenv/memenv.cc
+++ b/src/kudu/util/memenv/memenv.cc
@@ -6,7 +6,6 @@
 // - use boost mutexes instead of port mutexes
 
 #include <string.h>
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <map>
 #include <string>
@@ -132,7 +131,7 @@ class FileState : public RefCountedThreadSafe<FileState> {
   size_t memory_footprint() const {
     size_t size = kudu_malloc_usable_size(this);
     size += kudu_malloc_usable_size(blocks_.data());
-    BOOST_FOREACH(uint8_t* block, blocks_) {
+    for (uint8_t* block : blocks_) {
       size += kudu_malloc_usable_size(block);
     }
     size += filename_.capacity();
@@ -146,7 +145,7 @@ class FileState : public RefCountedThreadSafe<FileState> {
 
   // Private since only Release() should be used to delete it.
   ~FileState() {
-    BOOST_FOREACH(uint8_t* block, blocks_) {
+    for (uint8_t* block : blocks_) {
       delete[] block;
     }
   }
@@ -254,7 +253,7 @@ class WritableFileImpl : public WritableFile {
   // This is a dummy implementation that simply serially appends all
   // slices using regular I/O.
   virtual Status AppendVector(const vector<Slice>& data_vector) OVERRIDE {
-    BOOST_FOREACH(const Slice& data, data_vector) {
+    for (const Slice& data : data_vector) {
       RETURN_NOT_OK(file_->Append(data));
     }
     return Status::OK();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/memory/arena-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memory/arena-test.cc b/src/kudu/util/memory/arena-test.cc
index 667a667..a14e1f2 100644
--- a/src/kudu/util/memory/arena-test.cc
+++ b/src/kudu/util/memory/arena-test.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/thread/thread.hpp>
 #include <gflags/gflags.h>
@@ -52,7 +51,7 @@ static void AllocateThread(ArenaType *arena, uint8_t thread_index) {
     ptrs.push_back(alloced);
   }
 
-  BOOST_FOREACH(void *p, ptrs) {
+  for (void *p : ptrs) {
     if (memcmp(buf, p, FLAGS_alloc_size) != 0) {
       FAIL() << StringPrintf("overwritten pointer at %p", p);
     }
@@ -84,7 +83,7 @@ TEST(TestArena, TestMultiThreaded) {
     threads.push_back(new boost::thread(AllocateThreadTSArena, &arena, (uint8_t)i));
   }
 
-  BOOST_FOREACH(boost::thread &thr, threads) {
+  for (boost::thread &thr : threads) {
     thr.join();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/metrics.cc b/src/kudu/util/metrics.cc
index 1547682..08e5786 100644
--- a/src/kudu/util/metrics.cc
+++ b/src/kudu/util/metrics.cc
@@ -20,7 +20,6 @@
 #include <map>
 #include <set>
 
-#include <boost/foreach.hpp>
 #include <gflags/gflags.h>
 
 #include "kudu/gutil/atomicops.h"
@@ -181,7 +180,7 @@ namespace {
 
 bool MatchMetricInList(const string& metric_name,
                        const vector<string>& match_params) {
-  BOOST_FOREACH(const string& param, match_params) {
+  for (const string& param : match_params) {
     // Handle wildcard.
     if (param == "*") return true;
     // The parameter is a substring match of the metric name.
@@ -208,7 +207,7 @@ Status MetricEntity::WriteAsJson(JsonWriter* writer,
     // Snapshot the metrics in this registry (not guaranteed to be a consistent snapshot)
     lock_guard<simple_spinlock> l(&lock_);
     attrs = attributes_;
-    BOOST_FOREACH(const MetricMap::value_type& val, metric_map_) {
+    for (const MetricMap::value_type& val : metric_map_) {
       const MetricPrototype* prototype = val.first;
       const scoped_refptr<Metric>& metric = val.second;
 
@@ -234,7 +233,7 @@ Status MetricEntity::WriteAsJson(JsonWriter* writer,
 
   writer->String("attributes");
   writer->StartObject();
-  BOOST_FOREACH(const AttributeMap::value_type& val, attrs) {
+  for (const AttributeMap::value_type& val : attrs) {
     writer->String(val.first);
     writer->String(val.second);
   }
@@ -242,7 +241,7 @@ Status MetricEntity::WriteAsJson(JsonWriter* writer,
 
   writer->String("metrics");
   writer->StartArray();
-  BOOST_FOREACH(OrderedMetricMap::value_type& val, metrics) {
+  for (OrderedMetricMap::value_type& val : metrics) {
     WARN_NOT_OK(val.second->WriteAsJson(writer, opts),
                 strings::Substitute("Failed to write $0 as JSON", val.first));
 
@@ -336,7 +335,7 @@ Status MetricRegistry::WriteAsJson(JsonWriter* writer,
   }
 
   writer->StartArray();
-  BOOST_FOREACH(const EntityMap::value_type e, entities) {
+  for (const EntityMap::value_type e : entities) {
     WARN_NOT_OK(e.second->WriteAsJson(writer, requested_metrics, opts),
                 Substitute("Failed to write entity $0 as JSON", e.second->id()));
   }
@@ -396,7 +395,7 @@ void MetricPrototypeRegistry::WriteAsJson(JsonWriter* writer) const {
   // Dump metric prototypes.
   writer->String("metrics");
   writer->StartArray();
-  BOOST_FOREACH(const MetricPrototype* p, metrics_) {
+  for (const MetricPrototype* p : metrics_) {
     writer->StartObject();
     p->WriteFields(writer, opts);
     writer->String("entity_type");
@@ -408,7 +407,7 @@ void MetricPrototypeRegistry::WriteAsJson(JsonWriter* writer) const {
   // Dump entity prototypes.
   writer->String("entities");
   writer->StartArray();
-  BOOST_FOREACH(const MetricEntityPrototype* p, entities_) {
+  for (const MetricEntityPrototype* p : entities_) {
     writer->StartObject();
     writer->String("name");
     writer->String(p->name());
@@ -462,7 +461,7 @@ FunctionGaugeDetacher::FunctionGaugeDetacher() {
 }
 
 FunctionGaugeDetacher::~FunctionGaugeDetacher() {
-  BOOST_FOREACH(const Closure& c, callbacks_) {
+  for (const Closure& c : callbacks_) {
     c.Run();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/mt-metrics-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mt-metrics-test.cc b/src/kudu/util/mt-metrics-test.cc
index 62f3fa5..524bd90 100644
--- a/src/kudu/util/mt-metrics-test.cc
+++ b/src/kudu/util/mt-metrics-test.cc
@@ -18,7 +18,6 @@
 #include <vector>
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <boost/function.hpp>
 #include <gflags/gflags.h>
 #include <gtest/gtest.h>

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/mt-threadlocal-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mt-threadlocal-test.cc b/src/kudu/util/mt-threadlocal-test.cc
index a5059b7..c3479ff 100644
--- a/src/kudu/util/mt-threadlocal-test.cc
+++ b/src/kudu/util/mt-threadlocal-test.cc
@@ -14,7 +14,7 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-#include <boost/foreach.hpp>
+
 #include <boost/thread/locks.hpp>
 #include <glog/logging.h>
 #include <unordered_set>
@@ -158,7 +158,7 @@ static uint64_t Iterate(CounterRegistry* registry, int expected_counters) {
   uint64_t sum = 0;
   int seen_counters = 0;
   boost::lock_guard<RegistryLockType> l(*registry->get_lock());
-  BOOST_FOREACH(Counter* counter, *registry->GetCountersUnlocked()) {
+  for (Counter* counter : *registry->GetCountersUnlocked()) {
     uint64_t value;
     {
       boost::lock_guard<CounterLockType> l(*counter->get_lock());
@@ -211,7 +211,7 @@ static void TestThreadLocalCounters(CounterRegistry* registry, const int num_thr
   reader_done.CountDown();
 
   LOG(INFO) << "Joining & deleting threads...";
-  BOOST_FOREACH(scoped_refptr<kudu::Thread> thread, threads) {
+  for (scoped_refptr<kudu::Thread> thread : threads) {
     CHECK_OK(ThreadJoiner(thread.get()).Join());
   }
   LOG(INFO) << "Done.";
@@ -313,7 +313,7 @@ TEST_F(ThreadLocalTest, TestTLSMember) {
   }
 
   LOG(INFO) << "Joining & deleting threads...";
-  BOOST_FOREACH(scoped_refptr<kudu::Thread> thread, threads) {
+  for (scoped_refptr<kudu::Thread> thread : threads) {
     CHECK_OK(ThreadJoiner(thread.get()).Join());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/net/dns_resolver-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/net/dns_resolver-test.cc b/src/kudu/util/net/dns_resolver-test.cc
index 26f3c3b..55be284 100644
--- a/src/kudu/util/net/dns_resolver-test.cc
+++ b/src/kudu/util/net/dns_resolver-test.cc
@@ -18,7 +18,6 @@
 #include "kudu/util/net/dns_resolver.h"
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 #include <vector>
 
@@ -46,7 +45,7 @@ TEST_F(DnsResolverTest, TestResolution) {
   }
   ASSERT_OK(s.Wait());
   ASSERT_TRUE(!addrs.empty());
-  BOOST_FOREACH(const Sockaddr& addr, addrs) {
+  for (const Sockaddr& addr : addrs) {
     LOG(INFO) << "Address: " << addr.ToString();
     EXPECT_TRUE(HasPrefixString(addr.ToString(), "127."));
     EXPECT_TRUE(HasSuffixString(addr.ToString(), ":12345"));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/net/net_util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/net/net_util-test.cc b/src/kudu/util/net/net_util-test.cc
index ac7de16..ea499f8 100644
--- a/src/kudu/util/net/net_util-test.cc
+++ b/src/kudu/util/net/net_util-test.cc
@@ -17,7 +17,6 @@
 
 #include <gtest/gtest.h>
 
-#include <boost/foreach.hpp>
 #include <algorithm>
 #include <string>
 #include <vector>
@@ -40,7 +39,7 @@ class NetUtilTest : public KuduTest {
     std::sort(addrs.begin(), addrs.end());
 
     vector<string> addr_strs;
-    BOOST_FOREACH(const Sockaddr& addr, addrs) {
+    for (const Sockaddr& addr : addrs) {
       addr_strs.push_back(addr.ToString());
     }
     *result = JoinStrings(addr_strs, ",");
@@ -83,7 +82,7 @@ TEST_F(NetUtilTest, TestResolveAddresses) {
   vector<Sockaddr> addrs;
   ASSERT_OK(hp.ResolveAddresses(&addrs));
   ASSERT_TRUE(!addrs.empty());
-  BOOST_FOREACH(const Sockaddr& addr, addrs) {
+  for (const Sockaddr& addr : addrs) {
     LOG(INFO) << "Address: " << addr.ToString();
     EXPECT_TRUE(HasPrefixString(addr.ToString(), "127."));
     EXPECT_TRUE(HasSuffixString(addr.ToString(), ":12345"));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/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 0f86741..94f4f33 100644
--- a/src/kudu/util/net/net_util.cc
+++ b/src/kudu/util/net/net_util.cc
@@ -21,7 +21,6 @@
 #include <netdb.h>
 
 #include <algorithm>
-#include <boost/foreach.hpp>
 #include <unordered_set>
 #include <utility>
 #include <vector>
@@ -131,7 +130,7 @@ Status HostPort::ParseStrings(const string& comma_sep_addrs,
                               uint16_t default_port,
                               vector<HostPort>* res) {
   vector<string> addr_strings = strings::Split(comma_sep_addrs, ",", strings::SkipEmpty());
-  BOOST_FOREACH(const string& addr_string, addr_strings) {
+  for (const string& addr_string : addr_strings) {
     HostPort host_port;
     RETURN_NOT_OK(host_port.ParseString(addr_string, default_port));
     res->push_back(host_port);
@@ -145,7 +144,7 @@ string HostPort::ToString() const {
 
 string HostPort::ToCommaSeparatedString(const vector<HostPort>& hostports) {
   vector<string> hostport_strs;
-  BOOST_FOREACH(const HostPort& hostport, hostports) {
+  for (const HostPort& hostport : hostports) {
     hostport_strs.push_back(hostport.ToString());
   }
   return JoinStrings(hostport_strs, ",");
@@ -162,13 +161,13 @@ Status ParseAddressList(const std::string& addr_list,
   RETURN_NOT_OK(HostPort::ParseStrings(addr_list, default_port, &host_ports));
   unordered_set<Sockaddr> uniqued;
 
-  BOOST_FOREACH(const HostPort& host_port, host_ports) {
+  for (const HostPort& host_port : host_ports) {
     vector<Sockaddr> this_addresses;
     RETURN_NOT_OK(host_port.ResolveAddresses(&this_addresses));
 
     // Only add the unique ones -- the user may have specified
     // some IP addresses in multiple ways
-    BOOST_FOREACH(const Sockaddr& addr, this_addresses) {
+    for (const Sockaddr& addr : this_addresses) {
       if (InsertIfNotPresent(&uniqued, addr)) {
         addresses->push_back(addr);
       } else {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/nvm_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/nvm_cache.cc b/src/kudu/util/nvm_cache.cc
index bd27b8f..cce82b9 100644
--- a/src/kudu/util/nvm_cache.cc
+++ b/src/kudu/util/nvm_cache.cc
@@ -35,7 +35,6 @@
 
 #include "kudu/util/nvm_cache.h"
 
-#include <boost/foreach.hpp>
 #include <gflags/gflags.h>
 #include <glog/logging.h>
 #include <iostream>
@@ -546,7 +545,7 @@ class ShardedLRUCache : public Cache {
   }
   virtual void SetMetrics(const scoped_refptr<MetricEntity>& entity) OVERRIDE {
     metrics_.reset(new CacheMetrics(entity));
-    BOOST_FOREACH(NvmLRUCache* cache, shards_) {
+    for (NvmLRUCache* cache : shards_) {
       cache->SetMetrics(metrics_.get());
     }
   }
@@ -554,7 +553,7 @@ class ShardedLRUCache : public Cache {
     // Try allocating from each of the shards -- if vmem is tight,
     // this can cause eviction, so we might have better luck in different
     // shards.
-    BOOST_FOREACH(NvmLRUCache* cache, shards_) {
+    for (NvmLRUCache* cache : shards_) {
       uint8_t* ptr = reinterpret_cast<uint8_t*>(cache->AllocateAndRetry(size));
       if (ptr) return ptr;
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/once-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/once-test.cc b/src/kudu/util/once-test.cc
index aca92c8..8ccd8b6 100644
--- a/src/kudu/util/once-test.cc
+++ b/src/kudu/util/once-test.cc
@@ -17,7 +17,6 @@
 
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 
 #include "kudu/gutil/bind.h"
@@ -103,7 +102,7 @@ TEST(TestOnce, KuduOnceDynamicThreadSafeTest) {
     threads.push_back(t);
   }
 
-  BOOST_FOREACH(const scoped_refptr<Thread>& t, threads) {
+  for (const scoped_refptr<Thread>& t : threads) {
     t->Join();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/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 04e6988..d97872c 100644
--- a/src/kudu/util/pb_util-test.cc
+++ b/src/kudu/util/pb_util-test.cc
@@ -23,7 +23,6 @@
 #include <vector>
 
 #include <boost/assign.hpp>
-#include <boost/foreach.hpp>
 #include <google/protobuf/descriptor.pb.h>
 #include <gtest/gtest.h>
 
@@ -162,7 +161,7 @@ TEST_F(TestPBUtil, TestPBContainerSimple) {
   // Exercise both the SYNC and NO_SYNC codepaths, despite the fact that we
   // aren't able to observe a difference in the test.
   vector<SyncMode> modes = { SYNC, NO_SYNC };
-  BOOST_FOREACH(SyncMode mode, modes) {
+  for (SyncMode mode : modes) {
 
     // Write the file.
     ASSERT_OK(CreateKnownGoodContainerFile(NO_OVERWRITE, mode));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/pb_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/pb_util.cc b/src/kudu/util/pb_util.cc
index 8aaa725..f304582 100644
--- a/src/kudu/util/pb_util.cc
+++ b/src/kudu/util/pb_util.cc
@@ -29,7 +29,6 @@
 #include <unordered_set>
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/descriptor.pb.h>
@@ -228,7 +227,7 @@ void TruncateFields(Message* message, int max_len) {
   const Reflection* reflection = message->GetReflection();
   vector<const FieldDescriptor*> fields;
   reflection->ListFields(*message, &fields);
-  BOOST_FOREACH(const FieldDescriptor* field, fields) {
+  for (const FieldDescriptor* field : fields) {
     if (field->is_repeated()) {
       for (int i = 0; i < reflection->FieldSize(*message, field); i++) {
         switch (field->cpp_type()) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/rolling_log-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rolling_log-test.cc b/src/kudu/util/rolling_log-test.cc
index ef320fe..6f18fa0 100644
--- a/src/kudu/util/rolling_log-test.cc
+++ b/src/kudu/util/rolling_log-test.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/util/rolling_log.h"
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <glog/stl_logging.h>
 #include <string>
@@ -52,7 +51,7 @@ class RollingLogTest : public KuduTest {
     ASSERT_OK(env_->GetChildren(log_dir_, &dir_entries));
     children->clear();
 
-    BOOST_FOREACH(const string& child, dir_entries) {
+    for (const string& child : dir_entries) {
       if (child == "." || child == "..") continue;
       children->push_back(child);
       ASSERT_TRUE(HasPrefixString(child, "rolling_log-test."));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/rw_semaphore-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rw_semaphore-test.cc b/src/kudu/util/rw_semaphore-test.cc
index 166d58e..16a08e3 100644
--- a/src/kudu/util/rw_semaphore-test.cc
+++ b/src/kudu/util/rw_semaphore-test.cc
@@ -16,7 +16,6 @@
 // under the License.
 
 #include <gtest/gtest.h>
-#include <boost/foreach.hpp>
 #include <boost/thread/thread.hpp>
 #include <boost/thread/locks.hpp>
 #include <vector>
@@ -82,7 +81,7 @@ TEST(RWSemaphoreTest, TestBasicOperation) {
     s.done = true;
   }
 
-  BOOST_FOREACH(thread* t, threads) {
+  for (thread* t : threads) {
     t->join();
     delete t;
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/rwc_lock-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rwc_lock-test.cc b/src/kudu/util/rwc_lock-test.cc
index 0029579..af825d8 100644
--- a/src/kudu/util/rwc_lock-test.cc
+++ b/src/kudu/util/rwc_lock-test.cc
@@ -16,7 +16,6 @@
 // under the License.
 
 #include <boost/thread/thread.hpp>
-#include <boost/foreach.hpp>
 #include <string>
 #include <vector>
 
@@ -134,7 +133,7 @@ TEST_F(RWCLockTest, TestCorrectBehavior) {
 
   Release_Store(&state.stop, 1);
 
-  BOOST_FOREACH(boost::thread* t, threads) {
+  for (boost::thread* t : threads) {
     t->join();
     delete t;
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/slice-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/slice-test.cc b/src/kudu/util/slice-test.cc
index 39dbc47..d4868ac 100644
--- a/src/kudu/util/slice-test.cc
+++ b/src/kudu/util/slice-test.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/util/slice.h"
 
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 
 #include "kudu/gutil/map-util.h"
@@ -40,7 +39,7 @@ TEST(SliceTest, TestSliceMap) {
   InsertOrDie(&my_map, b, 2);
 
   int expectedValue = 0;
-  BOOST_FOREACH(const MySliceMap::value_type& pair, my_map) {
+  for (const MySliceMap::value_type& pair : my_map) {
     int data = 'a' + expectedValue++;
     ASSERT_EQ(Slice(reinterpret_cast<uint8_t*>(&data), 1), pair.first);
     ASSERT_EQ(expectedValue, pair.second);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/striped64-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/striped64-test.cc b/src/kudu/util/striped64-test.cc
index 5909c9c..d211a0a 100644
--- a/src/kudu/util/striped64-test.cc
+++ b/src/kudu/util/striped64-test.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <gtest/gtest.h>
 #include <memory>
@@ -78,7 +77,7 @@ class MultiThreadTest {
                      num_operations_, &ref);
       threads_.push_back(ref);
     }
-    BOOST_FOREACH(const scoped_refptr<Thread> &t, threads_) {
+    for (const scoped_refptr<Thread> &t : threads_) {
       t->Join();
     }
     ASSERT_EQ(num_threads_*num_operations_, adder_.Value());
@@ -91,7 +90,7 @@ class MultiThreadTest {
                      num_operations_, &ref);
       threads_.push_back(ref);
     }
-    BOOST_FOREACH(const scoped_refptr<Thread> &t, threads_) {
+    for (const scoped_refptr<Thread> &t : threads_) {
       t->Join();
     }
     ASSERT_EQ(0, adder_.Value());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/subprocess.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/subprocess.cc b/src/kudu/util/subprocess.cc
index 65ef63b..bc801c6 100644
--- a/src/kudu/util/subprocess.cc
+++ b/src/kudu/util/subprocess.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/util/subprocess.h"
 
-#include <boost/foreach.hpp>
 #include <dirent.h>
 #include <fcntl.h>
 #include <glog/logging.h>
@@ -241,7 +240,7 @@ Status Subprocess::Start() {
   }
 
   vector<char*> argv_ptrs;
-  BOOST_FOREACH(const string& arg, argv_) {
+  for (const string& arg : argv_) {
     argv_ptrs.push_back(const_cast<char*>(arg.c_str()));
   }
   argv_ptrs.push_back(NULL);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/sync_point.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/sync_point.cc b/src/kudu/util/sync_point.cc
index f79bb78..ded2ff4 100644
--- a/src/kudu/util/sync_point.cc
+++ b/src/kudu/util/sync_point.cc
@@ -22,8 +22,6 @@
 
 #include "kudu/util/sync_point.h"
 
-#include <boost/foreach.hpp>
-
 using std::string;
 using std::vector;
 
@@ -49,14 +47,14 @@ void SyncPoint::LoadDependency(const vector<Dependency>& dependencies) {
   successors_.clear();
   predecessors_.clear();
   cleared_points_.clear();
-  BOOST_FOREACH(const Dependency& dependency, dependencies) {
+  for (const Dependency& dependency : dependencies) {
     successors_[dependency.predecessor_].push_back(dependency.successor_);
     predecessors_[dependency.successor_].push_back(dependency.predecessor_);
   }
 }
 
 bool SyncPoint::PredecessorsAllCleared(const string& point) {
-  BOOST_FOREACH(const string& pred, predecessors_[point]) {
+  for (const string& pred : predecessors_[point]) {
     if (cleared_points_.count(pred) == 0) {
       return false;
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/test_graph.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/test_graph.cc b/src/kudu/util/test_graph.cc
index 74f9c4e..c3dc9e1 100644
--- a/src/kudu/util/test_graph.cc
+++ b/src/kudu/util/test_graph.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 
 #include "kudu/gutil/ref_counted.h"
@@ -105,7 +104,7 @@ void TimeSeriesCollector::BuildMetricsString(
   dst_buf->append(StringPrintf("{ \"scope\": \"%s\", \"time\": %.3f",
                                scope_.c_str(), time_since_start));
 
-  BOOST_FOREACH(SeriesMap::const_reference entry, series_map_) {
+  for (SeriesMap::const_reference entry : series_map_) {
     dst_buf->append(StringPrintf(", \"%s\": %.3f",
                                  entry.first.c_str(),  entry.second->value()));
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/thread.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/thread.cc b/src/kudu/util/thread.cc
index 086c940..6ecca47 100644
--- a/src/kudu/util/thread.cc
+++ b/src/kudu/util/thread.cc
@@ -20,7 +20,6 @@
 #include "kudu/util/thread.h"
 
 #include <algorithm>
-#include <boost/foreach.hpp>
 #include <map>
 #include <memory>
 #include <set>
@@ -326,7 +325,7 @@ void ThreadMgr::RemoveThread(const pthread_t& pthread_id, const string& category
 
 void ThreadMgr::PrintThreadCategoryRows(const ThreadCategory& category,
     stringstream* output) {
-  BOOST_FOREACH(const ThreadCategory::value_type& thread, category) {
+  for (const ThreadCategory::value_type& thread : category) {
     ThreadStats stats;
     Status status = GetThreadStats(thread.second.thread_id(), &stats);
     if (!status.ok()) {
@@ -358,7 +357,7 @@ void ThreadMgr::ThreadPathHandler(const WebCallbackRegistry::WebRequest& req,
       (*output) << "<h3>" << category->first << " : " << category->second.size()
                 << "</h3>";
     } else {
-      BOOST_FOREACH(const ThreadCategoryMap::value_type& category, thread_categories_) {
+      for (const ThreadCategoryMap::value_type& category : thread_categories_) {
         categories_to_print.push_back(&category.second);
       }
       (*output) << "<h3>All Threads : </h3>";
@@ -369,7 +368,7 @@ void ThreadMgr::ThreadPathHandler(const WebCallbackRegistry::WebRequest& req,
               << "<th>Cumulative Kernel CPU(s)</th>"
               << "<th>Cumulative IO-wait(s)</th></tr>";
 
-    BOOST_FOREACH(const ThreadCategory* category, categories_to_print) {
+    for (const ThreadCategory* category : categories_to_print) {
       PrintThreadCategoryRows(*category, output);
     }
     (*output) << "</table>";
@@ -380,7 +379,7 @@ void ThreadMgr::ThreadPathHandler(const WebCallbackRegistry::WebRequest& req,
     }
     (*output) << "<a href='/threadz?group=all'><h3>All Threads</h3>";
 
-    BOOST_FOREACH(const ThreadCategoryMap::value_type& category, thread_categories_) {
+    for (const ThreadCategoryMap::value_type& category : thread_categories_) {
       string category_arg;
       UrlEncode(category.first, &category_arg);
       (*output) << "<a href='/threadz?group=" << category_arg << "'><h3>"
@@ -586,7 +585,7 @@ void* Thread::SuperviseThread(void* arg) {
 void Thread::FinishThread(void* arg) {
   Thread* t = static_cast<Thread*>(arg);
 
-  BOOST_FOREACH(Closure& c, t->exit_callbacks_) {
+  for (Closure& c : t->exit_callbacks_) {
     c.Run();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/threadpool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/threadpool.cc b/src/kudu/util/threadpool.cc
index ca7e061..3f2dfe3 100644
--- a/src/kudu/util/threadpool.cc
+++ b/src/kudu/util/threadpool.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <boost/function.hpp>
 #include <gflags/gflags.h>
 #include <glog/logging.h>
@@ -134,7 +133,7 @@ Status ThreadPool::Init() {
 }
 
 void ThreadPool::ClearQueue() {
-  BOOST_FOREACH(QueueEntry& e, queue_) {
+  for (QueueEntry& e : queue_) {
     if (e.trace) {
       e.trace->Release();
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/trace-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/trace-test.cc b/src/kudu/util/trace-test.cc
index 12a5bac..049ed90 100644
--- a/src/kudu/util/trace-test.cc
+++ b/src/kudu/util/trace-test.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 #include <string>
 #include <rapidjson/document.h>
@@ -45,7 +44,7 @@ class TraceTest : public KuduTest {
 static string XOutDigits(const string& s) {
   string ret;
   ret.reserve(s.size());
-  BOOST_FOREACH(char c, s) {
+  for (char c : s) {
     if (isdigit(c)) {
       ret.push_back('X');
     } else {
@@ -102,7 +101,7 @@ TEST_F(TraceTest, TestChildTrace) {
   EXPECT_EQ(XOutDigits(traceA->DumpToString(false)),
             "XXXX XX:XX:XX.XXXXXX trace-test.cc:XX] hello from traceA\n"
             "Related trace:\n"
-            "XXXX XX:XX:XX.XXXXXX trace-test.cc:XXX] hello from traceB\n");
+            "XXXX XX:XX:XX.XXXXXX trace-test.cc:XX] hello from traceB\n");
 }
 
 static void GenerateTraceEvents(int thread_id,

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/trace.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/trace.cc b/src/kudu/util/trace.cc
index 29e7a8c..af12ad5 100644
--- a/src/kudu/util/trace.cc
+++ b/src/kudu/util/trace.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/util/trace.h"
 
-#include <boost/foreach.hpp>
 #include <iomanip>
 #include <ios>
 #include <iostream>
@@ -138,7 +137,7 @@ void Trace::Dump(std::ostream* out, bool include_time_deltas) const {
   std::ios::fmtflags save_flags(out->flags());
 
   int64_t prev_usecs = 0;
-  BOOST_FOREACH(TraceEntry* e, entries) {
+  for (TraceEntry* e : entries) {
     // Log format borrowed from glog/logging.cc
     time_t secs_since_epoch = e->timestamp_micros / 1000000;
     int usecs = e->timestamp_micros % 1000000;
@@ -172,7 +171,7 @@ void Trace::Dump(std::ostream* out, bool include_time_deltas) const {
     *out << std::endl;
   }
 
-  BOOST_FOREACH(scoped_refptr<Trace> child_trace, child_traces) {
+  for (scoped_refptr<Trace> child_trace : child_traces) {
     *out << "Related trace:" << std::endl;
     *out << child_trace->DumpToString(include_time_deltas);
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/util/url-coding.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/url-coding.cc b/src/kudu/util/url-coding.cc
index 1dd577d..13052cb 100644
--- a/src/kudu/util/url-coding.cc
+++ b/src/kudu/util/url-coding.cc
@@ -34,7 +34,6 @@
 #include <boost/archive/iterators/base64_from_binary.hpp>
 #include <boost/archive/iterators/binary_from_base64.hpp>
 #include <boost/archive/iterators/transform_width.hpp>
-#include <boost/foreach.hpp>
 #include <exception>
 #include <sstream>
 
@@ -193,7 +192,7 @@ bool Base64Decode(const string& in, string* out) {
 
 void EscapeForHtml(const string& in, std::stringstream* out) {
   DCHECK(out != NULL);
-  BOOST_FOREACH(const char& c, in) {
+  for (const char& c : in) {
     switch (c) {
       case '<': (*out) << "&lt;";
                 break;


Mime
View raw message