kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [6/6] incubator-kudu git commit: Replace BOOST_FOREACH with c++11 range syntax
Date Fri, 15 Jan 2016 20:00:11 GMT
Replace BOOST_FOREACH with c++11 range syntax

This was created using some scripts that Mike put together, along with some
manual tweaks.

Change-Id: I635ba6e83b65eec4427c10175c203c4864b2a22f
Reviewed-on: http://gerrit.cloudera.org:8080/1786
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/9daafa5e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/9daafa5e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/9daafa5e

Branch: refs/heads/master
Commit: 9daafa5e795f1a2fc0cf571285caddc06ffbc5da
Parents: 3eafca5
Author: Dan Burkert <dan@cloudera.com>
Authored: Fri Nov 20 17:40:13 2015 -0800
Committer: Dan Burkert <dan@cloudera.com>
Committed: Fri Jan 15 19:59:28 2016 +0000

----------------------------------------------------------------------
 docs/contributing.adoc                          |  5 +-
 .../benchmarks/tpch/rpc_line_item_dao-test.cc   |  5 +-
 src/kudu/benchmarks/tpch/rpc_line_item_dao.cc   |  5 +-
 src/kudu/benchmarks/tpch/tpch1.cc               |  3 +-
 src/kudu/benchmarks/tpch/tpch_real_world.cc     |  3 +-
 src/kudu/benchmarks/wal_hiccup.cc               |  5 +-
 src/kudu/cfile/binary_prefix_block.cc           |  3 +-
 src/kudu/cfile/block_compression.cc             |  3 +-
 src/kudu/cfile/cfile_reader.cc                  | 13 ++-
 src/kudu/cfile/cfile_writer.cc                  |  7 +-
 src/kudu/cfile/compression_codec.cc             |  5 +-
 src/kudu/cfile/encoding-test.cc                 |  1 -
 src/kudu/cfile/index_block.cc                   |  3 +-
 src/kudu/cfile/mt-bloomfile-test.cc             |  2 +-
 src/kudu/client/batcher.cc                      | 18 ++--
 src/kudu/client/client-internal.cc              | 13 ++-
 src/kudu/client/client-test-util.cc             |  5 +-
 src/kudu/client/client-test.cc                  | 29 +++---
 src/kudu/client/client.cc                       | 16 ++--
 src/kudu/client/meta_cache.cc                   | 25 +++---
 src/kudu/client/scanner-internal.cc             |  2 +-
 src/kudu/client/schema.cc                       |  9 +-
 src/kudu/client/table_alterer-internal.cc       |  5 +-
 src/kudu/client/table_creator-internal.cc       |  1 -
 src/kudu/codegen/codegen-test.cc                |  3 +-
 src/kudu/codegen/module_builder.cc              |  7 +-
 src/kudu/codegen/row_projector.cc               | 15 ++--
 src/kudu/common/generic_iterators.cc            | 35 ++++----
 src/kudu/common/partition-test.cc               |  4 +-
 src/kudu/common/partition.cc                    | 56 ++++++------
 src/kudu/common/predicate_encoder.cc            |  2 +-
 src/kudu/common/rowblock.cc                     |  4 +-
 src/kudu/common/scan_spec.cc                    |  2 +-
 src/kudu/common/schema-test.cc                  |  2 +-
 src/kudu/common/schema.cc                       | 20 ++---
 src/kudu/common/schema.h                        |  1 -
 src/kudu/common/wire_protocol.cc                |  8 +-
 src/kudu/consensus/consensus-test-util.h        |  1 -
 src/kudu/consensus/consensus.cc                 |  1 -
 src/kudu/consensus/consensus_meta-test.cc       |  3 +-
 src/kudu/consensus/consensus_queue.cc           | 25 +++---
 src/kudu/consensus/leader_election-test.cc      |  7 +-
 src/kudu/consensus/leader_election.cc           |  5 +-
 src/kudu/consensus/local_consensus.cc           |  2 +-
 src/kudu/consensus/log-dump.cc                  |  7 +-
 src/kudu/consensus/log-test-base.h              |  7 +-
 src/kudu/consensus/log-test.cc                  | 11 ++-
 src/kudu/consensus/log.cc                       | 16 ++--
 src/kudu/consensus/log_anchor_registry.cc       |  3 +-
 src/kudu/consensus/log_cache.cc                 |  9 +-
 src/kudu/consensus/log_index.cc                 |  3 +-
 src/kudu/consensus/log_reader.cc                | 13 ++-
 src/kudu/consensus/log_util.cc                  |  5 +-
 src/kudu/consensus/mt-log-test.cc               |  6 +-
 src/kudu/consensus/peer_manager.cc              |  4 +-
 src/kudu/consensus/quorum_util.cc               | 15 ++--
 src/kudu/consensus/raft_consensus-test.cc       |  2 +-
 src/kudu/consensus/raft_consensus.cc            |  4 +-
 .../consensus/raft_consensus_quorum-test.cc     | 23 +++--
 src/kudu/consensus/raft_consensus_state-test.cc |  1 -
 src/kudu/consensus/raft_consensus_state.cc      |  3 +-
 src/kudu/experiments/merge-test.cc              |  5 +-
 src/kudu/experiments/rwlock-perf.cc             |  3 +-
 src/kudu/fs/block_id.cc                         |  3 +-
 src/kudu/fs/block_manager-stress-test.cc        |  9 +-
 src/kudu/fs/block_manager-test.cc               | 15 ++--
 src/kudu/fs/block_manager.h                     |  3 +-
 src/kudu/fs/block_manager_util-test.cc          |  5 +-
 src/kudu/fs/block_manager_util.cc               |  5 +-
 src/kudu/fs/file_block_manager.cc               | 23 +++--
 src/kudu/fs/fs_manager-test.cc                  |  2 +-
 src/kudu/fs/fs_manager.cc                       | 31 ++++---
 src/kudu/fs/log_block_manager.cc                | 31 ++++---
 src/kudu/integration-tests/all_types-itest.cc   | 10 +--
 .../alter_table-randomized-test.cc              |  9 +-
 src/kudu/integration-tests/alter_table-test.cc  |  5 +-
 .../integration-tests/client-stress-test.cc     |  3 +-
 .../integration-tests/cluster_itest_util.cc     | 17 ++--
 .../create-table-stress-test.cc                 |  4 +-
 src/kudu/integration-tests/delete_table-test.cc |  7 +-
 .../external_mini_cluster-test.cc               |  1 -
 .../integration-tests/external_mini_cluster.cc  | 33 ++++---
 .../external_mini_cluster_fs_inspector.cc       | 11 ++-
 .../flex_partitioning-itest.cc                  |  9 +-
 .../full_stack-insert-scan-test.cc              |  5 +-
 .../integration-tests/linked_list-test-util.h   | 17 ++--
 src/kudu/integration-tests/linked_list-test.cc  |  2 +-
 src/kudu/integration-tests/mini_cluster.cc      | 17 ++--
 .../integration-tests/raft_consensus-itest.cc   | 45 +++++-----
 .../integration-tests/remote_bootstrap-itest.cc | 12 +--
 src/kudu/integration-tests/test_workload.cc     |  5 +-
 src/kudu/integration-tests/ts_itest-base.h      | 23 +++--
 .../update_scan_delta_compact-test.cc           |  4 +-
 src/kudu/master/catalog_manager.cc              | 93 ++++++++++----------
 src/kudu/master/master-path-handlers.cc         | 17 ++--
 src/kudu/master/master-test-util.h              |  2 +-
 src/kudu/master/master-test.cc                  |  3 +-
 src/kudu/master/master.cc                       |  3 +-
 src/kudu/master/master_rpc.cc                   |  3 +-
 src/kudu/master/master_service.cc               |  7 +-
 src/kudu/master/mini_master.cc                  |  2 +-
 src/kudu/master/sys_catalog-test.cc             |  5 +-
 src/kudu/master/sys_catalog.cc                  | 10 +--
 src/kudu/master/ts_descriptor.cc                |  5 +-
 src/kudu/master/ts_manager.cc                   |  3 +-
 src/kudu/rpc/acceptor_pool.cc                   |  5 +-
 src/kudu/rpc/connection.cc                      |  7 +-
 src/kudu/rpc/inbound_call.cc                    |  5 +-
 src/kudu/rpc/messenger.cc                       | 11 ++-
 src/kudu/rpc/mt-rpc-test.cc                     |  2 +-
 src/kudu/rpc/protoc-gen-krpc.cc                 | 11 ++-
 src/kudu/rpc/reactor.cc                         |  9 +-
 src/kudu/rpc/rpc-bench.cc                       |  3 +-
 src/kudu/rpc/rpc-test.cc                        |  5 +-
 src/kudu/rpc/rpc_stub-test.cc                   |  5 +-
 src/kudu/rpc/sasl_client.cc                     |  3 +-
 src/kudu/rpc/sasl_helper.cc                     |  1 -
 src/kudu/rpc/sasl_server.cc                     |  3 +-
 src/kudu/rpc/service_pool.cc                    |  3 +-
 src/kudu/rpc/transfer.cc                        |  1 -
 src/kudu/server/default-path-handlers.cc        |  3 +-
 src/kudu/server/hybrid_clock-test.cc            |  3 +-
 src/kudu/server/pprof-path-handlers.cc          |  3 +-
 src/kudu/server/rpc_server.cc                   | 13 ++-
 src/kudu/server/server_base.cc                  |  5 +-
 src/kudu/server/tracing-path-handlers.cc        |  5 +-
 src/kudu/server/webserver.cc                    | 13 ++-
 src/kudu/server/webui_util.cc                   |  2 +-
 src/kudu/tablet/cbtree-test.cc                  |  9 +-
 src/kudu/tablet/cfile_set-test.cc               |  4 +-
 src/kudu/tablet/cfile_set.cc                    |  6 +-
 src/kudu/tablet/compaction-test.cc              | 10 +--
 src/kudu/tablet/compaction.cc                   | 20 ++---
 src/kudu/tablet/compaction_policy.cc            |  9 +-
 src/kudu/tablet/composite-pushdown-test.cc      |  2 +-
 src/kudu/tablet/delta_compaction-test.cc        |  4 +-
 src/kudu/tablet/delta_compaction.cc             | 10 +--
 src/kudu/tablet/delta_iterator_merger.cc        | 20 ++---
 src/kudu/tablet/delta_stats.cc                  |  8 +-
 src/kudu/tablet/delta_store.cc                  |  4 +-
 src/kudu/tablet/delta_tracker.cc                | 20 ++---
 src/kudu/tablet/deltafile-test.cc               |  4 +-
 src/kudu/tablet/deltafile.cc                    |  2 +-
 src/kudu/tablet/deltamemstore-test.cc           |  3 +-
 src/kudu/tablet/deltamemstore.cc                |  8 +-
 src/kudu/tablet/diskrowset-test-base.h          |  2 +-
 src/kudu/tablet/diskrowset-test.cc              |  6 +-
 src/kudu/tablet/local_tablet_writer.h           |  5 +-
 src/kudu/tablet/lock_manager-test.cc            | 11 ++-
 src/kudu/tablet/maintenance_manager.cc          |  7 +-
 src/kudu/tablet/memrowset.cc                    |  3 +-
 src/kudu/tablet/metadata-test.cc                |  1 -
 src/kudu/tablet/mt-diskrowset-test.cc           |  3 +-
 .../tablet/mt-rowset_delta_compaction-test.cc   |  1 -
 src/kudu/tablet/mt-tablet-test.cc               |  3 +-
 src/kudu/tablet/multi_column_writer.cc          |  2 +-
 src/kudu/tablet/mvcc.cc                         | 13 ++-
 src/kudu/tablet/rowset.cc                       | 18 ++--
 src/kudu/tablet/rowset_info.cc                  | 12 +--
 src/kudu/tablet/rowset_metadata.cc              | 22 ++---
 src/kudu/tablet/rowset_tree-test.cc             |  2 +-
 src/kudu/tablet/rowset_tree.cc                  | 10 +--
 src/kudu/tablet/svg_dump.cc                     |  9 +-
 src/kudu/tablet/tablet-pushdown-test.cc         |  6 +-
 src/kudu/tablet/tablet-schema-test.cc           |  4 +-
 src/kudu/tablet/tablet-test-util.h              |  4 +-
 src/kudu/tablet/tablet.cc                       | 57 ++++++------
 src/kudu/tablet/tablet_bootstrap-test.cc        |  2 +-
 src/kudu/tablet/tablet_bootstrap.cc             | 27 +++---
 src/kudu/tablet/tablet_metadata.cc              | 28 +++---
 src/kudu/tablet/tablet_mm_ops-test.cc           |  2 +-
 src/kudu/tablet/tablet_peer.cc                  |  6 +-
 src/kudu/tablet/tablet_random_access-test.cc    | 10 +--
 .../transactions/transaction_tracker-test.cc    |  6 +-
 .../tablet/transactions/transaction_tracker.cc  |  5 +-
 .../tablet/transactions/write_transaction.cc    |  6 +-
 src/kudu/tools/fs_dump-tool.cc                  |  5 +-
 src/kudu/tools/fs_list-tool.cc                  |  5 +-
 src/kudu/tools/fs_tool.cc                       | 31 ++++---
 src/kudu/tools/insert-generated-rows.cc         |  3 +-
 src/kudu/tools/ksck-test.cc                     |  3 +-
 src/kudu/tools/ksck.cc                          | 27 +++---
 src/kudu/tools/ksck_remote-test.cc              |  2 +-
 src/kudu/tools/ksck_remote.cc                   |  8 +-
 src/kudu/tools/kudu-admin-test.cc               |  3 +-
 src/kudu/tools/kudu-admin.cc                    |  7 +-
 src/kudu/tools/kudu-ksck.cc                     |  2 +-
 src/kudu/tools/kudu-ts-cli-test.cc              |  3 +-
 src/kudu/tools/ts-cli.cc                        |  9 +-
 src/kudu/tserver/heartbeater.cc                 |  3 +-
 .../tserver/remote_bootstrap_client-test.cc     | 12 +--
 src/kudu/tserver/remote_bootstrap_client.cc     | 12 +--
 .../tserver/remote_bootstrap_service-test.cc    |  5 +-
 src/kudu/tserver/remote_bootstrap_service.cc    | 11 ++-
 .../tserver/remote_bootstrap_session-test.cc    | 13 ++-
 src/kudu/tserver/remote_bootstrap_session.cc    |  4 +-
 src/kudu/tserver/scanners.cc                    |  8 +-
 src/kudu/tserver/tablet_server-stress-test.cc   |  2 +-
 src/kudu/tserver/tablet_server-test-base.h      |  3 +-
 src/kudu/tserver/tablet_server-test.cc          |  6 +-
 src/kudu/tserver/tablet_server.cc               |  3 +-
 src/kudu/tserver/tablet_service.cc              | 10 +--
 src/kudu/tserver/ts_tablet_manager-test.cc      |  4 +-
 src/kudu/tserver/ts_tablet_manager.cc           | 12 +--
 src/kudu/tserver/tserver-path-handlers.cc       | 12 +--
 src/kudu/twitter-demo/insert_consumer.cc        |  3 +-
 src/kudu/twitter-demo/oauth.cc                  |  5 +-
 src/kudu/twitter-demo/parser-test.cc            |  3 +-
 src/kudu/util/atomic-test.cc                    | 11 ++-
 src/kudu/util/blocking_queue.h                  |  5 +-
 src/kudu/util/cache.cc                          |  3 +-
 src/kudu/util/debug-util-test.cc                |  3 +-
 src/kudu/util/debug/trace_event_impl.cc         |  7 +-
 src/kudu/util/env-test.cc                       |  5 +-
 src/kudu/util/env_posix.cc                      |  1 -
 src/kudu/util/failure_detector.cc               |  7 +-
 src/kudu/util/flags.cc                          |  3 +-
 src/kudu/util/interval_tree-inl.h               | 12 +--
 src/kudu/util/interval_tree-test.cc             |  6 +-
 src/kudu/util/interval_tree.h                   |  1 -
 src/kudu/util/jsonreader-test.cc                |  3 +-
 src/kudu/util/jsonwriter.cc                     |  3 +-
 src/kudu/util/kernel_stack_watchdog.cc          |  3 +-
 src/kudu/util/knapsack_solver-test.cc           |  2 +-
 src/kudu/util/knapsack_solver.h                 |  1 -
 src/kudu/util/mem_tracker-test.cc               |  3 +-
 src/kudu/util/mem_tracker.cc                    |  9 +-
 src/kudu/util/mem_tracker.h                     |  2 +-
 src/kudu/util/memcmpable_varint-test.cc         |  9 +-
 src/kudu/util/memenv/memenv-test.cc             |  3 +-
 src/kudu/util/memenv/memenv.cc                  |  7 +-
 src/kudu/util/memory/arena-test.cc              |  5 +-
 src/kudu/util/metrics.cc                        | 17 ++--
 src/kudu/util/mt-metrics-test.cc                |  1 -
 src/kudu/util/mt-threadlocal-test.cc            |  8 +-
 src/kudu/util/net/dns_resolver-test.cc          |  3 +-
 src/kudu/util/net/net_util-test.cc              |  5 +-
 src/kudu/util/net/net_util.cc                   |  9 +-
 src/kudu/util/nvm_cache.cc                      |  5 +-
 src/kudu/util/once-test.cc                      |  3 +-
 src/kudu/util/pb_util-test.cc                   |  3 +-
 src/kudu/util/pb_util.cc                        |  3 +-
 src/kudu/util/rolling_log-test.cc               |  3 +-
 src/kudu/util/rw_semaphore-test.cc              |  3 +-
 src/kudu/util/rwc_lock-test.cc                  |  3 +-
 src/kudu/util/slice-test.cc                     |  3 +-
 src/kudu/util/striped64-test.cc                 |  5 +-
 src/kudu/util/subprocess.cc                     |  3 +-
 src/kudu/util/sync_point.cc                     |  6 +-
 src/kudu/util/test_graph.cc                     |  3 +-
 src/kudu/util/thread.cc                         | 11 ++-
 src/kudu/util/threadpool.cc                     |  3 +-
 src/kudu/util/trace-test.cc                     |  5 +-
 src/kudu/util/trace.cc                          |  5 +-
 src/kudu/util/url-coding.cc                     |  3 +-
 255 files changed, 944 insertions(+), 1127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/docs/contributing.adoc
----------------------------------------------------------------------
diff --git a/docs/contributing.adoc b/docs/contributing.adoc
index d8b069c..4d8c96f 100644
--- a/docs/contributing.adoc
+++ b/docs/contributing.adoc
@@ -156,10 +156,9 @@ implementations.
 
 .Approved `boost` Libraries
 
-- `BOOST_FOREACH`
 - `boost::assign` (container literals)
-- `boost::mutex` and `boost::shared_mutex` (but prefer Kudu's
-  spin lock implementation for short critical sections)
+- `boost::shared_mutex` (but prefer Kudu's spin lock implementation for short
+  critical sections)
 
 Check that any features from `boost` you use are present in *`boost` 1.46*
 or earlier, for compatibility with RHEL 6.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/benchmarks/tpch/rpc_line_item_dao-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/rpc_line_item_dao-test.cc b/src/kudu/benchmarks/tpch/rpc_line_item_dao-test.cc
index 9a03b22..b6a2f8e 100644
--- a/src/kudu/benchmarks/tpch/rpc_line_item_dao-test.cc
+++ b/src/kudu/benchmarks/tpch/rpc_line_item_dao-test.cc
@@ -17,7 +17,6 @@
 
 #include <algorithm>
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 #include <gflags/gflags.h>
 #include <string>
@@ -116,7 +115,7 @@ class RpcLineItemDAOTest : public KuduTest {
     vector<KuduRowResult> rows;
     while (scanner->HasMore()) {
       scanner->GetNext(&rows);
-      BOOST_FOREACH(const KuduRowResult& row, rows) {
+      for (const KuduRowResult& row : rows) {
         str_rows->push_back(row.ToString());
       }
     }
@@ -155,7 +154,7 @@ TEST_F(RpcLineItemDAOTest, TestUpdate) {
   vector<KuduRowResult> rows;
   while (scanner->HasMore()) {
     scanner->GetNext(&rows);
-    BOOST_FOREACH(const KuduRowResult& row, rows) {
+    for (const KuduRowResult& row : rows) {
       int32_t l_quantity;
       ASSERT_OK(row.GetInt32(0, &l_quantity));
       ASSERT_EQ(12345, l_quantity);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc b/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
index b6dec1e..55e7d58 100644
--- a/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
+++ b/src/kudu/benchmarks/tpch/rpc_line_item_dao.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <boost/thread/locks.hpp>
 #include <glog/logging.h>
 #include <vector>
@@ -85,7 +84,7 @@ class FlushCallback : public KuduStatusCallback {
       if (overflow) {
         LOG(WARNING) << "Error overflow occured";
       }
-      BOOST_FOREACH(KuduError* error, errors) {
+      for (KuduError* error : errors) {
         LOG(WARNING) << "FAILED: " << error->failed_op().ToString();
       }
     }
@@ -169,7 +168,7 @@ void RpcLineItemDAO::OpenScanner(const vector<string>& columns,
   ret->scanner_.reset(new KuduScanner(client_table_.get()));
   ret->scanner_->SetCacheBlocks(FLAGS_tpch_cache_blocks_when_scanning);
   CHECK_OK(ret->scanner_->SetProjectedColumns(columns));
-  BOOST_FOREACH(KuduPredicate* pred, preds) {
+  for (KuduPredicate* pred : preds) {
     CHECK_OK(ret->scanner_->AddConjunctPredicate(pred));
   }
   CHECK_OK(ret->scanner_->Open());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/benchmarks/tpch/tpch1.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/tpch1.cc b/src/kudu/benchmarks/tpch/tpch1.cc
index 9188a32..b9675c9 100644
--- a/src/kudu/benchmarks/tpch/tpch1.cc
+++ b/src/kudu/benchmarks/tpch/tpch1.cc
@@ -57,7 +57,6 @@
 // 'R','F',37719753,56568041380.90,53741292684.6,55889619119.8,25.5,38250.9,0.1,1478870
 // ====
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <unordered_map>
 #include <stdlib.h>
 
@@ -164,7 +163,7 @@ void Tpch1(RpcLineItemDAO *dao) {
   vector<KuduRowResult> rows;
   while (scanner->HasMore()) {
     scanner->GetNext(&rows);
-    BOOST_FOREACH(const KuduRowResult& row, rows) {
+    for (const KuduRowResult& row : rows) {
       matching_rows++;
 
       SliceMapKey l_returnflag;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/benchmarks/tpch/tpch_real_world.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/tpch_real_world.cc b/src/kudu/benchmarks/tpch/tpch_real_world.cc
index a2d0bf3..4e6a2e5 100644
--- a/src/kudu/benchmarks/tpch/tpch_real_world.cc
+++ b/src/kudu/benchmarks/tpch/tpch_real_world.cc
@@ -39,7 +39,6 @@
 //
 // TODO Make the inserts multi-threaded. See Kudu-629 for the technique.
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 
 #include <glog/logging.h>
 #include <stdlib.h>
@@ -370,7 +369,7 @@ Status TpchRealWorld::Run() {
 
   stop_threads_.Store(true);
 
-  BOOST_FOREACH(scoped_refptr<kudu::Thread> thr, threads) {
+  for (scoped_refptr<kudu::Thread> thr : threads) {
     RETURN_NOT_OK(ThreadJoiner(thr.get()).Join());
   }
   return Status::OK();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/benchmarks/wal_hiccup.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/wal_hiccup.cc b/src/kudu/benchmarks/wal_hiccup.cc
index 1f4e35c..e1525c8 100644
--- a/src/kudu/benchmarks/wal_hiccup.cc
+++ b/src/kudu/benchmarks/wal_hiccup.cc
@@ -16,7 +16,6 @@
 // under the License.
 
 #include <algorithm>
-#include <boost/foreach.hpp>
 #include <vector>
 
 #include <fcntl.h>
@@ -168,7 +167,7 @@ void WalHiccupBenchmarker::Run() {
     // Randomize the order of setups in each round.
     std::random_shuffle(setups.begin(), setups.end());
 
-    BOOST_FOREACH(uint32_t setup, setups) {
+    for (uint32_t setup : setups) {
       SetFlags(setup);
       if (!FLAGS_fdatasync_each_file && !FLAGS_fdatasync_at_end) {
         // Skip non-durable configuration
@@ -197,7 +196,7 @@ void WalHiccupBenchmarker::Run() {
     LOG(INFO) << "----------------------------------------------------------------------";
   }
 
-  BOOST_FOREACH(uint32_t setup, setups) {
+  for (uint32_t setup : setups) {
     SetFlags(setup);
     if (!FLAGS_fdatasync_each_file && !FLAGS_fdatasync_at_end) {
       // Skip non-durable configuration

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/binary_prefix_block.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/binary_prefix_block.cc b/src/kudu/cfile/binary_prefix_block.cc
index 8b06d59..a9e8da2 100644
--- a/src/kudu/cfile/binary_prefix_block.cc
+++ b/src/kudu/cfile/binary_prefix_block.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/cfile/binary_prefix_block.h"
 
-#include <boost/foreach.hpp>
 #include <algorithm>
 #include <string>
 
@@ -110,7 +109,7 @@ Slice BinaryPrefixBlockBuilder::Finish(rowid_t ordinal_pos) {
   buffer_.reserve(buffer_.size()
                   + restarts_.size() * sizeof(uint32_t) // the data
                   + sizeof(uint32_t)); // the restart count);
-  BOOST_FOREACH(uint32_t restart, restarts_) {
+  for (uint32_t restart : restarts_) {
     DCHECK_GE(static_cast<int>(restart), header_offset);
     uint32_t relative_to_block = restart - header_offset;
     VLOG(2) << "appending restart " << relative_to_block;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/block_compression.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/block_compression.cc b/src/kudu/cfile/block_compression.cc
index ae7c275..61792b7 100644
--- a/src/kudu/cfile/block_compression.cc
+++ b/src/kudu/cfile/block_compression.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <algorithm>
 
@@ -44,7 +43,7 @@ Status CompressedBlockBuilder::Compress(const Slice& data, Slice *result) {
 
 Status CompressedBlockBuilder::Compress(const vector<Slice> &data_slices, Slice *result) {
   size_t data_size = 0;
-  BOOST_FOREACH(const Slice& data, data_slices) {
+  for (const Slice& data : data_slices) {
     data_size += data.size();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/cfile_reader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_reader.cc b/src/kudu/cfile/cfile_reader.cc
index 440b9cd..3378382 100644
--- a/src/kudu/cfile/cfile_reader.cc
+++ b/src/kudu/cfile/cfile_reader.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/cfile/cfile_reader.h"
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 
 #include <algorithm>
@@ -423,13 +422,13 @@ Status CFileReader::CountRows(rowid_t *count) const {
 }
 
 bool CFileReader::GetMetadataEntry(const string &key, string *val) {
-  BOOST_FOREACH(const FileMetadataPairPB &pair, header().metadata()) {
+  for (const FileMetadataPairPB &pair : header().metadata()) {
     if (pair.key() == key) {
       *val = pair.value();
       return true;
     }
   }
-  BOOST_FOREACH(const FileMetadataPairPB &pair, footer().metadata()) {
+  for (const FileMetadataPairPB &pair : footer().metadata()) {
     if (pair.key() == key) {
       *val = pair.value();
       return true;
@@ -708,7 +707,7 @@ Status CFileIterator::PrepareForNewSeek() {
   }
 
   seeked_ = NULL;
-  BOOST_FOREACH(PreparedBlock *pb, prepared_blocks_) {
+  for (PreparedBlock *pb : prepared_blocks_) {
     prepared_block_pool_.Destroy(pb);
   }
   prepared_blocks_.clear();
@@ -839,7 +838,7 @@ Status CFileIterator::PrepareBatch(size_t *n) {
   if (PREDICT_FALSE(VLOG_IS_ON(1))) {
     VLOG(1) << "Prepared for " << (*n) << " rows"
             << " (" << start_idx << "-" << (start_idx + *n - 1) << ")";
-    BOOST_FOREACH(PreparedBlock *b, prepared_blocks_) {
+    for (PreparedBlock *b : prepared_blocks_) {
       VLOG(1) << "  " << b->ToString();
     }
     VLOG(1) << "-------------";
@@ -878,7 +877,7 @@ Status CFileIterator::FinishBatch() {
   #ifndef NDEBUG
   if (VLOG_IS_ON(1)) {
     VLOG(1) << "Left around following blocks:";
-    BOOST_FOREACH(PreparedBlock *b, prepared_blocks_) {
+    for (PreparedBlock *b : prepared_blocks_) {
       VLOG(1) << "  " << b->ToString();
     }
     VLOG(1) << "-------------";
@@ -900,7 +899,7 @@ Status CFileIterator::Scan(ColumnBlock *dst) {
   uint32_t rem = last_prepare_count_;
   DCHECK_LE(rem, dst->nrows());
 
-  BOOST_FOREACH(PreparedBlock *pb, prepared_blocks_) {
+  for (PreparedBlock *pb : prepared_blocks_) {
     if (pb->needs_rewind_) {
       // Seek back to the saved position.
       SeekToPositionInBlock(pb, pb->rewind_idx_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/cfile_writer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_writer.cc b/src/kudu/cfile/cfile_writer.cc
index 5acfdd0..caeda21 100644
--- a/src/kudu/cfile/cfile_writer.cc
+++ b/src/kudu/cfile/cfile_writer.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/cfile/cfile_writer.h"
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <string>
 #include <utility>
@@ -264,7 +263,7 @@ void CFileWriter::AddMetadataPair(const Slice &key, const Slice &value) {
 
 string CFileWriter::GetMetaValueOrDie(Slice key) const {
   typedef pair<string, string> ss_pair;
-  BOOST_FOREACH(const ss_pair& entry, unflushed_metadata_) {
+  for (const ss_pair& entry : unflushed_metadata_) {
     if (Slice(entry.first) == key) {
       return entry.second;
     }
@@ -274,7 +273,7 @@ string CFileWriter::GetMetaValueOrDie(Slice key) const {
 
 void CFileWriter::FlushMetadataToPB(RepeatedPtrField<FileMetadataPairPB> *field) {
   typedef pair<string, string> ss_pair;
-  BOOST_FOREACH(const ss_pair &entry, unflushed_metadata_) {
+  for (const ss_pair &entry : unflushed_metadata_) {
     FileMetadataPairPB *pb = field->Add();
     pb->set_key(entry.first);
     pb->set_value(entry.second);
@@ -457,7 +456,7 @@ Status CFileWriter::AddBlock(const vector<Slice> &data_slices,
     RETURN_NOT_OK(WriteRawData(cdata));
   } else {
     // Write uncompressed block
-    BOOST_FOREACH(const Slice &data, data_slices) {
+    for (const Slice &data : data_slices) {
       RETURN_NOT_OK(WriteRawData(data));
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/compression_codec.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/compression_codec.cc b/src/kudu/cfile/compression_codec.cc
index cb29802..2a66a79 100644
--- a/src/kudu/cfile/compression_codec.cc
+++ b/src/kudu/cfile/compression_codec.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <snappy-sinksource.h>
 #include <snappy.h>
@@ -82,7 +81,7 @@ class SlicesSource : public snappy::Source {
 
   void Dump(faststring *buffer) {
     buffer->reserve(buffer->size() + TotalSize());
-    BOOST_FOREACH(const Slice& block, slices_) {
+    for (const Slice& block : slices_) {
       buffer->append(block.data(), block.size());
     }
   }
@@ -90,7 +89,7 @@ class SlicesSource : public snappy::Source {
  private:
   size_t TotalSize(void) const {
     size_t size = 0;
-    BOOST_FOREACH(const Slice& data, slices_) {
+    for (const Slice& data : slices_) {
       size += data.size();
     }
     return size;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/encoding-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/encoding-test.cc b/src/kudu/cfile/encoding-test.cc
index 064fda2..051dc58 100644
--- a/src/kudu/cfile/encoding-test.cc
+++ b/src/kudu/cfile/encoding-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/utility/binary.hpp>
 #include <glog/logging.h>

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/index_block.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/index_block.cc b/src/kudu/cfile/index_block.cc
index cdf0886..fb01834 100644
--- a/src/kudu/cfile/index_block.cc
+++ b/src/kudu/cfile/index_block.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 
 #include "kudu/cfile/cfile_writer.h"
 #include "kudu/cfile/index_block.h"
@@ -70,7 +69,7 @@ void IndexBlockBuilder::Add(const Slice &keyptr,
 Slice IndexBlockBuilder::Finish() {
   CHECK(!finished_) << "already called Finish()";
 
-  BOOST_FOREACH(uint32_t off, entry_offsets_) {
+  for (uint32_t off : entry_offsets_) {
     InlinePutFixed32(&buffer_, off);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/cfile/mt-bloomfile-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/mt-bloomfile-test.cc b/src/kudu/cfile/mt-bloomfile-test.cc
index e5c13b5..aafbd70 100644
--- a/src/kudu/cfile/mt-bloomfile-test.cc
+++ b/src/kudu/cfile/mt-bloomfile-test.cc
@@ -43,7 +43,7 @@ TEST_F(MTBloomFileTest, Benchmark) {
                             &new_thread));
     threads.push_back(new_thread);
   }
-  BOOST_FOREACH(scoped_refptr<kudu::Thread>& t, threads) {
+  for (scoped_refptr<kudu::Thread>& t : threads) {
     t->Join();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/batcher.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/batcher.cc b/src/kudu/client/batcher.cc
index 9b0bdf0..5b5d2bf 100644
--- a/src/kudu/client/batcher.cc
+++ b/src/kudu/client/batcher.cc
@@ -273,7 +273,7 @@ WriteRpc::WriteRpc(const scoped_refptr<Batcher>& batcher,
   // Add the rows
   int ctr = 0;
   RowOperationsPBEncoder enc(requested);
-  BOOST_FOREACH(InFlightOp* op, ops_) {
+  for (InFlightOp* op : ops_) {
     const Partition& partition = op->tablet->partition();
     const PartitionSchema& partition_schema = table()->partition_schema();
     const KuduPartialRow& row = op->write_op->row();
@@ -343,7 +343,7 @@ void WriteRpc::SendRpc() {
     // Try to "guess" the next leader.
     vector<RemoteTabletServer*> replicas;
     tablet_->GetRemoteTabletServers(&replicas);
-    BOOST_FOREACH(RemoteTabletServer* ts, replicas) {
+    for (RemoteTabletServer* ts : replicas) {
       if (!ContainsKey(followers_, ts)) {
         current_ts_ = ts;
         break;
@@ -501,14 +501,14 @@ void Batcher::Abort() {
   state_ = kAborted;
 
   vector<InFlightOp*> to_abort;
-  BOOST_FOREACH(InFlightOp* op, ops_) {
+  for (InFlightOp* op : ops_) {
     lock_guard<simple_spinlock> l(&op->lock_);
     if (op->state == InFlightOp::kBufferedToTabletServer) {
       to_abort.push_back(op);
     }
   }
 
-  BOOST_FOREACH(InFlightOp* op, to_abort) {
+  for (InFlightOp* op : to_abort) {
     VLOG(1) << "Aborting op: " << op->ToString();
     MarkInFlightOpFailedUnlocked(op, Status::Aborted("Batch aborted"));
   }
@@ -522,7 +522,7 @@ void Batcher::Abort() {
 
 Batcher::~Batcher() {
   if (PREDICT_FALSE(!ops_.empty())) {
-    BOOST_FOREACH(InFlightOp* op, ops_) {
+    for (InFlightOp* op : ops_) {
       LOG(ERROR) << "Orphaned op: " << op->ToString();
     }
     LOG(FATAL) << "ops_ not empty";
@@ -782,7 +782,7 @@ void Batcher::FlushBuffersIfReady() {
   }
 
   // Now flush the ops for each tablet.
-  BOOST_FOREACH(const OpsMap::value_type& e, ops_copy) {
+  for (const OpsMap::value_type& e : ops_copy) {
     RemoteTablet* tablet = e.first;
     const vector<InFlightOp*>& ops = e.second;
 
@@ -821,7 +821,7 @@ void Batcher::ProcessWriteResponse(const WriteRpc& rpc,
     }
   } else {
     // Mark each of the rows in the write op as failed, since the whole RPC failed.
-    BOOST_FOREACH(InFlightOp* op, rpc.ops()) {
+    for (InFlightOp* op : rpc.ops()) {
       gscoped_ptr<KuduError> error(new KuduError(op->write_op.release(), s));
       error_collector_->AddError(error.Pass());
     }
@@ -833,7 +833,7 @@ void Batcher::ProcessWriteResponse(const WriteRpc& rpc,
   // Remove all the ops from the "in-flight" list.
   {
     lock_guard<simple_spinlock> l(&lock_);
-    BOOST_FOREACH(InFlightOp* op, rpc.ops()) {
+    for (InFlightOp* op : rpc.ops()) {
       CHECK_EQ(1, ops_.erase(op))
             << "Could not remove op " << op->ToString()
             << " from in-flight list";
@@ -841,7 +841,7 @@ void Batcher::ProcessWriteResponse(const WriteRpc& rpc,
   }
 
   // Check individual row errors.
-  BOOST_FOREACH(const WriteResponsePB_PerRowErrorPB& err_pb, rpc.resp().per_row_errors()) {
+  for (const WriteResponsePB_PerRowErrorPB& err_pb : rpc.resp().per_row_errors()) {
     // TODO: handle case where we get one of the more specific TS errors
     // like the tablet not being hosted?
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/client-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-internal.cc b/src/kudu/client/client-internal.cc
index 948d7c6..ff98037 100644
--- a/src/kudu/client/client-internal.cc
+++ b/src/kudu/client/client-internal.cc
@@ -18,7 +18,6 @@
 #include "kudu/client/client-internal.h"
 
 #include <algorithm>
-#include <boost/foreach.hpp>
 #include <limits>
 #include <string>
 #include <vector>
@@ -260,7 +259,7 @@ RemoteTabletServer* KuduClient::Data::SelectTServer(const scoped_refptr<RemoteTa
       rt->GetRemoteTabletServers(candidates);
       // Filter out all the blacklisted candidates.
       vector<RemoteTabletServer*> filtered;
-      BOOST_FOREACH(RemoteTabletServer* rts, *candidates) {
+      for (RemoteTabletServer* rts : *candidates) {
         if (!ContainsKey(blacklist, rts->permanent_uuid())) {
           filtered.push_back(rts);
         } else {
@@ -273,7 +272,7 @@ RemoteTabletServer* KuduClient::Data::SelectTServer(const scoped_refptr<RemoteTa
         }
       } else if (selection == CLOSEST_REPLICA) {
         // Choose a local replica.
-        BOOST_FOREACH(RemoteTabletServer* rts, filtered) {
+        for (RemoteTabletServer* rts : filtered) {
           if (IsTabletServerLocal(*rts)) {
             ret = rts;
             break;
@@ -520,7 +519,7 @@ Status KuduClient::Data::InitLocalHostNames() {
   RETURN_NOT_OK_PREPEND(HostPort(hostname, 0).ResolveAddresses(&addresses),
                         Substitute("Could not resolve local host name '$0'", hostname));
 
-  BOOST_FOREACH(const Sockaddr& addr, addresses) {
+  for (const Sockaddr& addr : addresses) {
     // Similar to above, ignore local or wildcard addresses.
     if (addr.IsWildcard()) continue;
     if (addr.IsAnyLocalAddress()) continue;
@@ -539,7 +538,7 @@ bool KuduClient::Data::IsLocalHostPort(const HostPort& hp) const {
 bool KuduClient::Data::IsTabletServerLocal(const RemoteTabletServer& rts) const {
   vector<HostPort> host_ports;
   rts.GetHostPorts(&host_ports);
-  BOOST_FOREACH(const HostPort& hp, host_ports) {
+  for (const HostPort& hp : host_ports) {
     if (IsLocalHostPort(hp)) return true;
   }
   return false;
@@ -747,7 +746,7 @@ void KuduClient::Data::LeaderMasterDetermined(const Status& status,
     }
   }
 
-  BOOST_FOREACH(const StatusCallback& cb, cbs) {
+  for (const StatusCallback& cb : cbs) {
     cb.Run(new_status);
   }
 }
@@ -765,7 +764,7 @@ void KuduClient::Data::SetMasterServerProxyAsync(KuduClient* client,
   DCHECK(deadline.Initialized());
 
   vector<Sockaddr> master_sockaddrs;
-  BOOST_FOREACH(const string& master_server_addr, master_server_addrs_) {
+  for (const string& master_server_addr : master_server_addrs_) {
     vector<Sockaddr> addrs;
     Status s;
     // TODO: Do address resolution asynchronously as well.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/client-test-util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test-util.cc b/src/kudu/client/client-test-util.cc
index 898ae14..7015c8b 100644
--- a/src/kudu/client/client-test-util.cc
+++ b/src/kudu/client/client-test-util.cc
@@ -18,7 +18,6 @@
 #include "kudu/client/client-test-util.h"
 #include "kudu/client/row_result.h"
 
-#include <boost/foreach.hpp>
 #include <vector>
 
 #include "kudu/gutil/stl_util.h"
@@ -39,7 +38,7 @@ void LogSessionErrorsAndDie(const sp::shared_ptr<KuduSession>& session,
   // Log only the first 10 errors.
   LOG(INFO) << errors.size() << " failed ops. First 10 errors follow";
   int i = 0;
-  BOOST_FOREACH(const KuduError* e, errors) {
+  for (const KuduError* e : errors) {
     if (i == 10) {
       break;
     }
@@ -63,7 +62,7 @@ void ScanToStrings(KuduScanner* scanner, vector<string>* row_strings) {
   vector<KuduRowResult> rows;
   while (scanner->HasMoreRows()) {
     ASSERT_OK(scanner->NextBatch(&rows));
-    BOOST_FOREACH(const KuduRowResult& row, rows) {
+    for (const KuduRowResult& row : rows) {
       row_strings->push_back(row.ToString());
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 505c167..29ea8a8 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 #include <gtest/gtest.h>
 #include <gflags/gflags.h>
 #include <glog/stl_logging.h>
@@ -261,7 +260,7 @@ class ClientTest : public KuduTest {
       while (scanner.HasMoreRows()) {
         ASSERT_OK(scanner.NextBatch(&rows));
 
-        BOOST_FOREACH(const KuduRowResult& row, rows) {
+        for (const KuduRowResult& row : rows) {
           int32_t value;
           ASSERT_OK(row.GetInt32(0, &value));
           sum += value;
@@ -292,7 +291,7 @@ class ClientTest : public KuduTest {
       while (scanner.HasMoreRows()) {
         ASSERT_OK(scanner.NextBatch(&rows));
 
-        BOOST_FOREACH(const KuduRowResult& row, rows) {
+        for (const KuduRowResult& row : rows) {
           Slice s;
           ASSERT_OK(row.GetString(2, &s));
           if (!s.starts_with("hello 2") && !s.starts_with("hello 3")) {
@@ -320,7 +319,7 @@ class ClientTest : public KuduTest {
       while (scanner.HasMoreRows()) {
         ASSERT_OK(scanner.NextBatch(&rows));
 
-        BOOST_FOREACH(const KuduRowResult& row, rows) {
+        for (const KuduRowResult& row : rows) {
           int32_t k;
           ASSERT_OK(row.GetInt32(0, &k));
           if (k < 5 || k > 10) {
@@ -782,7 +781,7 @@ TEST_F(ClientTest, TestScanPredicateKeyColNotProjected) {
     while (scanner.HasMoreRows()) {
       ASSERT_OK(scanner.NextBatch(&rows));
 
-      BOOST_FOREACH(const KuduRowResult& row, rows) {
+      for (const KuduRowResult& row : rows) {
         int32_t val;
         ASSERT_OK(row.GetInt32(0, &val));
         ASSERT_EQ(curr_key * 2, val);
@@ -820,7 +819,7 @@ TEST_F(ClientTest, TestScanPredicateNonKeyColNotProjected) {
     while (scanner.HasMoreRows()) {
       ASSERT_OK(scanner.NextBatch(&rows));
 
-      BOOST_FOREACH(const KuduRowResult& row, rows) {
+      for (const KuduRowResult& row : rows) {
         int32_t val;
         ASSERT_OK(row.GetInt32(0, &val));
         ASSERT_EQ(curr_key / 2, val);
@@ -915,7 +914,7 @@ static void DoScanWithCallback(KuduTable* table,
     vector<KuduRowResult> result_rows;
     ASSERT_OK(scanner.NextBatch(&result_rows));
     ASSERT_GT(result_rows.size(), 0);
-    BOOST_FOREACH(KuduRowResult& r, result_rows) {
+    for (KuduRowResult& r : result_rows) {
       rows.push_back(r.ToString());
     }
     ASSERT_TRUE(scanner.HasMoreRows());
@@ -937,7 +936,7 @@ static void DoScanWithCallback(KuduTable* table,
   while (scanner.HasMoreRows()) {
     vector<KuduRowResult> result_rows;
     ASSERT_OK(scanner.NextBatch(&result_rows));
-    BOOST_FOREACH(KuduRowResult& r, result_rows) {
+    for (KuduRowResult& r : result_rows) {
       rows.push_back(r.ToString());
     }
   }
@@ -1076,18 +1075,18 @@ TEST_F(ClientTest, TestGetTabletServerBlacklist) {
   selections.push_back(KuduClient::LEADER_ONLY);
   selections.push_back(KuduClient::CLOSEST_REPLICA);
   selections.push_back(KuduClient::FIRST_REPLICA);
-  BOOST_FOREACH(KuduClient::ReplicaSelection selection, selections) {
+  for (KuduClient::ReplicaSelection selection : selections) {
     Status s = client_->data_->GetTabletServer(client_.get(), rt->tablet_id(), selection,
                                                blacklist, &candidates, &rts);
     ASSERT_TRUE(s.IsServiceUnavailable());
   }
 
   // Make sure none of the modes work when all nodes are dead.
-  BOOST_FOREACH(internal::RemoteTabletServer* rt, tservers) {
+  for (internal::RemoteTabletServer* rt : tservers) {
     client_->data_->meta_cache_->MarkTSFailed(rt, Status::NetworkError("test"));
   }
   blacklist.clear();
-  BOOST_FOREACH(KuduClient::ReplicaSelection selection, selections) {
+  for (KuduClient::ReplicaSelection selection : selections) {
     Status s = client_->data_->GetTabletServer(client_.get(), rt->tablet_id(),
                                                selection,
                                                blacklist, &candidates, &rts);
@@ -1209,7 +1208,7 @@ namespace {
 
 int64_t SumResults(const vector<KuduRowResult>& results) {
   int64_t sum = 0;
-  BOOST_FOREACH(const KuduRowResult row, results) {
+  for (const KuduRowResult row : results) {
     int32_t val;
     CHECK_OK(row.GetInt32(0, &val));
     sum += val;
@@ -2239,7 +2238,7 @@ void CheckCorrectness(KuduScanner* scanner, int expected[], int nrows) {
 
   while (scanner->HasMoreRows()) {
     ASSERT_OK(scanner->NextBatch(&rows));
-    BOOST_FOREACH(const KuduRowResult& r, rows) {
+    for (const KuduRowResult& r : rows) {
       int32_t key;
       int32_t val;
       Slice strval;
@@ -2431,7 +2430,7 @@ namespace {
     int cnt = 0;
     while (scanner.HasMoreRows()) {
       CHECK_OK(scanner.NextBatch(&rows));
-      BOOST_FOREACH(const KuduRowResult& row, rows) {
+      for (const KuduRowResult& row : rows) {
         // Check that for every key:
         // 1. Column 1 int32_t value == expected
         // 2. Column 2 string value is empty
@@ -2688,7 +2687,7 @@ TEST_F(ClientTest, TestServerTooBusyRetry) {
     }
   }
 
-  BOOST_FOREACH(const scoped_refptr<kudu::Thread>& thread, threads) {
+  for (const scoped_refptr<kudu::Thread>& thread : threads) {
     thread->Join();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.cc b/src/kudu/client/client.cc
index c1964c4..82f5a77 100644
--- a/src/kudu/client/client.cc
+++ b/src/kudu/client/client.cc
@@ -177,7 +177,7 @@ KuduClientBuilder& KuduClientBuilder::clear_master_server_addrs() {
 }
 
 KuduClientBuilder& KuduClientBuilder::master_server_addrs(const vector<string>& addrs) {
-  BOOST_FOREACH(const string& addr, addrs) {
+  for (const string& addr : addrs) {
     data_->master_server_addrs_.push_back(addr);
   }
   return *this;
@@ -338,7 +338,7 @@ Status KuduClient::ListTables(vector<string>* tables,
 Status KuduClient::TableExists(const string& table_name, bool* exists) {
   std::vector<std::string> tables;
   RETURN_NOT_OK(ListTables(&tables, table_name));
-  BOOST_FOREACH(const string& table, tables) {
+  for (const string& table : tables) {
     if (table == table_name) {
       *exists = true;
       return Status::OK();
@@ -431,7 +431,7 @@ KuduTableCreator& KuduTableCreator::add_hash_partitions(const std::vector<std::s
                                                         int32_t num_buckets, int32_t seed) {
   PartitionSchemaPB::HashBucketSchemaPB* bucket_schema =
     data_->partition_schema_.add_hash_bucket_schemas();
-  BOOST_FOREACH(const string& col_name, columns) {
+  for (const string& col_name : columns) {
     bucket_schema->add_columns()->set_name(col_name);
   }
   bucket_schema->set_num_buckets(num_buckets);
@@ -444,7 +444,7 @@ KuduTableCreator& KuduTableCreator::set_range_partition_columns(
   PartitionSchemaPB::RangeSchemaPB* range_schema =
     data_->partition_schema_.mutable_range_schema();
   range_schema->Clear();
-  BOOST_FOREACH(const string& col_name, columns) {
+  for (const string& col_name : columns) {
     range_schema->add_columns()->set_name(col_name);
   }
 
@@ -490,7 +490,7 @@ Status KuduTableCreator::Create() {
 
   RowOperationsPBEncoder encoder(req.mutable_split_rows());
 
-  BOOST_FOREACH(const KuduPartialRow* row, data_->split_rows_) {
+  for (const KuduPartialRow* row : data_->split_rows_) {
     encoder.Add(RowOperationsPB::SPLIT_ROW, *row);
   }
   req.mutable_partition_schema()->CopyFrom(data_->partition_schema_);
@@ -704,7 +704,7 @@ bool KuduSession::HasPendingOperations() const {
   if (data_->batcher_->HasPendingOperations()) {
     return true;
   }
-  BOOST_FOREACH(Batcher* b, data_->flushed_batchers_) {
+  for (Batcher* b : data_->flushed_batchers_) {
     if (b->HasPendingOperations()) {
       return true;
     }
@@ -844,7 +844,7 @@ Status KuduScanner::SetProjectedColumnNames(const vector<string>& col_names) {
   const Schema* table_schema = data_->table_->schema().schema_;
   vector<int> col_indexes;
   col_indexes.reserve(col_names.size());
-  BOOST_FOREACH(const string& col_name, col_names) {
+  for (const string& col_name : col_names) {
     int idx = table_schema->find_column(col_name);
     if (idx == Schema::kColumnNotFound) {
       return Status::NotFound(strings::Substitute("Column: \"$0\" was not found in the "
@@ -864,7 +864,7 @@ Status KuduScanner::SetProjectedColumnIndexes(const vector<int>& col_indexes) {
   const Schema* table_schema = data_->table_->schema().schema_;
   vector<ColumnSchema> cols;
   cols.reserve(col_indexes.size());
-  BOOST_FOREACH(const int col_index, col_indexes) {
+  for (const int col_index : col_indexes) {
     if (col_index >= table_schema->columns().size()) {
       return Status::NotFound(strings::Substitute("Column: \"$0\" was not found in the "
           "table schema.", col_index));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/meta_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/meta_cache.cc b/src/kudu/client/meta_cache.cc
index 527c3b7..038af91 100644
--- a/src/kudu/client/meta_cache.cc
+++ b/src/kudu/client/meta_cache.cc
@@ -18,7 +18,6 @@
 #include "kudu/client/meta_cache.h"
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 
 #include "kudu/client/client.h"
@@ -127,7 +126,7 @@ void RemoteTabletServer::Update(const master::TSInfoPB& pb) {
   lock_guard<simple_spinlock> l(&lock_);
 
   rpc_hostports_.clear();
-  BOOST_FOREACH(const HostPortPB& hostport_pb, pb.rpc_addresses()) {
+  for (const HostPortPB& hostport_pb : pb.rpc_addresses()) {
     rpc_hostports_.push_back(HostPort(hostport_pb.host(), hostport_pb.port()));
   }
 }
@@ -165,7 +164,7 @@ void RemoteTablet::Refresh(const TabletServerMap& tservers,
   // Adopt the data from the successful response.
   lock_guard<simple_spinlock> l(&lock_);
   replicas_.clear();
-  BOOST_FOREACH(const TabletLocationsPB_ReplicaPB& r, replicas) {
+  for (const TabletLocationsPB_ReplicaPB& r : replicas) {
     RemoteReplica rep;
     rep.ts = FindOrDie(tservers, r.ts_info().permanent_uuid());
     rep.role = r.role();
@@ -187,7 +186,7 @@ bool RemoteTablet::MarkReplicaFailed(RemoteTabletServer *ts,
           << ReplicasAsStringUnlocked();
   LOG(WARNING) << "Tablet " << tablet_id_ << ": Replica " << ts->ToString()
                << " has failed: " << status.ToString();
-  BOOST_FOREACH(RemoteReplica& rep, replicas_) {
+  for (RemoteReplica& rep : replicas_) {
     if (rep.ts == ts) {
       rep.failed = true;
       found = true;
@@ -199,7 +198,7 @@ bool RemoteTablet::MarkReplicaFailed(RemoteTabletServer *ts,
 int RemoteTablet::GetNumFailedReplicas() const {
   int failed = 0;
   lock_guard<simple_spinlock> l(&lock_);
-  BOOST_FOREACH(const RemoteReplica& rep, replicas_) {
+  for (const RemoteReplica& rep : replicas_) {
     if (rep.failed) {
       failed++;
     }
@@ -209,7 +208,7 @@ int RemoteTablet::GetNumFailedReplicas() const {
 
 RemoteTabletServer* RemoteTablet::LeaderTServer() const {
   lock_guard<simple_spinlock> l(&lock_);
-  BOOST_FOREACH(const RemoteReplica& replica, replicas_) {
+  for (const RemoteReplica& replica : replicas_) {
     if (!replica.failed && replica.role == RaftPeerPB::LEADER) {
       return replica.ts;
     }
@@ -223,7 +222,7 @@ bool RemoteTablet::HasLeader() const {
 
 void RemoteTablet::GetRemoteTabletServers(vector<RemoteTabletServer*>* servers) const {
   lock_guard<simple_spinlock> l(&lock_);
-  BOOST_FOREACH(const RemoteReplica& replica, replicas_) {
+  for (const RemoteReplica& replica : replicas_) {
     if (replica.failed) {
       continue;
     }
@@ -234,7 +233,7 @@ void RemoteTablet::GetRemoteTabletServers(vector<RemoteTabletServer*>* servers)
 void RemoteTablet::MarkTServerAsLeader(const RemoteTabletServer* server) {
   bool found = false;
   lock_guard<simple_spinlock> l(&lock_);
-  BOOST_FOREACH(RemoteReplica& replica, replicas_) {
+  for (RemoteReplica& replica : replicas_) {
     if (replica.ts == server) {
       replica.role = RaftPeerPB::LEADER;
       found = true;
@@ -250,7 +249,7 @@ void RemoteTablet::MarkTServerAsLeader(const RemoteTabletServer* server) {
 void RemoteTablet::MarkTServerAsFollower(const RemoteTabletServer* server) {
   bool found = false;
   lock_guard<simple_spinlock> l(&lock_);
-  BOOST_FOREACH(RemoteReplica& replica, replicas_) {
+  for (RemoteReplica& replica : replicas_) {
     if (replica.ts == server) {
       replica.role = RaftPeerPB::FOLLOWER;
       found = true;
@@ -269,7 +268,7 @@ std::string RemoteTablet::ReplicasAsString() const {
 std::string RemoteTablet::ReplicasAsStringUnlocked() const {
   DCHECK(lock_.is_locked());
   string replicas_str;
-  BOOST_FOREACH(const RemoteReplica& rep, replicas_) {
+  for (const RemoteReplica& rep : replicas_) {
     if (!replicas_str.empty()) replicas_str += ", ";
     strings::SubstituteAndAppend(&replicas_str, "$0 ($1, $2)",
                                 rep.ts->permanent_uuid(),
@@ -536,9 +535,9 @@ const scoped_refptr<RemoteTablet>& MetaCache::ProcessLookupResponse(const Lookup
   lock_guard<rw_spinlock> l(&lock_);
   TabletMap& tablets_by_key = LookupOrInsert(&tablets_by_table_and_key_,
                                              rpc.table_id(), TabletMap());
-  BOOST_FOREACH(const TabletLocationsPB& loc, rpc.resp().tablet_locations()) {
+  for (const TabletLocationsPB& loc : rpc.resp().tablet_locations()) {
     // First, update the tserver cache, needed for the Refresh calls below.
-    BOOST_FOREACH(const TabletLocationsPB_ReplicaPB& r, loc.replicas()) {
+    for (const TabletLocationsPB_ReplicaPB& r : loc.replicas()) {
       UpdateTabletServer(r.ts_info());
     }
 
@@ -627,7 +626,7 @@ void MetaCache::MarkTSFailed(RemoteTabletServer* ts,
   Status ts_status = status.CloneAndPrepend("TS failed");
 
   // TODO: replace with a ts->tablet multimap for faster lookup?
-  BOOST_FOREACH(const TabletMap::value_type& tablet, tablets_by_id_) {
+  for (const TabletMap::value_type& tablet : tablets_by_id_) {
     // We just loop on all tablets; if a tablet does not have a replica on this
     // TS, MarkReplicaFailed() returns false and we ignore the return value.
     tablet.second->MarkReplicaFailed(ts, ts_status);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/scanner-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scanner-internal.cc b/src/kudu/client/scanner-internal.cc
index afe893d..9b158fd 100644
--- a/src/kudu/client/scanner-internal.cc
+++ b/src/kudu/client/scanner-internal.cc
@@ -221,7 +221,7 @@ Status KuduScanner::Data::OpenTablet(const string& partition_key,
 
   // Set up the predicates.
   scan->clear_range_predicates();
-  BOOST_FOREACH(const ColumnRangePredicate& pred, spec_.predicates()) {
+  for (const ColumnRangePredicate& pred : spec_.predicates()) {
     const ColumnSchema& col = pred.column();
     const ValueRange& range = pred.range();
     ColumnRangePredicatePB* pb = scan->add_range_predicates();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/schema.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/schema.cc b/src/kudu/client/schema.cc
index aa574c0..5614356 100644
--- a/src/kudu/client/schema.cc
+++ b/src/kudu/client/schema.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/client/schema.h"
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <unordered_map>
 
@@ -282,7 +281,7 @@ KuduSchemaBuilder::KuduSchemaBuilder()
 }
 
 KuduSchemaBuilder::~KuduSchemaBuilder() {
-  BOOST_FOREACH(KuduColumnSpec* spec, data_->specs) {
+  for (KuduColumnSpec* spec : data_->specs) {
     // Can't use STLDeleteElements because KuduSchemaBuilder
     // is a friend of KuduColumnSpec in order to access its destructor.
     // STLDeleteElements is a free function and therefore can't access it.
@@ -343,7 +342,7 @@ Status KuduSchemaBuilder::Build(KuduSchema* schema) {
     // Build a map from name to index of all of the columns.
     unordered_map<string, int> name_to_idx_map;
     int i = 0;
-    BOOST_FOREACH(KuduColumnSpec* spec, data_->specs) {
+    for (KuduColumnSpec* spec : data_->specs) {
       // If they did pass the key column names, then we should not have explicitly
       // set it on any columns.
       if (spec->data_->primary_key) {
@@ -357,7 +356,7 @@ Status KuduSchemaBuilder::Build(KuduSchema* schema) {
 
     // Convert the key column names to a set of indexes.
     vector<int> key_col_indexes;
-    BOOST_FOREACH(const string& key_col_name, data_->key_col_names) {
+    for (const string& key_col_name : data_->key_col_names) {
       int idx;
       if (!FindCopy(name_to_idx_map, key_col_name, &idx)) {
         return Status::InvalidArgument("primary key column not defined", key_col_name);
@@ -486,7 +485,7 @@ void KuduSchema::CopyFrom(const KuduSchema& other) {
 
 Status KuduSchema::Reset(const vector<KuduColumnSchema>& columns, int key_columns) {
   vector<ColumnSchema> cols_private;
-  BOOST_FOREACH(const KuduColumnSchema& col, columns) {
+  for (const KuduColumnSchema& col : columns) {
     cols_private.push_back(*col.col_);
   }
   gscoped_ptr<Schema> new_schema(new Schema());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/table_alterer-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/table_alterer-internal.cc b/src/kudu/client/table_alterer-internal.cc
index 6ee0d28..d9594bb 100644
--- a/src/kudu/client/table_alterer-internal.cc
+++ b/src/kudu/client/table_alterer-internal.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/client/table_alterer-internal.h"
 
-#include <boost/foreach.hpp>
 #include <string>
 
 #include "kudu/client/schema.h"
@@ -41,7 +40,7 @@ KuduTableAlterer::Data::Data(
 }
 
 KuduTableAlterer::Data::~Data() {
-  BOOST_FOREACH(Step& s, steps_) {
+  for (Step& s : steps_) {
     delete s.spec;
   }
 }
@@ -62,7 +61,7 @@ Status KuduTableAlterer::Data::ToRequest(AlterTableRequestPB* req) {
     req->set_new_table_name(rename_to_.get());
   }
 
-  BOOST_FOREACH(const Step& s, steps_) {
+  for (const Step& s : steps_) {
     AlterTableRequestPB::Step* pb_step = req->add_alter_schema_steps();
     pb_step->set_type(s.step_type);
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/client/table_creator-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/table_creator-internal.cc b/src/kudu/client/table_creator-internal.cc
index 2189018..e5774b2 100644
--- a/src/kudu/client/table_creator-internal.cc
+++ b/src/kudu/client/table_creator-internal.cc
@@ -17,7 +17,6 @@
 
 #include "kudu/client/table_creator-internal.h"
 
-#include <boost/foreach.hpp>
 
 #include "kudu/gutil/stl_util.h"
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/codegen/codegen-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/codegen-test.cc b/src/kudu/codegen/codegen-test.cc
index f9ff013..0c209fe 100644
--- a/src/kudu/codegen/codegen-test.cc
+++ b/src/kudu/codegen/codegen-test.cc
@@ -18,7 +18,6 @@
 #include <string>
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <gmock/gmock.h>
 
@@ -224,7 +223,7 @@ Status CodegenTest::Generate(const Schema* proj, gscoped_ptr<CodegenRP>* out) {
 Status CodegenTest::CreatePartialSchema(const vector<size_t>& col_indexes,
                                         Schema* out) {
   vector<ColumnId> col_ids;
-  BOOST_FOREACH(size_t col_idx, col_indexes) {
+  for (size_t col_idx : col_indexes) {
     col_ids.push_back(defaults_.column_id(col_idx));
   }
   return defaults_.CreateProjectionByIdsIgnoreMissing(col_ids, out);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/codegen/module_builder.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/module_builder.cc b/src/kudu/codegen/module_builder.cc
index 538f6bd..ad0fe1f 100644
--- a/src/kudu/codegen/module_builder.cc
+++ b/src/kudu/codegen/module_builder.cc
@@ -22,7 +22,6 @@
 #include <string>
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <glog/logging.h>
 #include <llvm/ADT/StringRef.h>
 #include <llvm/Analysis/Passes.h>
@@ -222,7 +221,7 @@ void DoOptimizations(ExecutionEngine* engine,
   fpm.doInitialization();
 
   // For each function in the module, optimize it
-  BOOST_FOREACH(Function& f, *module) {
+  for (Function& f : *module) {
     // The bool return value here just indicates whether the passes did anything.
     // We can safely expect that many functions are too small to do any optimization.
     ignore_result(fpm.run(f));
@@ -275,7 +274,7 @@ Status ModuleBuilder::Compile(unique_ptr<ExecutionEngine>* out) {
   local_engine->finalizeObject();
 
   // Satisfy the promises
-  BOOST_FOREACH(JITFuture& fut, futures_) {
+  for (JITFuture& fut : futures_) {
     *fut.actual_f_ = local_engine->getPointerToFunction(fut.llvm_f_);
     if (*fut.actual_f_ == NULL) {
       return Status::NotFound(
@@ -304,7 +303,7 @@ TargetMachine* ModuleBuilder::GetTargetMachine() const {
 
 vector<const char*> ModuleBuilder::GetFunctionNames() const {
   vector<const char*> ret;
-  BOOST_FOREACH(const JITFuture& fut, futures_) {
+  for (const JITFuture& fut : futures_) {
     const char* name = CHECK_NOTNULL(fut.llvm_f_)->getName().data();
     ret.push_back(name);
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/codegen/row_projector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/row_projector.cc b/src/kudu/codegen/row_projector.cc
index 3b18e16..3ba4ad9 100644
--- a/src/kudu/codegen/row_projector.cc
+++ b/src/kudu/codegen/row_projector.cc
@@ -23,7 +23,6 @@
 #include <utility>
 #include <vector>
 
-#include <boost/foreach.hpp>
 #include <llvm/ExecutionEngine/ExecutionEngine.h>
 #include <llvm/IR/Argument.h>
 #include <llvm/IR/BasicBlock.h>
@@ -175,8 +174,7 @@ llvm::Function* MakeProjection(const string& name,
   int success_update_number = 0;
 
   // Copy base data
-  BOOST_FOREACH(const kudu::RowProjector::ProjectionIdxMapping& pmap,
-                proj.base_cols_mapping()) {
+  for (const kudu::RowProjector::ProjectionIdxMapping& pmap : proj.base_cols_mapping()) {
     // Retrieve information regarding this column-to-column transformation
     size_t proj_idx = pmap.first;
     size_t base_idx = pmap.second;
@@ -211,7 +209,7 @@ llvm::Function* MakeProjection(const string& name,
     << "Value Adapter not supported yet";
 
   // Fill defaults
-  BOOST_FOREACH(size_t dfl_idx, proj.projection_defaults()) {
+  for (size_t dfl_idx : proj.projection_defaults()) {
     // Retrieve mapping information
     const ColumnSchema& col = projection.column(dfl_idx);
     const void* dfl = READ ? col.read_default_value() :
@@ -345,21 +343,20 @@ Status RowProjectorFunctions::EncodeKey(const Schema& base, const Schema& proj,
 
   AddNext(out, JITWrapper::ROW_PROJECTOR);
   AddNext(out, base.num_columns());
-  BOOST_FOREACH(const ColumnSchema& col, base.columns()) {
+  for (const ColumnSchema& col : base.columns()) {
     AddNext(out, col.type_info()->physical_type());
     AddNext(out, col.is_nullable());
   }
   AddNext(out, proj.num_columns());
-  BOOST_FOREACH(const ColumnSchema& col, proj.columns()) {
+  for (const ColumnSchema& col : proj.columns()) {
     AddNext(out, col.type_info()->physical_type());
     AddNext(out, col.is_nullable());
   }
   AddNext(out, projector.base_cols_mapping().size());
-  BOOST_FOREACH(const kudu::RowProjector::ProjectionIdxMapping& map,
-                projector.base_cols_mapping()) {
+  for (const kudu::RowProjector::ProjectionIdxMapping& map : projector.base_cols_mapping()) {
     AddNext(out, map);
   }
-  BOOST_FOREACH(size_t dfl_idx, projector.projection_defaults()) {
+  for (size_t dfl_idx : projector.projection_defaults()) {
     const ColumnSchema& col = proj.column(dfl_idx);
     AddNext(out, dfl_idx);
     AddNext(out, col.read_default_value());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/common/generic_iterators.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/generic_iterators.cc b/src/kudu/common/generic_iterators.cc
index 5ffd0cf..d6a876f 100644
--- a/src/kudu/common/generic_iterators.cc
+++ b/src/kudu/common/generic_iterators.cc
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <boost/foreach.hpp>
 
 #include <algorithm>
 #include <memory>
@@ -159,7 +158,7 @@ Status MergeIterator::Init(ScanSpec *spec) {
 
   RETURN_NOT_OK(InitSubIterators(spec));
 
-  BOOST_FOREACH(shared_ptr<MergeIterState> &state, iters_) {
+  for (shared_ptr<MergeIterState> &state : iters_) {
     RETURN_NOT_OK(state->PullNextBlock());
   }
 
@@ -185,7 +184,7 @@ bool MergeIterator::HasNext() const {
 
 Status MergeIterator::InitSubIterators(ScanSpec *spec) {
   // Initialize all the sub iterators.
-  BOOST_FOREACH(shared_ptr<RowwiseIterator> &iter, orig_iters_) {
+  for (shared_ptr<RowwiseIterator> &iter : orig_iters_) {
     ScanSpec *spec_copy = spec != NULL ? scan_spec_copies_.Construct(*spec) : NULL;
     RETURN_NOT_OK(PredicateEvaluatingIterator::InitAndMaybeWrap(&iter, spec_copy));
     iters_.push_back(shared_ptr<MergeIterState>(new MergeIterState(iter)));
@@ -217,7 +216,7 @@ void MergeIterator::PrepareBatch(RowBlock* dst) {
   // We can always provide at least as many rows as are remaining
   // in the currently queued up blocks.
   size_t available = 0;
-  BOOST_FOREACH(shared_ptr<MergeIterState> &iter, iters_) {
+  for (shared_ptr<MergeIterState> &iter : iters_) {
     available += iter->remaining_in_block();
   }
 
@@ -269,7 +268,7 @@ string MergeIterator::ToString() const {
   string s;
   s.append("Merge(");
   bool first = true;
-  BOOST_FOREACH(const shared_ptr<RowwiseIterator> &iter, orig_iters_) {
+  for (const shared_ptr<RowwiseIterator> &iter : orig_iters_) {
     s.append(iter->ToString());
     if (!first) {
       s.append(", ");
@@ -288,14 +287,14 @@ const Schema& MergeIterator::schema() const {
 void MergeIterator::GetIteratorStats(vector<IteratorStats>* stats) const {
   CHECK(initted_);
   vector<vector<IteratorStats> > stats_by_iter;
-  BOOST_FOREACH(const shared_ptr<RowwiseIterator>& iter, orig_iters_) {
+  for (const shared_ptr<RowwiseIterator>& iter : orig_iters_) {
     vector<IteratorStats> stats_for_iter;
     iter->GetIteratorStats(&stats_for_iter);
     stats_by_iter.push_back(stats_for_iter);
   }
   for (size_t idx = 0; idx < schema_.num_columns(); ++idx) {
     IteratorStats stats_for_col;
-    BOOST_FOREACH(const vector<IteratorStats>& stats_for_iter, stats_by_iter) {
+    for (const vector<IteratorStats>& stats_for_iter : stats_by_iter) {
       stats_for_col.AddStats(stats_for_iter[idx]);
     }
     stats->push_back(stats_for_col);
@@ -326,7 +325,7 @@ Status UnionIterator::Init(ScanSpec *spec) {
   // sub-iterators, since they may not know their own schemas
   // until they've been initialized (in the case of a union of unions)
   schema_.reset(new Schema(iters_.front()->schema()));
-  BOOST_FOREACH(const shared_ptr<RowwiseIterator> &iter, iters_) {
+  for (const shared_ptr<RowwiseIterator> &iter : iters_) {
     if (!iter->schema().Equals(*schema_)) {
       return Status::InvalidArgument(
         string("Schemas do not match: ") + schema_->ToString()
@@ -340,7 +339,7 @@ Status UnionIterator::Init(ScanSpec *spec) {
 
 
 Status UnionIterator::InitSubIterators(ScanSpec *spec) {
-  BOOST_FOREACH(shared_ptr<RowwiseIterator> &iter, iters_) {
+  for (shared_ptr<RowwiseIterator> &iter : iters_) {
     ScanSpec *spec_copy = spec != NULL ? scan_spec_copies_.Construct(*spec) : NULL;
     RETURN_NOT_OK(PredicateEvaluatingIterator::InitAndMaybeWrap(&iter, spec_copy));
   }
@@ -354,7 +353,7 @@ Status UnionIterator::InitSubIterators(ScanSpec *spec) {
 
 bool UnionIterator::HasNext() const {
   CHECK(initted_);
-  BOOST_FOREACH(const shared_ptr<RowwiseIterator> &iter, iters_) {
+  for (const shared_ptr<RowwiseIterator> &iter : iters_) {
     if (iter->HasNext()) return true;
   }
 
@@ -394,7 +393,7 @@ string UnionIterator::ToString() const {
   string s;
   s.append("Union(");
   bool first = true;
-  BOOST_FOREACH(const shared_ptr<RowwiseIterator> &iter, iters_) {
+  for (const shared_ptr<RowwiseIterator> &iter : iters_) {
     if (!first) {
       s.append(", ");
     }
@@ -408,14 +407,14 @@ string UnionIterator::ToString() const {
 void UnionIterator::GetIteratorStats(std::vector<IteratorStats>* stats) const {
   CHECK(initted_);
   vector<vector<IteratorStats> > stats_by_iter;
-  BOOST_FOREACH(const shared_ptr<RowwiseIterator>& iter, all_iters_) {
+  for (const shared_ptr<RowwiseIterator>& iter : all_iters_) {
     vector<IteratorStats> stats_for_iter;
     iter->GetIteratorStats(&stats_for_iter);
     stats_by_iter.push_back(stats_for_iter);
   }
   for (size_t idx = 0; idx < schema_->num_columns(); ++idx) {
     IteratorStats stats_for_col;
-    BOOST_FOREACH(const vector<IteratorStats>& stats_for_iter, stats_by_iter) {
+    for (const vector<IteratorStats>& stats_for_iter : stats_by_iter) {
       stats_for_col.AddStats(stats_for_iter[idx]);
     }
     stats->push_back(stats_for_col);
@@ -504,15 +503,15 @@ Status MaterializingIterator::MaterializeBlock(RowBlock *dst) {
 
   bool short_circuit = false;
 
-  BOOST_FOREACH(size_t col_idx, materialization_order_) {
+  for (size_t col_idx : materialization_order_) {
     // Materialize the column itself into the row block.
     ColumnBlock dst_col(dst->column_block(col_idx));
     RETURN_NOT_OK(iter_->MaterializeColumn(col_idx, &dst_col));
 
     // Evaluate any predicates that apply to this column.
-    typedef std::pair<size_t, ColumnRangePredicate> MapEntry;
-    BOOST_FOREACH(const MapEntry &entry, preds_by_column_.equal_range(col_idx)) {
-      const ColumnRangePredicate &pred = entry.second;
+    auto range = preds_by_column_.equal_range(col_idx);
+    for (auto it = range.first; it != range.second; ++it) {
+      const ColumnRangePredicate &pred = it->second;
 
       pred.Evaluate(dst, dst->selection_vector());
 
@@ -579,7 +578,7 @@ bool PredicateEvaluatingIterator::HasNext() const {
 Status PredicateEvaluatingIterator::NextBlock(RowBlock *dst) {
   RETURN_NOT_OK(base_iter_->NextBlock(dst));
 
-  BOOST_FOREACH(ColumnRangePredicate &pred, predicates_) {
+  for (ColumnRangePredicate &pred : predicates_) {
     pred.Evaluate(dst, dst->selection_vector());
 
     // If after evaluating this predicate, the entire row block has now been

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/common/partition-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/partition-test.cc b/src/kudu/common/partition-test.cc
index bf24a4a..4af83c4 100644
--- a/src/kudu/common/partition-test.cc
+++ b/src/kudu/common/partition-test.cc
@@ -39,7 +39,7 @@ void AddHashBucketComponent(PartitionSchemaPB* partition_schema_pb,
                             uint32_t num_buckets, int32_t seed) {
   PartitionSchemaPB::HashBucketSchemaPB* hash_bucket_schema =
       partition_schema_pb->add_hash_bucket_schemas();
-  BOOST_FOREACH(const string& column, columns) {
+  for (const string& column : columns) {
     hash_bucket_schema->add_columns()->set_name(column);
   }
   hash_bucket_schema->set_num_buckets(num_buckets);
@@ -50,7 +50,7 @@ void SetRangePartitionComponent(PartitionSchemaPB* partition_schema_pb,
                                 const vector<string>& columns) {
   PartitionSchemaPB::RangeSchemaPB* range_schema = partition_schema_pb->mutable_range_schema();
   range_schema->Clear();
-  BOOST_FOREACH(const string& column, columns) {
+  for (const string& column : columns) {
     range_schema->add_columns()->set_name(column);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/common/partition.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/partition.cc b/src/kudu/common/partition.cc
index 8a30640..14de73e 100644
--- a/src/kudu/common/partition.cc
+++ b/src/kudu/common/partition.cc
@@ -18,7 +18,6 @@
 #include "kudu/common/partition.h"
 
 #include <algorithm>
-#include <boost/foreach.hpp>
 #include <set>
 
 #include "kudu/common/partial_row.h"
@@ -64,7 +63,7 @@ Slice Partition::range_key(const string& partition_key) const {
 void Partition::ToPB(PartitionPB* pb) const {
   pb->Clear();
   pb->mutable_hash_buckets()->Reserve(hash_buckets_.size());
-  BOOST_FOREACH(int32_t bucket, hash_buckets()) {
+  for (int32_t bucket : hash_buckets()) {
     pb->add_hash_buckets(bucket);
   }
   pb->set_partition_key_start(partition_key_start());
@@ -74,7 +73,7 @@ void Partition::ToPB(PartitionPB* pb) const {
 void Partition::FromPB(const PartitionPB& pb, Partition* partition) {
   partition->hash_buckets_.clear();
   partition->hash_buckets_.reserve(pb.hash_buckets_size());
-  BOOST_FOREACH(int32_t hash_bucket, pb.hash_buckets()) {
+  for (int32_t hash_bucket : pb.hash_buckets()) {
     partition->hash_buckets_.push_back(hash_bucket);
   }
 
@@ -88,7 +87,7 @@ Status ExtractColumnIds(const RepeatedPtrField<PartitionSchemaPB_ColumnIdentifie
                         const Schema& schema,
                         vector<ColumnId>* column_ids) {
     column_ids->reserve(identifiers.size());
-    BOOST_FOREACH(PartitionSchemaPB_ColumnIdentifierPB identifier, identifiers) {
+    for (PartitionSchemaPB_ColumnIdentifierPB identifier : identifiers) {
       switch (identifier.identifier_case()) {
         case PartitionSchemaPB_ColumnIdentifierPB::kId: {
           ColumnId column_id(identifier.id());
@@ -115,7 +114,7 @@ Status ExtractColumnIds(const RepeatedPtrField<PartitionSchemaPB_ColumnIdentifie
 void SetColumnIdentifiers(const vector<ColumnId>& column_ids,
                           RepeatedPtrField<PartitionSchemaPB_ColumnIdentifierPB>* identifiers) {
     identifiers->Reserve(column_ids.size());
-    BOOST_FOREACH(ColumnId column_id, column_ids) {
+    for (ColumnId column_id : column_ids) {
       identifiers->Add()->set_id(column_id);
     }
 }
@@ -126,8 +125,7 @@ Status PartitionSchema::FromPB(const PartitionSchemaPB& pb,
                                PartitionSchema* partition_schema) {
   partition_schema->Clear();
 
-  BOOST_FOREACH(const PartitionSchemaPB_HashBucketSchemaPB& hash_bucket_pb,
-                pb.hash_bucket_schemas()) {
+  for (const PartitionSchemaPB_HashBucketSchemaPB& hash_bucket_pb : pb.hash_bucket_schemas()) {
     HashBucketSchema hash_bucket;
     RETURN_NOT_OK(ExtractColumnIds(hash_bucket_pb.columns(), schema, &hash_bucket.column_ids));
 
@@ -161,7 +159,7 @@ Status PartitionSchema::FromPB(const PartitionSchemaPB& pb,
 void PartitionSchema::ToPB(PartitionSchemaPB* pb) const {
   pb->Clear();
   pb->mutable_hash_bucket_schemas()->Reserve(hash_bucket_schemas_.size());
-  BOOST_FOREACH(const HashBucketSchema& hash_bucket, hash_bucket_schemas_) {
+  for (const HashBucketSchema& hash_bucket : hash_bucket_schemas_) {
     PartitionSchemaPB_HashBucketSchemaPB* hash_bucket_pb = pb->add_hash_bucket_schemas();
     SetColumnIdentifiers(hash_bucket.column_ids, hash_bucket_pb->mutable_columns());
     hash_bucket_pb->set_num_buckets(hash_bucket.num_buckets);
@@ -174,7 +172,7 @@ void PartitionSchema::ToPB(PartitionSchemaPB* pb) const {
 Status PartitionSchema::EncodeKey(const KuduPartialRow& row, string* buf) const {
   const KeyEncoder<string>& hash_encoder = GetKeyEncoder<string>(GetTypeInfo(UINT32));
 
-  BOOST_FOREACH(const HashBucketSchema& hash_bucket_schema, hash_bucket_schemas_) {
+  for (const HashBucketSchema& hash_bucket_schema : hash_bucket_schemas_) {
     int32_t bucket;
     RETURN_NOT_OK(BucketForRow(row, hash_bucket_schema, &bucket));
     hash_encoder.Encode(&bucket, buf);
@@ -186,7 +184,7 @@ Status PartitionSchema::EncodeKey(const KuduPartialRow& row, string* buf) const
 Status PartitionSchema::EncodeKey(const ConstContiguousRow& row, string* buf) const {
   const KeyEncoder<string>& hash_encoder = GetKeyEncoder<string>(GetTypeInfo(UINT32));
 
-  BOOST_FOREACH(const HashBucketSchema& hash_bucket_schema, hash_bucket_schemas_) {
+  for (const HashBucketSchema& hash_bucket_schema : hash_bucket_schemas_) {
     int32_t bucket;
     RETURN_NOT_OK(BucketForRow(row, hash_bucket_schema, &bucket));
     hash_encoder.Encode(&bucket, buf);
@@ -202,11 +200,11 @@ Status PartitionSchema::CreatePartitions(const vector<KuduPartialRow>& split_row
 
   // Create a partition per hash bucket combination.
   *partitions = vector<Partition>(1);
-  BOOST_FOREACH(const HashBucketSchema& bucket_schema, hash_bucket_schemas_) {
+  for (const HashBucketSchema& bucket_schema : hash_bucket_schemas_) {
     vector<Partition> new_partitions;
     // For each of the partitions created so far, replicate it
     // by the number of buckets in the next hash bucketing component
-    BOOST_FOREACH(const Partition& base_partition, *partitions) {
+    for (const Partition& base_partition : *partitions) {
       for (int32_t bucket = 0; bucket < bucket_schema.num_buckets; bucket++) {
         Partition partition = base_partition;
         partition.hash_buckets_.push_back(bucket);
@@ -219,7 +217,7 @@ Status PartitionSchema::CreatePartitions(const vector<KuduPartialRow>& split_row
   }
 
   unordered_set<int> range_column_idxs;
-  BOOST_FOREACH(ColumnId column_id, range_schema_.column_ids) {
+  for (ColumnId column_id : range_schema_.column_ids) {
     int column_idx = schema.find_column_by_id(column_id);
     if (column_idx == Schema::kColumnNotFound) {
       return Status::InvalidArgument(Substitute("Range partition column ID $0 "
@@ -234,7 +232,7 @@ Status PartitionSchema::CreatePartitions(const vector<KuduPartialRow>& split_row
   // Create the start range keys.
   set<string> start_keys;
   string start_key;
-  BOOST_FOREACH(const KuduPartialRow& row, split_rows) {
+  for (const KuduPartialRow& row : split_rows) {
     int column_count = 0;
     for (int column_idx = 0; column_idx < schema.num_columns(); column_idx++) {
       const ColumnSchema& column = schema.column(column_idx);
@@ -265,10 +263,10 @@ Status PartitionSchema::CreatePartitions(const vector<KuduPartialRow>& split_row
 
   // Create a partition per range and hash bucket combination.
   vector<Partition> new_partitions;
-  BOOST_FOREACH(const Partition& base_partition, *partitions) {
+  for (const Partition& base_partition : *partitions) {
     start_key.clear();
 
-    BOOST_FOREACH(const string& end_key, start_keys) {
+    for (const string& end_key : start_keys) {
       Partition partition = base_partition;
       partition.partition_key_start_.append(start_key);
       partition.partition_key_end_.append(end_key);
@@ -300,7 +298,7 @@ Status PartitionSchema::CreatePartitions(const vector<KuduPartialRow>& split_row
   // the absolute start and end case, these holes are filled by clearing the
   // partition key beginning at the hash component. For a concrete example,
   // see PartitionTest::TestCreatePartitions.
-  BOOST_FOREACH(Partition& partition, *partitions) {
+  for (Partition& partition : *partitions) {
     if (partition.range_key_start().empty()) {
       for (int i = partition.hash_buckets().size() - 1; i >= 0; i--) {
         if (partition.hash_buckets()[i] != 0) {
@@ -425,7 +423,7 @@ string PartitionSchema::PartitionDebugString(const Partition& partition,
 
   if (!partition.hash_buckets().empty()) {
     vector<string> components;
-    BOOST_FOREACH(int32_t bucket, partition.hash_buckets()) {
+    for (int32_t bucket : partition.hash_buckets()) {
       components.push_back(Substitute("$0", bucket));
     }
     s.append("hash buckets: (");
@@ -476,7 +474,7 @@ void PartitionSchema::AppendRangeDebugStringComponentsOrString(const KuduPartial
                                                                vector<string>* components) const {
   ConstContiguousRow const_row(row.schema(), row.row_data_);
 
-  BOOST_FOREACH(ColumnId column_id, range_schema_.column_ids) {
+  for (ColumnId column_id : range_schema_.column_ids) {
     string column;
     int32_t column_idx = row.schema()->find_column_by_id(column_id);
     if (column_idx == Schema::kColumnNotFound) {
@@ -500,7 +498,7 @@ void PartitionSchema::AppendRangeDebugStringComponentsOrMin(const KuduPartialRow
                                                             vector<string>* components) const {
   ConstContiguousRow const_row(row.schema(), row.row_data_);
 
-  BOOST_FOREACH(ColumnId column_id, range_schema_.column_ids) {
+  for (ColumnId column_id : range_schema_.column_ids) {
     string column;
     int32_t column_idx = row.schema()->find_column_by_id(column_id);
     if (column_idx == Schema::kColumnNotFound) {
@@ -525,7 +523,7 @@ void PartitionSchema::AppendRangeDebugStringComponentsOrMin(const KuduPartialRow
 string PartitionSchema::RowDebugString(const ConstContiguousRow& row) const {
   vector<string> components;
 
-  BOOST_FOREACH(const HashBucketSchema& hash_bucket_schema, hash_bucket_schemas_) {
+  for (const HashBucketSchema& hash_bucket_schema : hash_bucket_schemas_) {
     int32_t bucket;
     Status s = BucketForRow(row, hash_bucket_schema, &bucket);
     if (s.ok()) {
@@ -535,7 +533,7 @@ string PartitionSchema::RowDebugString(const ConstContiguousRow& row) const {
     }
   }
 
-  BOOST_FOREACH(ColumnId column_id, range_schema_.column_ids) {
+  for (ColumnId column_id : range_schema_.column_ids) {
     string column;
     int32_t column_idx = row.schema()->find_column_by_id(column_id);
     if (column_idx == Schema::kColumnNotFound) {
@@ -552,7 +550,7 @@ string PartitionSchema::RowDebugString(const ConstContiguousRow& row) const {
 string PartitionSchema::RowDebugString(const KuduPartialRow& row) const {
   vector<string> components;
 
-  BOOST_FOREACH(const HashBucketSchema& hash_bucket_schema, hash_bucket_schemas_) {
+  for (const HashBucketSchema& hash_bucket_schema : hash_bucket_schemas_) {
     int32_t bucket;
     Status s = BucketForRow(row, hash_bucket_schema, &bucket);
     if (s.ok()) {
@@ -578,7 +576,7 @@ string PartitionSchema::PartitionKeyDebugString(const string& key, const Schema&
     if (!s.ok()) {
       return Substitute("<hash-decode-error: $0>", s.ToString());
     }
-    BOOST_FOREACH(int32_t bucket, buckets) {
+    for (int32_t bucket : buckets) {
       components.push_back(Substitute("bucket=$0", bucket));
     }
   }
@@ -604,7 +602,7 @@ namespace {
 string ColumnIdsToColumnNames(const Schema& schema,
                               const vector<ColumnId> column_ids) {
   vector<string> names;
-  BOOST_FOREACH(ColumnId column_id, column_ids) {
+  for (ColumnId column_id : column_ids) {
     names.push_back(schema.column(schema.find_column_by_id(column_id)).name());
   }
 
@@ -617,7 +615,7 @@ string PartitionSchema::DebugString(const Schema& schema) const {
 
   if (!hash_bucket_schemas_.empty()) {
     vector<string> hash_components;
-    BOOST_FOREACH(const HashBucketSchema& hash_bucket_schema, hash_bucket_schemas_) {
+    for (const HashBucketSchema& hash_bucket_schema : hash_bucket_schemas_) {
       string component;
       component.append(Substitute("(bucket count: $0", hash_bucket_schema.num_buckets));
       if (hash_bucket_schema.seed != 0) {
@@ -743,7 +741,7 @@ void PartitionSchema::Clear() {
 
 Status PartitionSchema::Validate(const Schema& schema) const {
   set<ColumnId> hash_columns;
-  BOOST_FOREACH(const PartitionSchema::HashBucketSchema& hash_schema, hash_bucket_schemas_) {
+  for (const PartitionSchema::HashBucketSchema& hash_schema : hash_bucket_schemas_) {
     if (hash_schema.num_buckets < 2) {
       return Status::InvalidArgument("must have at least two hash buckets");
     }
@@ -752,7 +750,7 @@ Status PartitionSchema::Validate(const Schema& schema) const {
       return Status::InvalidArgument("must have at least one hash column");
     }
 
-    BOOST_FOREACH(ColumnId hash_column, hash_schema.column_ids) {
+    for (ColumnId hash_column : hash_schema.column_ids) {
       if (!hash_columns.insert(hash_column).second) {
         return Status::InvalidArgument("hash bucket schema components must not "
                                        "contain columns in common");
@@ -768,7 +766,7 @@ Status PartitionSchema::Validate(const Schema& schema) const {
     }
   }
 
-  BOOST_FOREACH(ColumnId column_id, range_schema_.column_ids) {
+  for (ColumnId column_id : range_schema_.column_ids) {
     int32_t column_idx = schema.find_column_by_id(column_id);
     if (column_idx == Schema::kColumnNotFound) {
       return Status::InvalidArgument("must specify existing columns for range "

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/common/predicate_encoder.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/predicate_encoder.cc b/src/kudu/common/predicate_encoder.cc
index c693fa9..436cfe3 100644
--- a/src/kudu/common/predicate_encoder.cc
+++ b/src/kudu/common/predicate_encoder.cc
@@ -111,7 +111,7 @@ void RangePredicateEncoder::EncodeRangePredicates(ScanSpec *spec, bool erase_pus
       memcpy(upper_key.mutable_cell_ptr(n_pushed), key_bounds[n_pushed].upper, size);
       upper_len++;
     }
-    BOOST_FOREACH(int pred_idx, key_bounds[n_pushed].orig_predicate_indexes) {
+    for (int pred_idx : key_bounds[n_pushed].orig_predicate_indexes) {
       was_pushed[pred_idx] = true;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/common/rowblock.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/rowblock.cc b/src/kudu/common/rowblock.cc
index 21111ca..13ec37b 100644
--- a/src/kudu/common/rowblock.cc
+++ b/src/kudu/common/rowblock.cc
@@ -98,10 +98,10 @@ RowBlock::RowBlock(const Schema &schema,
 }
 
 RowBlock::~RowBlock() {
-  BOOST_FOREACH(uint8_t *column_data, columns_data_) {
+  for (uint8_t *column_data : columns_data_) {
     delete[] column_data;
   }
-  BOOST_FOREACH(uint8_t *bitmap_data, column_null_bitmaps_) {
+  for (uint8_t *bitmap_data : column_null_bitmaps_) {
     delete[] bitmap_data;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/common/scan_spec.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/scan_spec.cc b/src/kudu/common/scan_spec.cc
index 3e953d0..9a24328 100644
--- a/src/kudu/common/scan_spec.cc
+++ b/src/kudu/common/scan_spec.cc
@@ -82,7 +82,7 @@ string ScanSpec::ToStringWithOptionalSchema(const Schema* s) const {
     }
   }
 
-  BOOST_FOREACH(const ColumnRangePredicate& pred, predicates_) {
+  for (const ColumnRangePredicate& pred : predicates_) {
     preds.push_back(pred.ToString());
   }
   return JoinStrings(preds, "\n");

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9daafa5e/src/kudu/common/schema-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/schema-test.cc b/src/kudu/common/schema-test.cc
index cb63ffa..b29f04d 100644
--- a/src/kudu/common/schema-test.cc
+++ b/src/kudu/common/schema-test.cc
@@ -293,7 +293,7 @@ TEST(TestKeyEncoder, TestKeyEncoder) {
                             Slice("xxx" "\x00\x01" "yyy" "\x00\x00" "bar", 13)));
 
   int i = 0;
-  BOOST_FOREACH(const test_pair &t, pairs) {
+  for (const test_pair &t : pairs) {
     const vector<Slice> &in = std::get<0>(t);
     Slice expected = std::get<1>(t);
 


Mime
View raw message