kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject incubator-kudu git commit: use auto keyword where appropriate
Date Wed, 20 Jan 2016 01:43:26 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 4bff0cc3c -> 309afa48b


use auto keyword where appropriate

This patch was created using the clang-modernize use-auto transform tool. The
tool replaces type declarations with the auto keyword whenever the type would
be duplicated (e.g., `T* foo = new T;` -> `auto foo = new T`), or the type is a
standard iterator. See http://clang.llvm.org/extra/UseAutoTransform.html
for more examples.

Change-Id: Ie0196010c6c0d6ee994cd079ae63fc921ba1d990
Reviewed-on: http://gerrit.cloudera.org:8080/1803
Tested-by: Internal Jenkins
Reviewed-by: Dan Burkert <dan@cloudera.com>


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

Branch: refs/heads/master
Commit: 309afa48b8316cc4304852ac5e073bf60616e363
Parents: 4bff0cc
Author: Dan Burkert <dan@cloudera.com>
Authored: Tue Nov 24 15:54:18 2015 -0800
Committer: Dan Burkert <dan@cloudera.com>
Committed: Wed Jan 20 01:43:00 2016 +0000

----------------------------------------------------------------------
 src/kudu/benchmarks/tpch/tpch1.cc               |  6 ++---
 src/kudu/cfile/encoding-test.cc                 |  4 ++--
 src/kudu/client/client.cc                       |  2 +-
 src/kudu/client/meta_cache.cc                   |  2 +-
 src/kudu/client/schema.cc                       |  2 +-
 src/kudu/client/value.cc                        | 12 +++++-----
 src/kudu/common/encoded_key.cc                  |  2 +-
 src/kudu/common/generic_iterators.cc            |  3 +--
 src/kudu/common/partial_row.cc                  |  8 +++----
 src/kudu/common/schema.h                        |  2 +-
 src/kudu/common/types.h                         |  2 +-
 src/kudu/consensus/consensus-test-util.h        |  2 +-
 src/kudu/consensus/consensus_peers-test.cc      |  9 ++++----
 src/kudu/consensus/consensus_queue.cc           |  6 ++---
 src/kudu/consensus/leader_election-test.cc      |  7 +++---
 src/kudu/consensus/log_anchor_registry.cc       |  4 ++--
 src/kudu/consensus/log_cache.cc                 |  7 +++---
 src/kudu/consensus/log_index.cc                 |  5 ++--
 src/kudu/consensus/log_reader.cc                |  2 +-
 src/kudu/consensus/mt-log-test.cc               |  2 +-
 src/kudu/consensus/peer_manager.cc              | 17 +++++++-------
 src/kudu/consensus/raft_consensus-test.cc       |  2 +-
 src/kudu/consensus/raft_consensus.cc            |  6 ++---
 .../consensus/raft_consensus_quorum-test.cc     |  4 ++--
 src/kudu/consensus/raft_consensus_state.cc      |  6 ++---
 src/kudu/gutil/map-util.h                       | 24 ++++++++++----------
 src/kudu/gutil/ref_counted_memory.cc            |  4 ++--
 src/kudu/gutil/stringprintf.cc                  |  2 +-
 src/kudu/gutil/strings/join.cc                  |  2 +-
 src/kudu/gutil/strings/split.cc                 |  2 +-
 src/kudu/gutil/strings/util.cc                  |  4 ++--
 src/kudu/gutil/walltime.cc                      |  2 +-
 .../alter_table-randomized-test.cc              |  4 ++--
 .../external_mini_cluster_fs_inspector.cc       |  2 +-
 .../integration-tests/linked_list-test-util.h   |  2 +-
 .../integration-tests/raft_consensus-itest.cc   |  4 +---
 src/kudu/integration-tests/ts_itest-base.h      |  2 +-
 src/kudu/master/catalog_manager.cc              |  7 ++----
 src/kudu/master/sys_catalog.cc                  |  3 +--
 src/kudu/rpc/auth_store.cc                      |  2 +-
 src/kudu/rpc/connection.cc                      |  3 +--
 src/kudu/rpc/protoc-gen-krpc.cc                 |  2 +-
 src/kudu/rpc/reactor.cc                         | 14 ++++++------
 src/kudu/rpc/rpc-bench.cc                       |  2 +-
 src/kudu/rpc/rpc-test.cc                        |  2 +-
 src/kudu/rpc/rpc_stub-test.cc                   |  4 ++--
 src/kudu/server/pprof-path-handlers.cc          |  4 ++--
 src/kudu/server/webserver.cc                    |  2 +-
 src/kudu/tablet/compaction.cc                   |  4 +---
 src/kudu/tablet/delta_tracker.cc                |  2 +-
 src/kudu/tablet/lock_manager.cc                 |  2 +-
 src/kudu/tablet/maintenance_manager.cc          |  2 +-
 src/kudu/tablet/mutation.h                      |  2 +-
 src/kudu/tablet/mvcc.cc                         |  6 ++---
 src/kudu/tablet/rowset_metadata.cc              |  7 +++---
 src/kudu/tablet/tablet-test-util.h              |  2 +-
 src/kudu/tablet/tablet_bootstrap.cc             |  4 ++--
 src/kudu/tablet/tablet_metadata.cc              |  2 +-
 src/kudu/tablet/tablet_peer-test.cc             |  6 ++---
 .../tserver/remote_bootstrap_session-test.cc    |  3 +--
 src/kudu/tserver/scanners.cc                    |  3 +--
 src/kudu/tserver/tablet_service.cc              |  3 +--
 src/kudu/tserver/ts_tablet_manager.cc           |  2 +-
 src/kudu/util/cache.cc                          |  2 +-
 src/kudu/util/crc-test.cc                       |  2 +-
 src/kudu/util/debug/trace_event_impl.cc         | 20 ++++++----------
 src/kudu/util/env_posix.cc                      |  2 +-
 src/kudu/util/flag_tags.cc                      |  4 +---
 src/kudu/util/memenv/memenv.cc                  |  4 ++--
 src/kudu/util/metrics.cc                        |  6 ++---
 src/kudu/util/mt-hdr_histogram-test.cc          |  4 ++--
 src/kudu/util/mt-metrics-test.cc                |  6 ++---
 src/kudu/util/object_pool.h                     |  2 +-
 src/kudu/util/slice-test.cc                     |  2 +-
 src/kudu/util/status.cc                         |  4 ++--
 src/kudu/util/thread.cc                         |  4 ++--
 76 files changed, 152 insertions(+), 183 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/benchmarks/tpch/tpch1.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/tpch1.cc b/src/kudu/benchmarks/tpch/tpch1.cc
index b9675c9..f96f56b 100644
--- a/src/kudu/benchmarks/tpch/tpch1.cc
+++ b/src/kudu/benchmarks/tpch/tpch1.cc
@@ -117,7 +117,7 @@ struct SliceMapKey {
 
   // This copies the string out of the result buffer
   void RelocateSlice() {
-    uint8_t *buf = new uint8_t[slice.size()];
+    auto buf = new uint8_t[slice.size()];
     slice.relocate(buf);
   }
 
@@ -180,7 +180,7 @@ void Tpch1(RpcLineItemDAO *dao) {
       CHECK_OK(row.GetDouble(6, &l_tax));
 
       slice_map *linestatus_map;
-      slice_map_map::iterator it = results.find(l_returnflag);
+      auto it = results.find(l_returnflag);
       if (it == results.end()) {
         linestatus_map = new slice_map;
         l_returnflag.RelocateSlice();
@@ -189,7 +189,7 @@ void Tpch1(RpcLineItemDAO *dao) {
         linestatus_map = it->second;
       }
 
-      slice_map::iterator inner_it = linestatus_map->find(l_linestatus);
+      auto inner_it = linestatus_map->find(l_linestatus);
       if (inner_it == linestatus_map->end()) {
         r = new Result();
         l_linestatus.RelocateSlice();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/cfile/encoding-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/encoding-test.cc b/src/kudu/cfile/encoding-test.cc
index f1a83c5..10e8eef 100644
--- a/src/kudu/cfile/encoding-test.cc
+++ b/src/kudu/cfile/encoding-test.cc
@@ -97,7 +97,7 @@ class TestEncoding : public ::testing::Test {
   }
 
   WriterOptions* NewWriterOptions() {
-    WriterOptions* ret = new WriterOptions();
+    auto ret = new WriterOptions();
     ret->storage_attributes.cfile_block_size = 256 * 1024;
     return ret;
   }
@@ -640,7 +640,7 @@ TEST_F(TestEncoding, TestIntBlockEncoder) {
   gscoped_ptr<WriterOptions> opts(NewWriterOptions());
   GVIntBlockBuilder ibb(opts.get());
 
-  int *ints = new int[10000];
+  auto ints = new int[10000];
   for (int i = 0; i < 10000; i++) {
     ints[i] = random();
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/client/client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.cc b/src/kudu/client/client.cc
index bafbadc..e38a47e 100644
--- a/src/kudu/client/client.cc
+++ b/src/kudu/client/client.cc
@@ -299,7 +299,7 @@ Status KuduClient::ListTabletServers(vector<KuduTabletServer*>* tablet_servers)
   }
   for (int i = 0; i < resp.servers_size(); i++) {
     const ListTabletServersResponsePB_Entry& e = resp.servers(i);
-    KuduTabletServer* ts = new KuduTabletServer();
+    auto ts = new KuduTabletServer();
     ts->data_ = new KuduTabletServer::Data(e.instance_id().permanent_uuid(),
                                            e.registration().rpc_addresses(0).host());
     tablet_servers->push_back(ts);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/client/meta_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/meta_cache.cc b/src/kudu/client/meta_cache.cc
index 79a992f..fbc4856 100644
--- a/src/kudu/client/meta_cache.cc
+++ b/src/kudu/client/meta_cache.cc
@@ -114,7 +114,7 @@ void RemoteTabletServer::RefreshProxy(KuduClient* client,
     hp = rpc_hostports_[0];
   }
 
-  vector<Sockaddr>* addrs = new vector<Sockaddr>();
+  auto addrs = new vector<Sockaddr>();
   client->data_->dns_resolver_->ResolveAddresses(
     hp, addrs, Bind(&RemoteTabletServer::DnsResolutionFinished,
                     Unretained(this), hp, addrs, client, cb));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/client/schema.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/schema.cc b/src/kudu/client/schema.cc
index 9f57df0..ef5f5e3 100644
--- a/src/kudu/client/schema.cc
+++ b/src/kudu/client/schema.cc
@@ -291,7 +291,7 @@ KuduSchemaBuilder::~KuduSchemaBuilder() {
 }
 
 KuduColumnSpec* KuduSchemaBuilder::AddColumn(const std::string& name) {
-  KuduColumnSpec* c = new KuduColumnSpec(name);
+  auto c = new KuduColumnSpec(name);
   data_->specs.push_back(c);
   return c;
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/client/value.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/value.cc b/src/kudu/client/value.cc
index 52d34f8..7971748 100644
--- a/src/kudu/client/value.cc
+++ b/src/kudu/client/value.cc
@@ -52,7 +52,7 @@ KuduValue* KuduValue::Clone() const {
 }
 
 KuduValue* KuduValue::FromInt(int64_t v) {
-  Data* d = new Data;
+  auto d = new Data;
   d->type_ = Data::INT;
   d->int_val_ = v;
 
@@ -60,7 +60,7 @@ KuduValue* KuduValue::FromInt(int64_t v) {
 }
 
 KuduValue* KuduValue::FromDouble(double v) {
-  Data* d = new Data;
+  auto d = new Data;
   d->type_ = Data::DOUBLE;
   d->double_val_ = v;
 
@@ -69,7 +69,7 @@ KuduValue* KuduValue::FromDouble(double v) {
 
 
 KuduValue* KuduValue::FromFloat(float v) {
-  Data* d = new Data;
+  auto d = new Data;
   d->type_ = Data::FLOAT;
   d->float_val_ = v;
 
@@ -77,7 +77,7 @@ KuduValue* KuduValue::FromFloat(float v) {
 }
 
 KuduValue* KuduValue::FromBool(bool v) {
-  Data* d = new Data;
+  auto d = new Data;
   d->type_ = Data::INT;
   d->int_val_ = v ? 1 : 0;
 
@@ -85,10 +85,10 @@ KuduValue* KuduValue::FromBool(bool v) {
 }
 
 KuduValue* KuduValue::CopyString(Slice s) {
-  uint8_t* copy = new uint8_t[s.size()];
+  auto copy = new uint8_t[s.size()];
   memcpy(copy, s.data(), s.size());
 
-  Data* d = new Data;
+  auto d = new Data;
   d->type_ = Data::SLICE;
   d->slice_val_ = Slice(copy, s.size());
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/common/encoded_key.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/encoded_key.cc b/src/kudu/common/encoded_key.cc
index 888d109..e4ea027 100644
--- a/src/kudu/common/encoded_key.cc
+++ b/src/kudu/common/encoded_key.cc
@@ -162,7 +162,7 @@ EncodedKey *EncodedKeyBuilder::BuildEncodedKey() {
   if (idx_ == 0) {
     return nullptr;
   }
-  EncodedKey *ret = new EncodedKey(&encoded_key_, &raw_keys_, num_key_cols_);
+  auto ret = new EncodedKey(&encoded_key_, &raw_keys_, num_key_cols_);
   idx_ = 0;
   return ret;
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/common/generic_iterators.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/generic_iterators.cc b/src/kudu/common/generic_iterators.cc
index 8d7651c..6a0cbc0 100644
--- a/src/kudu/common/generic_iterators.cc
+++ b/src/kudu/common/generic_iterators.cc
@@ -436,8 +436,7 @@ Status MaterializingIterator::Init(ScanSpec *spec) {
   if (spec != nullptr && !disallow_pushdown_for_tests_) {
     // Gather any single-column predicates.
     ScanSpec::PredicateList *preds = spec->mutable_predicates();
-    for (ScanSpec::PredicateList::iterator iter = preds->begin();
-         iter != preds->end();) {
+    for (auto iter = preds->begin(); iter != preds->end();) {
       const ColumnRangePredicate &pred = *iter;
       const string &col_name = pred.column().name();
       int idx = schema().find_column(col_name);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/common/partial_row.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/partial_row.cc b/src/kudu/common/partial_row.cc
index 035657e..7f6bff9 100644
--- a/src/kudu/common/partial_row.cc
+++ b/src/kudu/common/partial_row.cc
@@ -50,7 +50,7 @@ KuduPartialRow::KuduPartialRow(const Schema* schema)
   size_t column_bitmap_size = BitmapSize(schema_->num_columns());
   size_t row_size = ContiguousRowHelper::row_size(*schema);
 
-  uint8_t* dst = new uint8_t[2 * column_bitmap_size + row_size];
+  auto dst = new uint8_t[2 * column_bitmap_size + row_size];
   isset_bitmap_ = dst;
   owned_strings_bitmap_ = isset_bitmap_ + column_bitmap_size;
 
@@ -90,7 +90,7 @@ KuduPartialRow::KuduPartialRow(const KuduPartialRow& other)
     if (BitmapTest(owned_strings_bitmap_, col_idx)) {
       ContiguousRow row(schema_, row_data_);
       Slice* slice = reinterpret_cast<Slice*>(row.mutable_cell_ptr(col_idx));
-      uint8_t* data = new uint8_t[slice->size()];
+      auto data = new uint8_t[slice->size()];
       slice->relocate(data);
     }
   }
@@ -299,7 +299,7 @@ Status KuduPartialRow::SetStringCopy(int col_idx, const Slice& val) {
 
 template<typename T>
 Status KuduPartialRow::SetSliceCopy(const Slice& col_name, const Slice& val) {
-  uint8_t* relocated = new uint8_t[val.size()];
+  auto relocated = new uint8_t[val.size()];
   memcpy(relocated, val.data(), val.size());
   Slice relocated_val(relocated, val.size());
   Status s = Set<T>(col_name, relocated_val, true);
@@ -311,7 +311,7 @@ Status KuduPartialRow::SetSliceCopy(const Slice& col_name, const Slice& val) {
 
 template<typename T>
 Status KuduPartialRow::SetSliceCopy(int col_idx, const Slice& val) {
-  uint8_t* relocated = new uint8_t[val.size()];
+  auto relocated = new uint8_t[val.size()];
   memcpy(relocated, val.data(), val.size());
   Slice relocated_val(relocated, val.size());
   Status s = Set<T>(col_idx, relocated_val, true);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/common/schema.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/schema.h b/src/kudu/common/schema.h
index 463abec..4641eb7 100644
--- a/src/kudu/common/schema.h
+++ b/src/kudu/common/schema.h
@@ -430,7 +430,7 @@ class Schema {
   // Return the column index corresponding to the given column,
   // or kColumnNotFound if the column is not in this schema.
   int find_column(const StringPiece col_name) const {
-    NameToIndexMap::const_iterator iter = name_to_index_.find(col_name);
+    auto iter = name_to_index_.find(col_name);
     if (PREDICT_FALSE(iter == name_to_index_.end())) {
       return kColumnNotFound;
     } else {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/common/types.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/types.h b/src/kudu/common/types.h
index e53af1b..cf65f6c 100644
--- a/src/kudu/common/types.h
+++ b/src/kudu/common/types.h
@@ -444,7 +444,7 @@ class Variant {
           // set vstr_ to Slice(""). Otherwise, we need to allocate and copy the
           // user's data.
           if (str->size() > 0) {
-            uint8_t *blob = new uint8_t[str->size()];
+            auto blob = new uint8_t[str->size()];
             memcpy(blob, str->data(), str->size());
             vstr_ = Slice(blob, str->size());
           }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/consensus-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus-test-util.h b/src/kudu/consensus/consensus-test-util.h
index e8cb3a8..252246b 100644
--- a/src/kudu/consensus/consensus-test-util.h
+++ b/src/kudu/consensus/consensus-test-util.h
@@ -655,7 +655,7 @@ class TestTransactionFactory : public ReplicaTransactionFactory {
   }
 
   Status StartReplicaTransaction(const scoped_refptr<ConsensusRound>& round) OVERRIDE {
-    TestDriver* txn = new TestDriver(pool_.get(), log_, round);
+    auto txn = new TestDriver(pool_.get(), log_, round);
     txn->round_->SetConsensusReplicatedCallback(Bind(&TestDriver::ReplicationFinished,
                                                      Unretained(txn)));
     return Status::OK();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/consensus_peers-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_peers-test.cc b/src/kudu/consensus/consensus_peers-test.cc
index 9599b93..7e5d536 100644
--- a/src/kudu/consensus/consensus_peers-test.cc
+++ b/src/kudu/consensus/consensus_peers-test.cc
@@ -83,9 +83,8 @@ class ConsensusPeersTest : public KuduTest {
       gscoped_ptr<Peer>* peer) {
     RaftPeerPB peer_pb;
     peer_pb.set_permanent_uuid(peer_name);
-    DelayablePeerProxy<NoOpTestPeerProxy>* proxy_ptr =
-        new DelayablePeerProxy<NoOpTestPeerProxy>(pool_.get(),
-            new NoOpTestPeerProxy(pool_.get(), peer_pb));
+    auto proxy_ptr = new DelayablePeerProxy<NoOpTestPeerProxy>(
+        pool_.get(), new NoOpTestPeerProxy(pool_.get(), peer_pb));
     gscoped_ptr<PeerProxy> proxy(proxy_ptr);
     CHECK_OK(Peer::NewRemotePeer(peer_pb,
                                  kTabletId,
@@ -238,7 +237,7 @@ TEST_F(ConsensusPeersTest, TestCloseWhenRemotePeerDoesntMakeProgress) {
                                 MinimumOpId().term(),
                                 BuildRaftConfigPBForTests(3));
 
-  MockedPeerProxy* mock_proxy = new MockedPeerProxy(pool_.get());
+  auto mock_proxy = new MockedPeerProxy(pool_.get());
   gscoped_ptr<Peer> peer;
   ASSERT_OK(Peer::NewRemotePeer(FakeRaftPeerPB(kFollowerUuid),
                                 kTabletId,
@@ -276,7 +275,7 @@ TEST_F(ConsensusPeersTest, TestDontSendOneRpcPerWriteWhenPeerIsDown) {
                                 MinimumOpId().term(),
                                 BuildRaftConfigPBForTests(3));
 
-  MockedPeerProxy* mock_proxy = new MockedPeerProxy(pool_.get());
+  auto mock_proxy = new MockedPeerProxy(pool_.get());
   gscoped_ptr<Peer> peer;
   ASSERT_OK(Peer::NewRemotePeer(FakeRaftPeerPB(kFollowerUuid),
                                 kTabletId,

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/consensus_queue.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_queue.cc b/src/kudu/consensus/consensus_queue.cc
index 2c1650d..a36d7fe 100644
--- a/src/kudu/consensus/consensus_queue.cc
+++ b/src/kudu/consensus/consensus_queue.cc
@@ -741,8 +741,7 @@ string PeerMessageQueue::ToStringUnlocked() const {
 
 void PeerMessageQueue::RegisterObserver(PeerMessageQueueObserver* observer) {
   boost::lock_guard<simple_spinlock> lock(queue_lock_);
-  std::vector<PeerMessageQueueObserver*>::iterator iter =
-        std::find(observers_.begin(), observers_.end(), observer);
+  auto iter = std::find(observers_.begin(), observers_.end(), observer);
   if (iter == observers_.end()) {
     observers_.push_back(observer);
   }
@@ -750,8 +749,7 @@ void PeerMessageQueue::RegisterObserver(PeerMessageQueueObserver* observer) {
 
 Status PeerMessageQueue::UnRegisterObserver(PeerMessageQueueObserver* observer) {
   boost::lock_guard<simple_spinlock> lock(queue_lock_);
-  std::vector<PeerMessageQueueObserver*>::iterator iter =
-      std::find(observers_.begin(), observers_.end(), observer);
+  auto iter = std::find(observers_.begin(), observers_.end(), observer);
   if (iter == observers_.end()) {
     return Status::NotFound("Can't find observer.");
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/leader_election-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/leader_election-test.cc b/src/kudu/consensus/leader_election-test.cc
index 6349d8f..b629e12 100644
--- a/src/kudu/consensus/leader_election-test.cc
+++ b/src/kudu/consensus/leader_election-test.cc
@@ -146,10 +146,9 @@ void LeaderElectionTest::InitDelayableMockedProxies(bool enable_delay) {
   config_.Clear();
   for (const string& uuid : voter_uuids_) {
     RaftPeerPB* peer_pb = config_.add_peers();
-       peer_pb->set_permanent_uuid(uuid);
-    DelayablePeerProxy<MockedPeerProxy>* proxy =
-        new DelayablePeerProxy<MockedPeerProxy>(pool_.get(),
-                                                new MockedPeerProxy(pool_.get()));
+    peer_pb->set_permanent_uuid(uuid);
+    auto proxy = new DelayablePeerProxy<MockedPeerProxy>(pool_.get(),
+                                                         new MockedPeerProxy(pool_.get()));
     if (enable_delay) {
       proxy->DelayResponse();
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/log_anchor_registry.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_anchor_registry.cc b/src/kudu/consensus/log_anchor_registry.cc
index b139cb8..f858617 100644
--- a/src/kudu/consensus/log_anchor_registry.cc
+++ b/src/kudu/consensus/log_anchor_registry.cc
@@ -69,7 +69,7 @@ Status LogAnchorRegistry::UnregisterIfAnchored(LogAnchor* anchor) {
 
 Status LogAnchorRegistry::GetEarliestRegisteredLogIndex(int64_t* log_index) {
   boost::lock_guard<simple_spinlock> l(lock_);
-  AnchorMultiMap::iterator iter = anchors_.begin();
+  auto iter = anchors_.begin();
   if (iter == anchors_.end()) {
     return Status::NotFound("No anchors in registry");
   }
@@ -118,7 +118,7 @@ Status LogAnchorRegistry::UnregisterUnlocked(LogAnchor* anchor) {
   DCHECK(anchor != nullptr);
   DCHECK(anchor->is_registered);
 
-  AnchorMultiMap::iterator iter = anchors_.find(anchor->log_index);
+  auto iter = anchors_.find(anchor->log_index);
   while (iter != anchors_.end()) {
     if (iter->second == anchor) {
       anchor->is_registered = false;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/log_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_cache.cc b/src/kudu/consensus/log_cache.cc
index 89e4c60..26358df 100644
--- a/src/kudu/consensus/log_cache.cc
+++ b/src/kudu/consensus/log_cache.cc
@@ -95,7 +95,7 @@ LogCache::LogCache(const scoped_refptr<MetricEntity>& metric_entity,
 
   // Put a fake message at index 0, since this simplifies a lot of our
   // code paths elsewhere.
-  ReplicateMsg* zero_op = new ReplicateMsg();
+  auto zero_op = new ReplicateMsg();
   *zero_op->mutable_id() = MinimumOpId();
   InsertOrDie(&cache_, 0, make_scoped_refptr_replicate(zero_op));
 }
@@ -245,7 +245,7 @@ Status LogCache::LookupOpId(int64_t op_index, OpId* op_id) const {
                                            "(next sequential op: $1)",
                                            op_index, next_sequential_op_index_));
     }
-    MessageCache::const_iterator iter = cache_.find(op_index);
+    auto iter = cache_.find(op_index);
     if (iter != cache_.end()) {
       *op_id = iter->second->get()->id();
       return Status::OK();
@@ -355,8 +355,7 @@ void LogCache::EvictSomeUnlocked(int64_t stop_after_index, int64_t bytes_to_evic
                       << ": before state: " << ToStringUnlocked();
 
   int64_t bytes_evicted = 0;
-  for (MessageCache::iterator iter = cache_.begin();
-       iter != cache_.end();) {
+  for (auto iter = cache_.begin(); iter != cache_.end();) {
     const ReplicateRefPtr& msg = (*iter).second;
     VLOG_WITH_PREFIX_UNLOCKED(2) << "considering for eviction: " << msg->get()->id();
     int64_t msg_index = msg->get()->id().index();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/log_index.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_index.cc b/src/kudu/consensus/log_index.cc
index 6da0a9a..51ac6bd 100644
--- a/src/kudu/consensus/log_index.cc
+++ b/src/kudu/consensus/log_index.cc
@@ -242,9 +242,8 @@ void LogIndex::GC(int64_t min_index_to_retain) {
   vector<int64_t> chunks_to_delete;
   {
     lock_guard<simple_spinlock> l(&open_chunks_lock_);
-    for (ChunkMap::iterator it = open_chunks_.begin();
-         it != open_chunks_.lower_bound(min_chunk_to_retain);
-         ++it) {
+    for (auto it = open_chunks_.begin();
+         it != open_chunks_.lower_bound(min_chunk_to_retain); ++it) {
       chunks_to_delete.push_back(it->first);
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/log_reader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_reader.cc b/src/kudu/consensus/log_reader.cc
index 72b9513..3567f54 100644
--- a/src/kudu/consensus/log_reader.cc
+++ b/src/kudu/consensus/log_reader.cc
@@ -403,7 +403,7 @@ Status LogReader::GetSegmentsSnapshot(SegmentSequence* segments) const {
 Status LogReader::TrimSegmentsUpToAndIncluding(int64_t segment_sequence_number) {
   boost::lock_guard<simple_spinlock> lock(lock_);
   CHECK_EQ(state_, kLogReaderReading);
-  SegmentSequence::iterator iter = segments_.begin();
+  auto iter = segments_.begin();
   int num_deleted_segments = 0;
 
   while (iter != segments_.end()) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/mt-log-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/mt-log-test.cc b/src/kudu/consensus/mt-log-test.cc
index 18d57d5..66a8402 100644
--- a/src/kudu/consensus/mt-log-test.cc
+++ b/src/kudu/consensus/mt-log-test.cc
@@ -117,7 +117,7 @@ class MultiThreadedLogTest : public LogTestBase {
 
         ASSERT_OK(log_->Reserve(REPLICATE, entry_batch_pb.Pass(), &entry_batch));
       } // lock_guard scope
-      CustomLatchCallback* cb = new CustomLatchCallback(&latch, &errors);
+      auto cb = new CustomLatchCallback(&latch, &errors);
       entry_batch->SetReplicates(batch_replicates);
       ASSERT_OK(log_->AsyncAppend(entry_batch, cb->AsStatusCallback()));
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/peer_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/peer_manager.cc b/src/kudu/consensus/peer_manager.cc
index 57483d2..8c9174d 100644
--- a/src/kudu/consensus/peer_manager.cc
+++ b/src/kudu/consensus/peer_manager.cc
@@ -86,15 +86,16 @@ Status PeerManager::UpdateRaftConfig(const RaftConfigPB& config) {
 
 void PeerManager::SignalRequest(bool force_if_queue_empty) {
   boost::lock_guard<simple_spinlock> lock(lock_);
-  PeersMap::iterator iter = peers_.begin();
-    for (; iter != peers_.end(); iter++) {
-      Status s = (*iter).second->SignalRequest(force_if_queue_empty);
-      if (PREDICT_FALSE(!s.ok())) {
-        LOG(WARNING) << GetLogPrefix() << "Peer was closed, removing from peers. Peer: "
-            << (*iter).second->peer_pb().ShortDebugString();
-        peers_.erase(iter);
-      }
+  auto iter = peers_.begin();
+  for (; iter != peers_.end(); iter++) {
+    Status s = (*iter).second->SignalRequest(force_if_queue_empty);
+    if (PREDICT_FALSE(!s.ok())) {
+      LOG(WARNING) << GetLogPrefix()
+                   << "Peer was closed, removing from peers. Peer: "
+                   << (*iter).second->peer_pb().ShortDebugString();
+      peers_.erase(iter);
     }
+  }
 }
 
 void PeerManager::Close() {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/raft_consensus-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus-test.cc b/src/kudu/consensus/raft_consensus-test.cc
index ec264be..2761844 100644
--- a/src/kudu/consensus/raft_consensus-test.cc
+++ b/src/kudu/consensus/raft_consensus-test.cc
@@ -439,7 +439,7 @@ TEST_F(RaftConsensusTest, TestPendingTransactions) {
   ConsensusBootstrapInfo info;
   info.last_id.set_term(10);
   for (int i = 0; i < 10; i++) {
-    ReplicateMsg* replicate = new ReplicateMsg();
+    auto replicate = new ReplicateMsg();
     replicate->set_op_type(NO_OP);
     info.last_id.set_index(100 + i);
     replicate->mutable_id()->CopyFrom(info.last_id);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/raft_consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index f03f09f..45567d8 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -447,7 +447,7 @@ Status RaftConsensus::BecomeLeaderUnlocked() {
 
   // Initiate a NO_OP transaction that is sent at the beginning of every term
   // change in raft.
-  ReplicateMsg* replicate = new ReplicateMsg;
+  auto replicate = new ReplicateMsg;
   replicate->set_op_type(NO_OP);
   replicate->mutable_noop_request(); // Define the no-op request field.
 
@@ -1065,7 +1065,7 @@ Status RaftConsensus::UpdateReplica(const ConsensusRequestPB* request,
     TRACE("Triggering prepare for $0 ops", deduped_req.messages.size());
 
     Status prepare_status;
-    std::vector<ReplicateRefPtr>::iterator iter = deduped_req.messages.begin();
+    auto iter = deduped_req.messages.begin();
 
     if (PREDICT_TRUE(deduped_req.messages.size() > 0)) {
       // TODO Temporary until the leader explicitly propagates the safe timestamp.
@@ -1651,7 +1651,7 @@ void RaftConsensus::SetLeaderUuidUnlocked(const string& uuid) {
 Status RaftConsensus::ReplicateConfigChangeUnlocked(const RaftConfigPB& old_config,
                                                     const RaftConfigPB& new_config,
                                                     const StatusCallback& client_cb) {
-  ReplicateMsg* cc_replicate = new ReplicateMsg();
+  auto cc_replicate = new ReplicateMsg();
   cc_replicate->set_op_type(CHANGE_CONFIG_OP);
   ChangeConfigRecordPB* cc_req = cc_replicate->mutable_change_config_record();
   cc_req->set_tablet_id(tablet_id());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/raft_consensus_quorum-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus_quorum-test.cc b/src/kudu/consensus/raft_consensus_quorum-test.cc
index e8fd4f6..1e63861 100644
--- a/src/kudu/consensus/raft_consensus_quorum-test.cc
+++ b/src/kudu/consensus/raft_consensus_quorum-test.cc
@@ -140,10 +140,10 @@ class RaftConsensusQuorumTest : public KuduTest {
   void BuildPeers() {
     vector<LocalTestPeerProxyFactory*> proxy_factories;
     for (int i = 0; i < config_.peers_size(); i++) {
-      LocalTestPeerProxyFactory* proxy_factory = new LocalTestPeerProxyFactory(peers_.get());
+      auto proxy_factory = new LocalTestPeerProxyFactory(peers_.get());
       proxy_factories.push_back(proxy_factory);
 
-      TestTransactionFactory* txn_factory = new TestTransactionFactory(logs_[i].get());
+      auto txn_factory = new TestTransactionFactory(logs_[i].get());
 
       string peer_uuid = Substitute("peer-$0", i);
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/consensus/raft_consensus_state.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus_state.cc b/src/kudu/consensus/raft_consensus_state.cc
index 44aed84..52659b2 100644
--- a/src/kudu/consensus/raft_consensus_state.cc
+++ b/src/kudu/consensus/raft_consensus_state.cc
@@ -401,7 +401,7 @@ Status ReplicaState::AbortOpsAfterUnlocked(int64_t new_preceding_idx) {
   DCHECK_GE(new_preceding_idx, 0);
   OpId new_preceding;
 
-  IndexToRoundMap::iterator iter = pending_txns_.lower_bound(new_preceding_idx);
+  auto iter = pending_txns_.lower_bound(new_preceding_idx);
 
   // Either the new preceding id is in the pendings set or it must be equal to the
   // committed index since we can't truncate already committed operations.
@@ -554,9 +554,9 @@ Status ReplicaState::AdvanceCommittedIndexUnlocked(const OpId& committed_index,
   }
 
   // Start at the operation after the last committed one.
-  IndexToRoundMap::iterator iter = pending_txns_.upper_bound(last_committed_index_.index());
+  auto iter = pending_txns_.upper_bound(last_committed_index_.index());
   // Stop at the operation after the last one we must commit.
-  IndexToRoundMap::iterator end_iter = pending_txns_.upper_bound(committed_index.index());
+  auto end_iter = pending_txns_.upper_bound(committed_index.index());
   CHECK(iter != pending_txns_.end());
 
   VLOG_WITH_PREFIX_UNLOCKED(1) << "Last triggered apply was: "

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/gutil/map-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/map-util.h b/src/kudu/gutil/map-util.h
index fe77bfc..565a9e2 100644
--- a/src/kudu/gutil/map-util.h
+++ b/src/kudu/gutil/map-util.h
@@ -98,7 +98,7 @@ template <class Collection>
 const typename Collection::value_type::second_type&
 FindOrDie(const Collection& collection,
           const typename Collection::value_type::first_type& key) {
-  typename Collection::const_iterator it = collection.find(key);
+  auto it = collection.find(key);
   CHECK(it != collection.end()) << "Map key not found: " << key;
   return it->second;
 }
@@ -108,7 +108,7 @@ template <class Collection>
 typename Collection::value_type::second_type&
 FindOrDie(Collection& collection,  // NOLINT
           const typename Collection::value_type::first_type& key) {
-  typename Collection::iterator it = collection.find(key);
+  auto it = collection.find(key);
   CHECK(it != collection.end()) << "Map key not found: " << key;
   return it->second;
 }
@@ -147,7 +147,7 @@ const typename Collection::value_type::second_type&
 FindWithDefault(const Collection& collection,
                 const typename Collection::value_type::first_type& key,
                 const typename Collection::value_type::second_type& value) {
-  typename Collection::const_iterator it = collection.find(key);
+  auto it = collection.find(key);
   if (it == collection.end()) {
     return value;
   }
@@ -160,7 +160,7 @@ template <class Collection>
 const typename Collection::value_type::second_type*
 FindOrNull(const Collection& collection,
            const typename Collection::value_type::first_type& key) {
-  typename Collection::const_iterator it = collection.find(key);
+  auto it = collection.find(key);
   if (it == collection.end()) {
     return 0;
   }
@@ -172,7 +172,7 @@ template <class Collection>
 typename Collection::value_type::second_type*
 FindOrNull(Collection& collection,  // NOLINT
            const typename Collection::value_type::first_type& key) {
-  typename Collection::iterator it = collection.find(key);
+  auto it = collection.find(key);
   if (it == collection.end()) {
     return 0;
   }
@@ -185,7 +185,7 @@ template <class Collection>
 const typename Collection::value_type::second_type*
 FindFloorOrNull(const Collection& collection,
                 const typename Collection::value_type::first_type& key) {
-  typename Collection::const_iterator it = collection.upper_bound(key);
+  auto it = collection.upper_bound(key);
   if (it == collection.begin()) {
     return 0;
   }
@@ -197,7 +197,7 @@ template <class Collection>
 typename Collection::value_type::second_type*
 FindFloorOrNull(Collection& collection,  // NOLINT
                 const typename Collection::value_type::first_type& key) {
-  typename Collection::iterator it = collection.upper_bound(key);
+  auto it = collection.upper_bound(key);
   if (it == collection.begin()) {
     return 0;
   }
@@ -214,7 +214,7 @@ template <class Collection>
 typename Collection::value_type::second_type
 FindPtrOrNull(const Collection& collection,
               const typename Collection::value_type::first_type& key) {
-  typename Collection::const_iterator it = collection.find(key);
+  auto it = collection.find(key);
   if (it == collection.end()) {
     return typename Collection::value_type::second_type(0);
   }
@@ -229,7 +229,7 @@ template <class Collection>
 typename Collection::value_type::second_type
 FindPtrOrNull(Collection& collection,  // NOLINT
               const typename Collection::value_type::first_type& key) {
-  typename Collection::iterator it = collection.find(key);
+  auto it = collection.find(key);
   if (it == collection.end()) {
     return typename Collection::value_type::second_type(0);
   }
@@ -242,7 +242,7 @@ template <class Collection, class Key, class Value>
 bool FindCopy(const Collection& collection,
               const Key& key,
               Value* const value) {
-  typename Collection::const_iterator it = collection.find(key);
+  auto it = collection.find(key);
   if (it == collection.end()) {
     return false;
   }
@@ -259,7 +259,7 @@ bool FindCopy(const Collection& collection,
 // Returns true iff the given collection contains the given key.
 template <class Collection, class Key>
 bool ContainsKey(const Collection& collection, const Key& key) {
-  typename Collection::const_iterator it = collection.find(key);
+  auto it = collection.find(key);
   return it != collection.end();
 }
 
@@ -666,7 +666,7 @@ template <class Collection>
 typename Collection::value_type::second_type EraseKeyReturnValuePtr(
     Collection* const collection,
     const typename Collection::value_type::first_type& key) {
-  typename Collection::iterator it = collection->find(key);
+  auto it = collection->find(key);
   if (it == collection->end()) {
     return NULL;
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/gutil/ref_counted_memory.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/ref_counted_memory.cc b/src/kudu/gutil/ref_counted_memory.cc
index 9609c29..1d695d9 100644
--- a/src/kudu/gutil/ref_counted_memory.cc
+++ b/src/kudu/gutil/ref_counted_memory.cc
@@ -41,7 +41,7 @@ RefCountedBytes::RefCountedBytes(const unsigned char* p, size_t size)
 
 RefCountedBytes* RefCountedBytes::TakeVector(
     std::vector<unsigned char>* to_destroy) {
-  RefCountedBytes* bytes = new RefCountedBytes;
+  auto bytes = new RefCountedBytes;
   bytes->data_.swap(*to_destroy);
   return bytes;
 }
@@ -64,7 +64,7 @@ RefCountedString::~RefCountedString() {}
 
 // static
 RefCountedString* RefCountedString::TakeString(std::string* to_destroy) {
-  RefCountedString* self = new RefCountedString;
+  auto self = new RefCountedString;
   to_destroy->swap(self->data_);
   return self;
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/gutil/stringprintf.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/stringprintf.cc b/src/kudu/gutil/stringprintf.cc
index 169ea95..112605c 100644
--- a/src/kudu/gutil/stringprintf.cc
+++ b/src/kudu/gutil/stringprintf.cc
@@ -54,7 +54,7 @@ void StringAppendV(string* dst, const char* format, va_list ap) {
   // Increase the buffer size to the size requested by vsnprintf,
   // plus one for the closing \0.
   int length = result+1;
-  char* buf = new char[length];
+  auto buf = new char[length];
 
   // Restore the va_list before we use it again
   va_copy(backup_ap, ap);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/gutil/strings/join.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/join.cc b/src/kudu/gutil/strings/join.cc
index 75a6db1..5454261 100644
--- a/src/kudu/gutil/strings/join.cc
+++ b/src/kudu/gutil/strings/join.cc
@@ -30,7 +30,7 @@ char* JoinUsing(const vector<const char*>& components,
   for (int i = 0; i < num_components; ++i)
     num_chars += strlen(components[i]);
 
-  char* res_buffer = new char[num_chars+1];
+  auto res_buffer = new char[num_chars + 1];
   return JoinUsingToBuffer(components, delim, num_chars+1,
                            res_buffer, result_length_p);
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/gutil/strings/split.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/split.cc b/src/kudu/gutil/strings/split.cc
index 5eca7a7..2e39a52 100644
--- a/src/kudu/gutil/strings/split.cc
+++ b/src/kudu/gutil/strings/split.cc
@@ -464,7 +464,7 @@ void SplitStringPieceToVector(const StringPiece& full,
 // ----------------------------------------------------------------------
 
 vector<char*>* SplitUsing(char* full, const char* delim) {
-  vector<char*>* vec = new vector<char*>;
+  auto vec = new vector<char*>;
   SplitToVector(full, delim, vec, true);        // Omit empty strings
   return vec;
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/gutil/strings/util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/util.cc b/src/kudu/gutil/strings/util.cc
index 4ff104d..715112b 100644
--- a/src/kudu/gutil/strings/util.cc
+++ b/src/kudu/gutil/strings/util.cc
@@ -688,7 +688,7 @@ char* strndup_with_new(const char* the_string, int max_length) {
   if (the_string == nullptr)
     return nullptr;
 
-  char* result = new char[max_length + 1];
+  auto result = new char[max_length + 1];
   result[max_length] = '\0';  // terminate the string because strncpy might not
   return strncpy(result, the_string, max_length);
 }
@@ -999,7 +999,7 @@ void InsertString(string *const s,
   tmp.reserve(s_len + separator_len * num_indices);
 
   vector<uint32>::const_iterator const ind_end(indices.end());
-  vector<uint32>::const_iterator ind_pos(indices.begin());
+  auto ind_pos(indices.begin());
 
   uint32 last_pos(0);
   while (ind_pos != ind_end) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/gutil/walltime.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/walltime.cc b/src/kudu/gutil/walltime.cc
index 03fbc51..89a805e 100644
--- a/src/kudu/gutil/walltime.cc
+++ b/src/kudu/gutil/walltime.cc
@@ -73,7 +73,7 @@ static void StringAppendStrftime(string* dst,
   int length = sizeof(space);
   for (int sanity = 0; sanity < 5; ++sanity) {
     length *= 2;
-    char* buf = new char[length];
+    auto buf = new char[length];
 
     result = strftime(buf, length, format, tm);
     if ((result >= 0) && (result < length)) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/integration-tests/alter_table-randomized-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/alter_table-randomized-test.cc b/src/kudu/integration-tests/alter_table-randomized-test.cc
index 1170482..99b1b0a 100644
--- a/src/kudu/integration-tests/alter_table-randomized-test.cc
+++ b/src/kudu/integration-tests/alter_table-randomized-test.cc
@@ -154,7 +154,7 @@ struct TableState {
     int32_t key = data[0].second;
     if (ContainsKey(rows_, key)) return false;
 
-    RowState* r = new RowState;
+    auto r = new RowState;
     r->cols = data;
     rows_[key] = r;
     return true;
@@ -185,7 +185,7 @@ struct TableState {
   }
 
   void DropColumn(const string& name) {
-    std::vector<string>::iterator col_it = std::find(col_names_.begin(), col_names_.end(), name);
+    auto col_it = std::find(col_names_.begin(), col_names_.end(), name);
     int index = col_it - col_names_.begin();
     col_names_.erase(col_it);
     col_nullable_.erase(col_nullable_.begin() + index);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc b/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
index 5d5b2d2..8c2158d 100644
--- a/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
+++ b/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
@@ -50,7 +50,7 @@ ExternalMiniClusterFsInspector::~ExternalMiniClusterFsInspector() {}
 Status ExternalMiniClusterFsInspector::ListFilesInDir(const string& path,
                                                       vector<string>* entries) {
   RETURN_NOT_OK(env_->GetChildren(path, entries));
-  vector<string>::iterator iter = entries->begin();
+  auto iter = entries->begin();
   while (iter != entries->end()) {
     if (*iter == "." || *iter == ".." || iter->find(".tmp.") != string::npos) {
       iter = entries->erase(iter);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/integration-tests/linked_list-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/linked_list-test-util.h b/src/kudu/integration-tests/linked_list-test-util.h
index 1549919..854e103 100644
--- a/src/kudu/integration-tests/linked_list-test-util.h
+++ b/src/kudu/integration-tests/linked_list-test-util.h
@@ -687,7 +687,7 @@ Status LinkedListTester::WaitAndVerify(int seconds_to_run,
     const int kBaseTimeToWaitSecs = 5;
     bool last_attempt = sw.elapsed().wall_seconds() > kBaseTimeToWaitSecs + seconds_to_run;
     s = Status::OK();
-    std::list<pair<int64_t, int64_t> >::iterator iter = samples_as_list.begin();
+    auto iter = samples_as_list.begin();
 
     while (iter != samples_as_list.end()) {
       // Only call the callback once, on the first verify pass, since it may be destructive.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/integration-tests/raft_consensus-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc
index 0cf01dc..7a0ccd4 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -870,9 +870,7 @@ TEST_F(RaftConsensusITest, InsertWithCrashyNodes) {
     ExternalTabletServer* ts = cluster_->tablet_server(i);
     vector<string>* flags = ts->mutable_flags();
     bool removed_flag = false;
-    for (vector<string>::iterator it = flags->begin();
-         it != flags->end();
-         ++it) {
+    for (auto it = flags->begin(); it != flags->end(); ++it) {
       if (HasPrefixString(*it, "--fault_crash")) {
         flags->erase(it);
         removed_flag = true;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/integration-tests/ts_itest-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/ts_itest-base.h b/src/kudu/integration-tests/ts_itest-base.h
index 5a77969..e1c422a 100644
--- a/src/kudu/integration-tests/ts_itest-base.h
+++ b/src/kudu/integration-tests/ts_itest-base.h
@@ -280,7 +280,7 @@ class TabletServerIntegrationTestBase : public TabletServerTestBase {
   // Removes a set of servers from the replicas_ list.
   // Handy for controlling who to validate against after killing servers.
   void PruneFromReplicas(const unordered_set<std::string>& uuids) {
-    TabletReplicaMap::iterator iter = tablet_replicas_.begin();
+    auto iter = tablet_replicas_.begin();
     while (iter != tablet_replicas_.end()) {
       if (uuids.count((*iter).second->instance_id.permanent_uuid()) != 0) {
         iter = tablet_replicas_.erase(iter);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index d935d63..74bfd44 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -2404,7 +2404,7 @@ void CatalogManager::SendAlterTableRequest(const scoped_refptr<TableInfo>& table
 }
 
 void CatalogManager::SendAlterTabletRequest(const scoped_refptr<TabletInfo>& tablet) {
-  AsyncAlterTable* call = new AsyncAlterTable(master_, worker_pool_.get(), tablet);
+  auto call = new AsyncAlterTable(master_, worker_pool_.get(), tablet);
   tablet->table()->AddTask(call);
   WARN_NOT_OK(call->Run(), "Failed to send alter table request");
 }
@@ -2460,10 +2460,7 @@ void CatalogManager::SendDeleteTabletRequest(
 
 void CatalogManager::SendAddServerRequest(const scoped_refptr<TabletInfo>& tablet,
                                           const ConsensusStatePB& cstate) {
-  AsyncAddServerTask* task = new AsyncAddServerTask(master_,
-                                                    worker_pool_.get(),
-                                                    tablet,
-                                                    cstate);
+  auto task = new AsyncAddServerTask(master_, worker_pool_.get(), tablet, cstate);
   tablet->table()->AddTask(task);
   WARN_NOT_OK(task->Run(), "Failed to send new AddServer request");
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/master/sys_catalog.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/sys_catalog.cc b/src/kudu/master/sys_catalog.cc
index fb799e9..caf47dd 100644
--- a/src/kudu/master/sys_catalog.cc
+++ b/src/kudu/master/sys_catalog.cc
@@ -314,8 +314,7 @@ Status SysCatalogTable::SyncWrite(const WriteRequestPB *req, WriteResponsePB *re
   CountDownLatch latch(1);
   gscoped_ptr<tablet::TransactionCompletionCallback> txn_callback(
     new LatchTransactionCompletionCallback<WriteResponsePB>(&latch, resp));
-  tablet::WriteTransactionState *tx_state =
-    new tablet::WriteTransactionState(tablet_peer_.get(), req, resp);
+  auto tx_state = new tablet::WriteTransactionState(tablet_peer_.get(), req, resp);
   tx_state->set_completion_callback(txn_callback.Pass());
 
   RETURN_NOT_OK(tablet_peer_->SubmitWrite(tx_state));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/rpc/auth_store.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/auth_store.cc b/src/kudu/rpc/auth_store.cc
index b4f9e10..ec28b54 100644
--- a/src/kudu/rpc/auth_store.cc
+++ b/src/kudu/rpc/auth_store.cc
@@ -37,7 +37,7 @@ Status AuthStore::Add(const string& user, const string& pass) {
 }
 
 Status AuthStore::Authenticate(const string& user, const string& pass) const {
-  unordered_map<string, string>::const_iterator it = user_cred_map_.find(user);
+  auto it = user_cred_map_.find(user);
   if (it == user_cred_map_.end()) {
     return Status::NotFound("Unknown user", user);
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/rpc/connection.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/connection.cc b/src/kudu/rpc/connection.cc
index 5052e5d..5dad5c3 100644
--- a/src/kudu/rpc/connection.cc
+++ b/src/kudu/rpc/connection.cc
@@ -575,8 +575,7 @@ class NegotiationCompletedTask : public ReactorTask {
 };
 
 void Connection::CompleteNegotiation(const Status& negotiation_status) {
-  NegotiationCompletedTask *task =
-      new NegotiationCompletedTask(this, negotiation_status);
+  auto task = new NegotiationCompletedTask(this, negotiation_status);
   reactor_thread_->reactor()->ScheduleReactorTask(task);
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/rpc/protoc-gen-krpc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/protoc-gen-krpc.cc b/src/kudu/rpc/protoc-gen-krpc.cc
index 25f8ebe..4f3d250 100644
--- a/src/kudu/rpc/protoc-gen-krpc.cc
+++ b/src/kudu/rpc/protoc-gen-krpc.cc
@@ -273,7 +273,7 @@ class CodeGenerator : public ::google::protobuf::compiler::CodeGenerator {
         const std::string &/* parameter */,
         google::protobuf::compiler::GeneratorContext *gen_context,
         std::string *error) const OVERRIDE {
-    FileSubstitutions *name_info = new FileSubstitutions();
+    auto name_info = new FileSubstitutions();
     Status ret = name_info->Init(file);
     if (!ret.ok()) {
       *error = "name_info.Init failed: " + ret.ToString();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/rpc/reactor.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/reactor.cc b/src/kudu/rpc/reactor.cc
index 6f6be20..40cb112 100644
--- a/src/kudu/rpc/reactor.cc
+++ b/src/kudu/rpc/reactor.cc
@@ -113,8 +113,8 @@ void ReactorThread::ShutdownInternal() {
   // Tear down any outbound TCP connections.
   Status service_unavailable = ShutdownError(false);
   VLOG(1) << name() << ": tearing down outbound TCP connections...";
-  for (conn_map_t::iterator c = client_conns_.begin();
-       c != client_conns_.end(); c = client_conns_.begin()) {
+  for (auto c = client_conns_.begin(); c != client_conns_.end();
+       c = client_conns_.begin()) {
     const scoped_refptr<Connection>& conn = (*c).second;
     VLOG(1) << name() << ": shutting down " << conn->ToString();
     conn->Shutdown(service_unavailable);
@@ -261,8 +261,8 @@ void ReactorThread::RegisterTimeout(ev::timer *watcher) {
 void ReactorThread::ScanIdleConnections() {
   DCHECK(IsCurrentThread());
   // enforce TCP connection timeouts
-  conn_list_t::iterator c = server_conns_.begin();
-  conn_list_t::iterator c_end = server_conns_.end();
+  auto c = server_conns_.begin();
+  auto c_end = server_conns_.end();
   uint64_t timed_out = 0;
   for (; c != c_end; ) {
     const scoped_refptr<Connection>& conn = *c;
@@ -431,11 +431,11 @@ void ReactorThread::DestroyConnection(Connection *conn,
   // Unlink connection from lists.
   if (conn->direction() == Connection::CLIENT) {
     ConnectionId conn_id(conn->remote(), conn->user_credentials());
-    conn_map_t::iterator it = client_conns_.find(conn_id);
+    auto it = client_conns_.find(conn_id);
     CHECK(it != client_conns_.end()) << "Couldn't find connection " << conn->ToString();
     client_conns_.erase(it);
   } else if (conn->direction() == Connection::SERVER) {
-    conn_list_t::iterator it = server_conns_.begin();
+    auto it = server_conns_.begin();
     while (it != server_conns_.end()) {
       if ((*it).get() == conn) {
         server_conns_.erase(it);
@@ -599,7 +599,7 @@ void Reactor::RegisterInboundSocket(Socket *socket, const Sockaddr &remote) {
   VLOG(3) << name_ << ": new inbound connection to " << remote.ToString();
   scoped_refptr<Connection> conn(
     new Connection(&thread_, remote, socket->Release(), Connection::SERVER));
-  RegisterConnectionTask *task = new RegisterConnectionTask(conn);
+  auto task = new RegisterConnectionTask(conn);
   ScheduleReactorTask(task);
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/rpc/rpc-bench.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-bench.cc b/src/kudu/rpc/rpc-bench.cc
index 0fbd0a0..34376b2 100644
--- a/src/kudu/rpc/rpc-bench.cc
+++ b/src/kudu/rpc/rpc-bench.cc
@@ -101,7 +101,7 @@ TEST_F(RpcBench, BenchmarkCalls) {
 
   boost::ptr_vector<ClientThread> threads;
   for (int i = 0; i < 16; i++) {
-    ClientThread *thr = new ClientThread(this);
+    auto thr = new ClientThread(this);
     thr->Start();
     threads.push_back(thr);
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/rpc/rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-test.cc b/src/kudu/rpc/rpc-test.cc
index ce811db..03928af 100644
--- a/src/kudu/rpc/rpc-test.cc
+++ b/src/kudu/rpc/rpc-test.cc
@@ -361,7 +361,7 @@ TEST_F(TestRpc, TestServerShutsDown) {
 
   CountDownLatch latch(n_calls);
   for (int i = 0; i < n_calls; i++) {
-    RpcController *controller = new RpcController();
+    auto controller = new RpcController();
     controllers.push_back(controller);
     p.AsyncRequest(GenericCalculatorService::kAddMethodName, req, &resp, controller,
                    boost::bind(&CountDownLatch::CountDown, boost::ref(latch)));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/rpc/rpc_stub-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_stub-test.cc b/src/kudu/rpc/rpc_stub-test.cc
index b2df45b..48292be 100644
--- a/src/kudu/rpc/rpc_stub-test.cc
+++ b/src/kudu/rpc/rpc_stub-test.cc
@@ -103,9 +103,9 @@ TEST_F(RpcStubTest, TestBigCallData) {
 
   CountDownLatch latch(kNumSentAtOnce);
   for (int i = 0; i < kNumSentAtOnce; i++) {
-    EchoResponsePB *resp = new EchoResponsePB;
+    auto resp = new EchoResponsePB;
     resps.push_back(resp);
-    RpcController *controller = new RpcController;
+    auto controller = new RpcController;
     controllers.push_back(controller);
 
     p.EchoAsync(req, resp, controller,

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/server/pprof-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/pprof-path-handlers.cc b/src/kudu/server/pprof-path-handlers.cc
index 6f6159b..52a045a 100644
--- a/src/kudu/server/pprof-path-handlers.cc
+++ b/src/kudu/server/pprof-path-handlers.cc
@@ -96,7 +96,7 @@ static void PprofHeapHandler(const Webserver::WebRequest& req, stringstream* out
     return;
   }
 
-  Webserver::ArgumentMap::const_iterator it = req.parsed_args.find("seconds");
+  auto it = req.parsed_args.find("seconds");
   int seconds = PPROF_DEFAULT_SAMPLE_SECS;
   if (it != req.parsed_args.end()) {
     seconds = atoi(it->second.c_str());
@@ -119,7 +119,7 @@ static void PprofCpuProfileHandler(const Webserver::WebRequest& req, stringstrea
 #ifndef TCMALLOC_ENABLED
   (*output) << "CPU profiling is not available without tcmalloc.";
 #else
-  Webserver::ArgumentMap::const_iterator it = req.parsed_args.find("seconds");
+  auto it = req.parsed_args.find("seconds");
   int seconds = PPROF_DEFAULT_SAMPLE_SECS;
   if (it != req.parsed_args.end()) {
     seconds = atoi(it->second.c_str());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/server/webserver.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/webserver.cc b/src/kudu/server/webserver.cc
index 04c1456..913f3b2 100644
--- a/src/kudu/server/webserver.cc
+++ b/src/kudu/server/webserver.cc
@@ -379,7 +379,7 @@ int Webserver::RunPathHandler(const PathHandler& handler,
 void Webserver::RegisterPathHandler(const string& path, const string& alias,
     const PathHandlerCallback& callback, bool is_styled, bool is_on_nav_bar) {
   boost::lock_guard<boost::shared_mutex> lock(lock_);
-  PathHandlerMap::iterator it = path_handlers_.find(path);
+  auto it = path_handlers_.find(path);
   if (it == path_handlers_.end()) {
     it = path_handlers_.insert(
         make_pair(path, new PathHandler(is_styled, is_on_nav_bar, alias))).first;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/compaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/compaction.cc b/src/kudu/tablet/compaction.cc
index df4bcbf..3a99ef7 100644
--- a/src/kudu/tablet/compaction.cc
+++ b/src/kudu/tablet/compaction.cc
@@ -420,9 +420,7 @@ class MergeCompactionInput : public CompactionInput {
       // it no longer dominates the inputs in it 'dominated' list. Re-check
       // all of those dominance relations and remove any that are no longer
       // valid.
-      for (vector<MergeState *>::iterator it = state->dominated.begin();
-           it != state->dominated.end();
-           ++it) {
+      for (auto it = state->dominated.begin(); it != state->dominated.end(); ++it) {
         MergeState *dominated = *it;
         if (!state->Dominates(*dominated, *schema_)) {
           states_.push_back(dominated);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/delta_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/delta_tracker.cc b/src/kudu/tablet/delta_tracker.cc
index 6e7df93..9b98214 100644
--- a/src/kudu/tablet/delta_tracker.cc
+++ b/src/kudu/tablet/delta_tracker.cc
@@ -158,7 +158,7 @@ Status DeltaTracker::AtomicUpdateStores(const SharedDeltaStoreVector& to_remove,
     start_it =
         std::find(stores_to_update->begin(), stores_to_update->end(), to_remove[0]);
 
-    SharedDeltaStoreVector::iterator end_it = start_it;
+    auto end_it = start_it;
     for (const shared_ptr<DeltaStore>& ds : to_remove) {
       if (end_it == stores_to_update->end() || *end_it != ds) {
         return Status::InvalidArgument(

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/lock_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/lock_manager.cc b/src/kudu/tablet/lock_manager.cc
index 6d79bf0..e33ae65 100644
--- a/src/kudu/tablet/lock_manager.cc
+++ b/src/kudu/tablet/lock_manager.cc
@@ -161,7 +161,7 @@ class LockTable {
 };
 
 LockEntry *LockTable::GetLockEntry(const Slice& key) {
-  LockEntry *new_entry = new LockEntry(key);
+  auto new_entry = new LockEntry(key);
   LockEntry *old_entry;
 
   {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/maintenance_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/maintenance_manager.cc b/src/kudu/tablet/maintenance_manager.cc
index ef9e349..14877bc 100644
--- a/src/kudu/tablet/maintenance_manager.cc
+++ b/src/kudu/tablet/maintenance_manager.cc
@@ -160,7 +160,7 @@ void MaintenanceManager::UnregisterOp(MaintenanceOp* op) {
     lock_guard<Mutex> guard(&lock_);
     CHECK(op->manager_.get() == this) << "Tried to unregister " << op->name()
           << ", but it is not currently registered with this maintenance manager.";
-    OpMapTy::iterator iter = ops_.find(op);
+    auto iter = ops_.find(op);
     CHECK(iter != ops_.end()) << "Tried to unregister " << op->name()
         << ", but it was never registered";
     // While the op is running, wait for it to be finished.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/mutation.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mutation.h b/src/kudu/tablet/mutation.h
index fb4e29f..6e29586 100644
--- a/src/kudu/tablet/mutation.h
+++ b/src/kudu/tablet/mutation.h
@@ -98,7 +98,7 @@ inline Mutation *Mutation::CreateInArena(
   size_t size = sizeof(Mutation) + rcl.slice().size();
   void *storage = arena->AllocateBytesAligned(size, BASE_PORT_H_ALIGN_OF(Mutation));
   CHECK(storage) << "failed to allocate storage from arena";
-  Mutation *ret = new(storage) Mutation();
+  auto ret = new (storage) Mutation();
   ret->timestamp_ = timestamp;
   ret->next_ = NULL;
   ret->changelist_size_ = rcl.slice().size();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/mvcc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mvcc.cc b/src/kudu/tablet/mvcc.cc
index b7f50f3..313a858 100644
--- a/src/kudu/tablet/mvcc.cc
+++ b/src/kudu/tablet/mvcc.cc
@@ -92,7 +92,7 @@ Status MvccManager::StartTransactionAtTimestamp(Timestamp timestamp) {
 
 void MvccManager::StartApplyingTransaction(Timestamp timestamp) {
   boost::lock_guard<LockType> l(lock_);
-  InFlightMap::iterator it = timestamps_in_flight_.find(timestamp.value());
+  auto it = timestamps_in_flight_.find(timestamp.value());
   if (PREDICT_FALSE(it == timestamps_in_flight_.end())) {
     LOG(FATAL) << "Cannot mark timestamp " << timestamp.ToString() << " as APPLYING: "
                << "not in the in-flight map.";
@@ -182,7 +182,7 @@ void MvccManager::OfflineCommitTransaction(Timestamp timestamp) {
 MvccManager::TxnState MvccManager::RemoveInFlightAndGetStateUnlocked(Timestamp ts) {
   DCHECK(lock_.is_locked());
 
-  InFlightMap::iterator it = timestamps_in_flight_.find(ts.value());
+  auto it = timestamps_in_flight_.find(ts.value());
   if (it == timestamps_in_flight_.end()) {
     LOG(FATAL) << "Trying to remove timestamp which isn't in the in-flight set: "
                << ts.ToString();
@@ -276,7 +276,7 @@ void MvccManager::AdjustCleanTime() {
   // it may also have unblocked some waiters.
   // Check if someone is waiting for transactions to be committed.
   if (PREDICT_FALSE(!waiters_.empty())) {
-    vector<WaitingState*>::iterator iter = waiters_.begin();
+    auto iter = waiters_.begin();
     while (iter != waiters_.end()) {
       WaitingState* waiter = *iter;
       if (IsDoneWaitingUnlocked(*waiter)) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/rowset_metadata.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/rowset_metadata.cc b/src/kudu/tablet/rowset_metadata.cc
index 6259e92..042cdef 100644
--- a/src/kudu/tablet/rowset_metadata.cc
+++ b/src/kudu/tablet/rowset_metadata.cc
@@ -161,11 +161,10 @@ Status RowSetMetadata::CommitUpdate(const RowSetMetadataUpdate& update) {
                   update.replace_redo_blocks_) {
       CHECK(!rep.to_remove.empty());
 
-      vector<BlockId>::iterator start_it =
-          std::find(redo_delta_blocks_.begin(),
-                    redo_delta_blocks_.end(), rep.to_remove[0]);
+      auto start_it = std::find(redo_delta_blocks_.begin(),
+                                redo_delta_blocks_.end(), rep.to_remove[0]);
 
-      vector<BlockId>::iterator end_it = start_it;
+      auto end_it = start_it;
       for (const BlockId& b : rep.to_remove) {
         if (end_it == redo_delta_blocks_.end() || *end_it != b) {
           return Status::InvalidArgument(

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/tablet-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet-test-util.h b/src/kudu/tablet/tablet-test-util.h
index 4159405..89c7591 100644
--- a/src/kudu/tablet/tablet-test-util.h
+++ b/src/kudu/tablet/tablet-test-util.h
@@ -173,7 +173,7 @@ static inline void CollectRowsForSnapshots(Tablet* tablet,
                                             Tablet::UNORDERED,
                                             &iter));
     ASSERT_OK(iter->Init(NULL));
-    vector<string>* collector = new vector<string>();
+    auto collector = new vector<string>();
     ASSERT_OK(IterateToStringList(iter.get(), collector));
     for (int i = 0; i < collector->size(); i++) {
       DVLOG(1) << "Got from MRS: " << (*collector)[i];

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/tablet_bootstrap.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_bootstrap.cc b/src/kudu/tablet/tablet_bootstrap.cc
index b2cbedd..b47b499 100644
--- a/src/kudu/tablet/tablet_bootstrap.cc
+++ b/src/kudu/tablet/tablet_bootstrap.cc
@@ -786,7 +786,7 @@ Status TabletBootstrap::HandleReplicateMessage(ReplayState* state, LogEntryPB* r
   if (existing_entry_ptr) {
     LogEntryPB* existing_entry = *existing_entry_ptr;
 
-    OpIndexToEntryMap::iterator iter = state->pending_replicates.lower_bound(index);
+    auto iter = state->pending_replicates.lower_bound(index);
     DCHECK(OpIdEquals((*iter).second->replicate().id(), existing_entry->replicate().id()));
 
     LogEntryPB* last_entry = (*state->pending_replicates.rbegin()).second;
@@ -843,7 +843,7 @@ Status TabletBootstrap::HandleCommitMessage(ReplayState* state, LogEntryPB* comm
   RETURN_NOT_OK(ApplyCommitMessage(state, commit_entry));
   delete commit_entry;
 
-  OpIndexToEntryMap::iterator iter = state->pending_commits.begin();
+  auto iter = state->pending_commits.begin();
   while (iter != state->pending_commits.end()) {
     if ((*iter).first == last_applied.index() + 1) {
       gscoped_ptr<LogEntryPB> buffered_commit_entry((*iter).second);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/tablet_metadata.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_metadata.cc b/src/kudu/tablet/tablet_metadata.cc
index a645dc7..92a3961 100644
--- a/src/kudu/tablet/tablet_metadata.cc
+++ b/src/kudu/tablet/tablet_metadata.cc
@@ -462,7 +462,7 @@ Status TabletMetadata::UpdateUnlocked(
   }
 
   RowSetMetadataVector new_rowsets = rowsets_;
-  RowSetMetadataVector::iterator it = new_rowsets.begin();
+  auto it = new_rowsets.begin();
   while (it != new_rowsets.end()) {
     if (ContainsKey(to_remove, (*it)->id())) {
       AddOrphanedBlocksUnlocked((*it)->GetAllBlocks());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tablet/tablet_peer-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_peer-test.cc b/src/kudu/tablet/tablet_peer-test.cc
index 20f45cb..915c7bc 100644
--- a/src/kudu/tablet/tablet_peer-test.cc
+++ b/src/kudu/tablet/tablet_peer-test.cc
@@ -188,8 +188,7 @@ class TabletPeerTest : public KuduTabletTest {
 
   Status ExecuteWriteAndRollLog(TabletPeer* tablet_peer, const WriteRequestPB& req) {
     gscoped_ptr<WriteResponsePB> resp(new WriteResponsePB());
-    WriteTransactionState* tx_state =
-        new WriteTransactionState(tablet_peer, &req, resp.get());
+    auto tx_state = new WriteTransactionState(tablet_peer, &req, resp.get());
 
     CountDownLatch rpc_latch(1);
     tx_state->set_completion_callback(gscoped_ptr<TransactionCompletionCallback>(
@@ -458,8 +457,7 @@ TEST_F(TabletPeerTest, TestActiveTransactionPreventsLogGC) {
   {
     // Long-running mutation.
     ASSERT_OK(GenerateSequentialDeleteRequest(req.get()));
-    WriteTransactionState* tx_state =
-      new WriteTransactionState(tablet_peer_.get(), req.get(), resp.get());
+    auto tx_state = new WriteTransactionState(tablet_peer_.get(), req.get(), resp.get());
 
     tx_state->set_completion_callback(gscoped_ptr<TransactionCompletionCallback>(
           new LatchTransactionCompletionCallback<WriteResponsePB>(&rpc_latch, resp.get())).Pass());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tserver/remote_bootstrap_session-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session-test.cc b/src/kudu/tserver/remote_bootstrap_session-test.cc
index 11443e7..04b876b 100644
--- a/src/kudu/tserver/remote_bootstrap_session-test.cc
+++ b/src/kudu/tserver/remote_bootstrap_session-test.cc
@@ -160,8 +160,7 @@ class RemoteBootstrapTest : public KuduTabletTest {
       WriteResponsePB resp;
       CountDownLatch latch(1);
 
-      WriteTransactionState* state =
-          new WriteTransactionState(tablet_peer_.get(), &req, &resp);
+      auto state = new WriteTransactionState(tablet_peer_.get(), &req, &resp);
       state->set_completion_callback(gscoped_ptr<tablet::TransactionCompletionCallback>(
           new tablet::LatchTransactionCompletionCallback<WriteResponsePB>(&latch, &resp)).Pass());
       ASSERT_OK(tablet_peer_->SubmitWrite(state));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tserver/scanners.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.cc b/src/kudu/tserver/scanners.cc
index 21755ab..eaf2ecc 100644
--- a/src/kudu/tserver/scanners.cc
+++ b/src/kudu/tserver/scanners.cc
@@ -157,8 +157,7 @@ void ScannerManager::RemoveExpiredScanners() {
 
   for (ScannerMapStripe* stripe : scanner_maps_) {
     boost::lock_guard<boost::shared_mutex> l(stripe->lock_);
-    for (ScannerMap::iterator it = stripe->scanners_by_id_.begin();
-         it != stripe->scanners_by_id_.end(); ) {
+    for (auto it = stripe->scanners_by_id_.begin(); it != stripe->scanners_by_id_.end();) {
       SharedScanner& scanner = it->second;
       MonoDelta time_live =
           scanner->TimeSinceLastAccess(MonoTime::Now(MonoTime::COARSE));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index 7aedaf9..57f404c 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -710,8 +710,7 @@ void TabletServiceImpl::Write(const WriteRequestPB* req,
     return;
   }
 
-  WriteTransactionState *tx_state =
-    new WriteTransactionState(tablet_peer.get(), req, resp);
+  auto tx_state = new WriteTransactionState(tablet_peer.get(), req, resp);
 
   // If the client sent us a timestamp, decode it and update the clock so that all future
   // timestamps are greater than the passed timestamp.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/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 284b8fb..52fb56a 100644
--- a/src/kudu/tserver/ts_tablet_manager.cc
+++ b/src/kudu/tserver/ts_tablet_manager.cc
@@ -869,7 +869,7 @@ void TSTabletManager::MarkTabletReportAcknowledged(const TabletReportPB& report)
 
   // Clear the "dirty" state for any tablets which have not changed since
   // this report.
-  DirtyMap::iterator it = dirty_tablets_.begin();
+  auto it = dirty_tablets_.begin();
   while (it != dirty_tablets_.end()) {
     const TabletReportState& state = it->second;
     if (state.change_seq <= acked_seq) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/cache.cc b/src/kudu/util/cache.cc
index 75f5159..c9d63ce 100644
--- a/src/kudu/util/cache.cc
+++ b/src/kudu/util/cache.cc
@@ -145,7 +145,7 @@ class HandleTable {
     while (new_length < elems_ * 1.5) {
       new_length *= 2;
     }
-    LRUHandle** new_list = new LRUHandle*[new_length];
+    auto new_list = new LRUHandle*[new_length];
     memset(new_list, 0, sizeof(new_list[0]) * new_length);
     uint32_t count = 0;
     for (uint32_t i = 0; i < length_; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/crc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/crc-test.cc b/src/kudu/util/crc-test.cc
index caf723e..6da023f 100644
--- a/src/kudu/util/crc-test.cc
+++ b/src/kudu/util/crc-test.cc
@@ -34,7 +34,7 @@ class CrcTest : public KuduTest {
     const uint32_t kNumNumbers = 1000000;
     const uint32_t kBytesPerNumber = sizeof(uint32_t);
     const uint32_t kLength = kNumNumbers * kBytesPerNumber;
-    uint8_t *buf = new uint8_t[kLength];
+    auto buf = new uint8_t[kLength];
     for (uint32_t i = 0; i < kNumNumbers; i++) {
       memcpy(buf + (i * kBytesPerNumber), &i, kBytesPerNumber);
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/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 cbbd7ea..6f3e5e9 100644
--- a/src/kudu/util/debug/trace_event_impl.cc
+++ b/src/kudu/util/debug/trace_event_impl.cc
@@ -1427,19 +1427,15 @@ void TraceLog::AddEnabledStateObserver(EnabledStateObserver* listener) {
 }
 
 void TraceLog::RemoveEnabledStateObserver(EnabledStateObserver* listener) {
-  std::vector<EnabledStateObserver*>::iterator it =
-      std::find(enabled_state_observer_list_.begin(),
-                enabled_state_observer_list_.end(),
-                listener);
+  auto it = std::find(enabled_state_observer_list_.begin(),
+                      enabled_state_observer_list_.end(), listener);
   if (it != enabled_state_observer_list_.end())
     enabled_state_observer_list_.erase(it);
 }
 
 bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const {
-  std::vector<EnabledStateObserver*>::const_iterator it =
-      std::find(enabled_state_observer_list_.begin(),
-                enabled_state_observer_list_.end(),
-                listener);
+  auto it = std::find(enabled_state_observer_list_.begin(),
+                      enabled_state_observer_list_.end(), listener);
   return it != enabled_state_observer_list_.end();
 }
 
@@ -1703,7 +1699,7 @@ TraceEventHandle TraceLog::AddTraceEvent(
 TraceLog::PerThreadInfo* TraceLog::SetupThreadLocalBuffer() {
   int64_t cur_tid = Thread::UniqueThreadId();
 
-  PerThreadInfo* thr_info = new PerThreadInfo();
+  auto thr_info = new PerThreadInfo();
   thr_info->event_buffer_ = nullptr;
   thr_info->is_in_trace_event_ = 0;
   thread_local_info_ = thr_info;
@@ -1825,8 +1821,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp(
 
         SpinLockHolder thread_info_lock(&thread_info_lock_);
 
-        std::unordered_map<int, std::string>::iterator existing_name =
-          thread_names_.find(thread_id);
+        auto existing_name = thread_names_.find(thread_id);
         if (existing_name == thread_names_.end()) {
           // This is a new thread id, and a new name.
           thread_names_[thread_id] = new_name;
@@ -2184,8 +2179,7 @@ void TraceLog::UpdateProcessLabel(
 
 void TraceLog::RemoveProcessLabel(int label_id) {
   SpinLockHolder lock(&lock_);
-  std::unordered_map<int, std::string>::iterator it = process_labels_.find(
-      label_id);
+  auto it = process_labels_.find(label_id);
   if (it == process_labels_.end())
     return;
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/env_posix.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index e8b3f92..f55e83c 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -884,7 +884,7 @@ class PosixEnv : public Env {
       result = IOError("lock " + fname, errno);
       close(fd);
     } else {
-      PosixFileLock* my_lock = new PosixFileLock;
+      auto my_lock = new PosixFileLock;
       my_lock->fd_ = fd;
       *lock = my_lock;
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/flag_tags.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/flag_tags.cc b/src/kudu/util/flag_tags.cc
index 698621d..8b9ebe3 100644
--- a/src/kudu/util/flag_tags.cc
+++ b/src/kudu/util/flag_tags.cc
@@ -50,9 +50,7 @@ class FlagTagRegistry {
     tags->clear();
     pair<TagMap::const_iterator, TagMap::const_iterator> range =
       tag_map_.equal_range(name);
-    for (TagMap::const_iterator it = range.first;
-         it != range.second;
-         ++it) {
+    for (auto it = range.first; it != range.second; ++it) {
       if (!InsertIfNotPresent(tags, it->second)) {
         LOG(DFATAL) << "Flag " << name << " was tagged more than once with the tag '"
                     << it->second << "'";

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/memenv/memenv.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memenv/memenv.cc b/src/kudu/util/memenv/memenv.cc
index ce56f04..9bf5a28 100644
--- a/src/kudu/util/memenv/memenv.cc
+++ b/src/kudu/util/memenv/memenv.cc
@@ -85,7 +85,7 @@ class FileState : public RefCountedThreadSafe<FileState> {
   }
 
   Status PreAllocate(uint64_t size) {
-    uint8_t *padding = new uint8_t[size];
+    auto padding = new uint8_t[size];
     // TODO optimize me
     memset(&padding, 0, sizeof(uint8_t));
     Status s = AppendRaw(padding, size);
@@ -481,7 +481,7 @@ class InMemoryEnv : public EnvWrapper {
 
     MutexLock lock(mutex_);
 
-    for (FileSystem::iterator i = file_map_.begin(); i != file_map_.end(); ) {
+    for (auto i = file_map_.begin(); i != file_map_.end();) {
       const std::string& filename = i->first;
 
       if (filename.size() >= dir.size() && Slice(filename).starts_with(Slice(dir))) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/metrics.cc b/src/kudu/util/metrics.cc
index 04b57bc..2935cbc 100644
--- a/src/kudu/util/metrics.cc
+++ b/src/kudu/util/metrics.cc
@@ -255,8 +255,7 @@ void MetricEntity::RetireOldMetrics() {
   MonoTime now(MonoTime::Now(MonoTime::FINE));
 
   lock_guard<simple_spinlock> l(&lock_);
-  for (MetricMap::iterator it = metric_map_.begin();
-       it != metric_map_.end();) {
+  for (auto it = metric_map_.begin(); it != metric_map_.end();) {
     const scoped_refptr<Metric>& metric = it->second;
 
     if (PREDICT_TRUE(!metric->HasOneRef())) {
@@ -351,8 +350,7 @@ Status MetricRegistry::WriteAsJson(JsonWriter* writer,
 
 void MetricRegistry::RetireOldMetrics() {
   lock_guard<simple_spinlock> l(&lock_);
-  for (EntityMap::iterator it = entities_.begin();
-       it != entities_.end();) {
+  for (auto it = entities_.begin(); it != entities_.end();) {
     it->second->RetireOldMetrics();
 
     if (it->second->num_metrics() == 0 && it->second->HasOneRef()) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/mt-hdr_histogram-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mt-hdr_histogram-test.cc b/src/kudu/util/mt-hdr_histogram-test.cc
index bb53d97..879c5e3 100644
--- a/src/kudu/util/mt-hdr_histogram-test.cc
+++ b/src/kudu/util/mt-hdr_histogram-test.cc
@@ -59,7 +59,7 @@ TEST_F(MtHdrHistogramTest, ConcurrentWriteTest) {
 
   HdrHistogram hist(100000LU, 3);
 
-  scoped_refptr<kudu::Thread>* threads = new scoped_refptr<kudu::Thread>[num_threads_];
+  auto threads = new scoped_refptr<kudu::Thread>[num_threads_];
   for (int i = 0; i < num_threads_; i++) {
     CHECK_OK(kudu::Thread::Create("test", strings::Substitute("thread-$0", i),
         IncrementSameHistValue, &hist, kValue, num_times_, &threads[i]));
@@ -81,7 +81,7 @@ TEST_F(MtHdrHistogramTest, ConcurrentCopyWhileWritingTest) {
 
   HdrHistogram hist(100000LU, 3);
 
-  scoped_refptr<kudu::Thread>* threads = new scoped_refptr<kudu::Thread>[num_threads_];
+  auto threads = new scoped_refptr<kudu::Thread>[num_threads_];
   for (int i = 0; i < num_threads_; i++) {
     CHECK_OK(kudu::Thread::Create("test", strings::Substitute("thread-$0", i),
         IncrementSameHistValue, &hist, kValue, num_times_, &threads[i]));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/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 524bd90..b4512fb 100644
--- a/src/kudu/util/mt-metrics-test.cc
+++ b/src/kudu/util/mt-metrics-test.cc
@@ -100,9 +100,9 @@ void MultiThreadedMetricsTest::RegisterCounters(
     ScopedLeakCheckDisabler disabler;
 
     string name = strings::Substitute("$0-$1-$2", name_prefix, tid, i);
-    CounterPrototype* proto = new CounterPrototype(
-        MetricPrototype::CtorArgs("test_entity", strdup(name.c_str()), "Test Counter",
-                                  MetricUnit::kOperations, "test counter"));
+    auto proto = new CounterPrototype(MetricPrototype::CtorArgs(
+        "test_entity", strdup(name.c_str()), "Test Counter",
+        MetricUnit::kOperations, "test counter"));
     proto->Instantiate(metric_entity)->Increment();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/object_pool.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/object_pool.h b/src/kudu/util/object_pool.h
index 8229df2..147363f 100644
--- a/src/kudu/util/object_pool.h
+++ b/src/kudu/util/object_pool.h
@@ -128,7 +128,7 @@ class ObjectPool {
 
       return static_cast<ManualConstructor<T> *>(tmp);
     }
-    ListNode *new_node = new ListNode();
+    auto new_node = new ListNode();
     new_node->next_on_free_list = NULL;
     new_node->next_on_alloc_list = alloc_list_head_;
     new_node->is_on_freelist = false;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/slice-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/slice-test.cc b/src/kudu/util/slice-test.cc
index d4868ac..b0d3bef 100644
--- a/src/kudu/util/slice-test.cc
+++ b/src/kudu/util/slice-test.cc
@@ -46,7 +46,7 @@ TEST(SliceTest, TestSliceMap) {
   }
 
   expectedValue = 0;
-  for (MySliceMap::iterator iter = my_map.begin(); iter != my_map.end(); iter++) {
+  for (auto iter = my_map.begin(); iter != my_map.end(); iter++) {
     int data = 'a' + expectedValue++;
     ASSERT_EQ(Slice(reinterpret_cast<uint8_t*>(&data), 1), iter->first);
     ASSERT_EQ(expectedValue, iter->second);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/status.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/status.cc b/src/kudu/util/status.cc
index 291d4bf..d13eeea 100644
--- a/src/kudu/util/status.cc
+++ b/src/kudu/util/status.cc
@@ -15,7 +15,7 @@ namespace kudu {
 const char* Status::CopyState(const char* state) {
   uint32_t size;
   strings::memcpy_inlined(&size, state, sizeof(size));
-  char* result = new char[size + 7];
+  auto result = new char[size + 7];
   strings::memcpy_inlined(result, state, size + 7);
   return result;
 }
@@ -26,7 +26,7 @@ Status::Status(Code code, const Slice& msg, const Slice& msg2,
   const uint32_t len1 = msg.size();
   const uint32_t len2 = msg2.size();
   const uint32_t size = len1 + (len2 ? (2 + len2) : 0);
-  char* result = new char[size + 7];
+  auto result = new char[size + 7];
   memcpy(result, &size, sizeof(size));
   result[4] = static_cast<char>(code);
   memcpy(result + 5, &posix_code, sizeof(posix_code));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/309afa48/src/kudu/util/thread.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/thread.cc b/src/kudu/util/thread.cc
index e95f8da..5026208 100644
--- a/src/kudu/util/thread.cc
+++ b/src/kudu/util/thread.cc
@@ -313,7 +313,7 @@ void ThreadMgr::RemoveThread(const pthread_t& pthread_id, const string& category
   ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN();
   {
     MutexLock l(lock_);
-    ThreadCategoryMap::iterator category_it = thread_categories_.find(category);
+    auto category_it = thread_categories_.find(category);
     DCHECK(category_it != thread_categories_.end());
     category_it->second.erase(pthread_id);
     if (metrics_enabled_) {
@@ -344,7 +344,7 @@ void ThreadMgr::ThreadPathHandler(const WebCallbackRegistry::WebRequest& req,
     stringstream* output) {
   MutexLock l(lock_);
   vector<const ThreadCategory*> categories_to_print;
-  WebCallbackRegistry::ArgumentMap::const_iterator category_name = req.parsed_args.find("group");
+  auto category_name = req.parsed_args.find("group");
   if (category_name != req.parsed_args.end()) {
     string group = EscapeForHtmlToString(category_name->second);
     (*output) << "<h2>Thread Group: " << group << "</h2>" << endl;



Mime
View raw message