kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject kudu git commit: Use nullptr instead of NULL in compaction
Date Mon, 15 Aug 2016 02:55:38 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 5be08fd79 -> b7e4f1212


Use nullptr instead of NULL in compaction

No functional changes here.

Change-Id: I2e9cba25065dbb4e577e3b4034d0c3cb2e4a5bf5
Reviewed-on: http://gerrit.cloudera.org:8080/3971
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


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

Branch: refs/heads/master
Commit: b7e4f1212f7ec69a9eb1a379555f4174a5c8040c
Parents: 5be08fd
Author: Mike Percy <mpercy@apache.org>
Authored: Sat Aug 13 17:34:31 2016 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Mon Aug 15 02:55:24 2016 +0000

----------------------------------------------------------------------
 src/kudu/tablet/compaction.cc       | 18 +++++++++---------
 src/kudu/tablet/delta_compaction.cc |  4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b7e4f121/src/kudu/tablet/compaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/compaction.cc b/src/kudu/tablet/compaction.cc
index 9243337..37a8877 100644
--- a/src/kudu/tablet/compaction.cc
+++ b/src/kudu/tablet/compaction.cc
@@ -60,7 +60,7 @@ class MemRowSetCompactionInput : public CompactionInput {
   }
 
   virtual Status Init() OVERRIDE {
-    RETURN_NOT_OK(iter_->Init(NULL));
+    RETURN_NOT_OK(iter_->Init(nullptr));
     has_more_blocks_ = iter_->HasNext();
     return Status::OK();
   }
@@ -87,7 +87,7 @@ class MemRowSetCompactionInput : public CompactionInput {
       input_row.row.Reset(row_block_.get(), i);
       Timestamp insertion_timestamp;
       RETURN_NOT_OK(iter_->GetCurrentRow(&input_row.row,
-                                         reinterpret_cast<Arena*>(NULL),
+                                         static_cast<Arena*>(nullptr),
                                          &input_row.redo_head,
                                          &arena_,
                                          &insertion_timestamp));
@@ -142,8 +142,8 @@ class DiskRowSetCompactionInput : public CompactionInput {
         undo_delta_iter_(std::move(undo_delta_iter)),
         arena_(32 * 1024, 128 * 1024),
         block_(base_iter_->schema(), kRowsPerBlock, &arena_),
-        redo_mutation_block_(kRowsPerBlock, reinterpret_cast<Mutation *>(NULL)),
-        undo_mutation_block_(kRowsPerBlock, reinterpret_cast<Mutation *>(NULL)),
+        redo_mutation_block_(kRowsPerBlock, static_cast<Mutation *>(nullptr)),
+        undo_mutation_block_(kRowsPerBlock, static_cast<Mutation *>(nullptr)),
         first_rowid_in_block_(0) {}
 
   virtual Status Init() OVERRIDE {
@@ -164,9 +164,9 @@ class DiskRowSetCompactionInput : public CompactionInput {
   virtual Status PrepareBlock(vector<CompactionInputRow> *block) OVERRIDE {
     RETURN_NOT_OK(base_iter_->NextBlock(&block_));
     std::fill(redo_mutation_block_.begin(), redo_mutation_block_.end(),
-              reinterpret_cast<Mutation *>(NULL));
+              static_cast<Mutation *>(nullptr));
     std::fill(undo_mutation_block_.begin(), undo_mutation_block_.end(),
-                  reinterpret_cast<Mutation *>(NULL));
+                  static_cast<Mutation *>(nullptr));
     RETURN_NOT_OK(redo_delta_iter_->PrepareBatch(
                       block_.nrows(), DeltaIterator::PREPARE_FOR_COLLECT));
     RETURN_NOT_OK(redo_delta_iter_->CollectMutations(&redo_mutation_block_, block_.arena()));
@@ -654,7 +654,7 @@ Status ApplyMutationsAndGenerateUndos(const MvccSnapshot& snap,
       DCHECK(!is_deleted) << "Got UPDATE for deleted row. " << ERROR_LOG_CONTEXT;
 
       s = redo_decoder.ApplyRowUpdate(dst_row,
-                                      reinterpret_cast<Arena *>(NULL), &undo_encoder);
+                                      static_cast<Arena *>(nullptr), &undo_encoder);
       if (PREDICT_FALSE(!s.ok())) {
         LOG(ERROR) << "Unable to apply update/create undo: " << s.ToString()
                    << "\n" << ERROR_LOG_CONTEXT;
@@ -671,7 +671,7 @@ Status ApplyMutationsAndGenerateUndos(const MvccSnapshot& snap,
       current_undo = Mutation::CreateInArena(arena, redo_mut->timestamp(),
                                              undo_encoder.as_changelist());
 
-      // In the case where the previous undo was NULL just make this one
+      // In the case where the previous undo was a nullptr just make this one
       // the head.
       if (undo_head == nullptr) {
         undo_head = current_undo;
@@ -762,7 +762,7 @@ Status FlushCompactionInput(CompactionInput* input,
       DCHECK(schema->has_column_ids());
 
       RowBlockRow dst_row = block.row(n);
-      RETURN_NOT_OK(CopyRow(input_row.row, &dst_row, reinterpret_cast<Arena*>(NULL)));
+      RETURN_NOT_OK(CopyRow(input_row.row, &dst_row, static_cast<Arena*>(nullptr)));
 
       DVLOG(2) << "Input Row: " << dst_row.schema()->DebugRow(dst_row) <<
         " RowId: " << input_row.row.row_index() <<

http://git-wip-us.apache.org/repos/asf/kudu/blob/b7e4f121/src/kudu/tablet/delta_compaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/delta_compaction.cc b/src/kudu/tablet/delta_compaction.cc
index b79b414..1cd7297 100644
--- a/src/kudu/tablet/delta_compaction.cc
+++ b/src/kudu/tablet/delta_compaction.cc
@@ -123,7 +123,7 @@ Status MajorDeltaCompaction::FlushRowSetAndDeltas() {
     size_t n = block.nrows();
 
     // 2) Fetch all the REDO mutations.
-    vector<Mutation *> redo_mutation_block(kRowsPerBlock, reinterpret_cast<Mutation
*>(NULL));
+    vector<Mutation *> redo_mutation_block(kRowsPerBlock, static_cast<Mutation *>(nullptr));
     RETURN_NOT_OK(delta_iter_->PrepareBatch(n, DeltaIterator::PREPARE_FOR_COLLECT));
     RETURN_NOT_OK(delta_iter_->CollectMutations(&redo_mutation_block, block.arena()));
 
@@ -139,7 +139,7 @@ Status MajorDeltaCompaction::FlushRowSetAndDeltas() {
       input_row.undo_head = nullptr;
 
       RowBlockRow dst_row = block.row(i);
-      RETURN_NOT_OK(CopyRow(input_row.row, &dst_row, reinterpret_cast<Arena*>(NULL)));
+      RETURN_NOT_OK(CopyRow(input_row.row, &dst_row, static_cast<Arena*>(nullptr)));
 
       Mutation* new_undos_head = nullptr;
       // We're ignoring the result from new_redos_head because we'll find them later at step
5).


Mime
View raw message