kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject [5/5] kudu git commit: Rename TabletPeer to TabletReplica
Date Thu, 04 May 2017 22:14:30 GMT
Rename TabletPeer to TabletReplica

This class was confusingly named. This changes the class names as well
as all usages from TabletPeer to TabletReplica.

This was initially done with a Perl script, then the indentation was
corrected, the variable naming was updated, and the documentation was
modified by hand.

Change-Id: Icafecd47268c395a6c0ce0aed75d154f4ace7192
Reviewed-on: http://gerrit.cloudera.org:8080/6794
Tested-by: Kudu Jenkins
Reviewed-by: Will Berkeley <wdberkeley@gmail.com>


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

Branch: refs/heads/master
Commit: 7f72105b79b36480d132e0ed10f4cc7fbabd6dca
Parents: 14e9d3d
Author: Mike Percy <mpercy@apache.org>
Authored: Wed May 3 13:39:03 2017 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Thu May 4 22:14:08 2017 +0000

----------------------------------------------------------------------
 docs/design-docs/rpc-retry-and-failover.md      |   4 +-
 src/kudu/client/client-test.cc                  |  68 +-
 src/kudu/consensus/consensus-test-util.h        |   2 +-
 src/kudu/consensus/consensus.h                  |   4 +-
 src/kudu/consensus/log.cc                       |   4 +-
 src/kudu/consensus/raft_consensus.cc            |   2 +-
 src/kudu/consensus/raft_consensus.h             |   2 +-
 src/kudu/integration-tests/alter_table-test.cc  |  98 +--
 src/kudu/integration-tests/consistency-itest.cc |  20 +-
 .../integration-tests/delete_tablet-itest.cc    |  34 +-
 .../full_stack-insert-scan-test.cc              |  10 +-
 src/kudu/integration-tests/fuzz-itest.cc        |  26 +-
 .../tablet_history_gc-itest.cc                  |  20 +-
 .../ts_tablet_manager-itest.cc                  |  26 +-
 src/kudu/master/catalog_manager.cc              |  26 +-
 src/kudu/master/catalog_manager.h               |  12 +-
 src/kudu/master/sys_catalog.cc                  |  42 +-
 src/kudu/master/sys_catalog.h                   |  18 +-
 src/kudu/tablet/CMakeLists.txt                  |   6 +-
 src/kudu/tablet/local_tablet_writer.h           |   2 +-
 src/kudu/tablet/metadata.proto                  |   4 +-
 src/kudu/tablet/tablet-harness.h                |   6 +-
 src/kudu/tablet/tablet.h                        |   2 +-
 src/kudu/tablet/tablet_bootstrap.cc             |   4 +-
 src/kudu/tablet/tablet_peer-test.cc             | 564 ----------------
 src/kudu/tablet/tablet_peer.cc                  | 672 -------------------
 src/kudu/tablet/tablet_peer.h                   | 377 -----------
 src/kudu/tablet/tablet_peer_mm_ops.cc           | 244 -------
 src/kudu/tablet/tablet_peer_mm_ops.h            | 133 ----
 src/kudu/tablet/tablet_replica-test.cc          | 565 ++++++++++++++++
 src/kudu/tablet/tablet_replica.cc               | 669 ++++++++++++++++++
 src/kudu/tablet/tablet_replica.h                | 377 +++++++++++
 src/kudu/tablet/tablet_replica_mm_ops.cc        | 246 +++++++
 src/kudu/tablet/tablet_replica_mm_ops.h         | 133 ++++
 .../transactions/alter_schema_transaction.cc    |  10 +-
 .../transactions/alter_schema_transaction.h     |   4 +-
 src/kudu/tablet/transactions/transaction.cc     |   4 +-
 src/kudu/tablet/transactions/transaction.h      |  12 +-
 .../tablet/transactions/transaction_driver.cc   |   6 +-
 .../tablet/transactions/transaction_tracker.cc  |   6 +-
 .../tablet/transactions/transaction_tracker.h   |   2 +-
 .../tablet/transactions/write_transaction.cc    |  16 +-
 .../tablet/transactions/write_transaction.h     |   2 +-
 src/kudu/tools/kudu-tool-test.cc                |  44 +-
 src/kudu/tserver/scanners-test.cc               |  16 +-
 src/kudu/tserver/scanners.cc                    |  10 +-
 src/kudu/tserver/scanners.h                     |  14 +-
 src/kudu/tserver/tablet_copy-test-base.h        |  12 +-
 src/kudu/tserver/tablet_copy_client-test.cc     |   6 +-
 src/kudu/tserver/tablet_copy_client.cc          |   2 +-
 src/kudu/tserver/tablet_copy_client.h           |   2 +-
 src/kudu/tserver/tablet_copy_service-test.cc    |   2 +-
 src/kudu/tserver/tablet_copy_service.cc         |  16 +-
 src/kudu/tserver/tablet_copy_service.h          |   6 +-
 .../tserver/tablet_copy_source_session-test.cc  |  50 +-
 src/kudu/tserver/tablet_copy_source_session.cc  |  32 +-
 src/kudu/tserver/tablet_copy_source_session.h   |  12 +-
 src/kudu/tserver/tablet_peer_lookup.h           |  63 --
 src/kudu/tserver/tablet_replica_lookup.h        |  63 ++
 src/kudu/tserver/tablet_server-test-base.h      |  28 +-
 src/kudu/tserver/tablet_server-test.cc          | 106 +--
 src/kudu/tserver/tablet_service.cc              | 174 ++---
 src/kudu/tserver/tablet_service.h               |  12 +-
 src/kudu/tserver/ts_tablet_manager-test.cc      |  32 +-
 src/kudu/tserver/ts_tablet_manager.cc           | 191 +++---
 src/kudu/tserver/ts_tablet_manager.h            |  54 +-
 src/kudu/tserver/tserver-path-handlers.cc       | 124 ++--
 67 files changed, 2779 insertions(+), 2776 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/docs/design-docs/rpc-retry-and-failover.md
----------------------------------------------------------------------
diff --git a/docs/design-docs/rpc-retry-and-failover.md b/docs/design-docs/rpc-retry-and-failover.md
index 0375f72..9bdb91a 100644
--- a/docs/design-docs/rpc-retry-and-failover.md
+++ b/docs/design-docs/rpc-retry-and-failover.md
@@ -47,7 +47,7 @@ it's not totally clear what happens when an RPC mutates multiple "server objects
 what these server objects really are.
 
 2. Handled ad-hoc by the client and the tablet server/master, outside of the RPC layer -
-With this option, we choose to handle errors at the TabletServer/TabletPeer, ad-hoc, and for
+With this option, we choose to handle errors at the TabletServer/TabletReplica, ad-hoc, and for
 each different RPC. For specific RPCs like Write() this option seems to map to existing
 components quite well. For instance the completion record can be the raft log and replica
 replay would mean that it would be relatively easy to implement a retry rendezvous
@@ -58,7 +58,7 @@ error handling for operations that are not tablet server transactions.
 such as retrying and retry rendez-vous logic, but other parts of the logic would be implemented
 ad-hoc in other layers. For instance, for Write()s, the RPC layer would know how to sequence and
 retry the RPCs but would delegate durability and cross-server replicated operation rendezvous
-to the tablet peer/transaction manager.
+to the tablet replica/transaction manager.
 
 # Design choices
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/client/client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index a78fadc..afc15d0 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -56,7 +56,7 @@
 #include "kudu/rpc/messenger.h"
 #include "kudu/security/tls_context.h"
 #include "kudu/server/hybrid_clock.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tablet/transactions/write_transaction.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/scanners.h"
@@ -117,7 +117,7 @@ using master::GetTableLocationsRequestPB;
 using master::GetTableLocationsResponsePB;
 using master::TabletLocationsPB;
 using sp::shared_ptr;
-using tablet::TabletPeer;
+using tablet::TabletReplica;
 using tserver::MiniTabletServer;
 
 class ClientTest : public KuduTest {
@@ -240,10 +240,10 @@ class ClientTest : public KuduTest {
 
   void FlushTablet(const string& tablet_id) {
     for (int i = 0; i < cluster_->num_tablet_servers(); i++) {
-      scoped_refptr<TabletPeer> tablet_peer;
+      scoped_refptr<TabletReplica> tablet_replica;
       ASSERT_TRUE(cluster_->mini_tablet_server(i)->server()->tablet_manager()->LookupTablet(
-          tablet_id, &tablet_peer));
-      ASSERT_OK(tablet_peer->tablet()->Flush());
+          tablet_id, &tablet_replica));
+      ASSERT_OK(tablet_replica->tablet()->Flush());
     }
   }
 
@@ -3376,18 +3376,18 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     ASSERT_STR_CONTAINS(s.ToString(), "unsupported alter operation: string_val");
   }
 
-  // Need a tablet peer for the next set of tests.
+  // Need a TabletReplica for the next set of tests.
   string tablet_id = GetFirstTabletId(client_table_.get());
-  scoped_refptr<TabletPeer> tablet_peer;
+  scoped_refptr<TabletReplica> tablet_replica;
   ASSERT_TRUE(cluster_->mini_tablet_server(0)->server()->tablet_manager()->LookupTablet(
-      tablet_id, &tablet_peer));
+      tablet_id, &tablet_replica));
 
   {
     gscoped_ptr<KuduTableAlterer> table_alterer(client_->NewTableAlterer(kTableName));
     table_alterer->DropColumn("int_val")
       ->AddColumn("new_col")->Type(KuduColumnSchema::INT32);
     ASSERT_OK(table_alterer->Alter());
-    ASSERT_EQ(1, tablet_peer->tablet()->metadata()->schema_version());
+    ASSERT_EQ(1, tablet_replica->tablet()->metadata()->schema_version());
   }
 
   // Specifying an encoding incompatible with the column's type is an error.
@@ -3398,7 +3398,7 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     Status s = table_alterer->Alter();
     ASSERT_TRUE(s.IsNotSupported());
     ASSERT_STR_CONTAINS(s.ToString(), "encoding GROUP_VARINT not supported for type BINARY");
-    ASSERT_EQ(1, tablet_peer->tablet()->metadata()->schema_version());
+    ASSERT_EQ(1, tablet_replica->tablet()->metadata()->schema_version());
   }
 
   // Test adding a new column of type string.
@@ -3407,7 +3407,7 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     table_alterer->AddColumn("new_string_val")->Type(KuduColumnSchema::STRING)
       ->Encoding(KuduColumnStorageAttributes::PREFIX_ENCODING);
     ASSERT_OK(table_alterer->Alter());
-    ASSERT_EQ(2, tablet_peer->tablet()->metadata()->schema_version());
+    ASSERT_EQ(2, tablet_replica->tablet()->metadata()->schema_version());
   }
 
   // Test renaming a primary key column.
@@ -3416,7 +3416,7 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     table_alterer->AlterColumn("key")->RenameTo("key2");
     Status s = table_alterer->Alter();
     ASSERT_FALSE(s.IsInvalidArgument());
-    ASSERT_EQ(3, tablet_peer->tablet()->metadata()->schema_version());
+    ASSERT_EQ(3, tablet_replica->tablet()->metadata()->schema_version());
   }
 
   // Changing the type of a primary key column is an error.
@@ -3435,8 +3435,8 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     table_alterer->AlterColumn("string_val")
         ->Default(KuduValue::CopyString("hello!"));
     ASSERT_OK(table_alterer->Alter());
-    ASSERT_EQ(4, tablet_peer->tablet()->metadata()->schema_version());
-    Schema schema = tablet_peer->tablet()->metadata()->schema();
+    ASSERT_EQ(4, tablet_replica->tablet()->metadata()->schema_version());
+    Schema schema = tablet_replica->tablet()->metadata()->schema();
     ColumnSchema col_schema = schema.column(schema.find_column("string_val"));
     ASSERT_FALSE(col_schema.has_read_default());
     ASSERT_TRUE(col_schema.has_write_default());
@@ -3449,8 +3449,8 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     table_alterer->AlterColumn("non_null_with_default")
         ->Default(KuduValue::FromInt(54321));
     ASSERT_OK(table_alterer->Alter());
-    ASSERT_EQ(5, tablet_peer->tablet()->metadata()->schema_version());
-    Schema schema = tablet_peer->tablet()->metadata()->schema();
+    ASSERT_EQ(5, tablet_replica->tablet()->metadata()->schema_version());
+    Schema schema = tablet_replica->tablet()->metadata()->schema();
     ColumnSchema col_schema = schema.column(schema.find_column("non_null_with_default"));
     ASSERT_TRUE(col_schema.has_read_default()); // Started with a default
     ASSERT_TRUE(col_schema.has_write_default());
@@ -3463,8 +3463,8 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     table_alterer->AlterColumn("string_val")
         ->RemoveDefault();
     ASSERT_OK(table_alterer->Alter());
-    ASSERT_EQ(6, tablet_peer->tablet()->metadata()->schema_version());
-    Schema schema = tablet_peer->tablet()->metadata()->schema();
+    ASSERT_EQ(6, tablet_replica->tablet()->metadata()->schema_version());
+    Schema schema = tablet_replica->tablet()->metadata()->schema();
     ColumnSchema col_schema = schema.column(schema.find_column("string_val"));
     ASSERT_FALSE(col_schema.has_read_default());
     ASSERT_FALSE(col_schema.has_write_default());
@@ -3476,8 +3476,8 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     table_alterer->AlterColumn("non_null_with_default")
         ->RemoveDefault();
     ASSERT_OK(table_alterer->Alter());
-    ASSERT_EQ(7, tablet_peer->tablet()->metadata()->schema_version());
-    Schema schema = tablet_peer->tablet()->metadata()->schema();
+    ASSERT_EQ(7, tablet_replica->tablet()->metadata()->schema_version());
+    Schema schema = tablet_replica->tablet()->metadata()->schema();
     ColumnSchema col_schema = schema.column(schema.find_column("non_null_with_default"));
     ASSERT_TRUE(col_schema.has_read_default());
     ASSERT_FALSE(col_schema.has_write_default());
@@ -3494,7 +3494,7 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     Status s = table_alterer->Alter();
     ASSERT_TRUE(s.IsInvalidArgument());
     ASSERT_STR_CONTAINS(s.ToString(), "wrong size for default value");
-    ASSERT_EQ(7, tablet_peer->tablet()->metadata()->schema_version());
+    ASSERT_EQ(7, tablet_replica->tablet()->metadata()->schema_version());
   }
 
   // Test altering encoding, compression, and block size.
@@ -3505,8 +3505,8 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
         ->Compression(KuduColumnStorageAttributes::LZ4)
         ->BlockSize(16 * 1024 * 1024);
     ASSERT_OK(table_alterer->Alter());
-    ASSERT_EQ(8, tablet_peer->tablet()->metadata()->schema_version());
-    Schema schema = tablet_peer->tablet()->metadata()->schema();
+    ASSERT_EQ(8, tablet_replica->tablet()->metadata()->schema_version());
+    Schema schema = tablet_replica->tablet()->metadata()->schema();
     ColumnSchema col_schema = schema.column(schema.find_column("string_val"));
     ASSERT_EQ(KuduColumnStorageAttributes::PLAIN_ENCODING, col_schema.attributes().encoding);
     ASSERT_EQ(KuduColumnStorageAttributes::LZ4, col_schema.attributes().compression);
@@ -3520,8 +3520,8 @@ TEST_F(ClientTest, TestBasicAlterOperations) {
     ASSERT_OK(table_alterer
               ->RenameTo(kRenamedTableName)
               ->Alter());
-    ASSERT_EQ(9, tablet_peer->tablet()->metadata()->schema_version());
-    ASSERT_EQ(kRenamedTableName, tablet_peer->tablet()->metadata()->table_name());
+    ASSERT_EQ(9, tablet_replica->tablet()->metadata()->schema_version());
+    ASSERT_EQ(kRenamedTableName, tablet_replica->tablet()->metadata()->table_name());
 
     CatalogManager *catalog_manager = cluster_->mini_master()->master()->catalog_manager();
     CatalogManager::ScopedLeaderSharedLock l(catalog_manager);
@@ -3561,9 +3561,9 @@ TEST_F(ClientTest, TestDeleteTable) {
   int wait_time = 1000;
   bool tablet_found = true;
   for (int i = 0; i < 80 && tablet_found; ++i) {
-    scoped_refptr<TabletPeer> tablet_peer;
+    scoped_refptr<TabletReplica> tablet_replica;
     tablet_found = cluster_->mini_tablet_server(0)->server()->tablet_manager()->LookupTablet(
-                      tablet_id, &tablet_peer);
+                      tablet_id, &tablet_replica);
     SleepFor(MonoDelta::FromMicroseconds(wait_time));
     wait_time = std::min(wait_time * 5 / 4, 1000000);
   }
@@ -4258,9 +4258,9 @@ TEST_F(ClientTest, TestInsertEmptyPK) {
   ASSERT_OK(client_->OpenTable(kTableName, &table));
 
   // Find the tablet.
-  scoped_refptr<TabletPeer> tablet_peer;
+  scoped_refptr<TabletReplica> tablet_replica;
   ASSERT_TRUE(cluster_->mini_tablet_server(0)->server()->tablet_manager()->LookupTablet(
-          GetFirstTabletId(table.get()), &tablet_peer));
+          GetFirstTabletId(table.get()), &tablet_replica));
 
   // Utility function to get the current value of the row.
   const auto ReadRowAsString = [&]() {
@@ -4285,7 +4285,7 @@ TEST_F(ClientTest, TestInsertEmptyPK) {
   ASSERT_EQ("(string k1=\"\", string v1=\"initial\")", ReadRowAsString());
 
   // Make sure that Flush works properly, and the data is still readable.
-  ASSERT_OK(tablet_peer->tablet()->Flush());
+  ASSERT_OK(tablet_replica->tablet()->Flush());
   ASSERT_EQ("(string k1=\"\", string v1=\"initial\")", ReadRowAsString());
 
   // Perform an update.
@@ -4297,9 +4297,9 @@ TEST_F(ClientTest, TestInsertEmptyPK) {
     ASSERT_OK(session->Flush());
   }
   ASSERT_EQ("(string k1=\"\", string v1=\"updated\")", ReadRowAsString());
-  ASSERT_OK(tablet_peer->tablet()->FlushAllDMSForTests());
+  ASSERT_OK(tablet_replica->tablet()->FlushAllDMSForTests());
   ASSERT_EQ("(string k1=\"\", string v1=\"updated\")", ReadRowAsString());
-  ASSERT_OK(tablet_peer->tablet()->Compact(tablet::Tablet::FORCE_COMPACT_ALL));
+  ASSERT_OK(tablet_replica->tablet()->Compact(tablet::Tablet::FORCE_COMPACT_ALL));
   ASSERT_EQ("(string k1=\"\", string v1=\"updated\")", ReadRowAsString());
 
   // Perform a delete.
@@ -4310,9 +4310,9 @@ TEST_F(ClientTest, TestInsertEmptyPK) {
     ASSERT_OK(session->Flush());
   }
   ASSERT_EQ("<none>", ReadRowAsString());
-  ASSERT_OK(tablet_peer->tablet()->FlushAllDMSForTests());
+  ASSERT_OK(tablet_replica->tablet()->FlushAllDMSForTests());
   ASSERT_EQ("<none>", ReadRowAsString());
-  ASSERT_OK(tablet_peer->tablet()->Compact(tablet::Tablet::FORCE_COMPACT_ALL));
+  ASSERT_OK(tablet_replica->tablet()->Compact(tablet::Tablet::FORCE_COMPACT_ALL));
   ASSERT_EQ("<none>", ReadRowAsString());
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/consensus/consensus-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus-test-util.h b/src/kudu/consensus/consensus-test-util.h
index 72cdf93..89707aa 100644
--- a/src/kudu/consensus/consensus-test-util.h
+++ b/src/kudu/consensus/consensus-test-util.h
@@ -634,7 +634,7 @@ class TestDriver {
   Log* log_;
 };
 
-// A transaction factory for tests, usually this is implemented by TabletPeer.
+// A transaction factory for tests, usually this is implemented by TabletReplica.
 class TestTransactionFactory : public ReplicaTransactionFactory {
  public:
   explicit TestTransactionFactory(Log* log) : consensus_(nullptr),

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/consensus/consensus.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus.h b/src/kudu/consensus/consensus.h
index 78edae3..8ea313c 100644
--- a/src/kudu/consensus/consensus.h
+++ b/src/kudu/consensus/consensus.h
@@ -48,7 +48,7 @@ class Clock;
 }
 
 namespace tablet {
-class TabletPeer;
+class TabletReplica;
 }
 
 namespace tserver {
@@ -294,7 +294,7 @@ class Consensus : public RefCountedThreadSafe<Consensus> {
 
  protected:
   friend class RefCountedThreadSafe<Consensus>;
-  friend class tablet::TabletPeer;
+  friend class tablet::TabletReplica;
   friend class master::SysCatalogTable;
 
   // This class is refcounted.

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/consensus/log.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log.cc b/src/kudu/consensus/log.cc
index a145767..4a6121d 100644
--- a/src/kudu/consensus/log.cc
+++ b/src/kudu/consensus/log.cc
@@ -499,9 +499,9 @@ Status Log::DoAppend(LogEntryBatch* entry_batch) {
   // We keep track of the last-written OpId here.
   // This is needed to initialize Consensus on startup.
   if (entry_batch->type_ == REPLICATE) {
-    // TODO Probably remove the code below as it looks suspicious: Tablet peer uses this
+    // TODO Probably remove the code below as it looks suspicious: TabletReplica uses this
     // as 'safe' anchor as it believes it in the log, when it actually isn't, i.e. this
-    // is not the last durable operation. Either move this to tablet peer (since we're
+    // is not the last durable operation. Either move this to TabletReplica (since we're
     // using in flights anyway no need to scan for ids here) or actually delay doing this
     // until fsync() has been done. See KUDU-527.
     std::lock_guard<rw_spinlock> write_lock(last_entry_op_id_lock_);

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/consensus/raft_consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index f75057f..91040bb 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -1079,7 +1079,7 @@ Status RaftConsensus::UpdateReplica(const ConsensusRequestPB* request,
   //   state machine so, were we to crash afterwards, having the prepares in-flight
   //   won't hurt.
   // - Prepares depend on factors external to consensus (the transaction drivers and
-  //   the tablet peer) so if for some reason they cannot be enqueued we must know
+  //   the TabletReplica) so if for some reason they cannot be enqueued we must know
   //   before we try write them to the WAL. Once enqueued, we assume that prepare will
   //   always succeed on a replica transaction (because the leader already prepared them
   //   successfully, and thus we know they are valid).

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/consensus/raft_consensus.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.h b/src/kudu/consensus/raft_consensus.h
index 98f2743..7d6c633 100644
--- a/src/kudu/consensus/raft_consensus.h
+++ b/src/kudu/consensus/raft_consensus.h
@@ -387,7 +387,7 @@ class RaftConsensus : public Consensus,
   Status HandleTermAdvanceUnlocked(ConsensusTerm new_term,
                                    ReplicaState::FlushToDisk flush = ReplicaState::FLUSH_TO_DISK);
 
-  // Asynchronously (on thread_pool_) notify the tablet peer that the consensus configuration
+  // Asynchronously (on thread_pool_) notify the TabletReplica that the consensus configuration
   // has changed, thus reporting it back to the master.
   void MarkDirty(const std::string& reason);
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/integration-tests/alter_table-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/alter_table-test.cc b/src/kudu/integration-tests/alter_table-test.cc
index 76ed354..03d2395 100644
--- a/src/kudu/integration-tests/alter_table-test.cc
+++ b/src/kudu/integration-tests/alter_table-test.cc
@@ -40,7 +40,7 @@
 #include "kudu/master/master-test-util.h"
 #include "kudu/master/mini_master.h"
 #include "kudu/server/hybrid_clock.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/tablet_server.h"
 #include "kudu/tserver/ts_tablet_manager.h"
@@ -82,7 +82,7 @@ using std::map;
 using std::pair;
 using std::unique_ptr;
 using std::vector;
-using tablet::TabletPeer;
+using tablet::TabletReplica;
 
 class AlterTableTest : public KuduTest {
  public:
@@ -125,37 +125,37 @@ class AlterTableTest : public KuduTest {
              .Create());
 
     if (num_replicas() == 1) {
-      tablet_peer_ = LookupTabletPeer();
-      ASSERT_OK(tablet_peer_->consensus()->WaitUntilLeaderForTests(MonoDelta::FromSeconds(10)));
+      tablet_replica_ = LookupTabletReplica();
+      ASSERT_OK(tablet_replica_->consensus()->WaitUntilLeaderForTests(MonoDelta::FromSeconds(10)));
     }
     LOG(INFO) << "Tablet successfully located";
   }
 
   void TearDown() override {
-    tablet_peer_.reset();
+    tablet_replica_.reset();
     cluster_->Shutdown();
   }
 
-  scoped_refptr<TabletPeer> LookupTabletPeer() {
-    vector<scoped_refptr<TabletPeer> > peers;
-    cluster_->mini_tablet_server(0)->server()->tablet_manager()->GetTabletPeers(&peers);
-    CHECK_EQ(1, peers.size());
-    return peers[0];
+  scoped_refptr<TabletReplica> LookupTabletReplica() {
+    vector<scoped_refptr<TabletReplica> > replicas;
+    cluster_->mini_tablet_server(0)->server()->tablet_manager()->GetTabletReplicas(&replicas);
+    CHECK_EQ(1, replicas.size());
+    return replicas[0];
   }
 
   void ShutdownTS() {
-    // Drop the tablet_peer_ reference since the tablet peer becomes invalid once
+    // Drop the tablet_replica_ reference since the tablet replica becomes invalid once
     // we shut down the server. Additionally, if we hold onto the reference,
     // we'll end up calling the destructor from the test code instead of the
     // normal location, which can cause crashes, etc.
-    tablet_peer_.reset();
+    tablet_replica_.reset();
     if (cluster_->mini_tablet_server(0)->server() != nullptr) {
       cluster_->mini_tablet_server(0)->Shutdown();
     }
   }
 
   void RestartTabletServer(int idx = 0) {
-    tablet_peer_.reset();
+    tablet_replica_.reset();
     if (cluster_->mini_tablet_server(idx)->server()) {
       cluster_->mini_tablet_server(idx)->Shutdown();
       ASSERT_OK(cluster_->mini_tablet_server(idx)->Restart());
@@ -165,7 +165,7 @@ class AlterTableTest : public KuduTest {
 
     ASSERT_OK(cluster_->mini_tablet_server(idx)->WaitStarted());
     if (idx == 0) {
-      tablet_peer_ = LookupTabletPeer();
+      tablet_replica_ = LookupTabletReplica();
     }
   }
 
@@ -255,7 +255,7 @@ class AlterTableTest : public KuduTest {
 
   KuduSchema schema_;
 
-  scoped_refptr<TabletPeer> tablet_peer_;
+  scoped_refptr<TabletReplica> tablet_replica_;
 
   atomic<bool> stop_threads_;
 
@@ -279,14 +279,14 @@ const char *AlterTableTest::kTableName = "fake-table";
 // on the TS handling the tablet of the altered table.
 // TODO: create and verify multiple tablets when the client will support that.
 TEST_F(AlterTableTest, TestTabletReports) {
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
   ASSERT_OK(AddNewI32Column(kTableName, "new-i32", 0));
-  ASSERT_EQ(1, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(1, tablet_replica_->tablet()->metadata()->schema_version());
 }
 
 // Verify that adding an existing column will return an "already present" error
 TEST_F(AlterTableTest, TestAddExistingColumn) {
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
 
   {
     Status s = AddNewI32Column(kTableName, "c1", 0);
@@ -294,7 +294,7 @@ TEST_F(AlterTableTest, TestAddExistingColumn) {
     ASSERT_STR_CONTAINS(s.ToString(), "The column already exists: c1");
   }
 
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
 }
 
 // Verify that adding a NOT NULL column without defaults will return an error.
@@ -303,7 +303,7 @@ TEST_F(AlterTableTest, TestAddExistingColumn) {
 // Our APIs for the client are designed such that it's impossible to send such
 // a request.
 TEST_F(AlterTableTest, TestAddNotNullableColumnWithoutDefaults) {
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
 
   {
     AlterTableRequestPB req;
@@ -324,14 +324,14 @@ TEST_F(AlterTableTest, TestAddNotNullableColumnWithoutDefaults) {
     ASSERT_STR_CONTAINS(s.ToString(), "column `c2`: NOT NULL columns must have a default");
   }
 
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
 }
 
 // Adding a nullable column with no default value should be equivalent
 // to a NULL default.
 TEST_F(AlterTableTest, TestAddNullableColumnWithoutDefault) {
   InsertRows(0, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   {
     gscoped_ptr<KuduTableAlterer> table_alterer(client_->NewTableAlterer(kTableName));
@@ -351,7 +351,7 @@ TEST_F(AlterTableTest, TestAddNullableColumnWithoutDefault) {
 // Rename a primary key column
 TEST_F(AlterTableTest, TestRenamePrimaryKeyColumn) {
   InsertRows(0, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   {
     gscoped_ptr<KuduTableAlterer> table_alterer(client_->NewTableAlterer(kTableName));
@@ -396,7 +396,7 @@ TEST_F(AlterTableTest, TestAddChangeRemoveColumnDefaultValue) {
   }
 
   InsertRows(0, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   {
     unique_ptr<KuduTableAlterer> table_alterer(client_->NewTableAlterer(kTableName));
@@ -406,7 +406,7 @@ TEST_F(AlterTableTest, TestAddChangeRemoveColumnDefaultValue) {
   }
 
   InsertRows(1, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   vector<string> rows;
   ScanToStrings(&rows);
@@ -423,7 +423,7 @@ TEST_F(AlterTableTest, TestAddChangeRemoveColumnDefaultValue) {
   }
 
   InsertRows(2, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   ScanToStrings(&rows);
   ASSERT_EQ(3, rows.size());
@@ -443,7 +443,7 @@ TEST_F(AlterTableTest, TestAddChangeRemoveColumnDefaultValue) {
   }
 
   InsertRows(3, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   ScanToStrings(&rows);
   ASSERT_EQ(4, rows.size());
@@ -498,7 +498,7 @@ TEST_F(AlterTableTest, TestAlterEmptyRLEBlock) {
 // Verify that, if a tablet server is down when an alter command is issued,
 // it will eventually receive the command when it restarts.
 TEST_F(AlterTableTest, TestAlterOnTSRestart) {
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
 
   ShutdownTS();
 
@@ -520,12 +520,12 @@ TEST_F(AlterTableTest, TestAlterOnTSRestart) {
   // Restart the TS and wait for the new schema
   RestartTabletServer();
   ASSERT_OK(WaitAlterTableCompletion(kTableName, 50));
-  ASSERT_EQ(1, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(1, tablet_replica_->tablet()->metadata()->schema_version());
 }
 
 // Verify that nothing is left behind on cluster shutdown with pending async tasks
 TEST_F(AlterTableTest, TestShutdownWithPendingTasks) {
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
 
   ShutdownTS();
 
@@ -548,7 +548,7 @@ TEST_F(AlterTableTest, TestRestartTSDuringAlter) {
     return;
   }
 
-  ASSERT_EQ(0, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(0, tablet_replica_->tablet()->metadata()->schema_version());
 
   Status s = AddNewI32Column(kTableName, "new-i32", 10,
                              MonoDelta::FromMilliseconds(1));
@@ -562,7 +562,7 @@ TEST_F(AlterTableTest, TestRestartTSDuringAlter) {
 
   // Wait for the new schema
   ASSERT_OK(WaitAlterTableCompletion(kTableName, 50));
-  ASSERT_EQ(1, tablet_peer_->tablet()->metadata()->schema_version());
+  ASSERT_EQ(1, tablet_replica_->tablet()->metadata()->schema_version());
 }
 
 TEST_F(AlterTableTest, TestGetSchemaAfterAlterTable) {
@@ -785,7 +785,7 @@ TEST_F(AlterTableTest, TestBootstrapAfterAlters) {
 
   ASSERT_OK(AddNewI32Column(kTableName, "c2", 12345));
   InsertRows(0, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
   InsertRows(1, 1);
 
   UpdateRow(0, { {"c1", 10001} });
@@ -837,9 +837,9 @@ TEST_F(AlterTableTest, TestCompactAfterUpdatingRemovedColumn) {
 
   ASSERT_OK(AddNewI32Column(kTableName, "c2", 12345));
   InsertRows(0, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
   InsertRows(1, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
 
   NO_FATALS(ScanToStrings(&rows));
@@ -860,7 +860,7 @@ TEST_F(AlterTableTest, TestCompactAfterUpdatingRemovedColumn) {
   ASSERT_EQ("(int32 c0=0, int32 c2=12345)", rows[0]);
 
   // Compact
-  ASSERT_OK(tablet_peer_->tablet()->Compact(tablet::Tablet::FORCE_COMPACT_ALL));
+  ASSERT_OK(tablet_replica_->tablet()->Compact(tablet::Tablet::FORCE_COMPACT_ALL));
 }
 
 // Test which major-compacts a column for which there are updates in
@@ -874,7 +874,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasAfterUpdatingRemovedColumn) {
 
   ASSERT_OK(AddNewI32Column(kTableName, "c2", 12345));
   InsertRows(0, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   NO_FATALS(ScanToStrings(&rows));
   ASSERT_EQ(1, rows.size());
@@ -884,7 +884,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasAfterUpdatingRemovedColumn) {
   UpdateRow(0, { {"c1", 54321} });
 
   // Make sure the delta is in a delta-file.
-  ASSERT_OK(tablet_peer_->tablet()->FlushBiggestDMS());
+  ASSERT_OK(tablet_replica_->tablet()->FlushBiggestDMS());
 
   // Drop c1.
   LOG(INFO) << "Dropping c1";
@@ -896,13 +896,13 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasAfterUpdatingRemovedColumn) {
   ASSERT_EQ("(int32 c0=0, int32 c2=12345)", rows[0]);
 
   // Major Compact Deltas
-  ASSERT_OK(tablet_peer_->tablet()->CompactWorstDeltas(
+  ASSERT_OK(tablet_replica_->tablet()->CompactWorstDeltas(
                 tablet::RowSet::MAJOR_DELTA_COMPACTION));
 
   // Check via debug dump that the data was properly compacted, including deltas.
   // We expect to see neither deltas nor base data for the deleted column.
   rows.clear();
-  tablet_peer_->tablet()->DebugDump(&rows);
+  tablet_replica_->tablet()->DebugDump(&rows);
   ASSERT_EQ("Dumping tablet:\n"
             "---------------------------\n"
             "MRS memrowset:\n"
@@ -925,7 +925,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasIntoMissingBaseData) {
   vector<string> rows;
 
   InsertRows(0, 2);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   // Add the new column after the Flush, so it has no base data.
   ASSERT_OK(AddNewI32Column(kTableName, "c2", 12345));
@@ -934,7 +934,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasIntoMissingBaseData) {
   UpdateRow(0, { {"c2", 54321} });
 
   // Make sure the delta is in a delta-file.
-  ASSERT_OK(tablet_peer_->tablet()->FlushBiggestDMS());
+  ASSERT_OK(tablet_replica_->tablet()->FlushBiggestDMS());
 
   NO_FATALS(ScanToStrings(&rows));
   ASSERT_EQ(2, rows.size());
@@ -942,7 +942,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasIntoMissingBaseData) {
   ASSERT_EQ("(int32 c0=16777216, int32 c1=1, int32 c2=12345)", rows[1]);
 
   // Major Compact Deltas
-  ASSERT_OK(tablet_peer_->tablet()->CompactWorstDeltas(
+  ASSERT_OK(tablet_replica_->tablet()->CompactWorstDeltas(
                 tablet::RowSet::MAJOR_DELTA_COMPACTION));
 
   // Check via debug dump that the data was properly compacted, including deltas.
@@ -950,7 +950,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasIntoMissingBaseData) {
   // row, the default value materialized for the second, and a proper UNDO to undo
   // the update on the first row.
   rows.clear();
-  tablet_peer_->tablet()->DebugDump(&rows);
+  tablet_replica_->tablet()->DebugDump(&rows);
   ASSERT_EQ("Dumping tablet:\n"
             "---------------------------\n"
             "MRS memrowset:\n"
@@ -974,7 +974,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasAfterAddUpdateRemoveColumn) {
   vector<string> rows;
 
   InsertRows(0, 1);
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
 
   // Add the new column after the Flush(), so that no CFile for this
   // column is present in the base data.
@@ -984,7 +984,7 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasAfterAddUpdateRemoveColumn) {
   UpdateRow(0, { {"c2", 54321} });
 
   // Make sure the delta is in a delta-file.
-  ASSERT_OK(tablet_peer_->tablet()->FlushBiggestDMS());
+  ASSERT_OK(tablet_replica_->tablet()->FlushBiggestDMS());
 
   NO_FATALS(ScanToStrings(&rows));
   ASSERT_EQ(1, rows.size());
@@ -1000,13 +1000,13 @@ TEST_F(AlterTableTest, TestMajorCompactDeltasAfterAddUpdateRemoveColumn) {
   ASSERT_EQ("(int32 c0=0, int32 c1=0)", rows[0]);
 
   // Major Compact Deltas
-  ASSERT_OK(tablet_peer_->tablet()->CompactWorstDeltas(
+  ASSERT_OK(tablet_replica_->tablet()->CompactWorstDeltas(
                 tablet::RowSet::MAJOR_DELTA_COMPACTION));
 
   // Check via debug dump that the data was properly compacted, including deltas.
   // We expect to see neither deltas nor base data for the deleted column.
   rows.clear();
-  tablet_peer_->tablet()->DebugDump(&rows);
+  tablet_replica_->tablet()->DebugDump(&rows);
   ASSERT_EQ("Dumping tablet:\n"
             "---------------------------\n"
             "MRS memrowset:\n"
@@ -1029,7 +1029,7 @@ TEST_F(AlterTableTest, TestReadHistoryAfterAlter) {
   DeleteRow(0);
   InsertRows(0, 1);
   uint64_t ts1 = client_->GetLatestObservedTimestamp();
-  ASSERT_OK(tablet_peer_->tablet()->Flush());
+  ASSERT_OK(tablet_replica_->tablet()->Flush());
   ASSERT_OK(AddNewI32Column(kTableName, "c2", 12345));
 
   shared_ptr<KuduTable> table;

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/integration-tests/consistency-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/consistency-itest.cc b/src/kudu/integration-tests/consistency-itest.cc
index 23a1f58..901b0d5 100644
--- a/src/kudu/integration-tests/consistency-itest.cc
+++ b/src/kudu/integration-tests/consistency-itest.cc
@@ -40,7 +40,7 @@
 #include "kudu/integration-tests/mini_cluster.h"
 #include "kudu/server/hybrid_clock.h"
 #include "kudu/tablet/tablet.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/tablet_server.h"
 #include "kudu/tserver/ts_tablet_manager.h"
@@ -59,7 +59,7 @@ using kudu::master::CatalogManager;
 using kudu::master::GetTableLocationsRequestPB;
 using kudu::master::GetTableLocationsResponsePB;
 using kudu::server::HybridClock;
-using kudu::tablet::TabletPeer;
+using kudu::tablet::TabletReplica;
 using kudu::tserver::MiniTabletServer;
 using kudu::tserver::TabletServer;
 using std::string;
@@ -198,24 +198,24 @@ class ConsistencyITest : public MiniClusterITestBase {
   }
 
   Status FindPeerForTablet(const string& tablet_id,
-                           scoped_refptr<TabletPeer>* peer) {
+                           scoped_refptr<TabletReplica>* replica) {
     bool found = false;
     for (size_t i = 0; i < num_tablet_servers_; ++i) {
       MiniTabletServer* mts = cluster_->mini_tablet_server(i);
       TabletServer* ts = mts->server();
 
-      scoped_refptr<TabletPeer> p;
-      if (!ts->tablet_manager()->LookupTablet(tablet_id, &p)) {
+      scoped_refptr<TabletReplica> r;
+      if (!ts->tablet_manager()->LookupTablet(tablet_id, &r)) {
         // Not this one, continue.
         continue;
       }
-      peer->swap(p);
+      replica->swap(r);
       found = true;
       break;
     }
     if (!found) {
       return Status::NotFound(
-          Substitute("$0: cannot find peer for tablet"), tablet_id);
+          Substitute("$0: cannot find replica for tablet"), tablet_id);
     }
     return Status::OK();
   }
@@ -223,10 +223,10 @@ class ConsistencyITest : public MiniClusterITestBase {
   Status UpdateClockForTabletHostingKey(int32_t key, const MonoDelta& offset) {
     string tablet_id;
     RETURN_NOT_OK(GetTabletIdForKey(key, &tablet_id));
-    scoped_refptr<TabletPeer> p;
-    RETURN_NOT_OK(FindPeerForTablet(tablet_id, &p));
+    scoped_refptr<TabletReplica> r;
+    RETURN_NOT_OK(FindPeerForTablet(tablet_id, &r));
 
-    HybridClock* clock = CHECK_NOTNULL(dynamic_cast<HybridClock*>(p->clock()));
+    HybridClock* clock = CHECK_NOTNULL(dynamic_cast<HybridClock*>(r->clock()));
     UpdateClock(clock, offset);
     return Status::OK();
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/integration-tests/delete_tablet-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/delete_tablet-itest.cc b/src/kudu/integration-tests/delete_tablet-itest.cc
index af95003..0305991 100644
--- a/src/kudu/integration-tests/delete_tablet-itest.cc
+++ b/src/kudu/integration-tests/delete_tablet-itest.cc
@@ -23,14 +23,14 @@
 #include "kudu/integration-tests/mini_cluster-itest-base.h"
 #include "kudu/integration-tests/test_workload.h"
 #include "kudu/master/mini_master.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/tablet_server.h"
 #include "kudu/tserver/ts_tablet_manager.h"
 
 DECLARE_int64(fs_wal_dir_reserved_bytes);
 
-using kudu::tablet::TabletPeer;
+using kudu::tablet::TabletReplica;
 using std::vector;
 
 namespace kudu {
@@ -53,12 +53,12 @@ TEST_F(DeleteTabletITest, TestDeleteFailedReplica) {
   auto* mts = cluster_->mini_tablet_server(0);
   auto* ts = ts_map[mts->uuid()];
 
-  scoped_refptr<TabletPeer> tablet_peer;
+  scoped_refptr<TabletReplica> tablet_replica;
   ASSERT_EVENTUALLY([&] {
-    vector<scoped_refptr<TabletPeer>> tablet_peers;
-    mts->server()->tablet_manager()->GetTabletPeers(&tablet_peers);
-    ASSERT_EQ(1, tablet_peers.size());
-    tablet_peer = tablet_peers[0];
+    vector<scoped_refptr<TabletReplica>> tablet_replicas;
+    mts->server()->tablet_manager()->GetTabletReplicas(&tablet_replicas);
+    ASSERT_EQ(1, tablet_replicas.size());
+    tablet_replica = tablet_replicas[0];
   });
 
   workload.Start();
@@ -68,7 +68,7 @@ TEST_F(DeleteTabletITest, TestDeleteFailedReplica) {
   workload.StopAndJoin();
 
   // We need blocks on-disk for this regression test, so force an MRS flush.
-  ASSERT_OK(tablet_peer->tablet()->Flush());
+  ASSERT_OK(tablet_replica->tablet()->Flush());
 
   // Shut down the master so it doesn't crash the test process when we make the
   // disk appear to be full.
@@ -85,20 +85,20 @@ TEST_F(DeleteTabletITest, TestDeleteFailedReplica) {
 
   // Tablet bootstrap failure should result in tablet status == FAILED.
   {
-    vector<scoped_refptr<TabletPeer>> tablet_peers;
-    mts->server()->tablet_manager()->GetTabletPeers(&tablet_peers);
-    ASSERT_EQ(1, tablet_peers.size());
-    tablet_peer = tablet_peers[0];
-    ASSERT_EQ(tablet::FAILED, tablet_peer->state());
+    vector<scoped_refptr<TabletReplica>> tablet_replicas;
+    mts->server()->tablet_manager()->GetTabletReplicas(&tablet_replicas);
+    ASSERT_EQ(1, tablet_replicas.size());
+    tablet_replica = tablet_replicas[0];
+    ASSERT_EQ(tablet::FAILED, tablet_replica->state());
   }
 
   // We should still be able to delete the failed tablet.
-  ASSERT_OK(itest::DeleteTablet(ts, tablet_peer->tablet_id(), tablet::TABLET_DATA_DELETED,
+  ASSERT_OK(itest::DeleteTablet(ts, tablet_replica->tablet_id(), tablet::TABLET_DATA_DELETED,
                                 boost::none, MonoDelta::FromSeconds(30)));
   ASSERT_EVENTUALLY([&] {
-    vector<scoped_refptr<TabletPeer>> tablet_peers;
-    mts->server()->tablet_manager()->GetTabletPeers(&tablet_peers);
-    ASSERT_EQ(0, tablet_peers.size());
+    vector<scoped_refptr<TabletReplica>> tablet_replicas;
+    mts->server()->tablet_manager()->GetTabletReplicas(&tablet_replicas);
+    ASSERT_EQ(0, tablet_replicas.size());
   });
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/integration-tests/full_stack-insert-scan-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/full_stack-insert-scan-test.cc b/src/kudu/integration-tests/full_stack-insert-scan-test.cc
index eab7aff..c2160af 100644
--- a/src/kudu/integration-tests/full_stack-insert-scan-test.cc
+++ b/src/kudu/integration-tests/full_stack-insert-scan-test.cc
@@ -41,7 +41,7 @@
 #include "kudu/master/mini_master.h"
 #include "kudu/tablet/tablet.h"
 #include "kudu/tablet/tablet_metrics.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/tablet_server.h"
 #include "kudu/tserver/ts_tablet_manager.h"
@@ -325,10 +325,10 @@ void FullStackInsertScanTest::FlushToDisk() {
     tserver::TabletServer* ts = cluster_->mini_tablet_server(i)->server();
     ts->maintenance_manager()->Shutdown();
     tserver::TSTabletManager* tm = ts->tablet_manager();
-    vector<scoped_refptr<TabletPeer> > peers;
-    tm->GetTabletPeers(&peers);
-    for (const scoped_refptr<TabletPeer>& peer : peers) {
-      Tablet* tablet = peer->tablet();
+    vector<scoped_refptr<TabletReplica> > replicas;
+    tm->GetTabletReplicas(&replicas);
+    for (const scoped_refptr<TabletReplica>& replica : replicas) {
+      Tablet* tablet = replica->tablet();
       if (!tablet->MemRowSetEmpty()) {
         ASSERT_OK(tablet->Flush());
       }

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/integration-tests/fuzz-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/fuzz-itest.cc b/src/kudu/integration-tests/fuzz-itest.cc
index 47b4095..f68784a 100644
--- a/src/kudu/integration-tests/fuzz-itest.cc
+++ b/src/kudu/integration-tests/fuzz-itest.cc
@@ -37,7 +37,7 @@
 #include "kudu/server/logical_clock.h"
 #include "kudu/tablet/key_value_test_schema.h"
 #include "kudu/tablet/tablet.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/tablet_server.h"
 #include "kudu/tserver/ts_tablet_manager.h"
@@ -192,8 +192,8 @@ class FuzzTest : public KuduTest {
              .num_replicas(1)
              .Create());
 
-    // Find the peer.
-    tablet_peer_ = LookupTabletPeer();
+    // Find the replica.
+    tablet_replica_ = LookupTabletReplica();
 
     // Setup session and table.
     session_ = client_->NewSession();
@@ -203,19 +203,19 @@ class FuzzTest : public KuduTest {
   }
 
   void TearDown() override {
-    if (tablet_peer_) tablet_peer_.reset();
+    if (tablet_replica_) tablet_replica_.reset();
     if (cluster_) cluster_->Shutdown();
   }
 
-  scoped_refptr<TabletPeer> LookupTabletPeer() {
-    vector<scoped_refptr<TabletPeer> > peers;
-    cluster_->mini_tablet_server(0)->server()->tablet_manager()->GetTabletPeers(&peers);
-    CHECK_EQ(1, peers.size());
-    return peers[0];
+  scoped_refptr<TabletReplica> LookupTabletReplica() {
+    vector<scoped_refptr<TabletReplica> > replicas;
+    cluster_->mini_tablet_server(0)->server()->tablet_manager()->GetTabletReplicas(&replicas);
+    CHECK_EQ(1, replicas.size());
+    return replicas[0];
   }
 
   void RestartTabletServer() {
-    tablet_peer_.reset();
+    tablet_replica_.reset();
     auto ts = cluster_->mini_tablet_server(0);
     if (ts->server()) {
       ts->Shutdown();
@@ -225,11 +225,11 @@ class FuzzTest : public KuduTest {
     }
     ASSERT_OK(ts->server()->WaitInited());
 
-    tablet_peer_ = LookupTabletPeer();
+    tablet_replica_ = LookupTabletReplica();
   }
 
   Tablet* tablet() const {
-    return tablet_peer_->tablet();
+    return tablet_replica_->tablet();
   }
 
   // Adds an insert for the given key/value pair to 'ops', returning the new contents
@@ -434,7 +434,7 @@ class FuzzTest : public KuduTest {
       vector<optional<ExpectedKeyValueRow>>,
       std::greater<int>> saved_values_;
 
-  scoped_refptr<TabletPeer> tablet_peer_;
+  scoped_refptr<TabletReplica> tablet_replica_;
 };
 
 // The set of ops to draw from.

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/integration-tests/tablet_history_gc-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/tablet_history_gc-itest.cc b/src/kudu/integration-tests/tablet_history_gc-itest.cc
index 4a40a6c..e307cd4 100644
--- a/src/kudu/integration-tests/tablet_history_gc-itest.cc
+++ b/src/kudu/integration-tests/tablet_history_gc-itest.cc
@@ -31,7 +31,7 @@
 #include "kudu/tablet/local_tablet_writer.h"
 #include "kudu/tablet/tablet.h"
 #include "kudu/tablet/tablet_metrics.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/tablet_server.h"
 #include "kudu/tserver/ts_tablet_manager.h"
@@ -42,7 +42,7 @@ using kudu::client::KuduTable;
 using kudu::client::sp::shared_ptr;
 using kudu::server::HybridClock;
 using kudu::tablet::Tablet;
-using kudu::tablet::TabletPeer;
+using kudu::tablet::TabletReplica;
 using kudu::tserver::MiniTabletServer;
 using kudu::tserver::TabletServer;
 using kudu::tserver::TSTabletManager;
@@ -121,10 +121,10 @@ TEST_F(TabletHistoryGcITest, TestUndoDeltaBlockGc) {
 
   // Find the tablet.
   tserver::MiniTabletServer* mts = cluster_->mini_tablet_server(0);
-  vector<scoped_refptr<TabletPeer>> tablet_peers;
-  mts->server()->tablet_manager()->GetTabletPeers(&tablet_peers);
-  ASSERT_EQ(1, tablet_peers.size());
-  std::shared_ptr<Tablet> tablet = tablet_peers[0]->shared_tablet();
+  vector<scoped_refptr<TabletReplica>> tablet_replicas;
+  mts->server()->tablet_manager()->GetTabletReplicas(&tablet_replicas);
+  ASSERT_EQ(1, tablet_replicas.size());
+  std::shared_ptr<Tablet> tablet = tablet_replicas[0]->shared_tablet();
 
   const int32_t kNumRows = AllowSlowTests() ? 100 : 10;
 
@@ -500,10 +500,10 @@ TEST_F(RandomizedTabletHistoryGcITest, TestRandomHistoryGCWorkload) {
   MiniTabletServer* mts = cluster_->mini_tablet_server(0);
   TabletServer* ts = mts->server();
   clock_ = down_cast<HybridClock*>(ts->clock());
-  std::vector<scoped_refptr<TabletPeer>> peers;
-  ts->tablet_manager()->GetTabletPeers(&peers);
-  ASSERT_EQ(1, peers.size());
-  Tablet* tablet = peers[0]->tablet();
+  std::vector<scoped_refptr<TabletReplica>> replicas;
+  ts->tablet_manager()->GetTabletReplicas(&replicas);
+  ASSERT_EQ(1, replicas.size());
+  Tablet* tablet = replicas[0]->tablet();
 
   // Set initial clock time to 1000 seconds past 0, which is enough so that the
   // AHM will not be negative.

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/integration-tests/ts_tablet_manager-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/ts_tablet_manager-itest.cc b/src/kudu/integration-tests/ts_tablet_manager-itest.cc
index f841313..b632050 100644
--- a/src/kudu/integration-tests/ts_tablet_manager-itest.cc
+++ b/src/kudu/integration-tests/ts_tablet_manager-itest.cc
@@ -33,7 +33,7 @@
 #include "kudu/master/mini_master.h"
 #include "kudu/rpc/messenger.h"
 #include "kudu/server/server_base.proxy.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tserver/heartbeater.h"
 #include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/tserver/tablet_server.h"
@@ -67,7 +67,7 @@ using rpc::Messenger;
 using rpc::MessengerBuilder;
 using std::shared_ptr;
 using strings::Substitute;
-using tablet::TabletPeer;
+using tablet::TabletReplica;
 using tserver::MiniTabletServer;
 using tserver::TSTabletManager;
 
@@ -134,21 +134,21 @@ TEST_F(TsTabletManagerITest, TestReportNewLeaderOnLeaderChange) {
   ASSERT_OK(CreateTabletServerMap(master_proxy, client_messenger_, &ts_map));
   ValueDeleter deleter(&ts_map);
 
-  // Collect the tablet peers so we get direct access to consensus.
-  vector<scoped_refptr<TabletPeer> > tablet_peers;
+  // Collect the TabletReplicas so we get direct access to Consensus.
+  vector<scoped_refptr<TabletReplica> > tablet_replicas;
   for (int replica = 0; replica < kNumReplicas; replica++) {
     MiniTabletServer* ts = cluster_->mini_tablet_server(replica);
     ts->FailHeartbeats(); // Stop heartbeating we don't race against the Master.
-    vector<scoped_refptr<TabletPeer> > cur_ts_tablet_peers;
+    vector<scoped_refptr<TabletReplica> > cur_ts_tablet_replicas;
     // The replicas may not have been created yet, so loop until we see them.
     while (true) {
-      ts->server()->tablet_manager()->GetTabletPeers(&cur_ts_tablet_peers);
-      if (!cur_ts_tablet_peers.empty()) break;
+      ts->server()->tablet_manager()->GetTabletReplicas(&cur_ts_tablet_replicas);
+      if (!cur_ts_tablet_replicas.empty()) break;
       SleepFor(MonoDelta::FromMilliseconds(10));
     }
-    ASSERT_EQ(1, cur_ts_tablet_peers.size()); // Each TS should only have 1 tablet.
-    ASSERT_OK(cur_ts_tablet_peers[0]->WaitUntilConsensusRunning(MonoDelta::FromSeconds(10)));
-    tablet_peers.push_back(cur_ts_tablet_peers[0]);
+    ASSERT_EQ(1, cur_ts_tablet_replicas.size()); // Each TS should only have 1 tablet.
+    ASSERT_OK(cur_ts_tablet_replicas[0]->WaitUntilConsensusRunning(MonoDelta::FromSeconds(10)));
+    tablet_replicas.push_back(cur_ts_tablet_replicas[0]);
   }
 
   // Loop and cause elections and term changes from different servers.
@@ -157,11 +157,11 @@ TEST_F(TsTabletManagerITest, TestReportNewLeaderOnLeaderChange) {
     SCOPED_TRACE(Substitute("Iter: $0", i));
     int new_leader_idx = rand() % 2;
     LOG(INFO) << "Electing peer " << new_leader_idx << "...";
-    consensus::Consensus* con = CHECK_NOTNULL(tablet_peers[new_leader_idx]->consensus());
+    consensus::Consensus* con = CHECK_NOTNULL(tablet_replicas[new_leader_idx]->consensus());
     ASSERT_OK(con->EmulateElection());
     LOG(INFO) << "Waiting for servers to agree...";
     ASSERT_OK(WaitForServersToAgree(MonoDelta::FromSeconds(5),
-                                    ts_map, tablet_peers[0]->tablet_id(), i + 1));
+                                    ts_map, tablet_replicas[0]->tablet_id(), i + 1));
 
     // Now check that the tablet report reports the correct role for both servers.
     for (int replica = 0; replica < kNumReplicas; replica++) {
@@ -184,7 +184,7 @@ TEST_F(TsTabletManagerITest, TestReportNewLeaderOnLeaderChange) {
       ReportedTabletPB reported_tablet = report.updated_tablets(0);
       ASSERT_TRUE(reported_tablet.has_committed_consensus_state());
 
-      string uuid = tablet_peers[replica]->permanent_uuid();
+      string uuid = tablet_replicas[replica]->permanent_uuid();
       RaftPeerPB::Role role = GetConsensusRole(uuid, reported_tablet.committed_consensus_state());
       if (replica == new_leader_idx) {
         ASSERT_EQ(RaftPeerPB::LEADER, role)

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index a19273c..3c61f84 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -232,7 +232,7 @@ using strings::Substitute;
 using tablet::TABLET_DATA_DELETED;
 using tablet::TABLET_DATA_TOMBSTONED;
 using tablet::TabletDataState;
-using tablet::TabletPeer;
+using tablet::TabletReplica;
 using tablet::TabletStatePB;
 using tserver::TabletServerErrorPB;
 
@@ -719,7 +719,7 @@ Status CatalogManager::ElectedAsLeaderCb() {
 }
 
 Status CatalogManager::WaitUntilCaughtUpAsLeader(const MonoDelta& timeout) {
-  ConsensusStatePB cstate = sys_catalog_->tablet_peer()->consensus()->
+  ConsensusStatePB cstate = sys_catalog_->tablet_replica()->consensus()->
       ConsensusState(CONSENSUS_CONFIG_COMMITTED);
   const string& uuid = master_->fs_manager()->uuid();
   if (!cstate.has_leader_uuid() || cstate.leader_uuid() != uuid) {
@@ -729,7 +729,7 @@ Status CatalogManager::WaitUntilCaughtUpAsLeader(const MonoDelta& timeout) {
   }
 
   // Wait for all transactions to be committed.
-  RETURN_NOT_OK(sys_catalog_->tablet_peer()->transaction_tracker()->WaitForAllToFinish(timeout));
+  RETURN_NOT_OK(sys_catalog_->tablet_replica()->transaction_tracker()->WaitForAllToFinish(timeout));
   return Status::OK();
 }
 
@@ -800,7 +800,7 @@ void CatalogManager::VisitTablesAndTabletsTask() {
     // Hack to block this function until InitSysCatalogAsync() is finished.
     shared_lock<LockType> l(lock_);
   }
-  const Consensus* consensus = sys_catalog_->tablet_peer()->consensus();
+  const Consensus* consensus = sys_catalog_->tablet_replica()->consensus();
   int64_t term = consensus->ConsensusState(CONSENSUS_CONFIG_COMMITTED).current_term();
   {
     std::lock_guard<simple_spinlock> l(state_lock_);
@@ -977,7 +977,7 @@ RaftPeerPB::Role CatalogManager::Role() const {
   {
     std::lock_guard<simple_spinlock> l(state_lock_);
     if (state_ == kRunning) {
-      consensus = sys_catalog_->tablet_peer()->shared_consensus();
+      consensus = sys_catalog_->tablet_replica()->shared_consensus();
     }
   }
   return consensus ? consensus->role() : RaftPeerPB::UNKNOWN_ROLE;
@@ -1026,12 +1026,12 @@ void CatalogManager::Shutdown() {
   //     call does not return because the underlying Raft indefinitely
   //     retries to get the response for the submitted operations.
   if (sys_catalog_) {
-    sys_catalog_->tablet_peer()->consensus()->Shutdown();
+    sys_catalog_->tablet_replica()->consensus()->Shutdown();
   }
 
   // Wait for any outstanding ElectedAsLeaderCb tasks to finish.
   //
-  // Must be done before shutting down the catalog, otherwise its tablet peer
+  // Must be done before shutting down the catalog, otherwise its TabletReplica
   // may be destroyed while still in use by the ElectedAsLeaderCb task.
   leader_election_pool_->Shutdown();
 
@@ -2502,8 +2502,8 @@ Status CatalogManager::HandleRaftConfigChanged(
   return Status::OK();
 }
 
-Status CatalogManager::GetTabletPeer(const string& tablet_id,
-                                     scoped_refptr<TabletPeer>* tablet_peer) const {
+Status CatalogManager::GetTabletReplica(const string& tablet_id,
+                                        scoped_refptr<TabletReplica>* replica) const {
   // Note: CatalogManager has only one table, 'sys_catalog', with only
   // one tablet.
   shared_lock<LockType> l(lock_);
@@ -2511,7 +2511,7 @@ Status CatalogManager::GetTabletPeer(const string& tablet_id,
     return Status::ServiceUnavailable("Systable not yet initialized");
   }
   if (sys_catalog_->tablet_id() == tablet_id) {
-    *tablet_peer = sys_catalog_->tablet_peer();
+    *replica = sys_catalog_->tablet_replica();
   } else {
     return Status::NotFound(Substitute("no SysTable exists with tablet_id $0 in CatalogManager",
                                        tablet_id));
@@ -3951,8 +3951,8 @@ void CatalogManager::DumpState(std::ostream* out) const {
 
 std::string CatalogManager::LogPrefix() const {
   return Substitute("T $0 P $1: ",
-                    sys_catalog_->tablet_peer()->tablet_id(),
-                    sys_catalog_->tablet_peer()->permanent_uuid());
+                    sys_catalog_->tablet_replica()->tablet_id(),
+                    sys_catalog_->tablet_replica()->permanent_uuid());
 }
 
 void CatalogManager::AbortAndWaitForAllTasks(
@@ -3984,7 +3984,7 @@ CatalogManager::ScopedLeaderSharedLock::ScopedLeaderSharedLock(
   }
 
   // Check if the catalog manager is the leader.
-  ConsensusStatePB cstate = catalog_->sys_catalog_->tablet_peer()->consensus()->
+  ConsensusStatePB cstate = catalog_->sys_catalog_->tablet_replica()->consensus()->
       ConsensusState(CONSENSUS_CONFIG_COMMITTED);
   string uuid = catalog_->master_->fs_manager()->uuid();
   if (PREDICT_FALSE(!cstate.has_leader_uuid() || cstate.leader_uuid() != uuid)) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/master/catalog_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.h b/src/kudu/master/catalog_manager.h
index fe8c4aa..59ffe16 100644
--- a/src/kudu/master/catalog_manager.h
+++ b/src/kudu/master/catalog_manager.h
@@ -33,7 +33,7 @@
 #include "kudu/master/master.pb.h"
 #include "kudu/master/ts_manager.h"
 #include "kudu/server/monitored_task.h"
-#include "kudu/tserver/tablet_peer_lookup.h"
+#include "kudu/tserver/tablet_replica_lookup.h"
 #include "kudu/util/cow_object.h"
 #include "kudu/util/locks.h"
 #include "kudu/util/monotime.h"
@@ -300,7 +300,7 @@ typedef MetadataLock<TableInfo> TableMetadataLock;
 // the state of each tablet on a given tablet-server.
 //
 // Thread-safe.
-class CatalogManager : public tserver::TabletPeerLookupIf {
+class CatalogManager : public tserver::TabletReplicaLookupIf {
  public:
 
   // Scoped "shared lock" to serialize master leader elections.
@@ -504,12 +504,12 @@ class CatalogManager : public tserver::TabletPeerLookupIf {
   // deleted the specified tablet.
   void NotifyTabletDeleteSuccess(const std::string& permanent_uuid, const std::string& tablet_id);
 
-  // Used by ConsensusService to retrieve the TabletPeer for a system
+  // Used by ConsensusService to retrieve the TabletReplica for a system
   // table specified by 'tablet_id'.
   //
-  // See also: TabletPeerLookupIf, ConsensusServiceImpl.
-  virtual Status GetTabletPeer(const std::string& tablet_id,
-                               scoped_refptr<tablet::TabletPeer>* tablet_peer) const override;
+  // See also: TabletReplicaLookupIf, ConsensusServiceImpl.
+  virtual Status GetTabletReplica(const std::string& tablet_id,
+                                  scoped_refptr<tablet::TabletReplica>* replica) const override;
 
   virtual const NodeInstancePB& NodeInstance() const override;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/master/sys_catalog.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/sys_catalog.cc b/src/kudu/master/sys_catalog.cc
index 2d54fcc..8820580 100644
--- a/src/kudu/master/sys_catalog.cc
+++ b/src/kudu/master/sys_catalog.cc
@@ -71,7 +71,7 @@ using kudu::consensus::RaftPeerPB;
 using kudu::log::Log;
 using kudu::tablet::LatchTransactionCompletionCallback;
 using kudu::tablet::Tablet;
-using kudu::tablet::TabletPeer;
+using kudu::tablet::TabletReplica;
 using kudu::tablet::TabletStatusListener;
 using kudu::tserver::WriteRequestPB;
 using kudu::tserver::WriteResponsePB;
@@ -107,8 +107,8 @@ SysCatalogTable::~SysCatalogTable() {
 }
 
 void SysCatalogTable::Shutdown() {
-  if (tablet_peer_) {
-    tablet_peer_->Shutdown();
+  if (tablet_replica_) {
+    tablet_replica_->Shutdown();
   }
   apply_pool_->Shutdown();
 }
@@ -254,8 +254,8 @@ Status SysCatalogTable::CreateDistributedConfig(const MasterOptions& options,
 }
 
 void SysCatalogTable::SysCatalogStateChanged(const string& tablet_id, const string& reason) {
-  CHECK_EQ(tablet_id, tablet_peer_->tablet_id());
-  scoped_refptr<consensus::Consensus> consensus  = tablet_peer_->shared_consensus();
+  CHECK_EQ(tablet_id, tablet_replica_->tablet_id());
+  scoped_refptr<consensus::Consensus> consensus  = tablet_replica_->shared_consensus();
   if (!consensus) {
     LOG_WITH_PREFIX(WARNING) << "Received notification of tablet state change "
                              << "but tablet no longer running. Tablet ID: "
@@ -265,7 +265,7 @@ void SysCatalogTable::SysCatalogStateChanged(const string& tablet_id, const stri
   consensus::ConsensusStatePB cstate = consensus->ConsensusState(CONSENSUS_CONFIG_COMMITTED);
   LOG_WITH_PREFIX(INFO) << "SysCatalogTable state changed. Reason: " << reason << ". "
                         << "Latest consensus state: " << SecureShortDebugString(cstate);
-  RaftPeerPB::Role new_role = GetConsensusRole(tablet_peer_->permanent_uuid(), cstate);
+  RaftPeerPB::Role new_role = GetConsensusRole(tablet_replica_->permanent_uuid(), cstate);
   LOG_WITH_PREFIX(INFO) << "This master's current role is: "
                         << RaftPeerPB::Role_Name(new_role);
   if (new_role == RaftPeerPB::LEADER) {
@@ -286,40 +286,40 @@ Status SysCatalogTable::SetupTablet(const scoped_refptr<tablet::TabletMetadata>&
 
   // TODO: handle crash mid-creation of tablet? do we ever end up with a
   // partially created tablet here?
-  tablet_peer_.reset(new TabletPeer(
+  tablet_replica_.reset(new TabletReplica(
       metadata,
       local_peer_pb_,
       apply_pool_.get(),
       Bind(&SysCatalogTable::SysCatalogStateChanged, Unretained(this), metadata->tablet_id())));
 
   consensus::ConsensusBootstrapInfo consensus_info;
-  tablet_peer_->SetBootstrapping();
+  tablet_replica_->SetBootstrapping();
   RETURN_NOT_OK(BootstrapTablet(metadata,
                                 scoped_refptr<server::Clock>(master_->clock()),
                                 master_->mem_tracker(),
                                 scoped_refptr<rpc::ResultTracker>(),
                                 metric_registry_,
-                                implicit_cast<TabletStatusListener*>(tablet_peer_.get()),
+                                implicit_cast<TabletStatusListener*>(tablet_replica_.get()),
                                 &tablet,
                                 &log,
-                                tablet_peer_->log_anchor_registry(),
+                                tablet_replica_->log_anchor_registry(),
                                 &consensus_info));
 
   // TODO: Do we have a setSplittable(false) or something from the outside is
   // handling split in the TS?
 
-  RETURN_NOT_OK_PREPEND(tablet_peer_->Init(tablet,
+  RETURN_NOT_OK_PREPEND(tablet_replica_->Init(tablet,
                                            scoped_refptr<server::Clock>(master_->clock()),
                                            master_->messenger(),
                                            scoped_refptr<rpc::ResultTracker>(),
                                            log,
                                            tablet->GetMetricEntity()),
-                        "Failed to Init() TabletPeer");
+                        "Failed to Init() TabletReplica");
 
-  RETURN_NOT_OK_PREPEND(tablet_peer_->Start(consensus_info),
-                        "Failed to Start() TabletPeer");
+  RETURN_NOT_OK_PREPEND(tablet_replica_->Start(consensus_info),
+                        "Failed to Start() TabletReplica");
 
-  tablet_peer_->RegisterMaintenanceOps(master_->maintenance_manager());
+  tablet_replica_->RegisterMaintenanceOps(master_->maintenance_manager());
 
   const Schema* schema = tablet->schema();
   schema_ = SchemaBuilder(*schema).BuildWithoutIds();
@@ -329,8 +329,8 @@ Status SysCatalogTable::SetupTablet(const scoped_refptr<tablet::TabletMetadata>&
 
 std::string SysCatalogTable::LogPrefix() const {
   return Substitute("T $0 P $1 [$2]: ",
-                    tablet_peer_->tablet_id(),
-                    tablet_peer_->permanent_uuid(),
+                    tablet_replica_->tablet_id(),
+                    tablet_replica_->permanent_uuid(),
                     table_name());
 }
 
@@ -338,7 +338,7 @@ Status SysCatalogTable::WaitUntilRunning() {
   TRACE_EVENT0("master", "SysCatalogTable::WaitUntilRunning");
   int seconds_waited = 0;
   while (true) {
-    Status status = tablet_peer_->WaitUntilConsensusRunning(MonoDelta::FromSeconds(1));
+    Status status = tablet_replica_->WaitUntilConsensusRunning(MonoDelta::FromSeconds(1));
     seconds_waited++;
     if (status.ok()) {
       LOG_WITH_PREFIX(INFO) << "configured and running, proceeding with master startup.";
@@ -363,13 +363,13 @@ Status SysCatalogTable::SyncWrite(const WriteRequestPB *req, WriteResponsePB *re
   gscoped_ptr<tablet::TransactionCompletionCallback> txn_callback(
       new LatchTransactionCompletionCallback<WriteResponsePB>(&latch, resp));
   unique_ptr<tablet::WriteTransactionState> tx_state(
-      new tablet::WriteTransactionState(tablet_peer_.get(),
+      new tablet::WriteTransactionState(tablet_replica_.get(),
                                         req,
                                         nullptr, // No RequestIdPB
                                         resp));
   tx_state->set_completion_callback(std::move(txn_callback));
 
-  RETURN_NOT_OK(tablet_peer_->SubmitWrite(std::move(tx_state)));
+  RETURN_NOT_OK(tablet_replica_->SubmitWrite(std::move(tx_state)));
   latch.Wait();
 
   if (resp->has_error()) {
@@ -525,7 +525,7 @@ Status SysCatalogTable::ProcessRows(
   spec.AddPredicate(pred);
 
   gscoped_ptr<RowwiseIterator> iter;
-  RETURN_NOT_OK(tablet_peer_->tablet()->NewRowIterator(schema_, &iter));
+  RETURN_NOT_OK(tablet_replica_->tablet()->NewRowIterator(schema_, &iter));
   RETURN_NOT_OK(iter->Init(&spec));
 
   Arena arena(32 * 1024, 256 * 1024);

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/master/sys_catalog.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/sys_catalog.h b/src/kudu/master/sys_catalog.h
index 11e92cd..4197288 100644
--- a/src/kudu/master/sys_catalog.h
+++ b/src/kudu/master/sys_catalog.h
@@ -24,7 +24,7 @@
 
 #include "kudu/consensus/metadata.pb.h"
 #include "kudu/master/master.pb.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/util/status.h"
 
 namespace kudu {
@@ -113,13 +113,13 @@ class SysCatalogTable {
 
   ~SysCatalogTable();
 
-  // Allow for orderly shutdown of tablet peer, etc.
+  // Allow for orderly shutdown of TabletReplica, etc.
   void Shutdown();
 
-  // Load the Metadata from disk, and initialize the TabletPeer for the sys-table
+  // Load the Metadata from disk, and initialize the TabletReplica for the sys-table
   Status Load(FsManager *fs_manager);
 
-  // Create the new Metadata and initialize the TabletPeer for the sys-table.
+  // Create the new Metadata and initialize the TabletReplica for the sys-table.
   Status CreateNew(FsManager *fs_manager);
 
   // Perform a series of table/tablet actions in one WriteTransaction.
@@ -183,12 +183,12 @@ class SysCatalogTable {
   Status CreateDistributedConfig(const MasterOptions& options,
                                  consensus::RaftConfigPB* committed_config);
 
-  const scoped_refptr<tablet::TabletPeer>& tablet_peer() const {
-    return tablet_peer_;
+  const scoped_refptr<tablet::TabletReplica>& tablet_replica() const {
+    return tablet_replica_;
   }
 
   std::string tablet_id() const {
-    return tablet_peer_->tablet_id();
+    return tablet_replica_->tablet_id();
   }
 
   // Conventional "T xxx P xxxx..." prefix for logging.
@@ -239,7 +239,7 @@ class SysCatalogTable {
   // Only useful for tests.
   static const char* const kInjectedFailureStatusMsg;
 
-  // Table schema, without IDs, used to send messages to the TabletPeer
+  // Table schema, without IDs, used to send messages to the TabletReplica
   Schema schema_;
   Schema key_schema_;
 
@@ -247,7 +247,7 @@ class SysCatalogTable {
 
   gscoped_ptr<ThreadPool> apply_pool_;
 
-  scoped_refptr<tablet::TabletPeer> tablet_peer_;
+  scoped_refptr<tablet::TabletReplica> tablet_replica_;
 
   Master* master_;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/tablet/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/CMakeLists.txt b/src/kudu/tablet/CMakeLists.txt
index 49fafef..c54ba43 100644
--- a/src/kudu/tablet/CMakeLists.txt
+++ b/src/kudu/tablet/CMakeLists.txt
@@ -20,8 +20,8 @@ set(TABLET_SRCS
   tablet_bootstrap.cc
   tablet_metrics.cc
   tablet_mm_ops.cc
-  tablet_peer_mm_ops.cc
-  tablet_peer.cc
+  tablet_replica_mm_ops.cc
+  tablet_replica.cc
   transactions/transaction.cc
   transactions/alter_schema_transaction.cc
   transactions/transaction_driver.cc
@@ -118,7 +118,7 @@ ADD_KUDU_TEST(mt-rowset_delta_compaction-test)
 ADD_KUDU_TEST(major_delta_compaction-test)
 ADD_KUDU_TEST(transactions/transaction_tracker-test)
 ADD_KUDU_TEST(tablet_history_gc-test)
-ADD_KUDU_TEST(tablet_peer-test)
+ADD_KUDU_TEST(tablet_replica-test)
 ADD_KUDU_TEST(tablet_random_access-test)
 ADD_KUDU_TEST(tablet_throttle-test)
 ADD_KUDU_TEST(tablet_mm_ops-test)

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/tablet/local_tablet_writer.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/local_tablet_writer.h b/src/kudu/tablet/local_tablet_writer.h
index e0d3371..6bc3f6e 100644
--- a/src/kudu/tablet/local_tablet_writer.h
+++ b/src/kudu/tablet/local_tablet_writer.h
@@ -32,7 +32,7 @@ namespace kudu {
 namespace tablet {
 
 // Helper class to write directly into a local tablet, without going
-// through TabletPeer, consensus, etc.
+// through TabletReplica, consensus, etc.
 //
 // This is useful for unit-testing the Tablet code paths with no consensus
 // implementation or thread pools.

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/tablet/metadata.proto
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/metadata.proto b/src/kudu/tablet/metadata.proto
index fc9b9dc..7acd140 100644
--- a/src/kudu/tablet/metadata.proto
+++ b/src/kudu/tablet/metadata.proto
@@ -125,7 +125,7 @@ message TabletSuperBlockPB {
 }
 
 // The enum of tablet states.
-// Tablet states are sent in TabletReports and kept in TabletPeer.
+// Tablet states are sent in TabletReports and kept in TabletReplica.
 enum TabletStatePB {
   UNKNOWN = 999;
 
@@ -140,7 +140,7 @@ enum TabletStatePB {
   // state Peers are available for client RPCs.
   RUNNING = 1;
 
-  // The tablet failed to for some reason. TabletPeer::error() will return
+  // The tablet failed to for some reason. TabletReplica::error() will return
   // the reason for the failure.
   FAILED = 2;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/tablet/tablet-harness.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet-harness.h b/src/kudu/tablet/tablet-harness.h
index fd09c5a..44159d5 100644
--- a/src/kudu/tablet/tablet-harness.h
+++ b/src/kudu/tablet/tablet-harness.h
@@ -14,8 +14,8 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-#ifndef KUDU_TABLET_TABLET_PEER_HARNESS_H
-#define KUDU_TABLET_TABLET_PEER_HARNESS_H
+#ifndef KUDU_TABLET_TABLET_REPLICA_HARNESS_H
+#define KUDU_TABLET_TABLET_REPLICA_HARNESS_H
 
 #include <memory>
 #include <string>
@@ -155,4 +155,4 @@ class TabletHarness {
 
 } // namespace tablet
 } // namespace kudu
-#endif /* KUDU_TABLET_TABLET_PEER_HARNESS_H */
+#endif /* KUDU_TABLET_TABLET_REPLICA_HARNESS_H */

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/tablet/tablet.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.h b/src/kudu/tablet/tablet.h
index a7c1d84..4c5b6e5 100644
--- a/src/kudu/tablet/tablet.h
+++ b/src/kudu/tablet/tablet.h
@@ -395,7 +395,7 @@ class Tablet {
 
  private:
   friend class Iterator;
-  friend class TabletPeerTest;
+  friend class TabletReplicaTest;
   FRIEND_TEST(TestTablet, TestGetReplaySizeForIndex);
 
   Status FlushUnlocked();

http://git-wip-us.apache.org/repos/asf/kudu/blob/7f72105b/src/kudu/tablet/tablet_bootstrap.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_bootstrap.cc b/src/kudu/tablet/tablet_bootstrap.cc
index 04eea5f..47775b9 100644
--- a/src/kudu/tablet/tablet_bootstrap.cc
+++ b/src/kudu/tablet/tablet_bootstrap.cc
@@ -48,7 +48,7 @@
 #include "kudu/tablet/lock_manager.h"
 #include "kudu/tablet/row_op.h"
 #include "kudu/tablet/tablet.h"
-#include "kudu/tablet/tablet_peer.h"
+#include "kudu/tablet/tablet_replica.h"
 #include "kudu/tablet/transactions/alter_schema_transaction.h"
 #include "kudu/tablet/transactions/write_transaction.h"
 #include "kudu/util/debug/trace_event.h"
@@ -320,7 +320,7 @@ class TabletBootstrap {
   // Return a log prefix string in the standard "T xxx P yyy" format.
   string LogPrefix() const;
 
-  // Report a status message in the WAL as well as update the tablet peer's
+  // Report a status message in the WAL as well as update the TabletReplica's
   // status.
   void StatusMessage(const string& status);
 


Mime
View raw message