kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [5/5] incubator-kudu git commit: Replace NULL with nullptr
Date Tue, 19 Jan 2016 22:48:15 GMT
Replace NULL with nullptr

These changes were generated using the clang-tidy modernize-use-nullptr
tool with some manual tweaks.

Change-Id: I40065ada0f7733945562b4ec6fa187915fafd7e9
Reviewed-on: http://gerrit.cloudera.org:8080/1800
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/35b49cc5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/35b49cc5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/35b49cc5

Branch: refs/heads/master
Commit: 35b49cc5a8af676d242b4f58306ccdde05097eb1
Parents: 5489476
Author: Dan Burkert <dan@cloudera.com>
Authored: Tue Nov 24 12:50:33 2015 -0800
Committer: Dan Burkert <dan@cloudera.com>
Committed: Tue Jan 19 22:27:49 2016 +0000

----------------------------------------------------------------------
 src/kudu/cfile/binary_dict_block.cc             |   4 +-
 src/kudu/cfile/binary_plain_block.cc            |   2 +-
 src/kudu/cfile/binary_prefix_block.cc           |  28 ++---
 src/kudu/cfile/block_cache.cc                   |   8 +-
 src/kudu/cfile/cfile-test.cc                    |  18 ++--
 src/kudu/cfile/cfile_reader.cc                  |  32 +++---
 src/kudu/cfile/cfile_util.cc                    |   4 +-
 src/kudu/cfile/cfile_writer.cc                  |  14 +--
 src/kudu/cfile/compression-test.cc              |   2 +-
 src/kudu/cfile/compression_codec.cc             |   4 +-
 src/kudu/cfile/encoding-test.cc                 |   8 +-
 src/kudu/cfile/gvint_block.cc                   |   4 +-
 src/kudu/cfile/index_block.cc                   |  12 +--
 src/kudu/cfile/type_encodings.cc                |   2 +-
 src/kudu/client/client-internal.cc              |  18 ++--
 src/kudu/client/client-test.cc                  |   6 +-
 src/kudu/client/client.cc                       |  16 +--
 src/kudu/client/meta_cache.cc                   |   6 +-
 src/kudu/client/scan_predicate.cc               |   4 +-
 src/kudu/client/scanner-internal.cc             |   2 +-
 src/kudu/client/schema.cc                       |  14 +--
 src/kudu/client/table_creator-internal.cc       |   2 +-
 src/kudu/codegen/codegen-test.cc                |   4 +-
 src/kudu/codegen/module_builder.cc              |   2 +-
 src/kudu/codegen/precompiled.cc                 |   2 +-
 src/kudu/codegen/row_projector.cc               |   8 +-
 src/kudu/common/encoded_key.cc                  |   2 +-
 src/kudu/common/generic_iterators-test.cc       |   4 +-
 src/kudu/common/generic_iterators.cc            |  18 ++--
 src/kudu/common/predicate-test.cc               |   4 +-
 src/kudu/common/predicate_encoder-test.cc       |   4 +-
 src/kudu/common/predicate_encoder.cc            |   4 +-
 src/kudu/common/row_changelist-test.cc          |   2 +-
 src/kudu/common/row_changelist.cc               |   8 +-
 src/kudu/common/row_operations-test.cc          |  18 ++--
 src/kudu/common/row_operations.cc               |   8 +-
 src/kudu/common/scan_predicate.cc               |   2 +-
 src/kudu/common/scan_spec.cc                    |   6 +-
 src/kudu/common/types.cc                        |   2 +-
 src/kudu/common/wire_protocol-test.cc           |  10 +-
 src/kudu/common/wire_protocol.cc                |   6 +-
 src/kudu/consensus/consensus.cc                 |   2 +-
 src/kudu/consensus/consensus_peers.cc           |   2 +-
 src/kudu/consensus/consensus_queue-test.cc      |  16 +--
 src/kudu/consensus/consensus_queue.cc           |  14 +--
 src/kudu/consensus/leader_election.cc           |   2 +-
 src/kudu/consensus/log-test.cc                  |  10 +-
 src/kudu/consensus/log.cc                       |   6 +-
 src/kudu/consensus/log_anchor_registry.cc       |   4 +-
 src/kudu/consensus/log_cache.cc                 |   2 +-
 src/kudu/consensus/log_index.cc                 |   8 +-
 src/kudu/consensus/log_reader.cc                |   6 +-
 src/kudu/consensus/log_util.cc                  |   6 +-
 src/kudu/consensus/peer_manager.cc              |   2 +-
 src/kudu/consensus/raft_consensus-test.cc       |   4 +-
 src/kudu/consensus/raft_consensus.cc            |   2 +-
 .../consensus/raft_consensus_quorum-test.cc     |   8 +-
 src/kudu/experiments/merge-test.cc              |   6 +-
 src/kudu/fs/block_manager-test.cc               |  10 +-
 src/kudu/fs/file_block_manager.cc               |   2 +-
 src/kudu/fs/fs_manager.cc                       |   4 +-
 src/kudu/fs/log_block_manager.cc                |   4 +-
 src/kudu/gutil/callback_internal.cc             |   8 +-
 src/kudu/gutil/hash/city.cc                     |   2 +-
 src/kudu/gutil/once.cc                          |   2 +-
 src/kudu/gutil/ref_counted_memory.cc            |   6 +-
 src/kudu/gutil/stringprintf.cc                  |   2 +-
 src/kudu/gutil/strings/escaping.cc              |   6 +-
 src/kudu/gutil/strings/join.cc                  |   6 +-
 src/kudu/gutil/strings/memutil.cc               |  14 +--
 src/kudu/gutil/strings/numbers.cc               |  48 ++++-----
 src/kudu/gutil/strings/serialize.cc             |   6 +-
 src/kudu/gutil/strings/split.cc                 |  16 +--
 src/kudu/gutil/strings/stringpiece.cc           |   2 +-
 src/kudu/gutil/strings/strip.cc                 |   4 +-
 src/kudu/gutil/strings/substitute.cc            |   4 +-
 src/kudu/gutil/strings/util.cc                  | 108 +++++++++----------
 src/kudu/gutil/sysinfo.cc                       |   2 +-
 src/kudu/gutil/walltime.cc                      |   8 +-
 src/kudu/integration-tests/alter_table-test.cc  |   4 +-
 .../integration-tests/client-stress-test.cc     |   4 +-
 .../integration-tests/cluster_itest_util.cc     |   2 +-
 .../integration-tests/external_mini_cluster.cc  |   6 +-
 src/kudu/integration-tests/mini_cluster.cc      |   4 +-
 .../integration-tests/raft_consensus-itest.cc   |  20 ++--
 .../integration-tests/remote_bootstrap-itest.cc |   4 +-
 .../ts_tablet_manager-itest.cc                  |   2 +-
 src/kudu/master/catalog_manager.cc              |  40 +++----
 src/kudu/master/sys_catalog-test.cc             |   4 +-
 src/kudu/rpc/blocking_ops.cc                    |  10 +-
 src/kudu/rpc/connection.cc                      |   4 +-
 src/kudu/rpc/inbound_call.cc                    |   6 +-
 src/kudu/rpc/messenger.cc                       |   6 +-
 src/kudu/rpc/proxy.cc                           |   4 +-
 src/kudu/rpc/reactor.cc                         |   6 +-
 src/kudu/rpc/rpc_controller.cc                  |   2 +-
 src/kudu/rpc/sasl_client.cc                     |  26 ++---
 src/kudu/rpc/sasl_common.cc                     |  24 ++---
 src/kudu/rpc/sasl_helper.cc                     |  16 +--
 src/kudu/rpc/sasl_server.cc                     |  10 +-
 src/kudu/rpc/service_if.cc                      |   2 +-
 src/kudu/server/default-path-handlers.cc        |   4 +-
 src/kudu/server/webserver.cc                    |  16 +--
 src/kudu/tablet/cbtree-test.cc                  |   8 +-
 src/kudu/tablet/cfile_set-test.cc               |  10 +-
 src/kudu/tablet/cfile_set.cc                    |  12 +--
 src/kudu/tablet/compaction-test.cc              |   6 +-
 src/kudu/tablet/compaction.cc                   |  34 +++---
 src/kudu/tablet/compaction_policy-test.cc       |   2 +-
 src/kudu/tablet/compaction_policy.cc            |   2 +-
 src/kudu/tablet/composite-pushdown-test.cc      |  16 +--
 src/kudu/tablet/delta_compaction.cc             |  10 +-
 src/kudu/tablet/deltafile-test.cc               |  18 ++--
 src/kudu/tablet/deltamemstore-test.cc           |   6 +-
 src/kudu/tablet/deltamemstore.cc                |   4 +-
 src/kudu/tablet/diskrowset-test.cc              |  10 +-
 src/kudu/tablet/diskrowset.cc                   |  16 +--
 src/kudu/tablet/lock_manager-test.cc            |   2 +-
 src/kudu/tablet/lock_manager.cc                 |  26 ++---
 src/kudu/tablet/maintenance_manager.cc          |  18 ++--
 src/kudu/tablet/major_delta_compaction-test.cc  |   2 +-
 src/kudu/tablet/memrowset-test.cc               |   6 +-
 src/kudu/tablet/memrowset.cc                    |  20 ++--
 src/kudu/tablet/metadata-test.cc                |   2 +-
 .../tablet/mt-rowset_delta_compaction-test.cc   |   2 +-
 src/kudu/tablet/mt-tablet-test.cc               |   2 +-
 src/kudu/tablet/mutation.cc                     |   8 +-
 src/kudu/tablet/mvcc-test.cc                    |   2 +-
 src/kudu/tablet/rowset_tree-test.cc             |   2 +-
 src/kudu/tablet/svg_dump.cc                     |   2 +-
 src/kudu/tablet/tablet-schema-test.cc           |   2 +-
 src/kudu/tablet/tablet-test.cc                  |  12 +--
 src/kudu/tablet/tablet.cc                       |  22 ++--
 src/kudu/tablet/tablet_bootstrap-test.cc        |   4 +-
 src/kudu/tablet/tablet_bootstrap.cc             |  12 +--
 src/kudu/tablet/tablet_metadata.cc              |   6 +-
 src/kudu/tablet/tablet_peer.cc                  |  11 +-
 .../transactions/alter_schema_transaction.cc    |   4 +-
 .../tablet/transactions/transaction_driver.cc   |   6 +-
 .../transactions/transaction_tracker-test.cc    |  12 +--
 .../tablet/transactions/write_transaction.cc    |  18 ++--
 src/kudu/tools/fs_tool.cc                       |   3 +-
 src/kudu/tools/kudu-admin-test.cc               |   4 +-
 src/kudu/tools/kudu-admin.cc                    |   2 +-
 src/kudu/tserver/heartbeater.cc                 |   4 +-
 src/kudu/tserver/mini_tablet_server.cc          |   2 +-
 src/kudu/tserver/remote_bootstrap_client.cc     |   4 +-
 .../tserver/remote_bootstrap_service-test.cc    |  28 ++---
 src/kudu/tserver/scanners-test.cc               |   6 +-
 src/kudu/tserver/scanners.cc                    |   2 +-
 src/kudu/tserver/tablet_server-test.cc          |  41 +++----
 src/kudu/tserver/tablet_service.cc              |  16 +--
 src/kudu/tserver/ts_tablet_manager-test.cc      |   4 +-
 src/kudu/tserver/ts_tablet_manager.cc           |   2 +-
 src/kudu/tserver/tserver-path-handlers.cc       |   4 +-
 src/kudu/util/cache-test.cc                     |   4 +-
 src/kudu/util/cache.cc                          |  26 ++---
 src/kudu/util/callback_bind-test.cc             |   2 +-
 src/kudu/util/coding.cc                         |  12 +--
 src/kudu/util/condition_variable.cc             |   2 +-
 src/kudu/util/crc.cc                            |   4 +-
 src/kudu/util/curl_util.cc                      |   2 +-
 src/kudu/util/debug-util-test.cc                |   2 +-
 src/kudu/util/debug-util.cc                     |   4 +-
 src/kudu/util/debug/trace_event_impl.cc         |  80 +++++++-------
 .../util/debug/trace_event_synthetic_delay.cc   |   2 +-
 src/kudu/util/env-test.cc                       |   2 +-
 src/kudu/util/env_posix.cc                      |  22 ++--
 src/kudu/util/env_util.cc                       |   2 +-
 src/kudu/util/hdr_histogram.cc                  |   4 +-
 src/kudu/util/jsonreader-test.cc                |  82 +++++++-------
 src/kudu/util/kernel_stack_watchdog.cc          |   2 +-
 src/kudu/util/logging.cc                        |   4 +-
 src/kudu/util/map-util-test.cc                  |   6 +-
 src/kudu/util/mem_tracker-test.cc               |   2 +-
 src/kudu/util/memory/arena.cc                   |  10 +-
 src/kudu/util/memory/memory.cc                  |  30 +++---
 src/kudu/util/metrics-test.cc                   |   2 +-
 src/kudu/util/metrics.cc                        |   2 +-
 src/kudu/util/net/net_util-test.cc              |   2 +-
 src/kudu/util/net/net_util.cc                   |   8 +-
 src/kudu/util/net/sockaddr.cc                   |   2 +-
 src/kudu/util/os-util.cc                        |  12 +--
 src/kudu/util/pb_util-test.cc                   |   2 +-
 src/kudu/util/pb_util.cc                        |   4 +-
 src/kudu/util/pstack_watcher.cc                 |   2 +-
 src/kudu/util/resettable_heartbeater.cc         |   2 +-
 src/kudu/util/rle-test.cc                       |  22 ++--
 src/kudu/util/rolling_log.cc                    |   2 +-
 src/kudu/util/spinlock_profiling.cc             |   4 +-
 src/kudu/util/status.cc                         |   8 +-
 src/kudu/util/striped64.cc                      |   4 +-
 src/kudu/util/subprocess.cc                     |  12 +--
 src/kudu/util/test_main.cc                      |   4 +-
 src/kudu/util/test_util.cc                      |   2 +-
 src/kudu/util/threadlocal.cc                    |   2 +-
 src/kudu/util/threadpool.cc                     |   2 +-
 src/kudu/util/trace-test.cc                     |  12 +--
 src/kudu/util/trace.cc                          |  16 +--
 src/kudu/util/url-coding.cc                     |   2 +-
 src/kudu/util/user.cc                           |   6 +-
 201 files changed, 919 insertions(+), 916 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/binary_dict_block.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/binary_dict_block.cc b/src/kudu/cfile/binary_dict_block.cc
index 415e67c..98aa7af 100644
--- a/src/kudu/cfile/binary_dict_block.cc
+++ b/src/kudu/cfile/binary_dict_block.cc
@@ -109,7 +109,7 @@ int BinaryDictBlockBuilder::AddCodeWords(const uint8_t* vals, size_t count) {
         break;
       }
       const uint8_t* s_ptr = dictionary_strings_arena_.AddSlice(*src);
-      if (s_ptr == NULL) {
+      if (s_ptr == nullptr) {
         // Arena does not have enough space for string content
         // Ideally, it should not happen.
         LOG(ERROR) << "Arena of Dictionary Encoder does not have enough memory for strings";
@@ -215,7 +215,7 @@ void BinaryDictBlockDecoder::SeekToPositionInBlock(uint pos) {
 
 Status BinaryDictBlockDecoder::SeekAtOrAfterValue(const void* value_void, bool* exact) {
   if (mode_ == kCodeWordMode) {
-    DCHECK(value_void != NULL);
+    DCHECK(value_void != nullptr);
     Status s = dict_decoder_->SeekAtOrAfterValue(value_void, exact);
     if (!s.ok()) {
       // This case means the value_void is larger that the largest key

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/binary_plain_block.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/binary_plain_block.cc b/src/kudu/cfile/binary_plain_block.cc
index c8eacfd..3446db5 100644
--- a/src/kudu/cfile/binary_plain_block.cc
+++ b/src/kudu/cfile/binary_plain_block.cc
@@ -224,7 +224,7 @@ void BinaryPlainBlockDecoder::SeekToPositionInBlock(uint pos) {
 }
 
 Status BinaryPlainBlockDecoder::SeekAtOrAfterValue(const void *value_void, bool *exact) {
-  DCHECK(value_void != NULL);
+  DCHECK(value_void != nullptr);
 
   const Slice &target = *reinterpret_cast<const Slice *>(value_void);
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/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 a9e8da2..efc66cd 100644
--- a/src/kudu/cfile/binary_prefix_block.cc
+++ b/src/kudu/cfile/binary_prefix_block.cc
@@ -44,10 +44,10 @@ static const uint8_t *DecodeEntryLengths(
   const uint8_t *ptr, const uint8_t *limit,
   uint32_t *shared, uint32_t *non_shared) {
 
-  if ((ptr = GetVarint32Ptr(ptr, limit, shared)) == NULL) return NULL;
-  if ((ptr = GetVarint32Ptr(ptr, limit, non_shared)) == NULL) return NULL;
+  if ((ptr = GetVarint32Ptr(ptr, limit, shared)) == nullptr) return nullptr;
+  if ((ptr = GetVarint32Ptr(ptr, limit, non_shared)) == nullptr) return nullptr;
   if (limit - ptr < *non_shared) {
-    return NULL;
+    return nullptr;
   }
 
   return ptr;
@@ -186,7 +186,7 @@ Status BinaryPrefixBlockBuilder::GetFirstKey(void *key) const {
   const uint8_t *p = &buffer_[kHeaderReservedLength];
   uint32_t shared, non_shared;
   p = DecodeEntryLengths(p, &buffer_[buffer_.size()], &shared, &non_shared);
-  if (p == NULL) {
+  if (p == nullptr) {
     return Status::Corruption("Could not decode first entry in string block");
   }
 
@@ -243,10 +243,10 @@ BinaryPrefixBlockDecoder::BinaryPrefixBlockDecoder(const Slice &slice)
     num_elems_(0),
     ordinal_pos_base_(0),
     num_restarts_(0),
-    restarts_(NULL),
-    data_start_(0),
+    restarts_(nullptr),
+    data_start_(nullptr),
     cur_idx_(0),
-    next_ptr_(NULL) {
+    next_ptr_(nullptr) {
 }
 
 Status BinaryPrefixBlockDecoder::ParseHeader() {
@@ -357,7 +357,7 @@ void BinaryPrefixBlockDecoder::SeekToRestartPoint(uint32_t idx) {
 
 Status BinaryPrefixBlockDecoder::SeekAtOrAfterValue(const void *value_void,
                                               bool *exact_match) {
-  DCHECK(value_void != NULL);
+  DCHECK(value_void != nullptr);
 
   const Slice &target = *reinterpret_cast<const Slice *>(value_void);
 
@@ -370,7 +370,7 @@ Status BinaryPrefixBlockDecoder::SeekAtOrAfterValue(const void *value_void,
     const uint8_t *entry = GetRestartPoint(mid);
     uint32_t shared, non_shared;
     const uint8_t *key_ptr = DecodeEntryLengths(entry, &shared, &non_shared);
-    if (key_ptr == NULL || (shared != 0)) {
+    if (key_ptr == nullptr || (shared != 0)) {
       string err =
         StringPrintf("bad entry restart=%d shared=%d\n", mid, shared) +
         HexDump(Slice(entry, 16));
@@ -428,7 +428,7 @@ Status BinaryPrefixBlockDecoder::CopyNextValues(size_t *n, ColumnDataView *dst)
 
   // Grab the first row, which we've cached from the last call or seek.
   const uint8_t *out_data = out_arena->AddSlice(cur_val_);
-  if (PREDICT_FALSE(out_data == NULL)) {
+  if (PREDICT_FALSE(out_data == nullptr)) {
     return Status::IOError(
       "Out of memory",
       StringPrintf("Failed to allocate %d bytes in output arena",
@@ -462,7 +462,7 @@ Status BinaryPrefixBlockDecoder::CopyNextValues(size_t *n, ColumnDataView *dst)
   if (cur_idx_ < num_elems_) {
     RETURN_NOT_OK(ParseNextValue());
   } else {
-    next_ptr_ = NULL;
+    next_ptr_ = nullptr;
   }
 
   *n = i;
@@ -504,7 +504,7 @@ Status BinaryPrefixBlockDecoder::SkipForward(int n) {
 }
 
 Status BinaryPrefixBlockDecoder::CheckNextPtr() {
-  DCHECK(next_ptr_ != NULL);
+  DCHECK(next_ptr_ != nullptr);
 
   if (PREDICT_FALSE(next_ptr_ == reinterpret_cast<const uint8_t *>(restarts_))) {
     DCHECK_EQ(cur_idx_, num_elems_ - 1);
@@ -519,7 +519,7 @@ inline Status BinaryPrefixBlockDecoder::ParseNextIntoArena(Slice prev_val,
   RETURN_NOT_OK(CheckNextPtr());
   uint32_t shared, non_shared;
   const uint8_t *val_delta = DecodeEntryLengths(next_ptr_, &shared, &non_shared);
-  if (val_delta == NULL) {
+  if (val_delta == nullptr) {
     return Status::Corruption(
       StringPrintf("Could not decode value length data at idx %d",
                    cur_idx_));
@@ -545,7 +545,7 @@ inline Status BinaryPrefixBlockDecoder::ParseNextValue() {
 
   uint32_t shared, non_shared;
   const uint8_t *val_delta = DecodeEntryLengths(next_ptr_, &shared, &non_shared);
-  if (val_delta == NULL) {
+  if (val_delta == nullptr) {
     return Status::Corruption(
       StringPrintf("Could not decode value length data at idx %d",
                    cur_idx_));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/block_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/block_cache.cc b/src/kudu/cfile/block_cache.cc
index 7b2c13b..2bf25bb 100644
--- a/src/kudu/cfile/block_cache.cc
+++ b/src/kudu/cfile/block_cache.cc
@@ -115,10 +115,10 @@ bool BlockCache::Lookup(FileId file_id, uint64_t offset, Cache::CacheBehavior be
                         BlockCacheHandle *handle) {
   CacheKey key(file_id, offset);
   Cache::Handle *h = cache_->Lookup(key.slice(), behavior);
-  if (h != NULL) {
+  if (h != nullptr) {
     handle->SetHandle(cache_.get(), h);
   }
-  return h != NULL;
+  return h != nullptr;
 }
 
 bool BlockCache::Insert(FileId file_id, uint64_t offset, const Slice &block_data,
@@ -129,11 +129,11 @@ bool BlockCache::Insert(FileId file_id, uint64_t offset, const Slice &block_data
   gscoped_ptr<Slice> value(new Slice(block_data));
   Cache::Handle *h = cache_->Insert(key.slice(), value.get(), value->size(),
                                     deleter_.get());
-  if (h != NULL) {
+  if (h != nullptr) {
     inserted->SetHandle(cache_.get(), h);
     ignore_result(value.release());
   }
-  return h != NULL;
+  return h != nullptr;
 }
 
 void BlockCache::StartInstrumentation(const scoped_refptr<MetricEntity>& metric_entity) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/cfile-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile-test.cc b/src/kudu/cfile/cfile-test.cc
index 0aab986..87a6bef 100644
--- a/src/kudu/cfile/cfile-test.cc
+++ b/src/kudu/cfile/cfile-test.cc
@@ -108,13 +108,13 @@ class TestCFile : public CFileTestBase {
     // Fetch all data using small batches of only a few rows.
     // This should catch edge conditions like a batch lining up exactly
     // with the end of a block.
-    unsigned int seed = time(NULL);
+    unsigned int seed = time(nullptr);
     LOG(INFO) << "Using random seed: " << seed;
     srand(seed);
     ASSERT_OK(iter->SeekToOrdinal(0));
     size_t fetched = 0;
     while (fetched < 10000) {
-      ColumnBlock advancing_block(out.type_info(), NULL,
+      ColumnBlock advancing_block(out.type_info(), nullptr,
                                   out.data() + (fetched * out.stride()),
                                   out.nrows() - fetched, out.arena());
       ASSERT_TRUE(iter->HasNext());
@@ -223,7 +223,7 @@ class TestCFile : public CFileTestBase {
       slices.push_back(Slice("Body"));
       slices.push_back(Slice("Tail"));
       slices.push_back(Slice(reinterpret_cast<uint8_t *>(&i), 4));
-      ASSERT_OK(w.AppendRawBlock(slices, i, NULL, "raw-data"));
+      ASSERT_OK(w.AppendRawBlock(slices, i, nullptr, "raw-data"));
     }
     ASSERT_OK(w.Finish());
 
@@ -326,7 +326,7 @@ template<DataType type>
 void CopyOne(CFileIterator *it,
              typename TypeTraits<type>::cpp_type *ret,
              Arena *arena) {
-  ColumnBlock cb(GetTypeInfo(type), NULL, ret, 1, arena);
+  ColumnBlock cb(GetTypeInfo(type), nullptr, ret, 1, arena);
   size_t n = 1;
   ASSERT_OK(it->CopyNextValues(&n, &cb));
   ASSERT_EQ(1, n);
@@ -635,7 +635,7 @@ TEST_P(TestCFileBothCacheTypes, TestDefaultColumnIter) {
   // Test Int Default Value
   uint32_t int_value = 15;
   DefaultColumnValueIterator iter(GetTypeInfo(UINT32), &int_value);
-  ColumnBlock int_col(GetTypeInfo(UINT32), NULL, data, kNumItems, NULL);
+  ColumnBlock int_col(GetTypeInfo(UINT32), nullptr, data, kNumItems, nullptr);
   ASSERT_OK(iter.Scan(&int_col));
   for (size_t i = 0; i < int_col.nrows(); ++i) {
     ASSERT_EQ(int_value, *reinterpret_cast<const uint32_t *>(int_col.cell_ptr(i)));
@@ -644,7 +644,7 @@ TEST_P(TestCFileBothCacheTypes, TestDefaultColumnIter) {
   // Test Int Nullable Default Value
   int_value = 321;
   DefaultColumnValueIterator nullable_iter(GetTypeInfo(UINT32), &int_value);
-  ColumnBlock nullable_col(GetTypeInfo(UINT32), null_bitmap, data, kNumItems, NULL);
+  ColumnBlock nullable_col(GetTypeInfo(UINT32), null_bitmap, data, kNumItems, nullptr);
   ASSERT_OK(nullable_iter.Scan(&nullable_col));
   for (size_t i = 0; i < nullable_col.nrows(); ++i) {
     ASSERT_FALSE(nullable_col.is_null(i));
@@ -652,8 +652,8 @@ TEST_P(TestCFileBothCacheTypes, TestDefaultColumnIter) {
   }
 
   // Test NULL Default Value
-  DefaultColumnValueIterator null_iter(GetTypeInfo(UINT32),  NULL);
-  ColumnBlock null_col(GetTypeInfo(UINT32), null_bitmap, data, kNumItems, NULL);
+  DefaultColumnValueIterator null_iter(GetTypeInfo(UINT32),  nullptr);
+  ColumnBlock null_col(GetTypeInfo(UINT32), null_bitmap, data, kNumItems, nullptr);
   ASSERT_OK(null_iter.Scan(&null_col));
   for (size_t i = 0; i < null_col.nrows(); ++i) {
     ASSERT_TRUE(null_col.is_null(i));
@@ -664,7 +664,7 @@ TEST_P(TestCFileBothCacheTypes, TestDefaultColumnIter) {
   Slice str_value("Hello");
   Arena arena(32*1024, 256*1024);
   DefaultColumnValueIterator str_iter(GetTypeInfo(STRING), &str_value);
-  ColumnBlock str_col(GetTypeInfo(STRING), NULL, str_data, kNumItems, &arena);
+  ColumnBlock str_col(GetTypeInfo(STRING), nullptr, str_data, kNumItems, &arena);
   ASSERT_OK(str_iter.Scan(&str_col));
   for (size_t i = 0; i < str_col.nrows(); ++i) {
     ASSERT_EQ(str_value, *reinterpret_cast<const Slice *>(str_col.cell_ptr(i)));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/cfile_reader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_reader.cc b/src/kudu/cfile/cfile_reader.cc
index 3378382..ebb107f 100644
--- a/src/kudu/cfile/cfile_reader.cc
+++ b/src/kudu/cfile/cfile_reader.cc
@@ -227,7 +227,7 @@ namespace {
 // the memory can be released using 'release()'.
 class ScratchMemory {
  public:
-  ScratchMemory() : cache_(NULL), ptr_(NULL), size_(-1) {}
+  ScratchMemory() : cache_(nullptr), ptr_(nullptr), size_(-1) {}
   ~ScratchMemory() {
     if (!ptr_) return;
     if (cache_) {
@@ -254,7 +254,7 @@ class ScratchMemory {
 
   void AllocateFromHeap(int size) {
     DCHECK(!ptr_);
-    cache_ = NULL;
+    cache_ = nullptr;
     ptr_ = new uint8_t[size];
     size_ = size;
   }
@@ -268,12 +268,12 @@ class ScratchMemory {
     if (cache_) {
       ptr_ = cache_->MoveToHeap(ptr_, size_);
     }
-    cache_ = NULL;
+    cache_ = nullptr;
   }
 
   // Return true if the current scratch memory was allocated from the cache.
   bool IsFromCache() const {
-    return cache_ != NULL;
+    return cache_ != nullptr;
   }
 
   uint8_t* get() {
@@ -282,7 +282,7 @@ class ScratchMemory {
 
   uint8_t* release() {
     uint8_t* ret = ptr_;
-    ptr_ = NULL;
+    ptr_ = nullptr;
     size_ = -1;
     return ret;
   }
@@ -331,7 +331,7 @@ Status CFileReader::ReadBlock(const BlockPointer &ptr, CacheControl cache_contro
   // then we should allocate our scratch memory directly from the cache.
   // This avoids an extra memory copy in the case of an NVM cache.
   ScratchMemory scratch;
-  if (block_uncompressor_ == NULL && cache_control == CACHE_BLOCK) {
+  if (block_uncompressor_ == nullptr && cache_control == CACHE_BLOCK) {
     scratch.TryAllocateFromCache(cache, ptr.size());
   } else {
     scratch.AllocateFromHeap(ptr.size());
@@ -344,7 +344,7 @@ Status CFileReader::ReadBlock(const BlockPointer &ptr, CacheControl cache_contro
   }
 
   // Decompress the block
-  if (block_uncompressor_ != NULL) {
+  if (block_uncompressor_ != nullptr) {
     // Get the size required for the uncompressed buffer
     uint32_t uncompressed_size;
     Status s = block_uncompressor_->ValidateHeader(block, &uncompressed_size);
@@ -478,9 +478,9 @@ Status DefaultColumnValueIterator::PrepareBatch(size_t *n) {
 Status DefaultColumnValueIterator::Scan(ColumnBlock *dst)  {
   if (dst->is_nullable()) {
     ColumnDataView dst_view(dst);
-    dst_view.SetNullBits(dst->nrows(), value_ != NULL);
+    dst_view.SetNullBits(dst->nrows(), value_ != nullptr);
   }
-  if (value_ != NULL) {
+  if (value_ != nullptr) {
     if (typeinfo_->physical_type() == BINARY) {
       const Slice *src_slice = reinterpret_cast<const Slice *>(value_);
       Slice dst_slice;
@@ -510,7 +510,7 @@ Status DefaultColumnValueIterator::FinishBatch() {
 CFileIterator::CFileIterator(CFileReader* reader,
                              CFileReader::CacheControl cache_control)
   : reader_(reader),
-    seeked_(NULL),
+    seeked_(nullptr),
     prepared_(false),
     cache_control_(cache_control),
     last_prepare_idx_(-1),
@@ -522,7 +522,7 @@ CFileIterator::~CFileIterator() {
 
 Status CFileIterator::SeekToOrdinal(rowid_t ord_idx) {
   RETURN_NOT_OK(PrepareForNewSeek());
-  if (PREDICT_FALSE(posidx_iter_ == NULL)) {
+  if (PREDICT_FALSE(posidx_iter_ == nullptr)) {
     return Status::NotSupported("no positional index in file");
   }
 
@@ -589,10 +589,10 @@ void CFileIterator::SeekToPositionInBlock(PreparedBlock *pb, uint32_t idx_in_blo
 Status CFileIterator::SeekToFirst() {
   RETURN_NOT_OK(PrepareForNewSeek());
   IndexTreeIterator *idx_iter;
-  if (PREDICT_TRUE(posidx_iter_ != NULL)) {
+  if (PREDICT_TRUE(posidx_iter_ != nullptr)) {
     RETURN_NOT_OK(posidx_iter_->SeekToFirst());
     idx_iter = posidx_iter_.get();
-  } else if (PREDICT_TRUE(validx_iter_ != NULL)) {
+  } else if (PREDICT_TRUE(validx_iter_ != nullptr)) {
     RETURN_NOT_OK(validx_iter_->SeekToFirst());
     idx_iter = validx_iter_.get();
   } else {
@@ -619,7 +619,7 @@ Status CFileIterator::SeekAtOrAfter(const EncodedKey &key,
   RETURN_NOT_OK(PrepareForNewSeek());
   DCHECK_EQ(reader_->is_nullable(), false);
 
-  if (PREDICT_FALSE(validx_iter_ == NULL)) {
+  if (PREDICT_FALSE(validx_iter_ == nullptr)) {
     return Status::NotSupported("no value index present");
   }
 
@@ -706,7 +706,7 @@ Status CFileIterator::PrepareForNewSeek() {
     RETURN_NOT_OK_PREPEND(dict_decoder_->ParseHeader(), "Couldn't parse dictionary block header");
   }
 
-  seeked_ = NULL;
+  seeked_ = nullptr;
   for (PreparedBlock *pb : prepared_blocks_) {
     prepared_block_pool_.Destroy(pb);
   }
@@ -798,7 +798,7 @@ bool CFileIterator::HasNext() const {
 
 Status CFileIterator::PrepareBatch(size_t *n) {
   CHECK(!prepared_) << "Should call FinishBatch() first";
-  CHECK(seeked_ != NULL) << "must be seeked";
+  CHECK(seeked_ != nullptr) << "must be seeked";
 
   CHECK(!prepared_blocks_.empty());
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/cfile_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_util.cc b/src/kudu/cfile/cfile_util.cc
index b43bcd4..ef9ca30 100644
--- a/src/kudu/cfile/cfile_util.cc
+++ b/src/kudu/cfile/cfile_util.cc
@@ -43,7 +43,7 @@ Status DumpIterator(const CFileReader& reader,
   const TypeInfo *type = reader.type_info();
   size_t max_rows = kBufSize/type->size();
   uint8_t nulls[BitmapSize(max_rows)];
-  ColumnBlock cb(type, reader.is_nullable() ? nulls : NULL, buf, max_rows, &arena);
+  ColumnBlock cb(type, reader.is_nullable() ? nulls : nullptr, buf, max_rows, &arena);
 
   string strbuf;
   size_t count = 0;
@@ -58,7 +58,7 @@ Status DumpIterator(const CFileReader& reader,
         for (size_t i = 0; i < n; i++) {
           strbuf.append(indent, ' ');
           const void *ptr = cb.nullable_cell_ptr(i);
-          if (ptr != NULL) {
+          if (ptr != nullptr) {
             type->AppendDebugStringForValue(ptr, &strbuf);
           } else {
             strbuf.append("NULL");

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/cfile_writer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_writer.cc b/src/kudu/cfile/cfile_writer.cc
index caeda21..db71e3c 100644
--- a/src/kudu/cfile/cfile_writer.cc
+++ b/src/kudu/cfile/cfile_writer.cc
@@ -95,7 +95,7 @@ CFileWriter::CFileWriter(const WriterOptions &options,
     options_(options),
     is_nullable_(is_nullable),
     typeinfo_(typeinfo),
-    key_encoder_(NULL),
+    key_encoder_(nullptr),
     state_(kWriterInitialized) {
   EncodingType encoding = options_.storage_attributes.encoding;
   Status s = TypeEncodingInfo::Get(typeinfo_, encoding, &type_encoding_info_);
@@ -308,7 +308,7 @@ Status CFileWriter::AppendEntries(const void *entries, size_t count) {
 Status CFileWriter::AppendNullableEntries(const uint8_t *bitmap,
                                           const void *entries,
                                           size_t count) {
-  DCHECK(is_nullable_ && bitmap != NULL);
+  DCHECK(is_nullable_ && bitmap != nullptr);
 
   const uint8_t *ptr = reinterpret_cast<const uint8_t *>(entries);
 
@@ -363,7 +363,7 @@ Status CFileWriter::FinishCurDataBlock() {
 
   uint8_t key_tmp_space[typeinfo_->size()];
 
-  if (validx_builder_ != NULL) {
+  if (validx_builder_ != nullptr) {
     // If we're building an index, we need to copy the first
     // key from the block locally, so we can write it into that index.
     RETURN_NOT_OK(data_block_->GetFirstKey(key_tmp_space));
@@ -407,14 +407,14 @@ Status CFileWriter::AppendRawBlock(const vector<Slice> &data_slices,
   }
 
   // Now add to the index blocks
-  if (posidx_builder_ != NULL) {
+  if (posidx_builder_ != nullptr) {
     tmp_buf_.clear();
     KeyEncoderTraits<UINT32, faststring>::Encode(ordinal_pos, &tmp_buf_);
     RETURN_NOT_OK(posidx_builder_->Append(Slice(tmp_buf_), ptr));
   }
 
-  if (validx_builder_ != NULL) {
-    CHECK(validx_key != NULL) <<
+  if (validx_builder_ != nullptr) {
+    CHECK(validx_key != nullptr) <<
       "must pass a  key for raw block if validx is configured";
     VLOG(1) << "Appending validx entry\n" <<
       kudu::HexDump(Slice(reinterpret_cast<const uint8_t *>(validx_key),
@@ -442,7 +442,7 @@ Status CFileWriter::AddBlock(const vector<Slice> &data_slices,
                              const char *name_for_log) {
   uint64_t start_offset = off_;
 
-  if (block_compressor_ != NULL) {
+  if (block_compressor_ != nullptr) {
     // Write compressed block
     Slice cdata;
     Status s = block_compressor_->Compress(data_slices, &cdata);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/compression-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/compression-test.cc b/src/kudu/cfile/compression-test.cc
index 0266a41..a03275f 100644
--- a/src/kudu/cfile/compression-test.cc
+++ b/src/kudu/cfile/compression-test.cc
@@ -96,7 +96,7 @@ class TestCompression : public CFileTestBase {
 TEST_F(TestCompression, TestNoCompressionCodec) {
   const CompressionCodec* codec;
   ASSERT_OK(GetCompressionCodec(NO_COMPRESSION, &codec));
-  ASSERT_EQ(NULL, codec);
+  ASSERT_EQ(nullptr, codec);
 }
 
 TEST_F(TestCompression, TestSnappyCompressionCodec) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/compression_codec.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/compression_codec.cc b/src/kudu/cfile/compression_codec.cc
index 2a66a79..2594f79 100644
--- a/src/kudu/cfile/compression_codec.cc
+++ b/src/kudu/cfile/compression_codec.cc
@@ -53,7 +53,7 @@ class SlicesSource : public snappy::Source {
   const char* Peek(size_t* len) OVERRIDE {
     if (available_ == 0) {
       *len = 0;
-      return NULL;
+      return nullptr;
     }
 
     const Slice& data = slices_[slice_index_];
@@ -229,7 +229,7 @@ Status GetCompressionCodec(CompressionType compression,
                            const CompressionCodec** codec) {
   switch (compression) {
     case NO_COMPRESSION:
-      *codec = NULL;
+      *codec = nullptr;
       break;
     case SNAPPY:
       *codec = SnappyCodec::GetSingleton();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/encoding-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/encoding-test.cc b/src/kudu/cfile/encoding-test.cc
index 051dc58..f1a83c5 100644
--- a/src/kudu/cfile/encoding-test.cc
+++ b/src/kudu/cfile/encoding-test.cc
@@ -59,7 +59,7 @@ class TestEncoding : public ::testing::Test {
   template<DataType type>
   void CopyOne(BlockDecoder *decoder,
                typename TypeTraits<type>::cpp_type *ret) {
-    ColumnBlock cb(GetTypeInfo(type), NULL, ret, 1, &arena_);
+    ColumnBlock cb(GetTypeInfo(type), nullptr, ret, 1, &arena_);
     ColumnDataView cdv(&cb);
     size_t n = 1;
     ASSERT_OK(decoder->CopyNextValues(&n, &cdv));
@@ -372,7 +372,7 @@ class TestEncoding : public ::testing::Test {
     std::vector<CppType> decoded;
     decoded.resize(size);
 
-    ColumnBlock dst_block(GetTypeInfo(Type), NULL, &decoded[0], size, &arena_);
+    ColumnBlock dst_block(GetTypeInfo(Type), nullptr, &decoded[0], size, &arena_);
     ColumnDataView view(&dst_block);
     int dec_count = 0;
     while (pbd.HasNext()) {
@@ -466,7 +466,7 @@ class TestEncoding : public ::testing::Test {
     std::vector<CppType> decoded;
     decoded.resize(to_insert.size());
 
-    ColumnBlock dst_block(GetTypeInfo(IntType), NULL,
+    ColumnBlock dst_block(GetTypeInfo(IntType), nullptr,
                           &decoded[0],
                           to_insert.size(),
                           &arena_);
@@ -543,7 +543,7 @@ class TestEncoding : public ::testing::Test {
     std::vector<uint8_t> decoded;
     decoded.resize(to_insert.size());
 
-    ColumnBlock dst_block(GetTypeInfo(BOOL), NULL,
+    ColumnBlock dst_block(GetTypeInfo(BOOL), nullptr,
                           &decoded[0],
                           to_insert.size(),
                           &arena_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/gvint_block.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/gvint_block.cc b/src/kudu/cfile/gvint_block.cc
index d13cf7e..c3fc8f7 100644
--- a/src/kudu/cfile/gvint_block.cc
+++ b/src/kudu/cfile/gvint_block.cc
@@ -120,7 +120,7 @@ Slice GVIntBlockBuilder::Finish(rowid_t ordinal_pos) {
 GVIntBlockDecoder::GVIntBlockDecoder(const Slice &slice)
   : data_(slice),
     parsed_(false),
-    cur_pos_(NULL),
+    cur_pos_(nullptr),
     cur_idx_(0) {
 }
 
@@ -169,7 +169,7 @@ void GVIntBlockDecoder::SeekToPositionInBlock(uint pos) {
   CHECK(parsed_) << "Must call ParseHeader()";
 
   // no-op if seeking to current position
-  if (cur_idx_ == pos && cur_pos_ != NULL) return;
+  if (cur_idx_ == pos && cur_pos_ != nullptr) return;
 
   // Reset to start of block
   cur_pos_ = ints_start_;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/index_block.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/index_block.cc b/src/kudu/cfile/index_block.cc
index fb01834..b5908d2 100644
--- a/src/kudu/cfile/index_block.cc
+++ b/src/kudu/cfile/index_block.cc
@@ -32,14 +32,14 @@ inline const uint8_t *SliceDecode(const uint8_t *encoded_ptr, const uint8_t *lim
                          Slice *retptr) {
   uint32_t len;
   const uint8_t *data_start = GetVarint32Ptr(encoded_ptr, limit, &len);
-  if (data_start == NULL) {
+  if (data_start == nullptr) {
     // bad varint
-    return NULL;
+    return nullptr;
   }
 
   if (data_start + len > limit) {
     // length extends past end of valid area
-    return NULL;
+    return nullptr;
   }
 
   *retptr = Slice(data_start, len);
@@ -95,7 +95,7 @@ Status IndexBlockBuilder::GetFirstKey(Slice *key) const {
     return Status::NotFound("no keys in builder");
   }
 
-  bool success = NULL != SliceDecode(buffer_.data(),buffer_.data() + buffer_.size(),key);
+  bool success = nullptr != SliceDecode(buffer_.data(),buffer_.data() + buffer_.size(),key);
 
   if (success) {
     return Status::OK();
@@ -187,7 +187,7 @@ int IndexBlockReader::CompareKey(int idx_in_block,
   const uint8_t *key_ptr, *limit;
   GetKeyPointer(idx_in_block, &key_ptr, &limit);
   Slice this_slice;
-  if (PREDICT_FALSE(SliceDecode(key_ptr, limit, &this_slice) == NULL)) {
+  if (PREDICT_FALSE(SliceDecode(key_ptr, limit, &this_slice) == nullptr)) {
     LOG(WARNING)<< "Invalid data in block!";
     return 0;
   }
@@ -207,7 +207,7 @@ Status IndexBlockReader::ReadEntry(size_t idx, Slice *key, BlockPointer *block_p
   GetKeyPointer(idx, &ptr, &limit);
 
   ptr = SliceDecode(ptr, limit, key);
-  if (ptr == NULL) {
+  if (ptr == nullptr) {
     return Status::Corruption("Invalid key in index");
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/cfile/type_encodings.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/type_encodings.cc b/src/kudu/cfile/type_encodings.cc
index baaeb8d..63bb0ed 100644
--- a/src/kudu/cfile/type_encodings.cc
+++ b/src/kudu/cfile/type_encodings.cc
@@ -236,7 +236,7 @@ class TypeEncodingResolver {
       e = GetDefaultEncoding(t);
     }
     const TypeEncodingInfo *type_info = mapping_[make_pair(t, e)].get();
-    if (PREDICT_FALSE(type_info == NULL)) {
+    if (PREDICT_FALSE(type_info == nullptr)) {
       return Status::NotSupported(
           strings::Substitute("Unsupported type/encoding pair: $0, $1",
                               DataType_Name(t),

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/client/client-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-internal.cc b/src/kudu/client/client-internal.cc
index ff98037..8c8f939 100644
--- a/src/kudu/client/client-internal.cc
+++ b/src/kudu/client/client-internal.cc
@@ -155,7 +155,7 @@ Status KuduClient::Data::SyncLeaderMasterRpc(
     rpc_deadline.AddDelta(client->default_rpc_timeout());
     rpc.set_deadline(MonoTime::Earliest(rpc_deadline, deadline));
 
-    if (num_attempts != NULL) {
+    if (num_attempts != nullptr) {
       ++*num_attempts;
     }
     Status s = func(master_proxy_.get(), req, resp, &rpc);
@@ -241,15 +241,15 @@ RemoteTabletServer* KuduClient::Data::SelectTServer(const scoped_refptr<RemoteTa
                                                     const ReplicaSelection selection,
                                                     const set<string>& blacklist,
                                                     vector<RemoteTabletServer*>* candidates) const {
-  RemoteTabletServer* ret = NULL;
+  RemoteTabletServer* ret = nullptr;
   candidates->clear();
   switch (selection) {
     case LEADER_ONLY: {
       ret = rt->LeaderTServer();
-      if (ret != NULL) {
+      if (ret != nullptr) {
         candidates->push_back(ret);
         if (ContainsKey(blacklist, ret->permanent_uuid())) {
-          ret = NULL;
+          ret = nullptr;
         }
       }
       break;
@@ -279,7 +279,7 @@ RemoteTabletServer* KuduClient::Data::SelectTServer(const scoped_refptr<RemoteTa
           }
         }
         // Fallback to a random replica if none are local.
-        if (ret == NULL && !filtered.empty()) {
+        if (ret == nullptr && !filtered.empty()) {
           ret = filtered[rand() % filtered.size()];
         }
       }
@@ -305,7 +305,7 @@ Status KuduClient::Data::GetTabletServer(KuduClient* client,
   meta_cache_->LookupTabletByID(tablet_id, &remote_tablet);
 
   RemoteTabletServer* ret = SelectTServer(remote_tablet, selection, blacklist, candidates);
-  if (PREDICT_FALSE(ret == NULL)) {
+  if (PREDICT_FALSE(ret == nullptr)) {
     // Construct a blacklist string if applicable.
     string blacklist_string = "";
     if (!blacklist.empty()) {
@@ -393,7 +393,7 @@ Status KuduClient::Data::IsCreateTableInProgress(KuduClient* client,
           client,
           req,
           &resp,
-          NULL,
+          nullptr,
           &MasterServiceProxy::IsCreateTableDone);
   // RETURN_NOT_OK macro can't take templated function call as param,
   // and SyncLeaderMasterRpc must be explicitly instantiated, else the
@@ -451,7 +451,7 @@ Status KuduClient::Data::AlterTable(KuduClient* client,
           client,
           req,
           &resp,
-          NULL,
+          nullptr,
           &MasterServiceProxy::AlterTable);
   RETURN_NOT_OK(s);
   // TODO: Consider the situation where the request is sent to the
@@ -479,7 +479,7 @@ Status KuduClient::Data::IsAlterTableInProgress(KuduClient* client,
           client,
           req,
           &resp,
-          NULL,
+          nullptr,
           &MasterServiceProxy::IsAlterTableDone);
   RETURN_NOT_OK(s);
   if (resp.has_error()) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/client/client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 29ea8a8..2377716 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -1031,7 +1031,7 @@ TEST_F(ClientTest, TestGetTabletServerBlacklist) {
     client_->data_->meta_cache_->LookupTabletByKey(table.get(), "", MonoTime::Max(), &rt,
                                                   sync.AsStatusCallback());
     ASSERT_OK(sync.Wait());
-    ASSERT_TRUE(rt.get() != NULL);
+    ASSERT_TRUE(rt.get() != nullptr);
     vector<internal::RemoteTabletServer*> tservers;
     rt->GetRemoteTabletServers(&tservers);
     if (tservers.size() == 3) {
@@ -1418,7 +1418,7 @@ TEST_F(ClientTest, TestInsertSingleRowManualBatch) {
   // Retry
   ASSERT_OK(insert->mutable_row()->SetInt32("key", 12345));
   ASSERT_OK(session->Apply(insert.release()));
-  ASSERT_TRUE(insert == NULL) << "Successful insert should take ownership";
+  ASSERT_TRUE(insert == nullptr) << "Successful insert should take ownership";
   ASSERT_TRUE(session->HasPendingOperations()) << "Should be pending until we Flush";
 
   FlushSessionOrDie(session);
@@ -2190,7 +2190,7 @@ TEST_F(ClientTest, TestReplicatedTabletWritesWithLeaderElection) {
   ASSERT_NE(-1, new_leader_idx);
 
   MiniTabletServer* new_leader = cluster_->mini_tablet_server(new_leader_idx);
-  ASSERT_TRUE(new_leader != NULL);
+  ASSERT_TRUE(new_leader != nullptr);
   new_leader_proxy.reset(
       new consensus::ConsensusServiceProxy(client_messenger,
                                            new_leader->bound_rpc_addr()));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/client/client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.cc b/src/kudu/client/client.cc
index 82f5a77..bafbadc 100644
--- a/src/kudu/client/client.cc
+++ b/src/kudu/client/client.cc
@@ -291,7 +291,7 @@ Status KuduClient::ListTabletServers(vector<KuduTabletServer*>* tablet_servers)
           this,
           req,
           &resp,
-          NULL,
+          nullptr,
           &MasterServiceProxy::ListTabletServers);
   RETURN_NOT_OK(s);
   if (resp.has_error()) {
@@ -323,7 +323,7 @@ Status KuduClient::ListTables(vector<string>* tables,
           this,
           req,
           &resp,
-          NULL,
+          nullptr,
           &MasterServiceProxy::ListTables);
   RETURN_NOT_OK(s);
   if (resp.has_error()) {
@@ -1041,7 +1041,7 @@ string KuduScanner::ToString() const {
 
 Status KuduScanner::Open() {
   CHECK(!data_->open_) << "Scanner already open";
-  CHECK(data_->projection_ != NULL) << "No projection provided";
+  CHECK(data_->projection_ != nullptr) << "No projection provided";
 
   // Find the first tablet.
   data_->spec_encoder_.EncodeRangePredicates(&data_->spec_, false);
@@ -1056,8 +1056,8 @@ Status KuduScanner::Open() {
     data_->table_->partition_schema().IsSimplePKRangePartitioning(*data_->table_->schema().schema_);
 
   if (!is_simple_range_partitioned &&
-      (data_->spec_.lower_bound_key() != NULL ||
-       data_->spec_.exclusive_upper_bound_key() != NULL ||
+      (data_->spec_.lower_bound_key() != nullptr ||
+       data_->spec_.exclusive_upper_bound_key() != nullptr ||
        !data_->spec_.predicates().empty())) {
     KLOG_FIRST_N(WARNING, 1) << "Starting full table scan. In the future this scan may be "
                                 "automatically optimized with partition pruning.";
@@ -1069,9 +1069,9 @@ Status KuduScanner::Open() {
     // length by only scanning the intersection of the primary key range and the
     // partition key range. This is a stop-gap until real partition pruning is
     // in place that will work across any partition type.
-    Slice start_primary_key = data_->spec_.lower_bound_key() == NULL ? Slice()
+    Slice start_primary_key = data_->spec_.lower_bound_key() == nullptr ? Slice()
                             : data_->spec_.lower_bound_key()->encoded_key();
-    Slice end_primary_key = data_->spec_.exclusive_upper_bound_key() == NULL ? Slice()
+    Slice end_primary_key = data_->spec_.exclusive_upper_bound_key() == nullptr ? Slice()
                           : data_->spec_.exclusive_upper_bound_key()->encoded_key();
     Slice start_partition_key = data_->spec_.lower_bound_partition_key();
     Slice end_partition_key = data_->spec_.exclusive_upper_bound_partition_key();
@@ -1239,7 +1239,7 @@ Status KuduScanner::GetCurrentServer(KuduTabletServer** server) {
 }
 
 KuduTabletServer::KuduTabletServer()
-  : data_(NULL) {
+  : data_(nullptr) {
 }
 
 KuduTabletServer::~KuduTabletServer() {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/client/meta_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/meta_cache.cc b/src/kudu/client/meta_cache.cc
index 038af91..c9877d8 100644
--- a/src/kudu/client/meta_cache.cc
+++ b/src/kudu/client/meta_cache.cc
@@ -213,11 +213,11 @@ RemoteTabletServer* RemoteTablet::LeaderTServer() const {
       return replica.ts;
     }
   }
-  return NULL;
+  return nullptr;
 }
 
 bool RemoteTablet::HasLeader() const {
-  return LeaderTServer() != NULL;
+  return LeaderTServer() != nullptr;
 }
 
 void RemoteTablet::GetRemoteTabletServers(vector<RemoteTabletServer*>* servers) const {
@@ -544,7 +544,7 @@ const scoped_refptr<RemoteTablet>& MetaCache::ProcessLookupResponse(const Lookup
     // Next, update the tablet caches.
     string tablet_id = loc.tablet_id();
     scoped_refptr<RemoteTablet> remote = FindPtrOrNull(tablets_by_id_, tablet_id);
-    if (remote.get() != NULL) {
+    if (remote.get() != nullptr) {
       // Partition should not have changed.
       DCHECK_EQ(loc.partition().partition_key_start(), remote->partition().partition_key_start());
       DCHECK_EQ(loc.partition().partition_key_end(), remote->partition().partition_key_end());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/client/scan_predicate.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scan_predicate.cc b/src/kudu/client/scan_predicate.cc
index 29414e3..8844cda 100644
--- a/src/kudu/client/scan_predicate.cc
+++ b/src/kudu/client/scan_predicate.cc
@@ -65,8 +65,8 @@ Status ComparisonPredicateData::AddToScanSpec(ScanSpec* spec) {
                                                     col_.type_info()->physical_type(),
                                                     &val_void));
 
-  void* lower_bound = NULL;
-  void* upper_bound = NULL;
+  void* lower_bound = nullptr;
+  void* upper_bound = nullptr;
   switch (op_) {
     case KuduPredicate::LESS_EQUAL:
       upper_bound = val_void;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/client/scanner-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scanner-internal.cc b/src/kudu/client/scanner-internal.cc
index 9b158fd..3fee9e9 100644
--- a/src/kudu/client/scanner-internal.cc
+++ b/src/kudu/client/scanner-internal.cc
@@ -450,7 +450,7 @@ bool KuduScanner::Data::MoreTablets() const {
     return true;
   }
 
-  if (spec_.exclusive_upper_bound_key() == NULL) {
+  if (spec_.exclusive_upper_bound_key() == nullptr) {
     // No upper bound - keep going!
     return true;
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/client/schema.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/schema.cc b/src/kudu/client/schema.cc
index 5614356..9f57df0 100644
--- a/src/kudu/client/schema.cc
+++ b/src/kudu/client/schema.cc
@@ -221,7 +221,7 @@ Status KuduColumnSpec::ToColumnSchema(KuduColumnSchema* col) const {
 
   bool nullable = data_->has_nullable ? data_->nullable : true;
 
-  void* default_val = NULL;
+  void* default_val = nullptr;
   // TODO: distinguish between DEFAULT NULL and no default?
   if (data_->has_default) {
     RETURN_NOT_OK(data_->default_val->data_->CheckTypeAndGetPointer(
@@ -404,11 +404,11 @@ KuduColumnSchema::KuduColumnSchema(const std::string &name,
 }
 
 KuduColumnSchema::KuduColumnSchema(const KuduColumnSchema& other)
-  : col_(NULL) {
+  : col_(nullptr) {
   CopyFrom(other);
 }
 
-KuduColumnSchema::KuduColumnSchema() : col_(NULL) {
+KuduColumnSchema::KuduColumnSchema() : col_(nullptr) {
 }
 
 KuduColumnSchema::~KuduColumnSchema() {
@@ -427,14 +427,14 @@ void KuduColumnSchema::CopyFrom(const KuduColumnSchema& other) {
   if (other.col_) {
     col_ = new ColumnSchema(*other.col_);
   } else {
-    col_ = NULL;
+    col_ = nullptr;
   }
 }
 
 bool KuduColumnSchema::Equals(const KuduColumnSchema& other) const {
   return this == &other ||
     col_ == other.col_ ||
-    (col_ != NULL && col_->Equals(*other.col_, true));
+    (col_ != nullptr && col_->Equals(*other.col_, true));
 }
 
 const std::string& KuduColumnSchema::name() const {
@@ -455,11 +455,11 @@ KuduColumnSchema::DataType KuduColumnSchema::type() const {
 ////////////////////////////////////////////////////////////
 
 KuduSchema::KuduSchema()
-  : schema_(NULL) {
+  : schema_(nullptr) {
 }
 
 KuduSchema::KuduSchema(const KuduSchema& other)
-  : schema_(NULL) {
+  : schema_(nullptr) {
   CopyFrom(other);
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/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 e5774b2..f1b8b42 100644
--- a/src/kudu/client/table_creator-internal.cc
+++ b/src/kudu/client/table_creator-internal.cc
@@ -26,7 +26,7 @@ namespace client {
 
 KuduTableCreator::Data::Data(KuduClient* client)
   : client_(client),
-    schema_(NULL),
+    schema_(nullptr),
     num_replicas_(0),
     wait_(true) {
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/codegen/codegen-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/codegen-test.cc b/src/kudu/codegen/codegen-test.cc
index 0c209fe..71f255a 100644
--- a/src/kudu/codegen/codegen-test.cc
+++ b/src/kudu/codegen/codegen-test.cc
@@ -63,9 +63,9 @@ class CodegenTest : public KuduTest {
     base_ = SchemaBuilder(base_).Build(); // add IDs
 
     // Create an extended default schema
-    cols.push_back(ColumnSchema("int32-R ",  INT32, false, kI32R,  NULL));
+    cols.push_back(ColumnSchema("int32-R ",  INT32, false, kI32R,  nullptr));
     cols.push_back(ColumnSchema("int32-RW",  INT32, false, kI32R, kI32W));
-    cols.push_back(ColumnSchema("str32-R ", STRING, false, kStrR,  NULL));
+    cols.push_back(ColumnSchema("str32-R ", STRING, false, kStrR,  nullptr));
     cols.push_back(ColumnSchema("str32-RW", STRING, false, kStrR, kStrW));
     defaults_.Reset(cols, 1);
     defaults_ = SchemaBuilder(defaults_).Build(); // add IDs

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/codegen/module_builder.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/module_builder.cc b/src/kudu/codegen/module_builder.cc
index ad0fe1f..533f238 100644
--- a/src/kudu/codegen/module_builder.cc
+++ b/src/kudu/codegen/module_builder.cc
@@ -276,7 +276,7 @@ Status ModuleBuilder::Compile(unique_ptr<ExecutionEngine>* out) {
   // Satisfy the promises
   for (JITFuture& fut : futures_) {
     *fut.actual_f_ = local_engine->getPointerToFunction(fut.llvm_f_);
-    if (*fut.actual_f_ == NULL) {
+    if (*fut.actual_f_ == nullptr) {
       return Status::NotFound(
         "Code generation for module failed. Could not find function \""
         + ToString(fut.llvm_f_) + "\".");

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/codegen/precompiled.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/precompiled.cc b/src/kudu/codegen/precompiled.cc
index db21c9a..7f2e20b 100644
--- a/src/kudu/codegen/precompiled.cc
+++ b/src/kudu/codegen/precompiled.cc
@@ -59,7 +59,7 @@ static bool BasicCopyCell(uint64_t size, uint8_t* src, uint8_t* dst,
                           bool is_string, Arena* arena) {
   // Relocate indirect data
   if (is_string) {
-    if (PREDICT_TRUE(arena != NULL)) {
+    if (PREDICT_TRUE(arena != nullptr)) {
       return PREDICT_TRUE(arena->RelocateSlice(*reinterpret_cast<Slice*>(src),
                                                reinterpret_cast<Slice*>(dst)));
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/codegen/row_projector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/row_projector.cc b/src/kudu/codegen/row_projector.cc
index 3ba4ad9..dd16285 100644
--- a/src/kudu/codegen/row_projector.cc
+++ b/src/kudu/codegen/row_projector.cc
@@ -223,11 +223,11 @@ llvm::Function* MakeProjection(const string& name,
 
     // Handle default columns that are nullable
     if (col.is_nullable()) {
-      Value* is_null = builder->getInt1(dfl == NULL);
+      Value* is_null = builder->getInt1(dfl == nullptr);
       vector<Value*> args = { rbrow, col_idx, is_null };
       builder->CreateCall(row_block_set_null, args);
       // If dfl was NULL, we're done
-      if (dfl == NULL) continue;
+      if (dfl == nullptr) continue;
     }
 
     // Make the copy cell call and check the return value
@@ -261,9 +261,9 @@ RowProjectorFunctions::RowProjectorFunctions(const Schema& base_schema,
     projection_(projection),
     read_f_(read_f),
     write_f_(write_f) {
-  CHECK(read_f != NULL)
+  CHECK(read_f != nullptr)
     << "Promise to compile read function not fulfilled by ModuleBuilder";
-  CHECK(write_f != NULL)
+  CHECK(write_f != nullptr)
     << "Promise to compile write function not fulfilled by ModuleBuilder";
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/encoded_key.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/encoded_key.cc b/src/kudu/common/encoded_key.cc
index fafd581..888d109 100644
--- a/src/kudu/common/encoded_key.cc
+++ b/src/kudu/common/encoded_key.cc
@@ -160,7 +160,7 @@ void EncodedKeyBuilder::AddColumnKey(const void *raw_key) {
 
 EncodedKey *EncodedKeyBuilder::BuildEncodedKey() {
   if (idx_ == 0) {
-    return NULL;
+    return nullptr;
   }
   EncodedKey *ret = new EncodedKey(&encoded_key_, &raw_keys_, num_key_cols_);
   idx_ = 0;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/generic_iterators-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/generic_iterators-test.cc b/src/kudu/common/generic_iterators-test.cc
index aaaf9e9..0571166 100644
--- a/src/kudu/common/generic_iterators-test.cc
+++ b/src/kudu/common/generic_iterators-test.cc
@@ -116,7 +116,7 @@ TEST(TestMergeIterator, TestMergeEmpty) {
   to_merge.push_back(iter);
 
   MergeIterator merger(kIntSchema, to_merge);
-  ASSERT_OK(merger.Init(NULL));
+  ASSERT_OK(merger.Init(nullptr));
   ASSERT_FALSE(merger.HasNext());
 }
 
@@ -176,7 +176,7 @@ void TestMerge(const TestIntRangePredicate &predicate) {
       MergeIterator merger(kIntSchema, to_merge);
       ASSERT_OK(merger.Init(&spec));
 
-      RowBlock dst(kIntSchema, 100, NULL);
+      RowBlock dst(kIntSchema, 100, nullptr);
       size_t total_idx = 0;
       while (merger.HasNext()) {
         ASSERT_OK(merger.NextBlock(&dst));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/generic_iterators.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/generic_iterators.cc b/src/kudu/common/generic_iterators.cc
index d6a876f..ebe8788 100644
--- a/src/kudu/common/generic_iterators.cc
+++ b/src/kudu/common/generic_iterators.cc
@@ -185,14 +185,14 @@ bool MergeIterator::HasNext() const {
 Status MergeIterator::InitSubIterators(ScanSpec *spec) {
   // Initialize all the sub iterators.
   for (shared_ptr<RowwiseIterator> &iter : orig_iters_) {
-    ScanSpec *spec_copy = spec != NULL ? scan_spec_copies_.Construct(*spec) : NULL;
+    ScanSpec *spec_copy = spec != nullptr ? scan_spec_copies_.Construct(*spec) : nullptr;
     RETURN_NOT_OK(PredicateEvaluatingIterator::InitAndMaybeWrap(&iter, spec_copy));
     iters_.push_back(shared_ptr<MergeIterState>(new MergeIterState(iter)));
   }
 
   // Since we handle predicates in all the wrapped iterators, we can clear
   // them here.
-  if (spec != NULL) {
+  if (spec != nullptr) {
     spec->mutable_predicates()->clear();
   }
   return Status::OK();
@@ -234,7 +234,7 @@ Status MergeIterator::MaterializeBlock(RowBlock *dst) {
     RowBlockRow dst_row = dst->row(dst_row_idx);
 
     // Find the sub-iterator which is currently smallest
-    MergeIterState *smallest = NULL;
+    MergeIterState *smallest = nullptr;
     ssize_t smallest_idx = -1;
 
     // Typically the number of iters_ is not that large, so using a priority
@@ -242,7 +242,7 @@ Status MergeIterator::MaterializeBlock(RowBlock *dst) {
     for (size_t i = 0; i < iters_.size(); i++) {
       shared_ptr<MergeIterState> &state = iters_[i];
 
-      if (smallest == NULL ||
+      if (smallest == nullptr ||
           schema_.Compare(state->next_row(), smallest->next_row()) < 0) {
         smallest = state.get();
         smallest_idx = i;
@@ -250,7 +250,7 @@ Status MergeIterator::MaterializeBlock(RowBlock *dst) {
     }
 
     // If no iterators had any row left, then we're done iterating.
-    if (PREDICT_FALSE(smallest == NULL)) break;
+    if (PREDICT_FALSE(smallest == nullptr)) break;
 
     // Otherwise, copy the row from the smallest one, and advance it
     RETURN_NOT_OK(CopyRow(smallest->next_row(), &dst_row, dst->arena()));
@@ -340,12 +340,12 @@ Status UnionIterator::Init(ScanSpec *spec) {
 
 Status UnionIterator::InitSubIterators(ScanSpec *spec) {
   for (shared_ptr<RowwiseIterator> &iter : iters_) {
-    ScanSpec *spec_copy = spec != NULL ? scan_spec_copies_.Construct(*spec) : NULL;
+    ScanSpec *spec_copy = spec != nullptr ? scan_spec_copies_.Construct(*spec) : nullptr;
     RETURN_NOT_OK(PredicateEvaluatingIterator::InitAndMaybeWrap(&iter, spec_copy));
   }
   // Since we handle predicates in all the wrapped iterators, we can clear
   // them here.
-  if (spec != NULL) {
+  if (spec != nullptr) {
     spec->mutable_predicates()->clear();
   }
   return Status::OK();
@@ -433,7 +433,7 @@ MaterializingIterator::MaterializingIterator(const shared_ptr<ColumnwiseIterator
 Status MaterializingIterator::Init(ScanSpec *spec) {
   RETURN_NOT_OK(iter_->Init(spec));
 
-  if (spec != NULL && !disallow_pushdown_for_tests_) {
+  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();
@@ -550,7 +550,7 @@ PredicateEvaluatingIterator::PredicateEvaluatingIterator(
 Status PredicateEvaluatingIterator::InitAndMaybeWrap(
   shared_ptr<RowwiseIterator> *base_iter, ScanSpec *spec) {
   RETURN_NOT_OK((*base_iter)->Init(spec));
-  if (spec != NULL &&
+  if (spec != nullptr &&
       !spec->predicates().empty()) {
     // Underlying iterator did not accept all predicates. Wrap it.
     shared_ptr<RowwiseIterator> wrapper(

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/predicate-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/predicate-test.cc b/src/kudu/common/predicate-test.cc
index a9cc376..a7c83f8 100644
--- a/src/kudu/common/predicate-test.cc
+++ b/src/kudu/common/predicate-test.cc
@@ -105,7 +105,7 @@ TEST_F(TestPredicate, TestColumnRange) {
 
   // Apply predicate col1 >= 250
   uint32_t col1_lower = 250;
-  ColumnRangePredicate pred2(schema_.column(1), &col1_lower, NULL);
+  ColumnRangePredicate pred2(schema_.column(1), &col1_lower, nullptr);
   ASSERT_EQ("(`col1` >= 250)", pred2.ToString());
   pred2.Evaluate(&row_block_, &selvec);
   ASSERT_EQ(5, selvec.CountSelected()) << "Only 5 rows should be left (25-29)";
@@ -123,7 +123,7 @@ TEST_F(TestPredicate, TestDontEvalauteOnUnselectedRows) {
                        "JUNKDATA");
 
   Slice lower("lower");
-  ColumnRangePredicate p(schema_.column(2), &lower, NULL);
+  ColumnRangePredicate p(schema_.column(2), &lower, nullptr);
   p.Evaluate(&row_block_, &selvec);
   ASSERT_EQ(0, selvec.CountSelected());
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/predicate_encoder-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/predicate_encoder-test.cc b/src/kudu/common/predicate_encoder-test.cc
index 2b5f899..b2486d1 100644
--- a/src/kudu/common/predicate_encoder-test.cc
+++ b/src/kudu/common/predicate_encoder-test.cc
@@ -45,8 +45,8 @@ class TestRangePredicateEncoder : public KuduTest {
     int idx = schema_.find_column(col);
     CHECK_GE(idx, 0);
 
-    void* upper = NULL;
-    void* lower = NULL;
+    void* upper = nullptr;
+    void* lower = nullptr;
     void* val_void = arena_.AllocateBytes(sizeof(val));
     memcpy(val_void, &val, sizeof(val));
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/predicate_encoder.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/predicate_encoder.cc b/src/kudu/common/predicate_encoder.cc
index 436cfe3..946a067 100644
--- a/src/kudu/common/predicate_encoder.cc
+++ b/src/kudu/common/predicate_encoder.cc
@@ -190,7 +190,7 @@ void RangePredicateEncoder::SimplifyBounds(const ScanSpec& spec,
     if (pred.range().has_upper_bound()) {
       // If we haven't seen any upper bound, or this upper bound is tighter than
       // (less than) the one we've seen already, replace it.
-      if ((*key_bounds)[idx].upper == NULL ||
+      if ((*key_bounds)[idx].upper == nullptr ||
           col.type_info()->Compare(pred.range().upper_bound(),
                                    (*key_bounds)[idx].upper) < 0) {
         (*key_bounds)[idx].upper = pred.range().upper_bound();
@@ -200,7 +200,7 @@ void RangePredicateEncoder::SimplifyBounds(const ScanSpec& spec,
     if (pred.range().has_lower_bound()) {
       // If we haven't seen any lower bound, or this lower bound is tighter than
       // (greater than) the one we've seen already, replace it.
-      if ((*key_bounds)[idx].lower == NULL ||
+      if ((*key_bounds)[idx].lower == nullptr ||
           col.type_info()->Compare(pred.range().lower_bound(),
                                    (*key_bounds)[idx].lower) > 0) {
         (*key_bounds)[idx].lower = pred.range().lower_bound();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/row_changelist-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/row_changelist-test.cc b/src/kudu/common/row_changelist-test.cc
index 457f7bf..c5cfa73 100644
--- a/src/kudu/common/row_changelist-test.cc
+++ b/src/kudu/common/row_changelist-test.cc
@@ -67,7 +67,7 @@ TEST_F(TestRowChangeList, TestEncodeDecodeUpdates) {
   rcl.AddColumnUpdate(schema_.column(0), c0_id, &update1);
   rcl.AddColumnUpdate(schema_.column(1), c1_id, &update2);
   rcl.AddColumnUpdate(schema_.column(2), c2_id, &update3);
-  rcl.AddColumnUpdate(schema_.column(3), c3_id, NULL);
+  rcl.AddColumnUpdate(schema_.column(3), c3_id, nullptr);
 
   LOG(INFO) << "Encoded: " << HexDump(buf);
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/row_changelist.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/row_changelist.cc b/src/kudu/common/row_changelist.cc
index c49c83b..5429c9c 100644
--- a/src/kudu/common/row_changelist.cc
+++ b/src/kudu/common/row_changelist.cc
@@ -84,7 +84,7 @@ string RowChangeList::ToString(const Schema &schema) const {
       const ColumnSchema& col_schema = schema.column(col_idx);
       ret.append(col_schema.name());
       ret.append("=");
-      if (value == NULL) {
+      if (value == nullptr) {
         ret.append("NULL");
       } else {
         ret.append(col_schema.Stringify(value));
@@ -116,7 +116,7 @@ void RowChangeListEncoder::AddColumnUpdate(const ColumnSchema& col_schema,
                                            int col_id,
                                            const void* cell_ptr) {
   Slice val_slice;
-  if (cell_ptr != NULL) {
+  if (cell_ptr != nullptr) {
     if (col_schema.type_info()->physical_type() == BINARY) {
       memcpy(&val_slice, cell_ptr, sizeof(val_slice));
     } else {
@@ -128,7 +128,7 @@ void RowChangeListEncoder::AddColumnUpdate(const ColumnSchema& col_schema,
     DCHECK(col_schema.is_nullable());
   }
 
-  AddRawColumnUpdate(col_id, cell_ptr == NULL, val_slice);
+  AddRawColumnUpdate(col_id, cell_ptr == nullptr, val_slice);
 }
 
 Status RowChangeListDecoder::Init() {
@@ -336,7 +336,7 @@ Status RowChangeListDecoder::DecodedUpdate::Validate(const Schema& schema,
       return Status::Corruption("decoded set-to-NULL for non-nullable column",
                                 col.ToString());
     }
-    *value = NULL;
+    *value = nullptr;
     return Status::OK();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/row_operations-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/row_operations-test.cc b/src/kudu/common/row_operations-test.cc
index eac8ed4..4ae3418 100644
--- a/src/kudu/common/row_operations-test.cc
+++ b/src/kudu/common/row_operations-test.cc
@@ -274,12 +274,12 @@ TEST_F(RowOperationsTest, SchemaFuzz) {
 // One case from SchemaFuzz which failed previously.
 TEST_F(RowOperationsTest, TestFuzz1) {
   SchemaBuilder client_schema_builder;
-  client_schema_builder.AddColumn("c1", INT32, false, NULL, NULL);
-  client_schema_builder.AddColumn("c2", STRING, false, NULL, NULL);
+  client_schema_builder.AddColumn("c1", INT32, false, nullptr, nullptr);
+  client_schema_builder.AddColumn("c2", STRING, false, nullptr, nullptr);
   Schema client_schema = client_schema_builder.BuildWithoutIds();
   SchemaBuilder server_schema_builder;
-  server_schema_builder.AddColumn("c1", INT32, false, NULL, NULL);
-  server_schema_builder.AddColumn("c2", STRING, false, NULL, NULL);
+  server_schema_builder.AddColumn("c1", INT32, false, nullptr, nullptr);
+  server_schema_builder.AddColumn("c2", STRING, false, nullptr, nullptr);
   Schema server_schema = server_schema_builder.Build();
   KuduPartialRow row(&client_schema);
   CHECK_OK(row.SetInt32(0, 12345));
@@ -290,12 +290,12 @@ TEST_F(RowOperationsTest, TestFuzz1) {
 // Another case from SchemaFuzz which failed previously.
 TEST_F(RowOperationsTest, TestFuzz2) {
   SchemaBuilder client_schema_builder;
-  client_schema_builder.AddColumn("c1", STRING, true, NULL, NULL);
-  client_schema_builder.AddColumn("c2", STRING, false, NULL, NULL);
+  client_schema_builder.AddColumn("c1", STRING, true, nullptr, nullptr);
+  client_schema_builder.AddColumn("c2", STRING, false, nullptr, nullptr);
   Schema client_schema = client_schema_builder.BuildWithoutIds();
   SchemaBuilder server_schema_builder;
-  server_schema_builder.AddColumn("c1", STRING, true, NULL, NULL);
-  server_schema_builder.AddColumn("c2", STRING, false, NULL, NULL);
+  server_schema_builder.AddColumn("c1", STRING, true, nullptr, nullptr);
+  server_schema_builder.AddColumn("c2", STRING, false, nullptr, nullptr);
   Schema server_schema = server_schema_builder.Build();
   KuduPartialRow row(&client_schema);
   CHECK_OK(row.SetNull(0));
@@ -634,7 +634,7 @@ TEST_F(RowOperationsTest, SplitKeyRoundTrip) {
   RowOperationsPBEncoder(&pb).Add(RowOperationsPB::SPLIT_ROW, row);
 
   Schema schema = client_schema.CopyWithColumnIds();
-  RowOperationsPBDecoder decoder(&pb, &client_schema, &schema, NULL);
+  RowOperationsPBDecoder decoder(&pb, &client_schema, &schema, nullptr);
   vector<DecodedRowOperation> ops;
   ASSERT_OK(decoder.DecodeOperations(&ops));
   ASSERT_EQ(1, ops.size());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/row_operations.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/row_operations.cc b/src/kudu/common/row_operations.cc
index e076e62..896b4c2 100644
--- a/src/kudu/common/row_operations.cc
+++ b/src/kudu/common/row_operations.cc
@@ -145,7 +145,7 @@ Status RowOperationsPBDecoder::ReadOpType(RowOperationsPB::Type* type) {
 
 Status RowOperationsPBDecoder::ReadIssetBitmap(const uint8_t** bitmap) {
   if (PREDICT_FALSE(src_.size() < bm_size_)) {
-    *bitmap = NULL;
+    *bitmap = nullptr;
     return Status::Corruption("Cannot find isset bitmap");
   }
   *bitmap = src_.data();
@@ -155,7 +155,7 @@ Status RowOperationsPBDecoder::ReadIssetBitmap(const uint8_t** bitmap) {
 
 Status RowOperationsPBDecoder::ReadNullBitmap(const uint8_t** null_bm) {
   if (PREDICT_FALSE(src_.size() < bm_size_)) {
-    *null_bm = NULL;
+    *null_bm = nullptr;
     return Status::Corruption("Cannot find null bitmap");
   }
   *null_bm = src_.data();
@@ -445,7 +445,7 @@ Status RowOperationsPBDecoder::DecodeUpdateOrDelete(const ClientServerMapping& m
             return Status::InvalidArgument("NULL value not allowed for non-nullable column",
                                            col.ToString());
           }
-          val_to_add = NULL;
+          val_to_add = nullptr;
         }
         rcl_encoder.AddColumnUpdate(col, tablet_schema_->column_id(tablet_col_idx), val_to_add);
       }
@@ -460,7 +460,7 @@ Status RowOperationsPBDecoder::DecodeUpdateOrDelete(const ClientServerMapping& m
     // Copy the row-changelist to the arena.
     uint8_t* rcl_in_arena = reinterpret_cast<uint8_t*>(
       dst_arena_->AllocateBytesAligned(buf.size(), 8));
-    if (PREDICT_FALSE(rcl_in_arena == NULL)) {
+    if (PREDICT_FALSE(rcl_in_arena == nullptr)) {
       return Status::RuntimeError("Out of memory allocating RCL");
     }
     memcpy(rcl_in_arena, buf.data(), buf.size());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/scan_predicate.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/scan_predicate.cc b/src/kudu/common/scan_predicate.cc
index 4b5d44a..1113920 100644
--- a/src/kudu/common/scan_predicate.cc
+++ b/src/kudu/common/scan_predicate.cc
@@ -78,7 +78,7 @@ void ColumnRangePredicate::Evaluate(RowBlock* block, SelectionVector* vec) const
     for (size_t i = 0; i < block->nrows(); i++) {
       if (!vec->IsRowSelected(i)) continue;
       const void *cell = cblock.nullable_cell_ptr(i);
-      if (cell == NULL || !range_.ContainsCell(cell)) {
+      if (cell == nullptr || !range_.ContainsCell(cell)) {
         BitmapClear(vec->mutable_bitmap(), i);
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/scan_spec.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/scan_spec.cc b/src/kudu/common/scan_spec.cc
index 9a24328..9419508 100644
--- a/src/kudu/common/scan_spec.cc
+++ b/src/kudu/common/scan_spec.cc
@@ -33,13 +33,13 @@ void ScanSpec::AddPredicate(const ColumnRangePredicate &pred) {
 }
 
 void ScanSpec::SetLowerBoundKey(const EncodedKey* key) {
-  if (lower_bound_key_ == NULL ||
+  if (lower_bound_key_ == nullptr ||
       key->encoded_key().compare(lower_bound_key_->encoded_key()) > 0) {
     lower_bound_key_ = key;
   }
 }
 void ScanSpec::SetExclusiveUpperBoundKey(const EncodedKey* key) {
-  if (exclusive_upper_bound_key_ == NULL ||
+  if (exclusive_upper_bound_key_ == nullptr ||
       key->encoded_key().compare(exclusive_upper_bound_key_->encoded_key()) < 0) {
     exclusive_upper_bound_key_ = key;
   }
@@ -59,7 +59,7 @@ void ScanSpec::SetExclusiveUpperBoundPartitionKey(const Slice& partitionKey) {
 }
 
 string ScanSpec::ToString() const {
-  return ToStringWithOptionalSchema(NULL);
+  return ToStringWithOptionalSchema(nullptr);
 }
 
 string ScanSpec::ToStringWithSchema(const Schema& s) const {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/types.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/types.cc b/src/kudu/common/types.cc
index 207efde..ca29e41 100644
--- a/src/kudu/common/types.cc
+++ b/src/kudu/common/types.cc
@@ -50,7 +50,7 @@ class TypeInfoResolver {
  public:
   const TypeInfo* GetTypeInfo(DataType t) {
     const TypeInfo *type_info = mapping_[t].get();
-    CHECK(type_info != NULL) <<
+    CHECK(type_info != nullptr) <<
       "Bad type: " << t;
     return type_info;
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/wire_protocol-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/wire_protocol-test.cc b/src/kudu/common/wire_protocol-test.cc
index a9f6c1b..8091942 100644
--- a/src/kudu/common/wire_protocol-test.cc
+++ b/src/kudu/common/wire_protocol-test.cc
@@ -190,7 +190,7 @@ TEST_F(WireProtocolTest, TestColumnarRowBlockToPB) {
   // Convert to PB.
   RowwiseRowBlockPB pb;
   faststring direct, indirect;
-  SerializeRowBlock(block, &pb, NULL, &direct, &indirect);
+  SerializeRowBlock(block, &pb, nullptr, &direct, &indirect);
   SCOPED_TRACE(pb.DebugString());
   SCOPED_TRACE("Row data: " + direct.ToString());
   SCOPED_TRACE("Indirect data: " + indirect.ToString());
@@ -268,7 +268,7 @@ TEST_F(WireProtocolTest, TestBlockWithNoColumns) {
   // Convert it to protobuf, ensure that the results look right.
   RowwiseRowBlockPB pb;
   faststring direct, indirect;
-  SerializeRowBlock(block, &pb, NULL, &direct, &indirect);
+  SerializeRowBlock(block, &pb, nullptr, &direct, &indirect);
   ASSERT_EQ(900, pb.num_rows());
 }
 
@@ -284,7 +284,7 @@ TEST_F(WireProtocolTest, TestColumnDefaultValue) {
   ColumnSchema col1fpb = ColumnSchemaFromPB(pb);
   ASSERT_FALSE(col1fpb.has_read_default());
   ASSERT_FALSE(col1fpb.has_write_default());
-  ASSERT_TRUE(col1fpb.read_default_value() == NULL);
+  ASSERT_TRUE(col1fpb.read_default_value() == nullptr);
 
   ColumnSchema col2("col2", STRING, false, &read_default_str);
   ColumnSchemaToPB(col2, &pb);
@@ -292,7 +292,7 @@ TEST_F(WireProtocolTest, TestColumnDefaultValue) {
   ASSERT_TRUE(col2fpb.has_read_default());
   ASSERT_FALSE(col2fpb.has_write_default());
   ASSERT_EQ(read_default_str, *static_cast<const Slice *>(col2fpb.read_default_value()));
-  ASSERT_EQ(NULL, static_cast<const Slice *>(col2fpb.write_default_value()));
+  ASSERT_EQ(nullptr, static_cast<const Slice *>(col2fpb.write_default_value()));
 
   ColumnSchema col3("col3", STRING, false, &read_default_str, &write_default_str);
   ColumnSchemaToPB(col3, &pb);
@@ -308,7 +308,7 @@ TEST_F(WireProtocolTest, TestColumnDefaultValue) {
   ASSERT_TRUE(col4fpb.has_read_default());
   ASSERT_FALSE(col4fpb.has_write_default());
   ASSERT_EQ(read_default_u32, *static_cast<const uint32_t *>(col4fpb.read_default_value()));
-  ASSERT_EQ(NULL, static_cast<const uint32_t *>(col4fpb.write_default_value()));
+  ASSERT_EQ(nullptr, static_cast<const uint32_t *>(col4fpb.write_default_value()));
 
   ColumnSchema col5("col5", UINT32, false, &read_default_u32, &write_default_u32);
   ColumnSchemaToPB(col5, &pb);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/common/wire_protocol.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/wire_protocol.cc b/src/kudu/common/wire_protocol.cc
index 774afb7..289f9a8 100644
--- a/src/kudu/common/wire_protocol.cc
+++ b/src/kudu/common/wire_protocol.cc
@@ -221,8 +221,8 @@ void ColumnSchemaToPB(const ColumnSchema& col_schema, ColumnSchemaPB *pb, int fl
 }
 
 ColumnSchema ColumnSchemaFromPB(const ColumnSchemaPB& pb) {
-  const void *write_default_ptr = NULL;
-  const void *read_default_ptr = NULL;
+  const void *write_default_ptr = nullptr;
+  const void *read_default_ptr = nullptr;
   Slice write_default;
   Slice read_default;
   const TypeInfo* typeinfo = GetTypeInfo(pb.type());
@@ -514,7 +514,7 @@ void SerializeRowBlock(const RowBlock& block, RowwiseRowBlockPB* rowblock_pb,
   DCHECK_GT(block.nrows(), 0);
   const Schema& tablet_schema = block.schema();
 
-  if (projection_schema == NULL) {
+  if (projection_schema == nullptr) {
     projection_schema = &tablet_schema;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/consensus/consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus.cc b/src/kudu/consensus/consensus.cc
index b8b30ed..52d2fbd 100644
--- a/src/kudu/consensus/consensus.cc
+++ b/src/kudu/consensus/consensus.cc
@@ -87,7 +87,7 @@ const shared_ptr<Consensus::ConsensusFaultHooks>& Consensus::GetFaultHooks() con
 }
 
 Status Consensus::ExecuteHook(HookPoint point) {
-  if (PREDICT_FALSE(fault_hooks_.get() != NULL)) {
+  if (PREDICT_FALSE(fault_hooks_.get() != nullptr)) {
     switch (point) {
       case Consensus::PRE_START: return fault_hooks_->PreStart();
       case Consensus::POST_START: return fault_hooks_->PostStart();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/consensus/consensus_peers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_peers.cc b/src/kudu/consensus/consensus_peers.cc
index 93fff35..4dbccde 100644
--- a/src/kudu/consensus/consensus_peers.cc
+++ b/src/kudu/consensus/consensus_peers.cc
@@ -343,7 +343,7 @@ void Peer::Close() {
   boost::lock_guard<Semaphore> l(sem_);
   queue_->UntrackPeer(peer_pb_.permanent_uuid());
   // We don't own the ops (the queue does).
-  request_.mutable_ops()->ExtractSubrange(0, request_.ops_size(), NULL);
+  request_.mutable_ops()->ExtractSubrange(0, request_.ops_size(), nullptr);
 }
 
 Peer::~Peer() {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/consensus/consensus_queue-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_queue-test.cc b/src/kudu/consensus/consensus_queue-test.cc
index 9eb90cb..fe10135 100644
--- a/src/kudu/consensus/consensus_queue-test.cc
+++ b/src/kudu/consensus/consensus_queue-test.cc
@@ -235,7 +235,7 @@ TEST_F(ConsensusQueueTest, TestStartTrackingAfterStart) {
   ASSERT_EQ(0, request.ops_size());
 
   // extract the ops from the request to avoid double free
-  request.mutable_ops()->ExtractSubrange(0, request.ops_size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops_size(), nullptr);
 }
 
 // Tests that the peers gets the messages pages, with the size of a page
@@ -302,7 +302,7 @@ TEST_F(ConsensusQueueTest, TestGetPagedMessages) {
   ASSERT_FALSE(more_pending);
 
   // extract the ops from the request to avoid double free
-  request.mutable_ops()->ExtractSubrange(0, request.ops_size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops_size(), nullptr);
 }
 
 TEST_F(ConsensusQueueTest, TestPeersDontAckBeyondWatermarks) {
@@ -371,7 +371,7 @@ TEST_F(ConsensusQueueTest, TestPeersDontAckBeyondWatermarks) {
   ASSERT_OPID_EQ(queue_->GetAllReplicatedIndexForTests(), expected);
 
   // extract the ops from the request to avoid double free
-  request.mutable_ops()->ExtractSubrange(0, request.ops_size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops_size(), nullptr);
 }
 
 TEST_F(ConsensusQueueTest, TestQueueAdvancesCommittedIndex) {
@@ -505,7 +505,7 @@ TEST_F(ConsensusQueueTest, TestQueueLoadsOperationsForPeer) {
   ASSERT_EQ(request.ops_size(), 50);
 
   // The messages still belong to the queue so we have to release them.
-  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), nullptr);
 }
 
 // This tests that the queue is able to handle operation overwriting, i.e. when a
@@ -612,7 +612,7 @@ TEST_F(ConsensusQueueTest, TestQueueHandlesOperationOverwriting) {
   ASSERT_OPID_EQ(queue_->GetAllReplicatedIndexForTests(), MakeOpId(2, 21));
 
   // The messages still belong to the queue so we have to release them.
-  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), nullptr);
 }
 
 // Test for a bug where we wouldn't move any watermark back, when overwriting
@@ -735,7 +735,7 @@ TEST_F(ConsensusQueueTest, TestOnlyAdvancesWatermarkWhenPeerHasAPrefixOfOurLog)
 
   // Another request for this peer should get another page of messages. Still not
   // on the queue's term (and thus without advancing watermarks).
-  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), nullptr);
   ASSERT_OK(queue_->RequestForPeer(kPeerUuid, &request, &refs, &needs_remote_bootstrap));
   ASSERT_FALSE(needs_remote_bootstrap);
   ASSERT_EQ(request.ops_size(), 9);
@@ -754,7 +754,7 @@ TEST_F(ConsensusQueueTest, TestOnlyAdvancesWatermarkWhenPeerHasAPrefixOfOurLog)
 
   // The last page of request should overwrite the peer's operations and the
   // response should finally advance the watermarks.
-  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), nullptr);
   ASSERT_OK(queue_->RequestForPeer(kPeerUuid, &request, &refs, &needs_remote_bootstrap));
   ASSERT_FALSE(needs_remote_bootstrap);
   ASSERT_EQ(request.ops_size(), 4);
@@ -771,7 +771,7 @@ TEST_F(ConsensusQueueTest, TestOnlyAdvancesWatermarkWhenPeerHasAPrefixOfOurLog)
   ASSERT_OPID_EQ(queue_->GetMajorityReplicatedOpIdForTests(), expected_majority_replicated);
   ASSERT_OPID_EQ(queue_->GetAllReplicatedIndexForTests(), expected_all_replicated);
 
-  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), NULL);
+  request.mutable_ops()->ExtractSubrange(0, request.ops().size(), nullptr);
 }
 
 // Test that remote bootstrap is triggered when a "tablet not found" error occurs.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/35b49cc5/src/kudu/consensus/consensus_queue.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_queue.cc b/src/kudu/consensus/consensus_queue.cc
index a4e3b4b..2c1650d 100644
--- a/src/kudu/consensus/consensus_queue.cc
+++ b/src/kudu/consensus/consensus_queue.cc
@@ -194,7 +194,7 @@ void PeerMessageQueue::TrackPeerUnlocked(const string& uuid) {
 void PeerMessageQueue::UntrackPeer(const string& uuid) {
   boost::lock_guard<simple_spinlock> lock(queue_lock_);
   TrackedPeer* peer = EraseKeyReturnValuePtr(&peers_map_, uuid);
-  if (peer != NULL) {
+  if (peer != nullptr) {
     delete peer;
   }
 }
@@ -275,7 +275,7 @@ Status PeerMessageQueue::RequestForPeer(const string& uuid,
                                         ConsensusRequestPB* request,
                                         vector<ReplicateRefPtr>* msg_refs,
                                         bool* needs_remote_bootstrap) {
-  TrackedPeer* peer = NULL;
+  TrackedPeer* peer = nullptr;
   OpId preceding_id;
   {
     lock_guard<simple_spinlock> lock(&queue_lock_);
@@ -283,12 +283,12 @@ Status PeerMessageQueue::RequestForPeer(const string& uuid,
     DCHECK_NE(uuid, local_peer_pb_.permanent_uuid());
 
     peer = FindPtrOrNull(peers_map_, uuid);
-    if (PREDICT_FALSE(peer == NULL || queue_state_.mode == NON_LEADER)) {
+    if (PREDICT_FALSE(peer == nullptr || queue_state_.mode == NON_LEADER)) {
       return Status::NotFound("Peer not tracked or queue not in leader mode.");
     }
 
     // Clear the requests without deleting the entries, as they may be in use by other peers.
-    request->mutable_ops()->ExtractSubrange(0, request->ops_size(), NULL);
+    request->mutable_ops()->ExtractSubrange(0, request->ops_size(), nullptr);
 
     // This is initialized to the queue's last appended op but gets set to the id of the
     // log entry preceding the first one in 'messages' if messages are found for the peer.
@@ -388,13 +388,13 @@ Status PeerMessageQueue::RequestForPeer(const string& uuid,
 
 Status PeerMessageQueue::GetRemoteBootstrapRequestForPeer(const string& uuid,
                                                           StartRemoteBootstrapRequestPB* req) {
-  TrackedPeer* peer = NULL;
+  TrackedPeer* peer = nullptr;
   {
     lock_guard<simple_spinlock> lock(&queue_lock_);
     DCHECK_EQ(queue_state_.state, kQueueOpen);
     DCHECK_NE(uuid, local_peer_pb_.permanent_uuid());
     peer = FindPtrOrNull(peers_map_, uuid);
-    if (PREDICT_FALSE(peer == NULL || queue_state_.mode == NON_LEADER)) {
+    if (PREDICT_FALSE(peer == nullptr || queue_state_.mode == NON_LEADER)) {
       return Status::NotFound("Peer not tracked or queue not in leader mode.");
     }
   }
@@ -485,7 +485,7 @@ void PeerMessageQueue::ResponseFromPeer(const std::string& peer_uuid,
     DCHECK_NE(kQueueConstructed, queue_state_.state);
 
     TrackedPeer* peer = FindPtrOrNull(peers_map_, peer_uuid);
-    if (PREDICT_FALSE(queue_state_.state != kQueueOpen || peer == NULL)) {
+    if (PREDICT_FALSE(queue_state_.state != kQueueOpen || peer == nullptr)) {
       LOG_WITH_PREFIX_UNLOCKED(WARNING) << "Queue is closed or peer was untracked, disregarding "
           "peer response. Response: " << response.ShortDebugString();
       *more_pending = false;



Mime
View raw message