kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [1/4] incubator-kudu git commit: Convert from pass-by-reference with copy to pass-by-value
Date Wed, 20 Jan 2016 00:35:36 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 35b49cc5a -> 4bff0cc3c


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/diskrowset.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/diskrowset.h b/src/kudu/tablet/diskrowset.h
index 9aa0046..0bc0430 100644
--- a/src/kudu/tablet/diskrowset.h
+++ b/src/kudu/tablet/diskrowset.h
@@ -68,9 +68,8 @@ class OperationResultPB;
 class DiskRowSetWriter {
  public:
   // TODO: document ownership of rowset_metadata
-  DiskRowSetWriter(RowSetMetadata *rowset_metadata,
-                   const Schema* schema,
-                   const BloomFilterSizing &bloom_sizing);
+  DiskRowSetWriter(RowSetMetadata* rowset_metadata, const Schema* schema,
+                   BloomFilterSizing bloom_sizing);
 
   ~DiskRowSetWriter();
 
@@ -144,9 +143,8 @@ class RollingDiskRowSetWriter {
   // Create a new rolling writer. The given 'tablet_metadata' must stay valid
   // for the lifetime of this writer, and is used to construct the new rowsets
   // that this RollingDiskRowSetWriter creates.
-  RollingDiskRowSetWriter(TabletMetadata* tablet_metadata,
-                          const Schema &schema,
-                          const BloomFilterSizing &bloom_sizing,
+  RollingDiskRowSetWriter(TabletMetadata* tablet_metadata, const Schema& schema,
+                          BloomFilterSizing bloom_sizing,
                           size_t target_rowset_size);
   ~RollingDiskRowSetWriter();
 
@@ -376,9 +374,9 @@ class DiskRowSet : public RowSet {
   friend class CompactionInput;
   friend class Tablet;
 
-  DiskRowSet(const std::shared_ptr<RowSetMetadata>& rowset_metadata,
+  DiskRowSet(std::shared_ptr<RowSetMetadata> rowset_metadata,
              log::LogAnchorRegistry* log_anchor_registry,
-             const std::shared_ptr<MemTracker>& parent_tracker);
+             std::shared_ptr<MemTracker> parent_tracker);
 
   Status Open();
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/lock_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/lock_manager-test.cc b/src/kudu/tablet/lock_manager-test.cc
index 5f07fc2..28a7a35 100644
--- a/src/kudu/tablet/lock_manager-test.cc
+++ b/src/kudu/tablet/lock_manager-test.cc
@@ -145,10 +145,7 @@ class LmTestThread {
  public:
   LmTestThread(LockManager* manager, vector<const Slice*> keys,
                const vector<LmTestResource*> resources)
-    : manager_(manager),
-      keys_(keys),
-      resources_(resources) {
-  }
+      : manager_(manager), keys_(std::move(keys)), resources_(resources) {}
 
   void Start() {
     CHECK_OK(kudu::Thread::Create("test", "test", &LmTestThread::Run, this, &thread_));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/maintenance_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/maintenance_manager.cc b/src/kudu/tablet/maintenance_manager.cc
index 7f6477a..ef9e349 100644
--- a/src/kudu/tablet/maintenance_manager.cc
+++ b/src/kudu/tablet/maintenance_manager.cc
@@ -74,11 +74,8 @@ void MaintenanceOpStats::Clear() {
   perf_improvement_ = 0;
 }
 
-MaintenanceOp::MaintenanceOp(const std::string &name, IOUsage io_usage)
-  : name_(name),
-    running_(0),
-    io_usage_(io_usage) {
-}
+MaintenanceOp::MaintenanceOp(std::string name, IOUsage io_usage)
+    : name_(std::move(name)), running_(0), io_usage_(io_usage) {}
 
 MaintenanceOp::~MaintenanceOp() {
   CHECK(!manager_.get()) << "You must unregister the " << name_

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/maintenance_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/maintenance_manager.h b/src/kudu/tablet/maintenance_manager.h
index b1607ad..1d1a609 100644
--- a/src/kudu/tablet/maintenance_manager.h
+++ b/src/kudu/tablet/maintenance_manager.h
@@ -143,7 +143,7 @@ class MaintenanceOp {
     HIGH_IO_USAGE // Everything else.
   };
 
-  explicit MaintenanceOp(const std::string& name, IOUsage io_usage);
+  explicit MaintenanceOp(std::string name, IOUsage io_usage);
   virtual ~MaintenanceOp();
 
   // Unregister this op, if it is currently registered.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/memrowset.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/memrowset.cc b/src/kudu/tablet/memrowset.cc
index e3b369b..1a9ab1d 100644
--- a/src/kudu/tablet/memrowset.cc
+++ b/src/kudu/tablet/memrowset.cc
@@ -376,18 +376,17 @@ gscoped_ptr<MRSRowProjector> GenerateAppropriateProjector(
 
 } // anonymous namespace
 
-MemRowSet::Iterator::Iterator(const std::shared_ptr<const MemRowSet> &mrs,
-                              MemRowSet::MSBTIter *iter,
-                              const Schema *projection,
-                              const MvccSnapshot &mvcc_snap)
-  : memrowset_(mrs),
-    iter_(iter),
-    mvcc_snap_(mvcc_snap),
-    projection_(projection),
-    projector_(GenerateAppropriateProjector(&mrs->schema_nonvirtual(),
-                                            projection)),
-    delta_projector_(&mrs->schema_nonvirtual(), projection),
-    state_(kUninitialized) {
+MemRowSet::Iterator::Iterator(const std::shared_ptr<const MemRowSet>& mrs,
+                              MemRowSet::MSBTIter* iter,
+                              const Schema* projection, MvccSnapshot mvcc_snap)
+    : memrowset_(mrs),
+      iter_(iter),
+      mvcc_snap_(std::move(mvcc_snap)),
+      projection_(projection),
+      projector_(
+          GenerateAppropriateProjector(&mrs->schema_nonvirtual(), projection)),
+      delta_projector_(&mrs->schema_nonvirtual(), projection),
+      state_(kUninitialized) {
   // TODO: various code assumes that a newly constructed iterator
   // is pointed at the beginning of the dataset. This causes a redundant
   // seek. Could make this lazy instead, or change the semantics so that

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/memrowset.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/memrowset.h b/src/kudu/tablet/memrowset.h
index 19e1b54..dee7db2 100644
--- a/src/kudu/tablet/memrowset.h
+++ b/src/kudu/tablet/memrowset.h
@@ -463,9 +463,8 @@ class MemRowSet::Iterator : public RowwiseIterator {
   DISALLOW_COPY_AND_ASSIGN(Iterator);
 
   Iterator(const std::shared_ptr<const MemRowSet> &mrs,
-           MemRowSet::MSBTIter *iter,
-           const Schema *projection,
-           const MvccSnapshot &mvcc_snap);
+           MemRowSet::MSBTIter *iter, const Schema *projection,
+           MvccSnapshot mvcc_snap);
 
   // Various helper functions called while getting the next RowBlock
   Status FetchRows(RowBlock* dst, size_t* fetched);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/mock-rowsets.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mock-rowsets.h b/src/kudu/tablet/mock-rowsets.h
index d4d1980..ca9b84b 100644
--- a/src/kudu/tablet/mock-rowsets.h
+++ b/src/kudu/tablet/mock-rowsets.h
@@ -126,11 +126,11 @@ class MockRowSet : public RowSet {
 // Mock which implements GetBounds() with constant provided bonuds.
 class MockDiskRowSet : public MockRowSet {
  public:
-  MockDiskRowSet(std::string first_key, std::string last_key, int size = 1000000)
-    : first_key_(first_key),
-      last_key_(last_key),
-      size_(size) {
-  }
+  MockDiskRowSet(std::string first_key, std::string last_key,
+                 int size = 1000000)
+      : first_key_(std::move(first_key)),
+        last_key_(std::move(last_key)),
+        size_(size) {}
 
   virtual Status GetBounds(Slice *min_encoded_key,
                            Slice *max_encoded_key) const OVERRIDE {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/row_op.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/row_op.cc b/src/kudu/tablet/row_op.cc
index aeea9ef..28dfeb9 100644
--- a/src/kudu/tablet/row_op.cc
+++ b/src/kudu/tablet/row_op.cc
@@ -22,9 +22,8 @@
 namespace kudu {
 namespace tablet {
 
-RowOp::RowOp(const DecodedRowOperation& decoded_op)
-  : decoded_op(decoded_op) {
-}
+RowOp::RowOp(DecodedRowOperation decoded_op)
+    : decoded_op(std::move(decoded_op)) {}
 
 RowOp::~RowOp() {
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/row_op.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/row_op.h b/src/kudu/tablet/row_op.h
index 8057f66..8ba2071 100644
--- a/src/kudu/tablet/row_op.h
+++ b/src/kudu/tablet/row_op.h
@@ -33,7 +33,7 @@ namespace tablet {
 // Structure tracking the progress of a single row operation within a WriteTransaction.
 struct RowOp {
  public:
-  explicit RowOp(const DecodedRowOperation& decoded_op);
+  explicit RowOp(DecodedRowOperation decoded_op);
   ~RowOp();
 
   // Functions to set the result of the mutation.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/rowset.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/rowset.cc b/src/kudu/tablet/rowset.cc
index b2768ba..247393c 100644
--- a/src/kudu/tablet/rowset.cc
+++ b/src/kudu/tablet/rowset.cc
@@ -33,10 +33,10 @@ using strings::Substitute;
 
 namespace kudu { namespace tablet {
 
-DuplicatingRowSet::DuplicatingRowSet(const RowSetVector &old_rowsets,
-                                     const RowSetVector &new_rowsets)
-  : old_rowsets_(old_rowsets),
-    new_rowsets_(new_rowsets) {
+DuplicatingRowSet::DuplicatingRowSet(RowSetVector old_rowsets,
+                                     RowSetVector new_rowsets)
+    : old_rowsets_(std::move(old_rowsets)),
+      new_rowsets_(std::move(new_rowsets)) {
   CHECK_GT(old_rowsets_.size(), 0);
   CHECK_GT(new_rowsets_.size(), 0);
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/rowset.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/rowset.h b/src/kudu/tablet/rowset.h
index 74ba4fb..3a301d8 100644
--- a/src/kudu/tablet/rowset.h
+++ b/src/kudu/tablet/rowset.h
@@ -176,8 +176,8 @@ class RowSetKeyProbe {
   //
   // NOTE: row_key is not copied and must be valid for the lifetime
   // of this object.
-  explicit RowSetKeyProbe(const ConstContiguousRow& row_key)
-      : row_key_(row_key) {
+  explicit RowSetKeyProbe(ConstContiguousRow row_key)
+      : row_key_(std::move(row_key)) {
     encoded_key_ = EncodedKey::FromContiguousRow(row_key_);
     bloom_probe_ = BloomKeyProbe(encoded_key_slice());
   }
@@ -251,8 +251,7 @@ struct ProbeStats {
 // See compaction.txt for a little more detail on how this is used.
 class DuplicatingRowSet : public RowSet {
  public:
-  DuplicatingRowSet(const RowSetVector &old_rowsets,
-                    const RowSetVector &new_rowsets);
+  DuplicatingRowSet(RowSetVector old_rowsets, RowSetVector new_rowsets);
 
   virtual Status MutateRow(Timestamp timestamp,
                            const RowSetKeyProbe &probe,

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/rowset_tree.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/rowset_tree.h b/src/kudu/tablet/rowset_tree.h
index 0f84c9c..dbb518a 100644
--- a/src/kudu/tablet/rowset_tree.h
+++ b/src/kudu/tablet/rowset_tree.h
@@ -52,10 +52,8 @@ class RowSetTree {
     STOP
   };
   struct RSEndpoint {
-    RSEndpoint(RowSet* rowset, EndpointType endpoint, const Slice& slice)
-    : rowset_(rowset),
-      endpoint_(endpoint),
-      slice_(slice) {}
+    RSEndpoint(RowSet *rowset, EndpointType endpoint, Slice slice)
+        : rowset_(rowset), endpoint_(endpoint), slice_(std::move(slice)) {}
 
     RowSet* rowset_;
     enum EndpointType endpoint_;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet-harness.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet-harness.h b/src/kudu/tablet/tablet-harness.h
index 06b91e7..cb81fae 100644
--- a/src/kudu/tablet/tablet-harness.h
+++ b/src/kudu/tablet/tablet-harness.h
@@ -60,12 +60,11 @@ static std::pair<PartitionSchema, Partition> CreateDefaultPartition(const Schema
 class TabletHarness {
  public:
   struct Options {
-    explicit Options(const string& root_dir)
-      : env(Env::Default()),
-        tablet_id("test_tablet_id"),
-        root_dir(root_dir),
-        enable_metrics(true) {
-    }
+    explicit Options(string root_dir)
+        : env(Env::Default()),
+          tablet_id("test_tablet_id"),
+          root_dir(std::move(root_dir)),
+          enable_metrics(true) {}
 
     Env* env;
     string tablet_id;
@@ -73,11 +72,8 @@ class TabletHarness {
     bool enable_metrics;
   };
 
-  TabletHarness(const Schema& schema,
-                const Options& options)
-    : options_(options),
-      schema_(schema) {
-  }
+  TabletHarness(const Schema& schema, Options options)
+      : options_(std::move(options)), schema_(schema) {}
 
   Status Create(bool first_time) {
     std::pair<PartitionSchema, Partition> partition(CreateDefaultPartition(schema_));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc
index 1afa62f..88f8417 100644
--- a/src/kudu/tablet/tablet.cc
+++ b/src/kudu/tablet/tablet.cc
@@ -117,11 +117,9 @@ static CompactionPolicy *CreateCompactionPolicy() {
 // TabletComponents
 ////////////////////////////////////////////////////////////
 
-TabletComponents::TabletComponents(const shared_ptr<MemRowSet>& mrs,
-                                   const shared_ptr<RowSetTree>& rs_tree)
-  : memrowset(mrs),
-    rowsets(rs_tree) {
-}
+TabletComponents::TabletComponents(shared_ptr<MemRowSet> mrs,
+                                   shared_ptr<RowSetTree> rs_tree)
+    : memrowset(std::move(mrs)), rowsets(std::move(rs_tree)) {}
 
 ////////////////////////////////////////////////////////////
 // Tablet
@@ -1710,17 +1708,14 @@ void Tablet::PrintRSLayout(ostream* o) {
 // Tablet::Iterator
 ////////////////////////////////////////////////////////////
 
-Tablet::Iterator::Iterator(const Tablet *tablet,
-                           const Schema &projection,
-                           const MvccSnapshot &snap,
-                           const OrderMode order)
+Tablet::Iterator::Iterator(const Tablet* tablet, const Schema& projection,
+                           MvccSnapshot snap, const OrderMode order)
     : tablet_(tablet),
       projection_(projection),
-      snap_(snap),
+      snap_(std::move(snap)),
       order_(order),
       arena_(256, 4096),
-      encoder_(&tablet_->key_schema(), &arena_) {
-}
+      encoder_(&tablet_->key_schema(), &arena_) {}
 
 Tablet::Iterator::~Iterator() {}
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.h b/src/kudu/tablet/tablet.h
index 7e9ece2..3a05f64 100644
--- a/src/kudu/tablet/tablet.h
+++ b/src/kudu/tablet/tablet.h
@@ -599,9 +599,7 @@ class Tablet::Iterator : public RowwiseIterator {
 
   DISALLOW_COPY_AND_ASSIGN(Iterator);
 
-  Iterator(const Tablet *tablet,
-           const Schema &projection,
-           const MvccSnapshot &snap,
+  Iterator(const Tablet* tablet, const Schema& projection, MvccSnapshot snap,
            const OrderMode order);
 
   const Tablet *tablet_;
@@ -620,8 +618,8 @@ class Tablet::Iterator : public RowwiseIterator {
 // This structure is immutable -- a transaction can grab it and be sure
 // that it won't change.
 struct TabletComponents : public RefCountedThreadSafe<TabletComponents> {
-  TabletComponents(const std::shared_ptr<MemRowSet>& mrs,
-                   const std::shared_ptr<RowSetTree>& rs_tree);
+  TabletComponents(std::shared_ptr<MemRowSet> mrs,
+                   std::shared_ptr<RowSetTree> rs_tree);
   const std::shared_ptr<MemRowSet> memrowset;
   const std::shared_ptr<RowSetTree> rowsets;
 };

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet_bootstrap.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_bootstrap.cc b/src/kudu/tablet/tablet_bootstrap.cc
index 5010110..b2cbedd 100644
--- a/src/kudu/tablet/tablet_bootstrap.cc
+++ b/src/kudu/tablet/tablet_bootstrap.cc
@@ -145,7 +145,7 @@ class TabletBootstrap {
  public:
   TabletBootstrap(const scoped_refptr<TabletMetadata>& meta,
                   const scoped_refptr<Clock>& clock,
-                  const shared_ptr<MemTracker>& mem_tracker,
+                  shared_ptr<MemTracker> mem_tracker,
                   MetricRegistry* metric_registry,
                   TabletStatusListener* listener,
                   const scoped_refptr<LogAnchorRegistry>& log_anchor_registry);
@@ -403,20 +403,18 @@ static string DebugInfo(const string& tablet_id,
                     segment_path, debug_str);
 }
 
-TabletBootstrap::TabletBootstrap(const scoped_refptr<TabletMetadata>& meta,
-                                 const scoped_refptr<Clock>& clock,
-                                 const shared_ptr<MemTracker>& mem_tracker,
-                                 MetricRegistry* metric_registry,
-                                 TabletStatusListener* listener,
-                                 const scoped_refptr<LogAnchorRegistry>& log_anchor_registry)
+TabletBootstrap::TabletBootstrap(
+    const scoped_refptr<TabletMetadata>& meta,
+    const scoped_refptr<Clock>& clock, shared_ptr<MemTracker> mem_tracker,
+    MetricRegistry* metric_registry, TabletStatusListener* listener,
+    const scoped_refptr<LogAnchorRegistry>& log_anchor_registry)
     : meta_(meta),
       clock_(clock),
-      mem_tracker_(mem_tracker),
+      mem_tracker_(std::move(mem_tracker)),
       metric_registry_(metric_registry),
       listener_(listener),
       log_anchor_registry_(log_anchor_registry),
-      arena_(256*1024, 4*1024*1024) {
-}
+      arena_(256 * 1024, 4 * 1024 * 1024) {}
 
 Status TabletBootstrap::Bootstrap(shared_ptr<Tablet>* rebuilt_tablet,
                                   scoped_refptr<Log>* rebuilt_log,

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet_metadata.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_metadata.cc b/src/kudu/tablet/tablet_metadata.cc
index 89d6fdc..a645dc7 100644
--- a/src/kudu/tablet/tablet_metadata.cc
+++ b/src/kudu/tablet/tablet_metadata.cc
@@ -206,28 +206,26 @@ Status TabletMetadata::DeleteSuperBlock() {
   return Status::OK();
 }
 
-TabletMetadata::TabletMetadata(FsManager *fs_manager,
-                               const string& tablet_id,
-                               const string& table_name,
-                               const Schema& schema,
-                               const PartitionSchema& partition_schema,
-                               const Partition& partition,
+TabletMetadata::TabletMetadata(FsManager* fs_manager, string tablet_id,
+                               string table_name, const Schema& schema,
+                               PartitionSchema partition_schema,
+                               Partition partition,
                                const TabletDataState& tablet_data_state)
-  : state_(kNotWrittenYet),
-    tablet_id_(tablet_id),
-    partition_(partition),
-    fs_manager_(fs_manager),
-    next_rowset_idx_(0),
-    last_durable_mrs_id_(kNoDurableMemStore),
-    schema_(new Schema(schema)),
-    schema_version_(0),
-    table_name_(table_name),
-    partition_schema_(partition_schema),
-    tablet_data_state_(tablet_data_state),
-    tombstone_last_logged_opid_(MinimumOpId()),
-    num_flush_pins_(0),
-    needs_flush_(false),
-    pre_flush_callback_(Bind(DoNothingStatusClosure)) {
+    : state_(kNotWrittenYet),
+      tablet_id_(std::move(tablet_id)),
+      partition_(std::move(partition)),
+      fs_manager_(fs_manager),
+      next_rowset_idx_(0),
+      last_durable_mrs_id_(kNoDurableMemStore),
+      schema_(new Schema(schema)),
+      schema_version_(0),
+      table_name_(std::move(table_name)),
+      partition_schema_(std::move(partition_schema)),
+      tablet_data_state_(tablet_data_state),
+      tombstone_last_logged_opid_(MinimumOpId()),
+      num_flush_pins_(0),
+      needs_flush_(false),
+      pre_flush_callback_(Bind(DoNothingStatusClosure)) {
   CHECK(schema_->has_column_ids());
   CHECK_GT(schema_->num_key_columns(), 0);
 }
@@ -237,17 +235,16 @@ TabletMetadata::~TabletMetadata() {
   delete schema_;
 }
 
-TabletMetadata::TabletMetadata(FsManager *fs_manager, const string& tablet_id)
-  : state_(kNotLoadedYet),
-    tablet_id_(tablet_id),
-    fs_manager_(fs_manager),
-    next_rowset_idx_(0),
-    schema_(nullptr),
-    tombstone_last_logged_opid_(MinimumOpId()),
-    num_flush_pins_(0),
-    needs_flush_(false),
-    pre_flush_callback_(Bind(DoNothingStatusClosure)) {
-}
+TabletMetadata::TabletMetadata(FsManager* fs_manager, string tablet_id)
+    : state_(kNotLoadedYet),
+      tablet_id_(std::move(tablet_id)),
+      fs_manager_(fs_manager),
+      next_rowset_idx_(0),
+      schema_(nullptr),
+      tombstone_last_logged_opid_(MinimumOpId()),
+      num_flush_pins_(0),
+      needs_flush_(false),
+      pre_flush_callback_(Bind(DoNothingStatusClosure)) {}
 
 Status TabletMetadata::LoadFromDisk() {
   TRACE_EVENT1("tablet", "TabletMetadata::LoadFromDisk",

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet_metadata.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_metadata.h b/src/kudu/tablet/tablet_metadata.h
index 257da37..e956ea6 100644
--- a/src/kudu/tablet/tablet_metadata.h
+++ b/src/kudu/tablet/tablet_metadata.h
@@ -232,16 +232,13 @@ class TabletMetadata : public RefCountedThreadSafe<TabletMetadata> {
   //
   // TODO: get rid of this many-arg constructor in favor of just passing in a
   // SuperBlock, which already contains all of these fields.
-  TabletMetadata(FsManager *fs_manager,
-                 const std::string& tablet_id,
-                 const std::string& table_name,
-                 const Schema& schema,
-                 const PartitionSchema& partition_schema,
-                 const Partition& partition,
+  TabletMetadata(FsManager* fs_manager, std::string tablet_id,
+                 std::string table_name, const Schema& schema,
+                 PartitionSchema partition_schema, Partition partition,
                  const TabletDataState& tablet_data_state);
 
   // Constructor for loading an existing tablet.
-  TabletMetadata(FsManager *fs_manager, const std::string& tablet_id);
+  TabletMetadata(FsManager* fs_manager, std::string tablet_id);
 
   void SetSchemaUnlocked(gscoped_ptr<Schema> schema, uint32_t version);
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet_peer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_peer.cc b/src/kudu/tablet/tablet_peer.cc
index 91398cc..1c18187 100644
--- a/src/kudu/tablet/tablet_peer.cc
+++ b/src/kudu/tablet/tablet_peer.cc
@@ -101,16 +101,15 @@ using tserver::TabletServerErrorPB;
 TabletPeer::TabletPeer(const scoped_refptr<TabletMetadata>& meta,
                        const consensus::RaftPeerPB& local_peer_pb,
                        ThreadPool* apply_pool,
-                       const Callback<void(const std::string& reason)>& mark_dirty_clbk)
-  : meta_(meta),
-    tablet_id_(meta->tablet_id()),
-    local_peer_pb_(local_peer_pb),
-    state_(NOT_STARTED),
-    status_listener_(new TabletStatusListener(meta)),
-    apply_pool_(apply_pool),
-    log_anchor_registry_(new LogAnchorRegistry()),
-    mark_dirty_clbk_(mark_dirty_clbk) {
-}
+                       Callback<void(const std::string& reason)> mark_dirty_clbk)
+    : meta_(meta),
+      tablet_id_(meta->tablet_id()),
+      local_peer_pb_(local_peer_pb),
+      state_(NOT_STARTED),
+      status_listener_(new TabletStatusListener(meta)),
+      apply_pool_(apply_pool),
+      log_anchor_registry_(new LogAnchorRegistry()),
+      mark_dirty_clbk_(std::move(mark_dirty_clbk)) {}
 
 TabletPeer::~TabletPeer() {
   boost::lock_guard<simple_spinlock> lock(lock_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/tablet_peer.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_peer.h b/src/kudu/tablet/tablet_peer.h
index 2888316..56a9281 100644
--- a/src/kudu/tablet/tablet_peer.h
+++ b/src/kudu/tablet/tablet_peer.h
@@ -69,9 +69,8 @@ class TabletPeer : public RefCountedThreadSafe<TabletPeer>,
   typedef std::map<int64_t, int64_t> MaxIdxToSegmentSizeMap;
 
   TabletPeer(const scoped_refptr<TabletMetadata>& meta,
-             const consensus::RaftPeerPB& local_peer_pb,
-             ThreadPool* apply_pool,
-             const Callback<void(const std::string& reason)>& mark_dirty_clbk);
+             const consensus::RaftPeerPB& local_peer_pb, ThreadPool* apply_pool,
+             Callback<void(const std::string& reason)> mark_dirty_clbk);
 
   // Initializes the TabletPeer, namely creating the Log and initializing
   // Consensus.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tablet/transactions/transaction.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/transaction.h b/src/kudu/tablet/transactions/transaction.h
index 01f00a7..9d2aa25 100644
--- a/src/kudu/tablet/transactions/transaction.h
+++ b/src/kudu/tablet/transactions/transaction.h
@@ -328,9 +328,8 @@ class LatchTransactionCompletionCallback : public TransactionCompletionCallback
 // calls it with the transaction status when it completes.
 class StatusTransactionCompletionCallback : public TransactionCompletionCallback {
  public:
-  explicit StatusTransactionCompletionCallback(const StatusCallback& callback)
-   : callback_(callback) {
-  }
+  explicit StatusTransactionCompletionCallback(StatusCallback callback)
+      : callback_(std::move(callback)) {}
 
   virtual void TransactionCompleted() OVERRIDE {
     callback_.Run(status());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tools/fs_dump-tool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/fs_dump-tool.cc b/src/kudu/tools/fs_dump-tool.cc
index 24c151f..fe45614 100644
--- a/src/kudu/tools/fs_dump-tool.cc
+++ b/src/kudu/tools/fs_dump-tool.cc
@@ -68,11 +68,8 @@ struct CommandHandler {
   string name_;
   string desc_;
 
-  CommandHandler(CommandType type, const string& name, const string& desc)
-      : type_(type),
-        name_(name),
-        desc_(desc) {
-  }
+  CommandHandler(CommandType type, string name, string desc)
+      : type_(type), name_(std::move(name)), desc_(std::move(desc)) {}
 };
 
 const vector<CommandHandler> kCommandHandlers = {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tools/fs_list-tool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/fs_list-tool.cc b/src/kudu/tools/fs_list-tool.cc
index 996a70f..228967c 100644
--- a/src/kudu/tools/fs_list-tool.cc
+++ b/src/kudu/tools/fs_list-tool.cc
@@ -55,11 +55,8 @@ struct CommandHandler {
   string name_;
   string desc_;
 
-  CommandHandler(CommandType type, const string& name, const string& desc)
-      : type_(type),
-        name_(name),
-        desc_(desc) {
-  }
+  CommandHandler(CommandType type, string name, string desc)
+      : type_(type), name_(std::move(name)), desc_(std::move(desc)) {}
 };
 
 const vector<CommandHandler> kCommandHandlers = {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tools/ksck.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index 5ab4e74..b1ff84a 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -76,15 +76,12 @@ ChecksumOptions::ChecksumOptions()
       snapshot_timestamp(FLAGS_checksum_snapshot_timestamp) {
 }
 
-ChecksumOptions::ChecksumOptions(MonoDelta timeout,
-                                 int scan_concurrency,
-                                 bool use_snapshot,
-                                 uint64_t snapshot_timestamp)
-    : timeout(timeout),
+ChecksumOptions::ChecksumOptions(MonoDelta timeout, int scan_concurrency,
+                                 bool use_snapshot, uint64_t snapshot_timestamp)
+    : timeout(std::move(timeout)),
       scan_concurrency(scan_concurrency),
       use_snapshot(use_snapshot),
-      snapshot_timestamp(snapshot_timestamp) {
-}
+      snapshot_timestamp(snapshot_timestamp) {}
 
 const uint64_t ChecksumOptions::kCurrentTimestamp = 0;
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tools/ksck.h
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.h b/src/kudu/tools/ksck.h
index b898a5b..f9d25a3 100644
--- a/src/kudu/tools/ksck.h
+++ b/src/kudu/tools/ksck.h
@@ -94,9 +94,7 @@ class KsckTabletReplica {
 class KsckTablet {
  public:
   // TODO add start/end keys, stale.
-  explicit KsckTablet(const std::string& id)
-      : id_(id) {
-  }
+  explicit KsckTablet(std::string id) : id_(std::move(id)) {}
 
   const std::string& id() const {
     return id_;
@@ -118,11 +116,8 @@ class KsckTablet {
 // Representation of a table. Composed of tablets.
 class KsckTable {
  public:
-  KsckTable(const std::string& name, const Schema& schema, int num_replicas)
-      : name_(name),
-        schema_(schema),
-        num_replicas_(num_replicas) {
-  }
+  KsckTable(std::string name, const Schema& schema, int num_replicas)
+      : name_(std::move(name)), schema_(schema), num_replicas_(num_replicas) {}
 
   const std::string& name() const {
     return name_;
@@ -162,9 +157,7 @@ typedef Callback<void(const Status& status, uint64_t checksum)> ReportResultCall
 // Class that must be extended to represent a tablet server.
 class KsckTabletServer {
  public:
-  explicit KsckTabletServer(const std::string& uuid)
-      : uuid_(uuid) {
-  }
+  explicit KsckTabletServer(std::string uuid) : uuid_(std::move(uuid)) {}
   virtual ~KsckTabletServer() { }
 
   // Connects to the configured Tablet Server.
@@ -224,9 +217,8 @@ class KsckMaster {
 // Class used to communicate with the cluster. It bootstraps this by using the provided master.
 class KsckCluster {
  public:
-  explicit KsckCluster(const std::shared_ptr<KsckMaster>& master)
-      : master_(master) {
-  }
+  explicit KsckCluster(std::shared_ptr<KsckMaster> master)
+      : master_(std::move(master)) {}
   ~KsckCluster();
 
   // Fetches list of tables, tablets, and tablet servers from the master and
@@ -265,9 +257,8 @@ class KsckCluster {
 // Externally facing class to run checks against the provided cluster.
 class Ksck {
  public:
-  explicit Ksck(const std::shared_ptr<KsckCluster>& cluster)
-      : cluster_(cluster) {
-  }
+  explicit Ksck(std::shared_ptr<KsckCluster> cluster)
+      : cluster_(std::move(cluster)) {}
   ~Ksck() {}
 
   // Verifies that it can connect to the Master.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tools/ksck_remote.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck_remote.cc b/src/kudu/tools/ksck_remote.cc
index c800ee4..76c464c 100644
--- a/src/kudu/tools/ksck_remote.cc
+++ b/src/kudu/tools/ksck_remote.cc
@@ -88,18 +88,15 @@ class ChecksumCallbackHandler {
 // After the ChecksumStepper reports its results to the reporter, it deletes itself.
 class ChecksumStepper {
  public:
-  ChecksumStepper(const string& tablet_id,
-                  const Schema& schema,
-                  const string& server_uuid,
-                  const ChecksumOptions& options,
-                  const ReportResultCallback& callback,
-                  const shared_ptr<tserver::TabletServerServiceProxy>& proxy)
+  ChecksumStepper(string tablet_id, const Schema& schema, string server_uuid,
+                  ChecksumOptions options, ReportResultCallback callback,
+                  shared_ptr<tserver::TabletServerServiceProxy> proxy)
       : schema_(schema),
-        tablet_id_(tablet_id),
-        server_uuid_(server_uuid),
-        options_(options),
-        reporter_callback_(callback),
-        proxy_(proxy),
+        tablet_id_(std::move(tablet_id)),
+        server_uuid_(std::move(server_uuid)),
+        options_(std::move(options)),
+        reporter_callback_(std::move(callback)),
+        proxy_(std::move(proxy)),
         call_seq_id_(0),
         checksum_(0) {
     DCHECK(proxy_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tools/kudu-admin.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/kudu-admin.cc b/src/kudu/tools/kudu-admin.cc
index 16bfcad..9d81dfd 100644
--- a/src/kudu/tools/kudu-admin.cc
+++ b/src/kudu/tools/kudu-admin.cc
@@ -91,7 +91,7 @@ class ClusterAdminClient {
  public:
   // Creates an admin client for host/port combination e.g.,
   // "localhost" or "127.0.0.1:7050".
-  ClusterAdminClient(const std::string& addrs, int64_t timeout_millis);
+  ClusterAdminClient(std::string addrs, int64_t timeout_millis);
 
   // Initialized the client and connects to the specified tablet
   // server.
@@ -134,11 +134,10 @@ class ClusterAdminClient {
   DISALLOW_COPY_AND_ASSIGN(ClusterAdminClient);
 };
 
-ClusterAdminClient::ClusterAdminClient(const string& addrs, int64_t timeout_millis)
-    : master_addr_list_(addrs),
+ClusterAdminClient::ClusterAdminClient(string addrs, int64_t timeout_millis)
+    : master_addr_list_(std::move(addrs)),
       timeout_(MonoDelta::FromMilliseconds(timeout_millis)),
-      initted_(false) {
-}
+      initted_(false) {}
 
 Status ClusterAdminClient::Init() {
   CHECK(!initted_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tools/ts-cli.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ts-cli.cc b/src/kudu/tools/ts-cli.cc
index dd204b8..663e720 100644
--- a/src/kudu/tools/ts-cli.cc
+++ b/src/kudu/tools/ts-cli.cc
@@ -117,7 +117,7 @@ class TsAdminClient {
  public:
   // Creates an admin client for host/port combination e.g.,
   // "localhost" or "127.0.0.1:7050".
-  TsAdminClient(const std::string& addr, int64_t timeout_millis);
+  TsAdminClient(std::string addr, int64_t timeout_millis);
 
   // Initialized the client and connects to the specified tablet
   // server.
@@ -163,11 +163,10 @@ class TsAdminClient {
   DISALLOW_COPY_AND_ASSIGN(TsAdminClient);
 };
 
-TsAdminClient::TsAdminClient(const string& addr, int64_t timeout_millis)
-    : addr_(addr),
+TsAdminClient::TsAdminClient(string addr, int64_t timeout_millis)
+    : addr_(std::move(addr)),
       timeout_(MonoDelta::FromMilliseconds(timeout_millis)),
-      initted_(false) {
-}
+      initted_(false) {}
 
 Status TsAdminClient::Init() {
   CHECK(!initted_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/remote_bootstrap_client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_client.cc b/src/kudu/tserver/remote_bootstrap_client.cc
index d549c3d..bac717e 100644
--- a/src/kudu/tserver/remote_bootstrap_client.cc
+++ b/src/kudu/tserver/remote_bootstrap_client.cc
@@ -84,22 +84,21 @@ using tablet::TabletMetadata;
 using tablet::TabletStatusListener;
 using tablet::TabletSuperBlockPB;
 
-RemoteBootstrapClient::RemoteBootstrapClient(const std::string& tablet_id,
+RemoteBootstrapClient::RemoteBootstrapClient(std::string tablet_id,
                                              FsManager* fs_manager,
-                                             const shared_ptr<Messenger>& messenger,
-                                             const string& client_permanent_uuid)
-  : tablet_id_(tablet_id),
-    fs_manager_(fs_manager),
-    messenger_(messenger),
-    permanent_uuid_(client_permanent_uuid),
-    started_(false),
-    downloaded_wal_(false),
-    downloaded_blocks_(false),
-    replace_tombstoned_tablet_(false),
-    status_listener_(nullptr),
-    session_idle_timeout_millis_(0),
-    start_time_micros_(0) {
-}
+                                             shared_ptr<Messenger> messenger,
+                                             string client_permanent_uuid)
+    : tablet_id_(std::move(tablet_id)),
+      fs_manager_(fs_manager),
+      messenger_(std::move(messenger)),
+      permanent_uuid_(std::move(client_permanent_uuid)),
+      started_(false),
+      downloaded_wal_(false),
+      downloaded_blocks_(false),
+      replace_tombstoned_tablet_(false),
+      status_listener_(nullptr),
+      session_idle_timeout_millis_(0),
+      start_time_micros_(0) {}
 
 RemoteBootstrapClient::~RemoteBootstrapClient() {
   // Note: Ending the remote bootstrap session releases anchors on the remote.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/remote_bootstrap_client.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_client.h b/src/kudu/tserver/remote_bootstrap_client.h
index 83a0c8a..df95038 100644
--- a/src/kudu/tserver/remote_bootstrap_client.h
+++ b/src/kudu/tserver/remote_bootstrap_client.h
@@ -72,10 +72,9 @@ class RemoteBootstrapClient {
   // Construct the remote bootstrap client.
   // 'fs_manager' and 'messenger' must remain valid until this object is destroyed.
   // 'client_permanent_uuid' is the permanent UUID of the caller server.
-  RemoteBootstrapClient(const std::string& tablet_id,
-                        FsManager* fs_manager,
-                        const std::shared_ptr<rpc::Messenger>& messenger,
-                        const std::string& client_permanent_uuid);
+  RemoteBootstrapClient(std::string tablet_id, FsManager* fs_manager,
+                        std::shared_ptr<rpc::Messenger> messenger,
+                        std::string client_permanent_uuid);
 
   // Attempt to clean up resources on the remote end by sending an
   // EndRemoteBootstrapSession() RPC

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/remote_bootstrap_session.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session.cc b/src/kudu/tserver/remote_bootstrap_session.cc
index 8520810..c0c6aa1 100644
--- a/src/kudu/tserver/remote_bootstrap_session.cc
+++ b/src/kudu/tserver/remote_bootstrap_session.cc
@@ -47,17 +47,15 @@ using tablet::TabletMetadata;
 using tablet::TabletPeer;
 using tablet::TabletSuperBlockPB;
 
-RemoteBootstrapSession::RemoteBootstrapSession(const scoped_refptr<TabletPeer>& tablet_peer,
-                                               const std::string& session_id,
-                                               const std::string& requestor_uuid,
-                                               FsManager* fs_manager)
-  : tablet_peer_(tablet_peer),
-    session_id_(session_id),
-    requestor_uuid_(requestor_uuid),
-    fs_manager_(fs_manager),
-    blocks_deleter_(&blocks_),
-    logs_deleter_(&logs_) {
-}
+RemoteBootstrapSession::RemoteBootstrapSession(
+    const scoped_refptr<TabletPeer>& tablet_peer, std::string session_id,
+    std::string requestor_uuid, FsManager* fs_manager)
+    : tablet_peer_(tablet_peer),
+      session_id_(std::move(session_id)),
+      requestor_uuid_(std::move(requestor_uuid)),
+      fs_manager_(fs_manager),
+      blocks_deleter_(&blocks_),
+      logs_deleter_(&logs_) {}
 
 RemoteBootstrapSession::~RemoteBootstrapSession() {
   // No lock taken in the destructor, should only be 1 thread with access now.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/remote_bootstrap_session.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session.h b/src/kudu/tserver/remote_bootstrap_session.h
index 78aa2b6..8bd9910 100644
--- a/src/kudu/tserver/remote_bootstrap_session.h
+++ b/src/kudu/tserver/remote_bootstrap_session.h
@@ -54,11 +54,9 @@ struct ImmutableRandomAccessFileInfo {
   std::shared_ptr<RandomAccessFile> readable;
   int64_t size;
 
-  ImmutableRandomAccessFileInfo(const std::shared_ptr<RandomAccessFile>& readable,
+  ImmutableRandomAccessFileInfo(std::shared_ptr<RandomAccessFile> readable,
                                 int64_t size)
-  : readable(readable),
-    size(size) {
-  }
+      : readable(std::move(readable)), size(size) {}
 
   Status ReadFully(uint64_t offset, int64_t size, Slice* data, uint8_t* scratch) const {
     return env_util::ReadFully(readable.get(), offset, size, data, scratch);
@@ -89,8 +87,7 @@ struct ImmutableReadableBlockInfo {
 class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSession> {
  public:
   RemoteBootstrapSession(const scoped_refptr<tablet::TabletPeer>& tablet_peer,
-                         const std::string& session_id,
-                         const std::string& requestor_uuid,
+                         std::string session_id, std::string requestor_uuid,
                          FsManager* fs_manager);
 
   // Initialize the session, including anchoring files (TODO) and fetching the

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/scanners.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.cc b/src/kudu/tserver/scanners.cc
index 4c240bb..21755ab 100644
--- a/src/kudu/tserver/scanners.cc
+++ b/src/kudu/tserver/scanners.cc
@@ -180,13 +180,11 @@ void ScannerManager::RemoveExpiredScanners() {
   }
 }
 
-Scanner::Scanner(const string& id,
-                 const scoped_refptr<TabletPeer>& tablet_peer,
-                 const string& requestor_string,
-                 ScannerMetrics* metrics)
-    : id_(id),
+Scanner::Scanner(string id, const scoped_refptr<TabletPeer>& tablet_peer,
+                 string requestor_string, ScannerMetrics* metrics)
+    : id_(std::move(id)),
       tablet_peer_(tablet_peer),
-      requestor_string_(requestor_string),
+      requestor_string_(std::move(requestor_string)),
       call_seq_id_(0),
       start_time_(MonoTime::Now(MonoTime::COARSE)),
       metrics_(metrics),

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/scanners.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.h b/src/kudu/tserver/scanners.h
index 6db1125..49c2073 100644
--- a/src/kudu/tserver/scanners.h
+++ b/src/kudu/tserver/scanners.h
@@ -142,12 +142,8 @@ class ScannerManager {
 // RAII wrapper to unregister a scanner upon scope exit.
 class ScopedUnregisterScanner {
  public:
-  ScopedUnregisterScanner(ScannerManager* mgr,
-                          const std::string& id)
-    : mgr_(mgr),
-      id_(id),
-      cancelled_(false) {
-  }
+  ScopedUnregisterScanner(ScannerManager* mgr, std::string id)
+      : mgr_(mgr), id_(std::move(id)), cancelled_(false) {}
 
   ~ScopedUnregisterScanner() {
     if (!cancelled_) {
@@ -169,10 +165,9 @@ class ScopedUnregisterScanner {
 // An open scanner on the server side.
 class Scanner {
  public:
-  explicit Scanner(const std::string& id,
+  explicit Scanner(std::string id,
                    const scoped_refptr<tablet::TabletPeer>& tablet_peer,
-                   const std::string& requestor_string,
-                   ScannerMetrics* metrics);
+                   std::string requestor_string, ScannerMetrics* metrics);
   ~Scanner();
 
   // Attach an actual iterator and a ScanSpec to this Scanner.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/ts_tablet_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.cc b/src/kudu/tserver/ts_tablet_manager.cc
index c3ebdd9..284b8fb 100644
--- a/src/kudu/tserver/ts_tablet_manager.cc
+++ b/src/kudu/tserver/ts_tablet_manager.cc
@@ -972,13 +972,9 @@ void TSTabletManager::LogAndTombstone(const scoped_refptr<TabletMetadata>& meta,
   }
 }
 
-TransitionInProgressDeleter::TransitionInProgressDeleter(TransitionInProgressMap* map,
-                                                         rw_spinlock* lock,
-                                                         const string& entry)
-    : in_progress_(map),
-      lock_(lock),
-      entry_(entry) {
-}
+TransitionInProgressDeleter::TransitionInProgressDeleter(
+    TransitionInProgressMap* map, rw_spinlock* lock, string entry)
+    : in_progress_(map), lock_(lock), entry_(std::move(entry)) {}
 
 TransitionInProgressDeleter::~TransitionInProgressDeleter() {
   boost::lock_guard<rw_spinlock> lock(*lock_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/tserver/ts_tablet_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.h b/src/kudu/tserver/ts_tablet_manager.h
index c271132..e8c5cb0 100644
--- a/src/kudu/tserver/ts_tablet_manager.h
+++ b/src/kudu/tserver/ts_tablet_manager.h
@@ -346,9 +346,8 @@ class TSTabletManager : public tserver::TabletPeerLookupIf {
 // when tablet boostrap, create, and delete operations complete.
 class TransitionInProgressDeleter : public RefCountedThreadSafe<TransitionInProgressDeleter> {
  public:
-  TransitionInProgressDeleter(TransitionInProgressMap* map,
-                              rw_spinlock* lock,
-                              const string& entry);
+  TransitionInProgressDeleter(TransitionInProgressMap* map, rw_spinlock* lock,
+                              string entry);
 
  private:
   friend class RefCountedThreadSafe<TransitionInProgressDeleter>;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/debug/trace_event_impl.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/debug/trace_event_impl.cc b/src/kudu/util/debug/trace_event_impl.cc
index 4246d75..cbbd7ea 100644
--- a/src/kudu/util/debug/trace_event_impl.cc
+++ b/src/kudu/util/debug/trace_event_impl.cc
@@ -996,14 +996,9 @@ void TraceSamplingThread::Stop() {
   cancellation_flag_.Store(true);
 }
 
-
-TraceBucketData::TraceBucketData(AtomicWord* bucket,
-                                 const char* name,
+TraceBucketData::TraceBucketData(AtomicWord* bucket, const char* name,
                                  TraceSampleCallback callback)
-    : bucket(bucket),
-      bucket_name(name),
-      callback(callback) {
-}
+    : bucket(bucket), bucket_name(name), callback(std::move(callback)) {}
 
 TraceBucketData::~TraceBucketData() {
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/env-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env-test.cc b/src/kudu/util/env-test.cc
index dd58d2e..03e2503 100644
--- a/src/kudu/util/env-test.cc
+++ b/src/kudu/util/env-test.cc
@@ -336,9 +336,8 @@ TEST_F(TestEnv, TestHolePunch) {
 
 class ShortReadRandomAccessFile : public RandomAccessFile {
  public:
-  explicit ShortReadRandomAccessFile(const shared_ptr<RandomAccessFile>& wrapped)
-    : wrapped_(wrapped) {
-  }
+  explicit ShortReadRandomAccessFile(shared_ptr<RandomAccessFile> wrapped)
+      : wrapped_(std::move(wrapped)) {}
 
   virtual Status Read(uint64_t offset, size_t n, Slice* result,
                       uint8_t *scratch) const OVERRIDE {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/env_posix.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index 4c96e46..e8b3f92 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -209,8 +209,8 @@ class PosixSequentialFile: public SequentialFile {
   FILE* file_;
 
  public:
-  PosixSequentialFile(const std::string& fname, FILE* f)
-      : filename_(fname), file_(f) { }
+  PosixSequentialFile(std::string fname, FILE* f)
+      : filename_(std::move(fname)), file_(f) {}
   virtual ~PosixSequentialFile() { fclose(file_); }
 
   virtual Status Read(size_t n, Slice* result, uint8_t* scratch) OVERRIDE {
@@ -248,8 +248,8 @@ class PosixRandomAccessFile: public RandomAccessFile {
   int fd_;
 
  public:
-  PosixRandomAccessFile(const std::string& fname, int fd)
-      : filename_(fname), fd_(fd) { }
+  PosixRandomAccessFile(std::string fname, int fd)
+      : filename_(std::move(fname)), fd_(fd) {}
   virtual ~PosixRandomAccessFile() { close(fd_); }
 
   virtual Status Read(uint64_t offset, size_t n, Slice* result,
@@ -289,17 +289,14 @@ class PosixRandomAccessFile: public RandomAccessFile {
 // order to further improve Sync() performance.
 class PosixWritableFile : public WritableFile {
  public:
-  PosixWritableFile(const std::string& fname,
-                    int fd,
-                    uint64_t file_size,
+  PosixWritableFile(std::string fname, int fd, uint64_t file_size,
                     bool sync_on_close)
-      : filename_(fname),
+      : filename_(std::move(fname)),
         fd_(fd),
         sync_on_close_(sync_on_close),
         filesize_(file_size),
         pre_allocated_size_(0),
-        pending_sync_(false) {
-  }
+        pending_sync_(false) {}
 
   ~PosixWritableFile() {
     if (fd_ >= 0) {
@@ -483,14 +480,11 @@ class PosixWritableFile : public WritableFile {
 class PosixRWFile : public RWFile {
 // is not employed.
  public:
-  PosixRWFile(const string& fname,
-              int fd,
-              bool sync_on_close)
-  : filename_(fname),
-    fd_(fd),
-    sync_on_close_(sync_on_close),
-    pending_sync_(false) {
-  }
+  PosixRWFile(string fname, int fd, bool sync_on_close)
+      : filename_(std::move(fname)),
+        fd_(fd),
+        sync_on_close_(sync_on_close),
+        pending_sync_(false) {}
 
   ~PosixRWFile() {
     if (fd_ >= 0) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/env_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_util.cc b/src/kudu/util/env_util.cc
index e9e8117..b6b2244 100644
--- a/src/kudu/util/env_util.cc
+++ b/src/kudu/util/env_util.cc
@@ -131,11 +131,8 @@ Status CopyFile(Env* env, const string& source_path, const string& dest_path,
   return Status::OK();
 }
 
-ScopedFileDeleter::ScopedFileDeleter(Env* env, const std::string& path)
-  : env_(DCHECK_NOTNULL(env)),
-    path_(path),
-    should_delete_(true) {
-}
+ScopedFileDeleter::ScopedFileDeleter(Env* env, std::string path)
+    : env_(DCHECK_NOTNULL(env)), path_(std::move(path)), should_delete_(true) {}
 
 ScopedFileDeleter::~ScopedFileDeleter() {
   if (should_delete_) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/env_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_util.h b/src/kudu/util/env_util.h
index 483ce29..e121f9c 100644
--- a/src/kudu/util/env_util.h
+++ b/src/kudu/util/env_util.h
@@ -75,7 +75,7 @@ Status CopyFile(Env* env, const std::string& source_path, const std::string& des
 // creation of the tmp file may fail.
 class ScopedFileDeleter {
  public:
-  ScopedFileDeleter(Env* env, const std::string& path);
+  ScopedFileDeleter(Env* env, std::string path);
   ~ScopedFileDeleter();
 
   // Do not delete the file when this object goes out of scope.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/failure_detector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/failure_detector.cc b/src/kudu/util/failure_detector.cc
index 76f2611..426d345 100644
--- a/src/kudu/util/failure_detector.cc
+++ b/src/kudu/util/failure_detector.cc
@@ -36,8 +36,7 @@ using strings::Substitute;
 const int64_t RandomizedFailureMonitor::kMinWakeUpTimeMillis = 10;
 
 TimedFailureDetector::TimedFailureDetector(MonoDelta failure_period)
-    : failure_period_(failure_period) {
-}
+    : failure_period_(std::move(failure_period)) {}
 
 TimedFailureDetector::~TimedFailureDetector() {
   STLDeleteValues(&nodes_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/interval_tree-inl.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/interval_tree-inl.h b/src/kudu/util/interval_tree-inl.h
index 043c05e..7e88e42 100644
--- a/src/kudu/util/interval_tree-inl.h
+++ b/src/kudu/util/interval_tree-inl.h
@@ -191,14 +191,11 @@ bool ITNode<Traits>::SortByDescRight(const interval_type &a, const interval_type
   return Traits::compare(Traits::get_right(a), Traits::get_right(b)) > 0;
 }
 
-template<class Traits>
+template <class Traits>
 ITNode<Traits>::ITNode(typename Traits::point_type split_point,
-                       ITNode<Traits> *left,
-                       const IntervalVector &overlap,
+                       ITNode<Traits> *left, const IntervalVector &overlap,
                        ITNode<Traits> *right)
-  : split_point_(split_point),
-    left_(left),
-    right_(right) {
+    : split_point_(std::move(split_point)), left_(left), right_(right) {
   // Store two copies of the set of intervals which overlap the split point:
   // 1) Sorted by ascending left boundary
   overlapping_by_asc_left_.assign(overlap.begin(), overlap.end());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/jsonreader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/jsonreader.cc b/src/kudu/util/jsonreader.cc
index 643128f..e39761d 100644
--- a/src/kudu/util/jsonreader.cc
+++ b/src/kudu/util/jsonreader.cc
@@ -26,9 +26,7 @@ using strings::Substitute;
 
 namespace kudu {
 
-JsonReader::JsonReader(const string& text)
-  : text_(text) {
-}
+JsonReader::JsonReader(string text) : text_(std::move(text)) {}
 
 JsonReader::~JsonReader() {
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/jsonreader.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/jsonreader.h b/src/kudu/util/jsonreader.h
index e4fa551..2d9e982 100644
--- a/src/kudu/util/jsonreader.h
+++ b/src/kudu/util/jsonreader.h
@@ -37,7 +37,7 @@ namespace kudu {
 // error-handling wrapper for reading and parsing.
 class JsonReader {
  public:
-  explicit JsonReader(const std::string& text);
+  explicit JsonReader(std::string text);
   ~JsonReader();
 
   Status Init();

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/logging.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/logging.cc b/src/kudu/util/logging.cc
index 92e0434..8edd20a 100644
--- a/src/kudu/util/logging.cc
+++ b/src/kudu/util/logging.cc
@@ -63,9 +63,7 @@ namespace {
 
 class SimpleSink : public google::LogSink {
  public:
-  explicit SimpleSink(const LoggingCallback& cb)
-    : cb_(cb) {
-  }
+  explicit SimpleSink(LoggingCallback cb) : cb_(std::move(cb)) {}
 
   virtual ~SimpleSink() OVERRIDE {
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/mem_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker.cc b/src/kudu/util/mem_tracker.cc
index 84a057a..3bee9cf 100644
--- a/src/kudu/util/mem_tracker.cc
+++ b/src/kudu/util/mem_tracker.cc
@@ -159,16 +159,14 @@ shared_ptr<MemTracker> MemTracker::CreateTrackerUnlocked(int64_t byte_limit,
   return tracker;
 }
 
-MemTracker::MemTracker(const ConsumptionFunction& consumption_func,
-                       int64_t byte_limit,
-                       const string& id,
-                       const shared_ptr<MemTracker>& parent)
+MemTracker::MemTracker(ConsumptionFunction consumption_func, int64_t byte_limit,
+                       const string& id, shared_ptr<MemTracker> parent)
     : limit_(byte_limit),
       id_(id),
       descr_(Substitute("memory consumption for $0", id)),
-      parent_(parent),
+      parent_(std::move(parent)),
       consumption_(0),
-      consumption_func_(consumption_func),
+      consumption_func_(std::move(consumption_func)),
       rand_(GetRandomSeed32()),
       enable_logging_(false),
       log_stack_(false) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/mem_tracker.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker.h b/src/kudu/util/mem_tracker.h
index 5a2dde7..645f6e5 100644
--- a/src/kudu/util/mem_tracker.h
+++ b/src/kudu/util/mem_tracker.h
@@ -243,10 +243,8 @@ class MemTracker : public std::enable_shared_from_this<MemTracker> {
   // Consume()/Release() can still be called.
   // byte_limit < 0 means no limit
   // 'id' is the label for LogUsage() and web UI.
-  MemTracker(const ConsumptionFunction& consumption_func,
-             int64_t byte_limit,
-             const std::string& id,
-             const std::shared_ptr<MemTracker>& parent);
+  MemTracker(ConsumptionFunction consumption_func, int64_t byte_limit,
+             const std::string& id, std::shared_ptr<MemTracker> parent);
 
   bool CheckLimitExceeded() const {
     return limit_ >= 0 && limit_ < consumption();
@@ -351,9 +349,8 @@ class MemTrackerAllocator : public Alloc {
   typedef typename Alloc::const_pointer const_pointer;
   typedef typename Alloc::size_type size_type;
 
-  explicit MemTrackerAllocator(const std::shared_ptr<MemTracker>& mem_tracker)
-      : mem_tracker_(mem_tracker) {
-  }
+  explicit MemTrackerAllocator(std::shared_ptr<MemTracker> mem_tracker)
+      : mem_tracker_(std::move(mem_tracker)) {}
 
   // This constructor is used for rebinding.
   template <typename U>
@@ -394,10 +391,9 @@ class MemTrackerAllocator : public Alloc {
 // releasing it when the end of scope is reached.
 class ScopedTrackedConsumption {
  public:
-  ScopedTrackedConsumption(const std::shared_ptr<MemTracker>& tracker,
+  ScopedTrackedConsumption(std::shared_ptr<MemTracker> tracker,
                            int64_t to_consume)
-    : tracker_(tracker),
-      consumption_(to_consume) {
+      : tracker_(std::move(tracker)), consumption_(to_consume) {
     DCHECK(tracker_);
     tracker_->Consume(consumption_);
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/memenv/memenv.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memenv/memenv.cc b/src/kudu/util/memenv/memenv.cc
index 1a5063f..ce56f04 100644
--- a/src/kudu/util/memenv/memenv.cc
+++ b/src/kudu/util/memenv/memenv.cc
@@ -37,10 +37,8 @@ class FileState : public RefCountedThreadSafe<FileState> {
  public:
   // FileStates are reference counted. The initial reference count is zero
   // and the caller must call Ref() at least once.
-  explicit FileState(const string& filename)
-    : filename_(filename),
-      size_(0) {
-  }
+  explicit FileState(string filename)
+      : filename_(std::move(filename)), size_(0) {}
 
   uint64_t Size() const { return size_; }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/memory/memory.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/memory/memory.h b/src/kudu/util/memory/memory.h
index d6a7b09..4fdda05 100644
--- a/src/kudu/util/memory/memory.h
+++ b/src/kudu/util/memory/memory.h
@@ -673,12 +673,11 @@ class MemoryTrackingBufferAllocator : public BufferAllocator {
   // through an Arena) must be able to handle the case when allocation
   // fails. If 'enforce_limit' is false (this is the default), then
   // allocation will always succeed.
-  MemoryTrackingBufferAllocator(
-      BufferAllocator* const delegate,
-      const std::shared_ptr<MemTracker>& mem_tracker,
-      bool enforce_limit = false)
+  MemoryTrackingBufferAllocator(BufferAllocator* const delegate,
+                                std::shared_ptr<MemTracker> mem_tracker,
+                                bool enforce_limit = false)
       : delegate_(delegate),
-        mem_tracker_(mem_tracker),
+        mem_tracker_(std::move(mem_tracker)),
         enforce_limit_(enforce_limit) {}
 
   virtual ~MemoryTrackingBufferAllocator() {}

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/metrics.cc b/src/kudu/util/metrics.cc
index c3eba47..04b57bc 100644
--- a/src/kudu/util/metrics.cc
+++ b/src/kudu/util/metrics.cc
@@ -155,12 +155,10 @@ scoped_refptr<MetricEntity> MetricEntityPrototype::Instantiate(
 //
 
 MetricEntity::MetricEntity(const MetricEntityPrototype* prototype,
-                           const std::string& id,
-                           const AttributeMap& attributes)
-  : prototype_(prototype),
-    id_(id),
-    attributes_(attributes) {
-}
+                           std::string id, AttributeMap attributes)
+    : prototype_(prototype),
+      id_(std::move(id)),
+      attributes_(std::move(attributes)) {}
 
 MetricEntity::~MetricEntity() {
 }
@@ -429,7 +427,7 @@ void MetricPrototypeRegistry::WriteAsJsonAndExit() const {
 //
 // MetricPrototype
 //
-MetricPrototype::MetricPrototype(const CtorArgs& args) : args_(args) {
+MetricPrototype::MetricPrototype(CtorArgs args) : args_(std::move(args)) {
   MetricPrototypeRegistry::get()->AddMetric(this);
 }
 
@@ -513,10 +511,8 @@ Status Gauge::WriteAsJson(JsonWriter* writer,
 //
 
 StringGauge::StringGauge(const GaugePrototype<string>* proto,
-                         const string& initial_value)
-  : Gauge(proto),
-    value_(initial_value) {
-}
+                         string initial_value)
+    : Gauge(proto), value_(std::move(initial_value)) {}
 
 std::string StringGauge::value() const {
   lock_guard<simple_spinlock> l(&lock_);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/metrics.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/metrics.h b/src/kudu/util/metrics.h
index 5ea8fb7..b55cd08 100644
--- a/src/kudu/util/metrics.h
+++ b/src/kudu/util/metrics.h
@@ -494,9 +494,8 @@ class MetricEntity : public RefCountedThreadSafe<MetricEntity> {
   friend class MetricRegistry;
   friend class RefCountedThreadSafe<MetricEntity>;
 
-  MetricEntity(const MetricEntityPrototype* prototype,
-               const std::string& id,
-               const AttributeMap& attributes);
+  MetricEntity(const MetricEntityPrototype* prototype, std::string id,
+               AttributeMap attributes);
   ~MetricEntity();
 
   // Ensure that the given metric prototype is allowed to be instantiated
@@ -679,7 +678,7 @@ class MetricPrototype {
                    const MetricJsonOptions& opts) const;
 
  protected:
-  explicit MetricPrototype(const CtorArgs& args);
+  explicit MetricPrototype(CtorArgs args);
   virtual ~MetricPrototype() {
   }
 
@@ -741,7 +740,8 @@ class Gauge : public Metric {
 // Gauge implementation for string that uses locks to ensure thread safety.
 class StringGauge : public Gauge {
  public:
-  StringGauge(const GaugePrototype<std::string>* proto, const std::string& initial_value);
+  StringGauge(const GaugePrototype<std::string>* proto,
+              std::string initial_value);
   std::string value() const;
   void set_value(const std::string& value);
  protected:
@@ -897,11 +897,8 @@ class FunctionGauge : public Gauge {
  private:
   friend class MetricEntity;
 
-  FunctionGauge(const GaugePrototype<T>* proto,
-                const Callback<T()>& function)
-    : Gauge(proto),
-      function_(function) {
-  }
+  FunctionGauge(const GaugePrototype<T>* proto, Callback<T()> function)
+      : Gauge(proto), function_(std::move(function)) {}
 
   static T Return(T v) {
     return v;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/net/net_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/net/net_util.cc b/src/kudu/util/net/net_util.cc
index 2edd674..2f806d6 100644
--- a/src/kudu/util/net/net_util.cc
+++ b/src/kudu/util/net/net_util.cc
@@ -64,10 +64,8 @@ HostPort::HostPort()
     port_(0) {
 }
 
-HostPort::HostPort(const std::string& host, uint16_t port)
-  : host_(host),
-    port_(port) {
-}
+HostPort::HostPort(std::string host, uint16_t port)
+    : host_(std::move(host)), port_(port) {}
 
 HostPort::HostPort(const Sockaddr& addr)
   : host_(addr.host()),

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/net/net_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/net/net_util.h b/src/kudu/util/net/net_util.h
index f6c262f..d0bb92e 100644
--- a/src/kudu/util/net/net_util.h
+++ b/src/kudu/util/net/net_util.h
@@ -30,7 +30,7 @@ class Sockaddr;
 class HostPort {
  public:
   HostPort();
-  HostPort(const std::string& host, uint16_t port);
+  HostPort(std::string host, uint16_t port);
   explicit HostPort(const Sockaddr& addr);
 
   // Parse a "host:port" pair into this object.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/pstack_watcher.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/pstack_watcher.cc b/src/kudu/util/pstack_watcher.cc
index c7203dd..c769f07 100644
--- a/src/kudu/util/pstack_watcher.cc
+++ b/src/kudu/util/pstack_watcher.cc
@@ -37,10 +37,8 @@ using std::string;
 using std::vector;
 using strings::Substitute;
 
-PstackWatcher::PstackWatcher(const MonoDelta& timeout)
-  : timeout_(timeout),
-    running_(true),
-    cond_(&lock_) {
+PstackWatcher::PstackWatcher(MonoDelta timeout)
+    : timeout_(std::move(timeout)), running_(true), cond_(&lock_) {
   CHECK_OK(Thread::Create("pstack_watcher", "pstack_watcher",
                  boost::bind(&PstackWatcher::Run, this), &thread_));
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/pstack_watcher.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/pstack_watcher.h b/src/kudu/util/pstack_watcher.h
index e54c3d2..82390dd 100644
--- a/src/kudu/util/pstack_watcher.h
+++ b/src/kudu/util/pstack_watcher.h
@@ -49,7 +49,7 @@ class PstackWatcher {
 
   // Instantiate a watcher that writes a pstack to stdout after the given
   // timeout expires.
-  explicit PstackWatcher(const MonoDelta& timeout);
+  explicit PstackWatcher(MonoDelta timeout);
 
   ~PstackWatcher();
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/resettable_heartbeater.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/resettable_heartbeater.cc b/src/kudu/util/resettable_heartbeater.cc
index 30456d4..a1c68b9 100644
--- a/src/kudu/util/resettable_heartbeater.cc
+++ b/src/kudu/util/resettable_heartbeater.cc
@@ -32,8 +32,7 @@ using std::string;
 
 class ResettableHeartbeaterThread {
  public:
-  ResettableHeartbeaterThread(const std::string& name,
-                              MonoDelta period,
+  ResettableHeartbeaterThread(std::string name, MonoDelta period,
                               HeartbeatFunction function);
 
   Status Start();
@@ -87,15 +86,13 @@ ResettableHeartbeater::~ResettableHeartbeater() {
   WARN_NOT_OK(Stop(), "Unable to stop heartbeater thread");
 }
 
-ResettableHeartbeaterThread::ResettableHeartbeaterThread(const std::string& name,
-                                                         MonoDelta period,
-                                                         HeartbeatFunction function)
-    : name_(name),
-      period_(period),
-      function_(function),
+ResettableHeartbeaterThread::ResettableHeartbeaterThread(
+    std::string name, MonoDelta period, HeartbeatFunction function)
+    : name_(std::move(name)),
+      period_(std::move(period)),
+      function_(std::move(function)),
       run_latch_(0),
-      shutdown_(false) {
-}
+      shutdown_(false) {}
 
 void ResettableHeartbeaterThread::RunThread() {
   CHECK(IsCurrentThread());

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/rolling_log.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rolling_log.cc b/src/kudu/util/rolling_log.cc
index 836cf52..457ad2c 100644
--- a/src/kudu/util/rolling_log.cc
+++ b/src/kudu/util/rolling_log.cc
@@ -43,15 +43,12 @@ static const int kDefaultSizeLimitBytes = 64 * 1024 * 1024; // 64MB
 
 namespace kudu {
 
-RollingLog::RollingLog(Env* env,
-                       const string& log_dir,
-                       const string& log_name)
-  : env_(env),
-    log_dir_(log_dir),
-    log_name_(log_name),
-    size_limit_bytes_(kDefaultSizeLimitBytes),
-    compress_after_close_(true) {
-}
+RollingLog::RollingLog(Env* env, string log_dir, string log_name)
+    : env_(env),
+      log_dir_(std::move(log_dir)),
+      log_name_(std::move(log_name)),
+      size_limit_bytes_(kDefaultSizeLimitBytes),
+      compress_after_close_(true) {}
 
 RollingLog::~RollingLog() {
   WARN_NOT_OK(Close(), "Unable to close RollingLog");

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/rolling_log.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/rolling_log.h b/src/kudu/util/rolling_log.h
index b3be59d..eefd138 100644
--- a/src/kudu/util/rolling_log.h
+++ b/src/kudu/util/rolling_log.h
@@ -53,9 +53,7 @@ class WritableFile;
 // This class is not thread-safe and must be externally synchronized.
 class RollingLog {
  public:
-  RollingLog(Env* env,
-             const std::string& log_dir,
-             const std::string& log_name);
+  RollingLog(Env* env, std::string log_dir, std::string log_name);
 
   ~RollingLog();
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/stopwatch.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/stopwatch.h b/src/kudu/util/stopwatch.h
index 9140a0e..a08691a 100644
--- a/src/kudu/util/stopwatch.h
+++ b/src/kudu/util/stopwatch.h
@@ -264,17 +264,17 @@ namespace sw_internal {
 // Internal class used by the LOG_TIMING macro.
 class LogTiming {
  public:
-  LogTiming(const char* file, int line, google::LogSeverity severity,
-            const std::string& prefix, const std::string& description,
+  LogTiming(const char *file, int line, google::LogSeverity severity,
+            std::string prefix, std::string description,
             int64_t max_expected_millis, bool should_print)
-    : file_(file),
-      line_(line),
-      severity_(severity),
-      prefix_(prefix),
-      description_(description),
-      max_expected_millis_(max_expected_millis),
-      should_print_(should_print),
-      has_run_(false) {
+      : file_(file),
+        line_(line),
+        severity_(severity),
+        prefix_(std::move(prefix)),
+        description_(std::move(description)),
+        max_expected_millis_(max_expected_millis),
+        should_print_(should_print),
+        has_run_(false) {
     stopwatch_.start();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/subprocess.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/subprocess.cc b/src/kudu/util/subprocess.cc
index 94d57a1..014568a 100644
--- a/src/kudu/util/subprocess.cc
+++ b/src/kudu/util/subprocess.cc
@@ -145,14 +145,13 @@ void CloseNonStandardFDs(DIR* fd_dir) {
 
 } // anonymous namespace
 
-Subprocess::Subprocess(const string& program,
-                       const vector<string>& argv)
-  : program_(program),
-    argv_(argv),
-    state_(kNotStarted),
-    child_pid_(-1),
-    fd_state_(),
-    child_fds_() {
+Subprocess::Subprocess(string program, vector<string> argv)
+    : program_(std::move(program)),
+      argv_(std::move(argv)),
+      state_(kNotStarted),
+      child_pid_(-1),
+      fd_state_(),
+      child_fds_() {
   fd_state_[STDIN_FILENO]   = PIPED;
   fd_state_[STDOUT_FILENO]  = SHARED;
   fd_state_[STDERR_FILENO]  = SHARED;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/subprocess.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/subprocess.h b/src/kudu/util/subprocess.h
index ddf81bd..6889b6a 100644
--- a/src/kudu/util/subprocess.h
+++ b/src/kudu/util/subprocess.h
@@ -45,8 +45,7 @@ namespace kudu {
 // will be forcibly SIGKILLed to avoid orphaning processes.
 class Subprocess {
  public:
-  Subprocess(const std::string& program,
-             const std::vector<std::string>& argv);
+  Subprocess(std::string program, std::vector<std::string> argv);
   ~Subprocess();
 
   // Disable subprocess stream output.  Must be called before subprocess starts.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/sync_point.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/sync_point.cc b/src/kudu/util/sync_point.cc
index ded2ff4..7f171d7 100644
--- a/src/kudu/util/sync_point.cc
+++ b/src/kudu/util/sync_point.cc
@@ -28,10 +28,8 @@ using std::vector;
 #ifndef NDEBUG
 namespace kudu {
 
-SyncPoint::Dependency::Dependency(const string& predecessor, const string &successor)
-  : predecessor_(predecessor),
-    successor_(successor) {
-}
+SyncPoint::Dependency::Dependency(string predecessor, string successor)
+    : predecessor_(std::move(predecessor)), successor_(std::move(successor)) {}
 
 SyncPoint::SyncPoint()
   : cv_(&mutex_),

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/sync_point.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/sync_point.h b/src/kudu/util/sync_point.h
index d990468..b24686d 100644
--- a/src/kudu/util/sync_point.h
+++ b/src/kudu/util/sync_point.h
@@ -48,7 +48,7 @@ class SyncPoint {
   static SyncPoint* GetInstance();
 
   struct Dependency {
-    Dependency(const std::string& predecessor, const std::string& successor);
+    Dependency(std::string predecessor, std::string successor);
 
     std::string predecessor_;
     std::string successor_;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/test_graph.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/test_graph.h b/src/kudu/util/test_graph.h
index d01ec37..6ea49ca 100644
--- a/src/kudu/util/test_graph.h
+++ b/src/kudu/util/test_graph.h
@@ -53,11 +53,8 @@ class TimeSeries {
 
 class TimeSeriesCollector {
  public:
-  explicit TimeSeriesCollector(const std::string &scope) :
-    scope_(scope),
-    exit_latch_(0),
-    started_(false)
-  {}
+  explicit TimeSeriesCollector(std::string scope)
+      : scope_(std::move(scope)), exit_latch_(0), started_(false) {}
 
   ~TimeSeriesCollector();
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/thread.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/thread.cc b/src/kudu/util/thread.cc
index 6ecca47..e95f8da 100644
--- a/src/kudu/util/thread.cc
+++ b/src/kudu/util/thread.cc
@@ -167,9 +167,10 @@ class ThreadMgr {
   class ThreadDescriptor {
    public:
     ThreadDescriptor() { }
-    ThreadDescriptor(const string& category, const string& name, int64_t thread_id)
-        : name_(name), category_(category), thread_id_(thread_id) {
-    }
+    ThreadDescriptor(string category, string name, int64_t thread_id)
+        : name_(std::move(name)),
+          category_(std::move(category)),
+          thread_id_(thread_id) {}
 
     const string& name() const { return name_; }
     const string& category() const { return category_; }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/thread.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/thread.h b/src/kudu/util/thread.h
index 7e2a519..1d33aa3 100644
--- a/src/kudu/util/thread.h
+++ b/src/kudu/util/thread.h
@@ -265,15 +265,14 @@ class Thread : public RefCountedThreadSafe<Thread> {
   // Function object that wraps the user-supplied function to run in a separate thread.
   typedef boost::function<void ()> ThreadFunctor;
 
-  Thread(const std::string& category, const std::string& name, const ThreadFunctor& functor)
-    : thread_(0),
-      category_(category),
-      name_(name),
-      tid_(CHILD_WAITING_TID),
-      functor_(functor),
-      done_(1),
-      joinable_(false) {
-  }
+  Thread(std::string category, std::string name, ThreadFunctor functor)
+      : thread_(0),
+        category_(std::move(category)),
+        name_(std::move(name)),
+        tid_(CHILD_WAITING_TID),
+        functor_(std::move(functor)),
+        done_(1),
+        joinable_(false) {}
 
   // Library-specific thread ID.
   pthread_t thread_;

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/threadpool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/threadpool.cc b/src/kudu/util/threadpool.cc
index 63aaa39..ffd8557 100644
--- a/src/kudu/util/threadpool.cc
+++ b/src/kudu/util/threadpool.cc
@@ -40,9 +40,7 @@ using strings::Substitute;
 
 class FunctionRunnable : public Runnable {
  public:
-  FunctionRunnable(const boost::function<void()>& func)
-    : func_(func) {
-  }
+  FunctionRunnable(boost::function<void()> func) : func_(std::move(func)) {}
 
   void Run() OVERRIDE {
     func_();
@@ -56,13 +54,12 @@ class FunctionRunnable : public Runnable {
 // ThreadPoolBuilder
 ////////////////////////////////////////////////////////
 
-ThreadPoolBuilder::ThreadPoolBuilder(const std::string& name)
-  : name_(name),
-    min_threads_(0),
-    max_threads_(base::NumCPUs()),
-    max_queue_size_(std::numeric_limits<int>::max()),
-    idle_timeout_(MonoDelta::FromMilliseconds(500)) {
-}
+ThreadPoolBuilder::ThreadPoolBuilder(std::string name)
+    : name_(std::move(name)),
+      min_threads_(0),
+      max_threads_(base::NumCPUs()),
+      max_queue_size_(std::numeric_limits<int>::max()),
+      idle_timeout_(MonoDelta::FromMilliseconds(500)) {}
 
 ThreadPoolBuilder& ThreadPoolBuilder::set_min_threads(int min_threads) {
   CHECK_GE(min_threads, 0);

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/61934118/src/kudu/util/threadpool.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/threadpool.h b/src/kudu/util/threadpool.h
index 053eda4..267b3a3 100644
--- a/src/kudu/util/threadpool.h
+++ b/src/kudu/util/threadpool.h
@@ -69,7 +69,7 @@ class Runnable {
 //
 class ThreadPoolBuilder {
  public:
-  explicit ThreadPoolBuilder(const std::string& name);
+  explicit ThreadPoolBuilder(std::string name);
 
   // Note: We violate the style guide by returning mutable references here
   // in order to provide traditional Builder pattern conveniences.


Mime
View raw message