kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject kudu git commit: [util] remove 'using pb_util::Secure[Short]DebugString'
Date Thu, 10 Aug 2017 03:39:16 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 154b07de7 -> dd68c6255


[util] remove 'using pb_util::Secure[Short]DebugString'

Addressed TODO in pb_util.h: removed 'using' directives from the header
file, updating call sites of pb_util::SecureDebugString() and
pb_util::SecureShortDebugString().

This is a follow-up for 154b07de73ca2b949fceacef6798411dc4a3c6eb.

This changelist does not contain any functional changes.

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


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

Branch: refs/heads/master
Commit: dd68c62555a2b8a977a7a2052233a990a43afb8f
Parents: 154b07d
Author: Alexey Serbin <alexey@apache.org>
Authored: Wed Aug 9 17:03:30 2017 -0700
Committer: Alexey Serbin <aserbin@cloudera.com>
Committed: Thu Aug 10 03:38:15 2017 +0000

----------------------------------------------------------------------
 src/kudu/cfile/cfile_reader.cc                  |  1 +
 src/kudu/cfile/index_block.cc                   |  2 +-
 src/kudu/client/batcher.cc                      |  2 ++
 src/kudu/client/client-internal.cc              |  1 +
 src/kudu/client/meta_cache.cc                   |  5 ++--
 src/kudu/common/partition.cc                    |  8 +++----
 src/kudu/common/wire_protocol-test.cc           |  4 ++--
 src/kudu/common/wire_protocol.cc                |  2 ++
 src/kudu/consensus/consensus-test-util.h        | 14 +++++++-----
 src/kudu/consensus/consensus_meta-test.cc       |  4 ++--
 src/kudu/consensus/consensus_meta.cc            |  2 +-
 src/kudu/consensus/consensus_peers.cc           | 15 ++++++------
 src/kudu/consensus/consensus_queue-test.cc      |  6 ++---
 src/kudu/consensus/consensus_queue.cc           | 10 ++++----
 src/kudu/consensus/leader_election.cc           |  2 +-
 src/kudu/consensus/log-test-base.h              |  6 ++---
 src/kudu/consensus/log.cc                       |  2 +-
 src/kudu/consensus/log_cache.cc                 |  1 +
 src/kudu/consensus/log_reader.cc                | 16 +++++++------
 src/kudu/consensus/peer_manager.cc              |  7 +++---
 src/kudu/consensus/pending_rounds.cc            |  7 +++---
 src/kudu/consensus/quorum_util.cc               |  1 +
 src/kudu/consensus/raft_consensus.cc            |  6 ++---
 .../consensus/raft_consensus_quorum-test.cc     | 15 ++++++------
 src/kudu/fs/fs_manager.cc                       |  1 +
 src/kudu/fs/fs_report.cc                        |  2 +-
 .../integration-tests/cluster_itest_util.cc     |  2 ++
 .../create-table-stress-test.cc                 |  5 ++--
 .../integration-tests/delete_table-itest.cc     |  2 ++
 .../exactly_once_writes-itest.cc                |  4 ++--
 .../integration-tests/external_mini_cluster.cc  |  2 ++
 .../master_cert_authority-itest.cc              |  4 ++--
 .../master_replication-itest.cc                 |  2 +-
 .../integration-tests/raft_consensus-itest.cc   |  2 ++
 src/kudu/integration-tests/registration-test.cc |  1 +
 .../integration-tests/table_locations-itest.cc  |  1 +
 src/kudu/integration-tests/ts_itest-base.h      |  4 ++--
 .../ts_tablet_manager-itest.cc                  |  6 ++---
 src/kudu/master/catalog_manager.cc              |  2 ++
 src/kudu/master/master-path-handlers.cc         |  4 ++--
 src/kudu/master/master-test.cc                  |  2 ++
 src/kudu/master/master_service.cc               |  2 ++
 src/kudu/master/sys_catalog-test.cc             |  2 +-
 src/kudu/master/sys_catalog.cc                  |  1 +
 src/kudu/master/ts_descriptor.cc                |  2 ++
 src/kudu/master/ts_manager.cc                   |  5 ++--
 src/kudu/rpc/exactly_once_rpc-test.cc           |  2 ++
 src/kudu/rpc/result_tracker.cc                  |  2 ++
 src/kudu/rpc/rpc-test-base.h                    |  4 ++--
 src/kudu/rpc/rpc_context.cc                     |  1 +
 src/kudu/rpc/rpc_stub-test.cc                   |  1 +
 src/kudu/tablet/row_op.cc                       |  2 ++
 src/kudu/tablet/tablet_bootstrap-test.cc        |  1 +
 src/kudu/tablet/tablet_bootstrap.cc             |  2 ++
 src/kudu/tablet/tablet_metadata-test.cc         |  6 ++---
 src/kudu/tablet/tablet_metadata.cc              | 11 ++++-----
 src/kudu/tablet/tablet_replica-test.cc          |  2 ++
 src/kudu/tablet/tablet_replica.cc               |  1 +
 .../transactions/alter_schema_transaction.cc    |  1 +
 .../tablet/transactions/transaction_driver.cc   |  1 +
 .../tablet/transactions/write_transaction.cc    |  1 +
 src/kudu/tools/kudu-admin-test.cc               |  1 +
 src/kudu/tools/kudu-tool-test.cc                |  4 ++--
 src/kudu/tools/tool_action_common.cc            |  2 ++
 src/kudu/tools/tool_action_fs.cc                |  4 ++--
 src/kudu/tools/tool_action_local_replica.cc     |  6 ++---
 src/kudu/tools/tool_action_remote_replica.cc    |  6 ++---
 src/kudu/tserver/heartbeater.cc                 |  1 +
 src/kudu/tserver/tablet_copy_client.cc          |  4 ++--
 src/kudu/tserver/tablet_copy_service-test.cc    |  2 ++
 src/kudu/tserver/tablet_copy_service.cc         |  1 +
 .../tserver/tablet_copy_source_session-test.cc  |  6 +++--
 src/kudu/tserver/tablet_copy_source_session.cc  |  2 +-
 src/kudu/tserver/tablet_server-test-base.h      | 24 ++++++++++----------
 src/kudu/tserver/tablet_server-test.cc          |  2 ++
 src/kudu/tserver/tablet_service.cc              |  2 ++
 src/kudu/tserver/ts_tablet_manager-test.cc      |  1 +
 src/kudu/tserver/tserver-path-handlers.cc       |  2 ++
 src/kudu/util/pb_util.h                         |  6 -----
 79 files changed, 189 insertions(+), 122 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/cfile/cfile_reader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_reader.cc b/src/kudu/cfile/cfile_reader.cc
index 93c0788..0036ae2 100644
--- a/src/kudu/cfile/cfile_reader.cc
+++ b/src/kudu/cfile/cfile_reader.cc
@@ -56,6 +56,7 @@ DEFINE_bool(cfile_verify_checksums, true,
 TAG_FLAG(cfile_verify_checksums, evolving);
 
 using kudu::fs::ReadableBlock;
+using kudu::pb_util::SecureDebugString;
 using std::string;
 using std::unique_ptr;
 using std::vector;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/cfile/index_block.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/index_block.cc b/src/kudu/cfile/index_block.cc
index 904be7e..efe4b82 100644
--- a/src/kudu/cfile/index_block.cc
+++ b/src/kudu/cfile/index_block.cc
@@ -166,7 +166,7 @@ Status IndexBlockReader::Parse(const Slice &data) {
   key_offsets_ = trailer_ptr - sizeof(uint32_t) * trailer_.num_entries();
   CHECK(trailer_ptr >= data_.data());
 
-  VLOG(2) << "Parsed index trailer: " << SecureDebugString(trailer_);
+  VLOG(2) << "Parsed index trailer: " << pb_util::SecureDebugString(trailer_);
 
   parsed_ = true;
   return Status::OK();

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/client/batcher.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/batcher.cc b/src/kudu/client/batcher.cc
index 2fe4bf0..4a0fc8c 100644
--- a/src/kudu/client/batcher.cc
+++ b/src/kudu/client/batcher.cc
@@ -67,6 +67,8 @@ using strings::Substitute;
 
 namespace kudu {
 
+using pb_util::SecureDebugString;
+using pb_util::SecureShortDebugString;
 using rpc::CredentialsPolicy;
 using rpc::ErrorStatusPB;
 using rpc::Messenger;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/client/client-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-internal.cc b/src/kudu/client/client-internal.cc
index f72b8de..da16fcf 100644
--- a/src/kudu/client/client-internal.cc
+++ b/src/kudu/client/client-internal.cc
@@ -82,6 +82,7 @@ using master::ListTabletServersResponsePB;
 using master::MasterErrorPB;
 using master::MasterFeatures;
 using master::MasterServiceProxy;
+using pb_util::SecureShortDebugString;
 using rpc::CredentialsPolicy;
 using rpc::ErrorStatusPB;
 using rpc::RpcController;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/client/meta_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/meta_cache.cc b/src/kudu/client/meta_cache.cc
index fecac55..f54e2c1 100644
--- a/src/kudu/client/meta_cache.cc
+++ b/src/kudu/client/meta_cache.cc
@@ -794,7 +794,7 @@ void LookupRpc::SendRpcCb(const Status& status) {
 Status MetaCache::ProcessLookupResponse(const LookupRpc& rpc,
                                         MetaCacheEntry* cache_entry) {
   VLOG(2) << "Processing master response for " << rpc.ToString()
-          << ". Response: " << SecureShortDebugString(rpc.resp());
+          << ". Response: " << pb_util::SecureShortDebugString(rpc.resp());
 
   MonoTime expiration_time = MonoTime::Now() +
       MonoDelta::FromMilliseconds(rpc.resp().ttl_millis());
@@ -884,7 +884,8 @@ Status MetaCache::ProcessLookupResponse(const LookupRpc& rpc,
         DCHECK_EQ(tablet_lower_bound, remote->partition().partition_key_start());
         DCHECK_EQ(tablet_upper_bound, remote->partition().partition_key_end());
 
-        VLOG(3) << "Refreshing tablet " << tablet_id << ": " << SecureShortDebugString(tablet);
+        VLOG(3) << "Refreshing tablet " << tablet_id << ": "
+                << pb_util::SecureShortDebugString(tablet);
         remote->Refresh(ts_cache_, tablet.replicas());
 
         // Update the entry TTL.

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/common/partition.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/partition.cc b/src/kudu/common/partition.cc
index e6ef4e0..5a0c55c 100644
--- a/src/kudu/common/partition.cc
+++ b/src/kudu/common/partition.cc
@@ -33,17 +33,17 @@
 #include "kudu/util/pb_util.h"
 #include "kudu/util/url-coding.h"
 
+using google::protobuf::RepeatedPtrField;
+using kudu::pb_util::SecureDebugString;
 using std::pair;
 using std::set;
 using std::string;
 using std::vector;
-
-namespace kudu {
-
-using google::protobuf::RepeatedPtrField;
 using strings::Substitute;
 using strings::SubstituteAndAppend;
 
+namespace kudu {
+
 // The encoded size of a hash bucket in a partition key.
 static const size_t kEncodedBucketSize = sizeof(uint32_t);
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/common/wire_protocol-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/wire_protocol-test.cc b/src/kudu/common/wire_protocol-test.cc
index c5cc271..ef3c5bf 100644
--- a/src/kudu/common/wire_protocol-test.cc
+++ b/src/kudu/common/wire_protocol-test.cc
@@ -211,7 +211,7 @@ TEST_F(WireProtocolTest, TestColumnarRowBlockToPB) {
   RowwiseRowBlockPB pb;
   faststring direct, indirect;
   SerializeRowBlock(block, &pb, nullptr, &direct, &indirect);
-  SCOPED_TRACE(SecureDebugString(pb));
+  SCOPED_TRACE(pb_util::SecureDebugString(pb));
   SCOPED_TRACE("Row data: " + direct.ToString());
   SCOPED_TRACE("Indirect data: " + indirect.ToString());
 
@@ -271,7 +271,7 @@ TEST_F(WireProtocolTest, TestColumnarRowBlockToPBWithPadding) {
   RowwiseRowBlockPB pb;
   faststring direct, indirect;
   SerializeRowBlock(block, &pb, &proj_schema, &direct, &indirect, true /* pad timestamps */);
-  SCOPED_TRACE(SecureDebugString(pb));
+  SCOPED_TRACE(pb_util::SecureDebugString(pb));
   SCOPED_TRACE("Row data: " + HexDump(direct));
   SCOPED_TRACE("Indirect data: " + HexDump(indirect));
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/common/wire_protocol.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/wire_protocol.cc b/src/kudu/common/wire_protocol.cc
index b1e06f2..a5404a7 100644
--- a/src/kudu/common/wire_protocol.cc
+++ b/src/kudu/common/wire_protocol.cc
@@ -37,6 +37,8 @@
 #include "kudu/util/slice.h"
 
 using google::protobuf::RepeatedPtrField;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using std::string;
 using std::vector;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/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 1075db4..b554dcd 100644
--- a/src/kudu/consensus/consensus-test-util.h
+++ b/src/kudu/consensus/consensus-test-util.h
@@ -50,8 +50,10 @@
   OpId TOKENPASTE2(_left, __LINE__) = (left); \
   OpId TOKENPASTE2(_right, __LINE__) = (right); \
   if (!consensus::OpIdEquals(TOKENPASTE2(_left, __LINE__), TOKENPASTE2(_right,__LINE__))) { \
-    FAIL() << "Expected: " << SecureShortDebugString(TOKENPASTE2(_right,__LINE__)) << "\n" \
-           << "Value: " << SecureShortDebugString(TOKENPASTE2(_left,__LINE__)) << "\n"; \
+    FAIL() << "Expected: " \
+           << pb_util::SecureShortDebugString(TOKENPASTE2(_right,__LINE__)) << "\n" \
+           << "Value: " \
+           << pb_util::SecureShortDebugString(TOKENPASTE2(_left,__LINE__)) << "\n"; \
   }
 
 namespace kudu {
@@ -239,7 +241,7 @@ class MockedPeerProxy : public TestPeerProxy {
   }
 
   virtual void set_update_response(const ConsensusResponsePB& update_response) {
-    CHECK(update_response.IsInitialized()) << SecureShortDebugString(update_response);
+    CHECK(update_response.IsInitialized()) << pb_util::SecureShortDebugString(update_response);
     {
       std::lock_guard<simple_spinlock> l(lock_);
       update_response_ = update_response;
@@ -475,7 +477,7 @@ class LocalTestPeerProxy : public TestPeerProxy {
       miss_comm_ = false;
     }
     if (PREDICT_FALSE(miss_comm_copy)) {
-      VLOG(2) << this << ": injecting fault on " << SecureShortDebugString(*request);
+      VLOG(2) << this << ": injecting fault on " << pb_util::SecureShortDebugString(*request);
       SetResponseError(Status::IOError("Artificial error caused by communication "
           "failure injection."), final_response);
     } else {
@@ -505,7 +507,7 @@ class LocalTestPeerProxy : public TestPeerProxy {
     }
     if (!s.ok()) {
       LOG(WARNING) << "Could not Update replica with request: "
-                   << SecureShortDebugString(other_peer_req)
+                   << pb_util::SecureShortDebugString(other_peer_req)
                    << " Status: " << s.ToString();
       SetResponseError(s, &other_peer_resp);
     }
@@ -534,7 +536,7 @@ class LocalTestPeerProxy : public TestPeerProxy {
     }
     if (!s.ok()) {
       LOG(WARNING) << "Could not RequestVote from replica with request: "
-                   << SecureShortDebugString(other_peer_req)
+                   << pb_util::SecureShortDebugString(other_peer_req)
                    << " Status: " << s.ToString();
       SetResponseError(s, &other_peer_resp);
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/consensus_meta-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_meta-test.cc b/src/kudu/consensus/consensus_meta-test.cc
index ff0ece9..4ffd2fb 100644
--- a/src/kudu/consensus/consensus_meta-test.cc
+++ b/src/kudu/consensus/consensus_meta-test.cc
@@ -260,8 +260,8 @@ static void AssertConsensusMergeExpected(const scoped_refptr<ConsensusMetadata>&
   // See header docs for ConsensusMetadata::MergeCommittedConsensusStatePB() for
   // a "spec" of these assertions.
   ASSERT_TRUE(!cmeta->has_pending_config());
-  ASSERT_EQ(SecureShortDebugString(cmeta->CommittedConfig()),
-            SecureShortDebugString(cstate.committed_config()));
+  ASSERT_EQ(pb_util::SecureShortDebugString(cmeta->CommittedConfig()),
+            pb_util::SecureShortDebugString(cstate.committed_config()));
   ASSERT_EQ("", cmeta->leader_uuid());
   ASSERT_EQ(expected_term, cmeta->current_term());
   if (expected_voted_for.empty()) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/consensus_meta.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_meta.cc b/src/kudu/consensus/consensus_meta.cc
index 79b198c..b01bfe9 100644
--- a/src/kudu/consensus/consensus_meta.cc
+++ b/src/kudu/consensus/consensus_meta.cc
@@ -345,7 +345,7 @@ void ConsensusMetadata::UpdateActiveRoleUnlocked() {
   ConsensusStatePB cstate = ToConsensusStatePBUnlocked();
   active_role_ = GetConsensusRole(peer_uuid_, cstate);
   VLOG_WITH_PREFIX(1) << "Updating active role to " << RaftPeerPB::Role_Name(active_role_)
-                      << ". Consensus state: " << SecureShortDebugString(cstate);
+                      << ". Consensus state: " << pb_util::SecureShortDebugString(cstate);
 }
 
 } // namespace consensus

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/consensus_peers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_peers.cc b/src/kudu/consensus/consensus_peers.cc
index 1fce7c5..d5a29d9 100644
--- a/src/kudu/consensus/consensus_peers.cc
+++ b/src/kudu/consensus/consensus_peers.cc
@@ -74,18 +74,19 @@ TAG_FLAG(enable_tablet_copy, unsafe);
 
 DECLARE_int32(raft_heartbeat_interval_ms);
 
-
-namespace kudu {
-namespace consensus {
-
-using rpc::Messenger;
-using rpc::RpcController;
+using kudu::pb_util::SecureShortDebugString;
+using kudu::rpc::Messenger;
+using kudu::rpc::RpcController;
+using kudu::tserver::TabletServerErrorPB;
 using std::shared_ptr;
 using std::string;
 using std::vector;
 using std::weak_ptr;
 using strings::Substitute;
-using tserver::TabletServerErrorPB;
+
+
+namespace kudu {
+namespace consensus {
 
 Status Peer::NewRemotePeer(RaftPeerPB peer_pb,
                            string tablet_id,

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/consensus_queue-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_queue-test.cc b/src/kudu/consensus/consensus_queue-test.cc
index 69fdad8..13e298f 100644
--- a/src/kudu/consensus/consensus_queue-test.cc
+++ b/src/kudu/consensus/consensus_queue-test.cc
@@ -830,11 +830,11 @@ TEST_F(ConsensusQueueTest, TestTriggerTabletCopyIfTabletNotFound) {
   StartTabletCopyRequestPB tc_req;
   ASSERT_OK(queue_->GetTabletCopyRequestForPeer(kPeerUuid, &tc_req));
 
-  ASSERT_TRUE(tc_req.IsInitialized()) << SecureShortDebugString(tc_req);
+  ASSERT_TRUE(tc_req.IsInitialized()) << pb_util::SecureShortDebugString(tc_req);
   ASSERT_EQ(kTestTablet, tc_req.tablet_id());
   ASSERT_EQ(kLeaderUuid, tc_req.copy_peer_uuid());
-  ASSERT_EQ(SecureShortDebugString(FakeRaftPeerPB(kLeaderUuid).last_known_addr()),
-            SecureShortDebugString(tc_req.copy_peer_addr()));
+  ASSERT_EQ(pb_util::SecureShortDebugString(FakeRaftPeerPB(kLeaderUuid).last_known_addr()),
+            pb_util::SecureShortDebugString(tc_req.copy_peer_addr()));
 }
 
 TEST_F(ConsensusQueueTest, TestFollowerCommittedIndexAndMetrics) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/consensus_queue.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_queue.cc b/src/kudu/consensus/consensus_queue.cc
index d7aa2f7..3937857 100644
--- a/src/kudu/consensus/consensus_queue.cc
+++ b/src/kudu/consensus/consensus_queue.cc
@@ -69,15 +69,17 @@ TAG_FLAG(consensus_inject_latency_ms_in_notifications, unsafe);
 
 DECLARE_bool(safe_time_advancement_without_writes);
 
-namespace kudu {
-namespace consensus {
-
-using log::Log;
+using kudu::log::Log;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using std::string;
 using std::unique_ptr;
 using std::vector;
 using strings::Substitute;
 
+namespace kudu {
+namespace consensus {
+
 METRIC_DEFINE_gauge_int64(tablet, majority_done_ops, "Leader Operations Acked by Majority",
                           MetricUnit::kOperations,
                           "Number of operations in the leader queue ack'd by a majority but "

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/leader_election.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/leader_election.cc b/src/kudu/consensus/leader_election.cc
index b180345..8b69c88 100644
--- a/src/kudu/consensus/leader_election.cc
+++ b/src/kudu/consensus/leader_election.cc
@@ -173,7 +173,7 @@ LeaderElection::LeaderElection(const RaftConfigPB& config,
            vote_counter_->GetTotalExpectedVotes())
       << "Expected different number of followers. Follower UUIDs: ["
       << JoinStringsIterator(follower_uuids_.begin(), follower_uuids_.end(), ", ")
-      << "]; RaftConfig: {" << SecureShortDebugString(config) << "}";
+      << "]; RaftConfig: {" << pb_util::SecureShortDebugString(config) << "}";
 }
 
 LeaderElection::~LeaderElection() {

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/log-test-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log-test-base.h b/src/kudu/consensus/log-test-base.h
index 6647617..0f2b03a 100644
--- a/src/kudu/consensus/log-test-base.h
+++ b/src/kudu/consensus/log-test-base.h
@@ -195,7 +195,7 @@ class LogTestBase : public KuduTest {
 
   void EntriesToIdList(std::vector<uint32_t>* ids) {
     for (const LogEntryPB* entry : entries_) {
-      VLOG(2) << "Entry contents: " << SecureDebugString(*entry);
+      VLOG(2) << "Entry contents: " << pb_util::SecureDebugString(*entry);
       if (entry->type() == REPLICATE) {
         ids->push_back(entry->replicate().id().index());
       }
@@ -352,10 +352,10 @@ class LogTestBase : public KuduTest {
       strings::SubstituteAndAppend(&dump, "Segment: $0, Path: $1\n",
                                    segment->header().sequence_number(), segment->path());
       strings::SubstituteAndAppend(&dump, "Header: $0\n",
-                                   SecureShortDebugString(segment->header()));
+                                   pb_util::SecureShortDebugString(segment->header()));
       if (segment->HasFooter()) {
         strings::SubstituteAndAppend(&dump, "Footer: $0\n",
-                                     SecureShortDebugString(segment->footer()));
+                                     pb_util::SecureShortDebugString(segment->footer()));
       } else {
         dump.append("Footer: None or corrupt.");
       }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/log.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log.cc b/src/kudu/consensus/log.cc
index 4a149d1..6b22733 100644
--- a/src/kudu/consensus/log.cc
+++ b/src/kudu/consensus/log.cc
@@ -538,7 +538,7 @@ Status Log::CloseCurrentSegment() {
                         << active_segment_->path();
   }
   VLOG_WITH_PREFIX(2) << "Segment footer for " << active_segment_->path()
-                      << ": " << SecureShortDebugString(footer_builder_);
+                      << ": " << pb_util::SecureShortDebugString(footer_builder_);
 
   footer_builder_.set_close_timestamp_micros(GetCurrentTimeMicros());
   RETURN_NOT_OK(active_segment_->WriteFooterAndClose(footer_builder_));

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/log_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_cache.cc b/src/kudu/consensus/log_cache.cc
index 285d7e7..060b03a 100644
--- a/src/kudu/consensus/log_cache.cc
+++ b/src/kudu/consensus/log_cache.cc
@@ -53,6 +53,7 @@ DEFINE_int32(global_log_cache_size_limit_mb, 1024,
              "caching log entries across all tablets is kept under this threshold.");
 TAG_FLAG(global_log_cache_size_limit_mb, advanced);
 
+using kudu::pb_util::SecureShortDebugString;
 using std::string;
 using std::vector;
 using strings::Substitute;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/log_reader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_reader.cc b/src/kudu/consensus/log_reader.cc
index 3c676ef..5057b06 100644
--- a/src/kudu/consensus/log_reader.cc
+++ b/src/kudu/consensus/log_reader.cc
@@ -46,6 +46,15 @@ METRIC_DEFINE_histogram(tablet, log_reader_read_batch_latency, "Log Read Latency
                         "Microseconds spent reading log entry batches",
                         60000000LU, 2);
 
+using kudu::consensus::OpId;
+using kudu::consensus::ReplicateMsg;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
+using std::shared_ptr;
+using std::string;
+using std::vector;
+using strings::Substitute;
+
 namespace kudu {
 namespace log {
 
@@ -58,13 +67,6 @@ struct LogSegmentSeqnoComparator {
 };
 }
 
-using consensus::OpId;
-using consensus::ReplicateMsg;
-using std::shared_ptr;
-using std::string;
-using std::vector;
-using strings::Substitute;
-
 const int64_t LogReader::kNoSizeLimit = -1;
 
 Status LogReader::Open(FsManager* fs_manager,

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/peer_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/peer_manager.cc b/src/kudu/consensus/peer_manager.cc
index 322d59c..0dde6a6 100644
--- a/src/kudu/consensus/peer_manager.cc
+++ b/src/kudu/consensus/peer_manager.cc
@@ -28,12 +28,13 @@
 #include "kudu/util/pb_util.h"
 #include "kudu/util/threadpool.h"
 
+using kudu::log::Log;
+using kudu::pb_util::SecureShortDebugString;
+using strings::Substitute;
+
 namespace kudu {
 namespace consensus {
 
-using log::Log;
-using strings::Substitute;
-
 PeerManager::PeerManager(std::string tablet_id,
                          std::string local_uuid,
                          PeerProxyFactory* peer_proxy_factory,

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/pending_rounds.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/pending_rounds.cc b/src/kudu/consensus/pending_rounds.cc
index adbca50..6484183 100644
--- a/src/kudu/consensus/pending_rounds.cc
+++ b/src/kudu/consensus/pending_rounds.cc
@@ -25,12 +25,13 @@
 #include "kudu/util/pb_util.h"
 #include "kudu/util/status.h"
 
-namespace kudu {
-namespace consensus {
-
+using kudu::pb_util::SecureShortDebugString;
 using std::string;
 using strings::Substitute;
 
+namespace kudu {
+namespace consensus {
+
 //------------------------------------------------------------
 // PendingRounds
 //------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/quorum_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/quorum_util.cc b/src/kudu/consensus/quorum_util.cc
index d462082..a433ec9 100644
--- a/src/kudu/consensus/quorum_util.cc
+++ b/src/kudu/consensus/quorum_util.cc
@@ -29,6 +29,7 @@
 #include "kudu/util/status.h"
 
 using google::protobuf::RepeatedPtrField;
+using kudu::pb_util::SecureShortDebugString;
 using std::map;
 using std::pair;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/raft_consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index 66339bf..a7140ce 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -125,7 +125,10 @@ METRIC_DEFINE_gauge_int64(tablet, raft_term,
                           "Current Term of the Raft Consensus algorithm. This number increments "
                           "each time a leader election is started.");
 
+using kudu::pb_util::SecureShortDebugString;
+using kudu::tserver::TabletServerErrorPB;
 using std::string;
+using strings::Substitute;
 
 namespace  {
 
@@ -154,9 +157,6 @@ int GetFailureMonitorCheckStddevMs() {
 namespace kudu {
 namespace consensus {
 
-using strings::Substitute;
-using tserver::TabletServerErrorPB;
-
 // Special string that represents any known leader to the failure detector.
 static const char* const kTimerId = "election-timer";
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/consensus/raft_consensus_quorum-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus_quorum-test.cc b/src/kudu/consensus/raft_consensus_quorum-test.cc
index 0350b94..43816b4 100644
--- a/src/kudu/consensus/raft_consensus_quorum-test.cc
+++ b/src/kudu/consensus/raft_consensus_quorum-test.cc
@@ -54,24 +54,25 @@ METRIC_DECLARE_entity(tablet);
 #define REPLICATE_SEQUENCE_OF_MESSAGES(a, b, c, d, e, f, g) \
   ASSERT_NO_FATAL_FAILURE(ReplicateSequenceOfMessages(a, b, c, d, e, f, g))
 
+using kudu::pb_util::SecureShortDebugString;
+using kudu::log::Log;
+using kudu::log::LogEntryPB;
+using kudu::log::LogOptions;
+using kudu::log::LogReader;
 using std::shared_ptr;
 using std::string;
 using std::unique_ptr;
 using std::vector;
+using strings::Substitute;
+using strings::SubstituteAndAppend;
 
 namespace kudu {
 
 namespace rpc {
 class RpcContext;
 }
-namespace consensus {
 
-using log::Log;
-using log::LogEntryPB;
-using log::LogOptions;
-using log::LogReader;
-using strings::Substitute;
-using strings::SubstituteAndAppend;
+namespace consensus {
 
 const char* kTestTablet = "TestTablet";
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/fs/fs_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_manager.cc b/src/kudu/fs/fs_manager.cc
index ac3e15a..846be68 100644
--- a/src/kudu/fs/fs_manager.cc
+++ b/src/kudu/fs/fs_manager.cc
@@ -89,6 +89,7 @@ using kudu::fs::FsReport;
 using kudu::fs::LogBlockManager;
 using kudu::fs::ReadableBlock;
 using kudu::fs::WritableBlock;
+using kudu::pb_util::SecureDebugString;
 using std::map;
 using std::ostream;
 using std::set;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/fs/fs_report.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_report.cc b/src/kudu/fs/fs_report.cc
index 64bf8c8..dd353c5 100644
--- a/src/kudu/fs/fs_report.cc
+++ b/src/kudu/fs/fs_report.cc
@@ -188,7 +188,7 @@ string LBMMalformedRecordCheck::ToString() const {
   for (const auto& mr : entries) {
     SubstituteAndAppend(
         &s, "Fatal error: malformed record in container $0: $1\n",
-        mr.container, SecureDebugString(mr.record));
+        mr.container, pb_util::SecureDebugString(mr.record));
   }
   return s;
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/cluster_itest_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/cluster_itest_util.cc b/src/kudu/integration-tests/cluster_itest_util.cc
index 424a397..ca88aa7 100644
--- a/src/kudu/integration-tests/cluster_itest_util.cc
+++ b/src/kudu/integration-tests/cluster_itest_util.cc
@@ -67,6 +67,8 @@ using master::ListTabletServersResponsePB;
 using master::ListTabletServersResponsePB_Entry;
 using master::MasterServiceProxy;
 using master::TabletLocationsPB;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using rpc::Messenger;
 using rpc::RpcController;
 using std::min;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/create-table-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/create-table-stress-test.cc b/src/kudu/integration-tests/create-table-stress-test.cc
index fbdd96c..67acf0e 100644
--- a/src/kudu/integration-tests/create-table-stress-test.cc
+++ b/src/kudu/integration-tests/create-table-stress-test.cc
@@ -155,7 +155,7 @@ TEST_F(CreateTableStressTest, CreateAndDeleteBigTable) {
   LOG(INFO) << "Created table successfully!";
   // Use std::cout instead of log, since these responses are large and log
   // messages have a max size.
-  std::cout << "Response:\n" << SecureDebugString(resp);
+  std::cout << "Response:\n" << pb_util::SecureDebugString(resp);
   std::cout << "CatalogManager state:\n";
   cluster_->mini_master()->master()->catalog_manager()->DumpState(&std::cerr);
 
@@ -321,7 +321,8 @@ TEST_F(CreateTableStressTest, TestGetTableLocationsOptions) {
     req.set_max_returned_locations(1);
     req.set_partition_key_start(start_key_middle);
     ASSERT_OK(catalog->GetTableLocations(&req, &resp));
-    ASSERT_EQ(1, resp.tablet_locations_size()) << "Response: [" << SecureDebugString(resp) << "]";
+    ASSERT_EQ(1, resp.tablet_locations_size())
+        << "Response: [" << pb_util::SecureDebugString(resp) << "]";
     ASSERT_EQ(start_key_middle, resp.tablet_locations(0).partition().partition_key_start());
   }
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/delete_table-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/delete_table-itest.cc b/src/kudu/integration-tests/delete_table-itest.cc
index 3d64fc0..1d2da0d 100644
--- a/src/kudu/integration-tests/delete_table-itest.cc
+++ b/src/kudu/integration-tests/delete_table-itest.cc
@@ -55,6 +55,8 @@ using kudu::consensus::ConsensusMetadataPB;
 using kudu::consensus::ConsensusStatePB;
 using kudu::consensus::RaftPeerPB;
 using kudu::itest::TServerDetails;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::tablet::TABLET_DATA_COPYING;
 using kudu::tablet::TABLET_DATA_DELETED;
 using kudu::tablet::TABLET_DATA_READY;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/exactly_once_writes-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/exactly_once_writes-itest.cc b/src/kudu/integration-tests/exactly_once_writes-itest.cc
index bd7f08d..b45eb83 100644
--- a/src/kudu/integration-tests/exactly_once_writes-itest.cc
+++ b/src/kudu/integration-tests/exactly_once_writes-itest.cc
@@ -208,12 +208,12 @@ void ExactlyOnceSemanticsITest::DoTestWritesWithExactlyOnceSemantics(
   bool mismatched = false;
   for (int i = 0; i < num_batches; i++) {
     for (int j = 0; j < num_threads; j++) {
-      string expected_response = SecureShortDebugString(responses[j][i]);
+      string expected_response = pb_util::SecureShortDebugString(responses[j][i]);
       string expected_ts = strings::Substitute(
           "T:$0 TSidx:$1 TSuuid:$2", j, j % FLAGS_num_replicas,
           cluster_.get()->tablet_server(j % FLAGS_num_replicas)->instance_id().permanent_uuid());
       for (int k = 0; k < num_threads; k++) {
-        string got_response = SecureShortDebugString(responses[k][i]);
+        string got_response = pb_util::SecureShortDebugString(responses[k][i]);
         string got_ts = strings::Substitute(
             "T:$0 TSidx:$1 TSuuid:$2", k, k % FLAGS_num_replicas,
             cluster_.get()->tablet_server(k % FLAGS_num_replicas)->instance_id().permanent_uuid());

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/external_mini_cluster.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/external_mini_cluster.cc b/src/kudu/integration-tests/external_mini_cluster.cc
index 2acca30..1693f4b 100644
--- a/src/kudu/integration-tests/external_mini_cluster.cc
+++ b/src/kudu/integration-tests/external_mini_cluster.cc
@@ -58,6 +58,8 @@ using kudu::client::internal::ConnectToClusterRpc;
 using kudu::master::ListTablesRequestPB;
 using kudu::master::ListTablesResponsePB;
 using kudu::master::MasterServiceProxy;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::rpc::RpcController;
 using kudu::server::ServerStatusPB;
 using kudu::tserver::ListTabletsRequestPB;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/master_cert_authority-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_cert_authority-itest.cc b/src/kudu/integration-tests/master_cert_authority-itest.cc
index 2c313b7..3a369c4 100644
--- a/src/kudu/integration-tests/master_cert_authority-itest.cc
+++ b/src/kudu/integration-tests/master_cert_authority-itest.cc
@@ -122,7 +122,7 @@ class MasterCertAuthorityTest : public KuduTest {
 
       // All masters (including followers) should accept the heartbeat.
       ASSERT_OK(proxy.TSHeartbeat(req, &resp, &rpc));
-      SCOPED_TRACE(SecureDebugString(resp));
+      SCOPED_TRACE(pb_util::SecureDebugString(resp));
       ASSERT_FALSE(resp.has_error());
     }
   }
@@ -152,7 +152,7 @@ class MasterCertAuthorityTest : public KuduTest {
 
       // All masters (including followers) should accept the heartbeat.
       RETURN_NOT_OK(proxy.TSHeartbeat(req, &resp, &rpc));
-      SCOPED_TRACE(SecureDebugString(resp));
+      SCOPED_TRACE(pb_util::SecureDebugString(resp));
       if (resp.has_error()) {
         return Status::RuntimeError("RPC error", resp.error().ShortDebugString());
       }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/master_replication-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_replication-itest.cc b/src/kudu/integration-tests/master_replication-itest.cc
index affd267..ce8f991 100644
--- a/src/kudu/integration-tests/master_replication-itest.cc
+++ b/src/kudu/integration-tests/master_replication-itest.cc
@@ -245,7 +245,7 @@ TEST_F(MasterReplicationTest, TestHeartbeatAcceptedByAnyMaster) {
 
     // All masters (including followers) should accept the heartbeat.
     ASSERT_OK(proxy.TSHeartbeat(req, &resp, &rpc));
-    SCOPED_TRACE(SecureDebugString(resp));
+    SCOPED_TRACE(pb_util::SecureDebugString(resp));
     ASSERT_FALSE(resp.has_error());
   }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/raft_consensus-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc
index 918ac0a..af5e391 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -91,6 +91,8 @@ using itest::TServerDetails;
 using itest::WaitUntilLeader;
 using itest::WriteSimpleTestRow;
 using master::TabletLocationsPB;
+using pb_util::SecureShortDebugString;
+using pb_util::SecureDebugString;
 using rpc::RpcController;
 using server::SetFlagRequestPB;
 using server::SetFlagResponsePB;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/registration-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/registration-test.cc b/src/kudu/integration-tests/registration-test.cc
index 42c73d4..a08ba39 100644
--- a/src/kudu/integration-tests/registration-test.cc
+++ b/src/kudu/integration-tests/registration-test.cc
@@ -71,6 +71,7 @@ using master::IsCreateTableDoneResponsePB;
 using master::MiniMaster;
 using master::TSDescriptor;
 using master::TabletLocationsPB;
+using kudu::pb_util::SecureShortDebugString;
 using tserver::MiniTabletServer;
 
 void CreateTableForTesting(MiniMaster* mini_master,

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/table_locations-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/table_locations-itest.cc b/src/kudu/integration-tests/table_locations-itest.cc
index 219f96c..9b972a7 100644
--- a/src/kudu/integration-tests/table_locations-itest.cc
+++ b/src/kudu/integration-tests/table_locations-itest.cc
@@ -34,6 +34,7 @@
 #include "kudu/util/pb_util.h"
 #include "kudu/util/test_util.h"
 
+using kudu::pb_util::SecureDebugString;
 using kudu::rpc::Messenger;
 using kudu::rpc::MessengerBuilder;
 using kudu::rpc::RpcController;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/integration-tests/ts_itest-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/ts_itest-base.h b/src/kudu/integration-tests/ts_itest-base.h
index 2a4e9f0..28fa0a3 100644
--- a/src/kudu/integration-tests/ts_itest-base.h
+++ b/src/kudu/integration-tests/ts_itest-base.h
@@ -150,7 +150,7 @@ class TabletServerIntegrationTestBase : public TabletServerTestBase {
 
           default:
             FAIL() << "Response had a fatal error: "
-                   << SecureShortDebugString(resp.error());
+                   << pb_util::SecureShortDebugString(resp.error());
             break;  // unreachable
         }
         SleepFor(MonoDelta::FromSeconds(1));
@@ -167,7 +167,7 @@ class TabletServerIntegrationTestBase : public TabletServerTestBase {
 
         if (tablet_replicas.count(location.tablet_id()) < FLAGS_num_replicas) {
           LOG(WARNING)<< "Couldn't find the leader and/or replicas. Location: "
-              << SecureShortDebugString(location);
+              << pb_util::SecureShortDebugString(location);
           replicas_missing = true;
           SleepFor(MonoDelta::FromSeconds(1));
           break;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/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 fcda144..9eedbc0 100644
--- a/src/kudu/integration-tests/ts_tablet_manager-itest.cc
+++ b/src/kudu/integration-tests/ts_tablet_manager-itest.cc
@@ -182,7 +182,7 @@ TEST_F(TsTabletManagerITest, TestReportNewLeaderOnLeaderChange) {
       // Ensure that our tablet reports are consistent.
       TabletReportPB& report = reports[0];
       ASSERT_EQ(1, report.updated_tablets_size())
-          << "Wrong report size:\n" << SecureDebugString(report);
+          << "Wrong report size:\n" << pb_util::SecureDebugString(report);
       const ReportedTabletPB& reported_tablet = report.updated_tablets(0);
       ASSERT_TRUE(reported_tablet.has_consensus_state());
 
@@ -190,10 +190,10 @@ TEST_F(TsTabletManagerITest, TestReportNewLeaderOnLeaderChange) {
       RaftPeerPB::Role role = GetConsensusRole(uuid, reported_tablet.consensus_state());
       if (replica == new_leader_idx) {
         ASSERT_EQ(RaftPeerPB::LEADER, role)
-            << "Tablet report: " << SecureShortDebugString(report);
+            << "Tablet report: " << pb_util::SecureShortDebugString(report);
       } else {
         ASSERT_EQ(RaftPeerPB::FOLLOWER, role)
-            << "Tablet report: " << SecureShortDebugString(report);
+            << "Tablet report: " << pb_util::SecureShortDebugString(report);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index e8612b5..c198f4e 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -231,6 +231,8 @@ using consensus::RaftConsensus;
 using consensus::RaftPeerPB;
 using consensus::StartTabletCopyRequestPB;
 using consensus::kMinimumTerm;
+using pb_util::SecureDebugString;
+using pb_util::SecureShortDebugString;
 using rpc::RpcContext;
 using security::Cert;
 using security::DataFormat;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/master-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-path-handlers.cc b/src/kudu/master/master-path-handlers.cc
index 26c7a5e..b8e665d 100644
--- a/src/kudu/master/master-path-handlers.cc
+++ b/src/kudu/master/master-path-handlers.cc
@@ -86,7 +86,7 @@ void MasterPathHandlers::HandleTabletServers(const Webserver::WebRequest& req,
     string row = Substitute("<tr><th>$0</th><td>$1</td><td><pre><code>$2</code></pre></td></tr>\n",
                             RegistrationToHtml(reg, desc->permanent_uuid()),
                             time_since_hb,
-                            EscapeForHtmlToString(SecureShortDebugString(reg)));
+                            EscapeForHtmlToString(pb_util::SecureShortDebugString(reg)));
 
     if (desc->PresumedDead()) {
       version_counts[reg.software_version()][1]++;
@@ -383,7 +383,7 @@ void MasterPathHandlers::HandleMasters(const Webserver::WebRequest& req,
         master.registration(),
         master.instance_id().permanent_uuid());
     string reg_str = EscapeForHtmlToString(
-        SecureShortDebugString(master.registration()));
+        pb_util::SecureShortDebugString(master.registration()));
     *output << Substitute(
         "  <tr><td>$0</td><td>$1</td><td><pre><code>$2</code></pre></td></tr>\n",
         uuid_text,

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/master-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index e1fcff7..edb22e7 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -46,6 +46,8 @@
 #include "kudu/util/test_util.h"
 #include "kudu/util/version_info.h"
 
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::rpc::Messenger;
 using kudu::rpc::MessengerBuilder;
 using kudu::rpc::RpcController;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/master_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master_service.cc b/src/kudu/master/master_service.cc
index 6476516..97677dc 100644
--- a/src/kudu/master/master_service.cc
+++ b/src/kudu/master/master_service.cc
@@ -56,6 +56,8 @@ DEFINE_bool(master_non_leader_masters_propagate_tsk, false,
             "tests scenarios only and should not be used elsewhere.");
 TAG_FLAG(master_non_leader_masters_propagate_tsk, hidden);
 
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::security::SignedTokenPB;
 using google::protobuf::Message;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/sys_catalog-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/sys_catalog-test.cc b/src/kudu/master/sys_catalog-test.cc
index 524f64a..a895a76 100644
--- a/src/kudu/master/sys_catalog-test.cc
+++ b/src/kudu/master/sys_catalog-test.cc
@@ -108,7 +108,7 @@ class TableLoader : public TableVisitor {
 };
 
 static bool PbEquals(const google::protobuf::Message& a, const google::protobuf::Message& b) {
-  return SecureDebugString(a) == SecureDebugString(b);
+  return pb_util::SecureDebugString(a) == pb_util::SecureDebugString(b);
 }
 
 template<class C>

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/sys_catalog.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/sys_catalog.cc b/src/kudu/master/sys_catalog.cc
index a9ef482..b5ee951 100644
--- a/src/kudu/master/sys_catalog.cc
+++ b/src/kudu/master/sys_catalog.cc
@@ -72,6 +72,7 @@ using kudu::consensus::ConsensusStatePB;
 using kudu::consensus::RaftConfigPB;
 using kudu::consensus::RaftPeerPB;
 using kudu::log::Log;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::tablet::LatchTransactionCompletionCallback;
 using kudu::tablet::Tablet;
 using kudu::tablet::TabletReplica;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/ts_descriptor.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_descriptor.cc b/src/kudu/master/ts_descriptor.cc
index 5f78ba6..99a2379 100644
--- a/src/kudu/master/ts_descriptor.cc
+++ b/src/kudu/master/ts_descriptor.cc
@@ -37,6 +37,8 @@ DEFINE_int32(tserver_unresponsive_timeout_ms, 60 * 1000,
              "selected when assigning replicas during table creation or re-replication.");
 TAG_FLAG(tserver_unresponsive_timeout_ms, advanced);
 
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/master/ts_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_manager.cc b/src/kudu/master/ts_manager.cc
index bfecd84..6c9713c 100644
--- a/src/kudu/master/ts_manager.cc
+++ b/src/kudu/master/ts_manager.cc
@@ -46,13 +46,14 @@ Status TSManager::LookupTS(const NodeInstancePB& instance,
   const shared_ptr<TSDescriptor>* found_ptr =
     FindOrNull(servers_by_id_, instance.permanent_uuid());
   if (!found_ptr) {
-    return Status::NotFound("unknown tablet server ID", SecureShortDebugString(instance));
+    return Status::NotFound("unknown tablet server ID",
+        pb_util::SecureShortDebugString(instance));
   }
   const shared_ptr<TSDescriptor>& found = *found_ptr;
 
   if (instance.instance_seqno() != found->latest_seqno()) {
     return Status::NotFound("mismatched instance sequence number",
-                            SecureShortDebugString(instance));
+                            pb_util::SecureShortDebugString(instance));
   }
 
   *ts_desc = found;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/rpc/exactly_once_rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/exactly_once_rpc-test.cc b/src/kudu/rpc/exactly_once_rpc-test.cc
index 66eabf6..6601ed0 100644
--- a/src/kudu/rpc/exactly_once_rpc-test.cc
+++ b/src/kudu/rpc/exactly_once_rpc-test.cc
@@ -24,6 +24,8 @@ DECLARE_int64(remember_clients_ttl_ms);
 DECLARE_int64(remember_responses_ttl_ms);
 DECLARE_int64(result_tracker_gc_interval_ms);
 
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using std::atomic_int;
 using std::shared_ptr;
 using std::unique_ptr;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/rpc/result_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/result_tracker.cc b/src/kudu/rpc/result_tracker.cc
index 9378451..c9c1aad 100644
--- a/src/kudu/rpc/result_tracker.cc
+++ b/src/kudu/rpc/result_tracker.cc
@@ -54,6 +54,8 @@ namespace rpc {
 
 using google::protobuf::Message;
 using kudu::MemTracker;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using rpc::InboundCall;
 using std::make_pair;
 using std::move;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/rpc/rpc-test-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-test-base.h b/src/kudu/rpc/rpc-test-base.h
index 968e0a0..f9cba05 100644
--- a/src/kudu/rpc/rpc-test-base.h
+++ b/src/kudu/rpc/rpc-test-base.h
@@ -206,7 +206,7 @@ class GenericCalculatorService : public ServiceIf {
       return;
     }
 
-    LOG(INFO) << "got call: " << SecureShortDebugString(req);
+    LOG(INFO) << "got call: " << pb_util::SecureShortDebugString(req);
     SleepFor(MonoDelta::FromMicroseconds(req.sleep_micros()));
     SleepResponsePB resp;
     incoming->RespondSuccess(resp);
@@ -222,7 +222,7 @@ class GenericCalculatorService : public ServiceIf {
       return;
     }
 
-    LOG(INFO) << "got call: " << SecureShortDebugString(req);
+    LOG(INFO) << "got call: " << pb_util::SecureShortDebugString(req);
     SleepFor(MonoDelta::FromMicroseconds(req.sleep_micros()));
 
     uint32 pattern = req.pattern();

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/rpc/rpc_context.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_context.cc b/src/kudu/rpc/rpc_context.cc
index 2ee88f5..092d5d8 100644
--- a/src/kudu/rpc/rpc_context.cc
+++ b/src/kudu/rpc/rpc_context.cc
@@ -33,6 +33,7 @@
 #include "kudu/util/trace.h"
 
 using google::protobuf::Message;
+using kudu::pb_util::SecureDebugString;
 using std::string;
 using std::unique_ptr;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/rpc/rpc_stub-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_stub-test.cc b/src/kudu/rpc/rpc_stub-test.cc
index ecbb261..3cf9e99 100644
--- a/src/kudu/rpc/rpc_stub-test.cc
+++ b/src/kudu/rpc/rpc_stub-test.cc
@@ -41,6 +41,7 @@
 DEFINE_bool(is_panic_test_child, false, "Used by TestRpcPanic");
 DECLARE_bool(socket_inject_short_recvs);
 
+using kudu::pb_util::SecureDebugString;
 using std::shared_ptr;
 using std::string;
 using std::unique_ptr;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/row_op.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/row_op.cc b/src/kudu/tablet/row_op.cc
index da97e6b..058f40f 100644
--- a/src/kudu/tablet/row_op.cc
+++ b/src/kudu/tablet/row_op.cc
@@ -20,6 +20,8 @@
 #include "kudu/tablet/tablet.pb.h"
 #include "kudu/util/pb_util.h"
 
+using kudu::pb_util::SecureDebugString;
+
 namespace kudu {
 namespace tablet {
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/tablet_bootstrap-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_bootstrap-test.cc b/src/kudu/tablet/tablet_bootstrap-test.cc
index 68d6388..5b51ccf 100644
--- a/src/kudu/tablet/tablet_bootstrap-test.cc
+++ b/src/kudu/tablet/tablet_bootstrap-test.cc
@@ -57,6 +57,7 @@ using consensus::make_scoped_refptr_replicate;
 using log::Log;
 using log::LogAnchorRegistry;
 using log::LogTestBase;
+using pb_util::SecureShortDebugString;
 using tserver::WriteRequestPB;
 
 class BootstrapTest : public LogTestBase {

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/tablet_bootstrap.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_bootstrap.cc b/src/kudu/tablet/tablet_bootstrap.cc
index 8c91378..f6b9d65 100644
--- a/src/kudu/tablet/tablet_bootstrap.cc
+++ b/src/kudu/tablet/tablet_bootstrap.cc
@@ -99,6 +99,8 @@ using log::LogOptions;
 using log::LogReader;
 using log::ReadableLogSegment;
 using rpc::ResultTracker;
+using pb_util::SecureDebugString;
+using pb_util::SecureShortDebugString;
 using std::map;
 using std::shared_ptr;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/tablet_metadata-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_metadata-test.cc b/src/kudu/tablet/tablet_metadata-test.cc
index 1935d35..5bc3e7d 100644
--- a/src/kudu/tablet/tablet_metadata-test.cc
+++ b/src/kudu/tablet/tablet_metadata-test.cc
@@ -87,11 +87,11 @@ TEST_F(TestTabletMetadata, TestLoadFromSuperBlock) {
   // Compare the 2 dumped superblock PBs.
   ASSERT_EQ(superblock_pb_1.SerializeAsString(),
             superblock_pb_2.SerializeAsString())
-    << SecureDebugString(superblock_pb_1)
-    << SecureDebugString(superblock_pb_2);
+    << pb_util::SecureDebugString(superblock_pb_1)
+    << pb_util::SecureDebugString(superblock_pb_2);
 
   LOG(INFO) << "Superblocks match:\n"
-            << SecureDebugString(superblock_pb_1);
+            << pb_util::SecureDebugString(superblock_pb_1);
 }
 
 TEST_F(TestTabletMetadata, TestOnDiskSize) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/tablet_metadata.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_metadata.cc b/src/kudu/tablet/tablet_metadata.cc
index af7d82d..463ae3d 100644
--- a/src/kudu/tablet/tablet_metadata.cc
+++ b/src/kudu/tablet/tablet_metadata.cc
@@ -51,19 +51,18 @@ TAG_FLAG(enable_tablet_orphaned_block_deletion, advanced);
 TAG_FLAG(enable_tablet_orphaned_block_deletion, hidden);
 TAG_FLAG(enable_tablet_orphaned_block_deletion, runtime);
 
+using base::subtle::Barrier_AtomicIncrement;
+using kudu::consensus::MinimumOpId;
+using kudu::consensus::OpId;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using std::memory_order_relaxed;
 using std::shared_ptr;
 using std::string;
 using std::vector;
-
-using base::subtle::Barrier_AtomicIncrement;
 using strings::Substitute;
 
 namespace kudu {
-
-using consensus::MinimumOpId;
-using consensus::OpId;
-
 namespace tablet {
 
 const int64 kNoDurableMemStore = -1;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/tablet_replica-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_replica-test.cc b/src/kudu/tablet/tablet_replica-test.cc
index ada9039..8335827 100644
--- a/src/kudu/tablet/tablet_replica-test.cc
+++ b/src/kudu/tablet/tablet_replica-test.cc
@@ -63,6 +63,8 @@ using consensus::RaftConfigPB;
 using consensus::RaftPeerPB;
 using log::Log;
 using log::LogOptions;
+using pb_util::SecureDebugString;
+using pb_util::SecureShortDebugString;
 using rpc::Messenger;
 using std::shared_ptr;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/tablet_replica.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_replica.cc b/src/kudu/tablet/tablet_replica.cc
index 0681ade..873f5f2 100644
--- a/src/kudu/tablet/tablet_replica.cc
+++ b/src/kudu/tablet/tablet_replica.cc
@@ -96,6 +96,7 @@ using consensus::ALTER_SCHEMA_OP;
 using consensus::WRITE_OP;
 using log::Log;
 using log::LogAnchorRegistry;
+using pb_util::SecureDebugString;
 using rpc::Messenger;
 using rpc::ResultTracker;
 using std::map;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/transactions/alter_schema_transaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/alter_schema_transaction.cc b/src/kudu/tablet/transactions/alter_schema_transaction.cc
index 8ab38d0..89ed599 100644
--- a/src/kudu/tablet/transactions/alter_schema_transaction.cc
+++ b/src/kudu/tablet/transactions/alter_schema_transaction.cc
@@ -37,6 +37,7 @@ using consensus::ReplicateMsg;
 using consensus::CommitMsg;
 using consensus::ALTER_SCHEMA_OP;
 using consensus::DriverType;
+using pb_util::SecureShortDebugString;
 using std::string;
 using std::unique_ptr;
 using strings::Substitute;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/transactions/transaction_driver.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/transaction_driver.cc b/src/kudu/tablet/transactions/transaction_driver.cc
index b90f911..d823b10 100644
--- a/src/kudu/tablet/transactions/transaction_driver.cc
+++ b/src/kudu/tablet/transactions/transaction_driver.cc
@@ -40,6 +40,7 @@ using consensus::DriverType;
 using consensus::RaftConsensus;
 using consensus::ReplicateMsg;
 using log::Log;
+using pb_util::SecureShortDebugString;
 using rpc::RequestIdPB;
 using rpc::ResultTracker;
 using std::shared_ptr;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tablet/transactions/write_transaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/write_transaction.cc b/src/kudu/tablet/transactions/write_transaction.cc
index f20717b..899ebf0 100644
--- a/src/kudu/tablet/transactions/write_transaction.cc
+++ b/src/kudu/tablet/transactions/write_transaction.cc
@@ -50,6 +50,7 @@ using consensus::ReplicateMsg;
 using consensus::CommitMsg;
 using consensus::DriverType;
 using consensus::WRITE_OP;
+using pb_util::SecureShortDebugString;
 using tserver::TabletServerErrorPB;
 using tserver::WriteRequestPB;
 using tserver::WriteResponsePB;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tools/kudu-admin-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/kudu-admin-test.cc b/src/kudu/tools/kudu-admin-test.cc
index cf67e5c..f141d4f 100644
--- a/src/kudu/tools/kudu-admin-test.cc
+++ b/src/kudu/tools/kudu-admin-test.cc
@@ -55,6 +55,7 @@ using itest::WaitUntilCommittedConfigNumVotersIs;
 using itest::WaitUntilCommittedOpIdIndexIs;
 using itest::WaitUntilTabletInState;
 using itest::WaitUntilTabletRunning;
+using pb_util::SecureDebugString;
 using std::deque;
 using std::string;
 using std::vector;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tools/kudu-tool-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/kudu-tool-test.cc b/src/kudu/tools/kudu-tool-test.cc
index 7d9f3e8..687d137 100644
--- a/src/kudu/tools/kudu-tool-test.cc
+++ b/src/kudu/tools/kudu-tool-test.cc
@@ -1009,7 +1009,7 @@ TEST_F(ToolTest, TestLocalReplicaDumpMeta) {
 
   TabletSuperBlockPB pb1;
   meta->ToSuperBlock(&pb1);
-  debug_str = SecureDebugString(pb1);
+  debug_str = pb_util::SecureDebugString(pb1);
   StripWhiteSpace(&debug_str);
   ASSERT_STR_CONTAINS(stdout, "Superblock:");
   ASSERT_STR_CONTAINS(stdout, debug_str);
@@ -1138,7 +1138,7 @@ TEST_F(ToolTest, TestLocalReplicaOps) {
 
     TabletSuperBlockPB pb1;
     meta->ToSuperBlock(&pb1);
-    debug_str = SecureDebugString(pb1);
+    debug_str = pb_util::SecureDebugString(pb1);
     StripWhiteSpace(&debug_str);
     ASSERT_STR_CONTAINS(stdout, "Superblock:");
     ASSERT_STR_CONTAINS(stdout, debug_str);

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tools/tool_action_common.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_common.cc b/src/kudu/tools/tool_action_common.cc
index b6ff2d2..511d0a6 100644
--- a/src/kudu/tools/tool_action_common.cc
+++ b/src/kudu/tools/tool_action_common.cc
@@ -96,6 +96,8 @@ using master::ListTabletServersResponsePB;
 using master::ListMastersRequestPB;
 using master::ListMastersResponsePB;
 using master::MasterServiceProxy;
+using pb_util::SecureDebugString;
+using pb_util::SecureShortDebugString;
 using rpc::Messenger;
 using rpc::MessengerBuilder;
 using rpc::RequestIdPB;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tools/tool_action_fs.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_fs.cc b/src/kudu/tools/tool_action_fs.cc
index a0c9dfe..529dd6b 100644
--- a/src/kudu/tools/tool_action_fs.cc
+++ b/src/kudu/tools/tool_action_fs.cc
@@ -201,8 +201,8 @@ Status DumpCFile(const RunnerContext& context) {
   RETURN_NOT_OK(CFileReader::Open(std::move(block), ReaderOptions(), &reader));
 
   if (FLAGS_print_meta) {
-    cout << "Header:\n" << SecureDebugString(reader->header()) << endl;
-    cout << "Footer:\n" << SecureDebugString(reader->footer()) << endl;
+    cout << "Header:\n" << pb_util::SecureDebugString(reader->header()) << endl;
+    cout << "Footer:\n" << pb_util::SecureDebugString(reader->footer()) << endl;
   }
 
   if (FLAGS_print_rows) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tools/tool_action_local_replica.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_local_replica.cc b/src/kudu/tools/tool_action_local_replica.cc
index 72d24d4..369f969 100644
--- a/src/kudu/tools/tool_action_local_replica.cc
+++ b/src/kudu/tools/tool_action_local_replica.cc
@@ -601,7 +601,7 @@ Status DumpTabletMeta(FsManager* fs_manager,
 
   tablet::TabletSuperBlockPB pb;
   RETURN_NOT_OK_PREPEND(meta->ToSuperBlock(&pb), "Could not get superblock");
-  cout << "Superblock:\n" << SecureDebugString(pb) << endl;
+  cout << "Superblock:\n" << pb_util::SecureDebugString(pb) << endl;
 
   return Status::OK();
 }
@@ -632,7 +632,7 @@ Status DumpCFileBlockInternal(FsManager* fs_manager,
   RETURN_NOT_OK(CFileReader::Open(std::move(block), ReaderOptions(), &reader));
 
   cout << Indent(indent) << "CFile Header: "
-       << SecureShortDebugString(reader->header()) << endl;
+       << pb_util::SecureShortDebugString(reader->header()) << endl;
   if (!FLAGS_dump_data) {
     return Status::OK();
   }
@@ -762,7 +762,7 @@ Status DumpRowSetInternal(FsManager* fs_manager,
   tablet::RowSetDataPB pb;
   rs_meta->ToProtobuf(&pb);
 
-  cout << Indent(indent) << "RowSet metadata: " << SecureDebugString(pb)
+  cout << Indent(indent) << "RowSet metadata: " << pb_util::SecureDebugString(pb)
        << endl << endl;
 
   RowSetMetadata::ColumnIdToBlockIdMap col_blocks =

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tools/tool_action_remote_replica.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_action_remote_replica.cc b/src/kudu/tools/tool_action_remote_replica.cc
index 0eee76e..5447120 100644
--- a/src/kudu/tools/tool_action_remote_replica.cc
+++ b/src/kudu/tools/tool_action_remote_replica.cc
@@ -118,7 +118,7 @@ class ReplicaDumper {
 
       if (resp.has_error()) {
         return Status::IOError("Failed to read: ",
-                               SecureShortDebugString(resp.error()));
+                               pb_util::SecureShortDebugString(resp.error()));
       }
 
       // The first response has a scanner ID. We use this for all subsequent
@@ -232,7 +232,7 @@ Status DeleteReplica(const RunnerContext& context) {
                         "DeleteTablet() failed");
   if (resp.has_error()) {
     return Status::IOError("Failed to delete tablet: ",
-                           SecureShortDebugString(resp.error()));
+                           pb_util::SecureShortDebugString(resp.error()));
   }
   return Status::OK();
 }
@@ -329,7 +329,7 @@ Status CopyReplica(const RunnerContext& context) {
     req.set_caller_term(std::numeric_limits<int64_t>::max());
   }
 
-  LOG(INFO) << "Sending copy replica request:\n" << SecureDebugString(req);
+  LOG(INFO) << "Sending copy replica request:\n" << pb_util::SecureDebugString(req);
   LOG(WARNING) << "NOTE: this copy may happen asynchronously "
                << "and may timeout if the tablet size is large. Watch the logs on "
                << "the target tablet server for indication of progress.";

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/heartbeater.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/heartbeater.cc b/src/kudu/tserver/heartbeater.cc
index 84232e0..e466c71 100644
--- a/src/kudu/tserver/heartbeater.cc
+++ b/src/kudu/tserver/heartbeater.cc
@@ -62,6 +62,7 @@ TAG_FLAG(heartbeat_max_failures_before_backoff, advanced);
 
 using kudu::master::MasterServiceProxy;
 using kudu::master::TabletReportPB;
+using kudu::pb_util::SecureDebugString;
 using kudu::rpc::RpcController;
 using std::shared_ptr;
 using std::string;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_copy_client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_client.cc b/src/kudu/tserver/tablet_copy_client.cc
index 029a426..22898e9 100644
--- a/src/kudu/tserver/tablet_copy_client.cc
+++ b/src/kudu/tserver/tablet_copy_client.cc
@@ -189,7 +189,7 @@ Status TabletCopyClient::Start(const HostPort& copy_source_addr,
   if (resp.superblock().tablet_data_state() != tablet::TABLET_DATA_READY) {
     Status s = Status::IllegalState("Remote peer (" + copy_peer_uuid + ")" +
                                     " is currently copying itself!",
-                                    SecureShortDebugString(resp.superblock()));
+                                    pb_util::SecureShortDebugString(resp.superblock()));
     LOG_WITH_PREFIX(WARNING) << s.ToString();
     return s;
   }
@@ -594,7 +594,7 @@ Status TabletCopyClient::DownloadFile(const DataIdPB& data_id,
     // Sanity-check for corruption.
     RETURN_NOT_OK_PREPEND(VerifyData(offset, resp.chunk()),
                           Substitute("Error validating data item $0",
-                                     SecureShortDebugString(data_id)));
+                                     pb_util::SecureShortDebugString(data_id)));
 
     // Write the data.
     RETURN_NOT_OK(appendable->Append(resp.chunk().data()));

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_copy_service-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_service-test.cc b/src/kudu/tserver/tablet_copy_service-test.cc
index ef3cf64..6d33731 100644
--- a/src/kudu/tserver/tablet_copy_service-test.cc
+++ b/src/kudu/tserver/tablet_copy_service-test.cc
@@ -52,6 +52,8 @@ using consensus::MaximumOpId;
 using consensus::MinimumOpId;
 using consensus::OpIdEquals;
 using log::ReadableLogSegment;
+using pb_util::SecureDebugString;
+using pb_util::SecureShortDebugString;
 using rpc::ErrorStatusPB;
 using rpc::RpcController;
 using std::thread;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_copy_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_service.cc b/src/kudu/tserver/tablet_copy_service.cc
index ed4feca..546ce0d 100644
--- a/src/kudu/tserver/tablet_copy_service.cc
+++ b/src/kudu/tserver/tablet_copy_service.cc
@@ -76,6 +76,7 @@ namespace kudu {
 
 using crc::Crc32c;
 using server::ServerBase;
+using pb_util::SecureShortDebugString;
 using tablet::TabletReplica;
 
 namespace tserver {

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_copy_source_session-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_source_session-test.cc b/src/kudu/tserver/tablet_copy_source_session-test.cc
index 1655a2b..6204638 100644
--- a/src/kudu/tserver/tablet_copy_source_session-test.cc
+++ b/src/kudu/tserver/tablet_copy_source_session-test.cc
@@ -180,8 +180,10 @@ class TabletCopyTest : public KuduTabletTest {
           new tablet::LatchTransactionCompletionCallback<WriteResponsePB>(&latch, &resp)));
       ASSERT_OK(tablet_replica_->SubmitWrite(std::move(state)));
       latch.Wait();
-      ASSERT_FALSE(resp.has_error()) << "Request failed: " << SecureShortDebugString(resp.error());
-      ASSERT_EQ(0, resp.per_row_errors_size()) << "Insert error: " << SecureShortDebugString(resp);
+      ASSERT_FALSE(resp.has_error())
+          << "Request failed: " << pb_util::SecureShortDebugString(resp.error());
+      ASSERT_EQ(0, resp.per_row_errors_size())
+          << "Insert error: " << pb_util::SecureShortDebugString(resp);
     }
     ASSERT_OK(tablet()->Flush());
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_copy_source_session.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_source_session.cc b/src/kudu/tserver/tablet_copy_source_session.cc
index ba18e54..de3ecbf 100644
--- a/src/kudu/tserver/tablet_copy_source_session.cc
+++ b/src/kudu/tserver/tablet_copy_source_session.cc
@@ -94,7 +94,7 @@ Status TabletCopySourceSession::Init() {
   vector<BlockIdPB> data_blocks =
       TabletMetadata::CollectBlockIdPBs(tablet_superblock_);
   for (const BlockIdPB& block_id : data_blocks) {
-    VLOG(1) << "Opening block " << SecureDebugString(block_id);
+    VLOG(1) << "Opening block " << pb_util::SecureDebugString(block_id);
     RETURN_NOT_OK(OpenBlockUnlocked(BlockId::FromPB(block_id)));
   }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_server-test-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test-base.h b/src/kudu/tserver/tablet_server-test-base.h
index 4d37a15..bd77601 100644
--- a/src/kudu/tserver/tablet_server-test-base.h
+++ b/src/kudu/tserver/tablet_server-test-base.h
@@ -147,8 +147,8 @@ class TabletServerTestBase : public KuduTest {
                    req.mutable_row_operations());
     ASSERT_OK(proxy_->Write(req, &resp, &controller));
 
-    SCOPED_TRACE(SecureDebugString(resp));
-    ASSERT_FALSE(resp.has_error())<< SecureShortDebugString(resp);
+    SCOPED_TRACE(pb_util::SecureDebugString(resp));
+    ASSERT_FALSE(resp.has_error()) << pb_util::SecureShortDebugString(resp);
     ASSERT_EQ(0, resp.per_row_errors_size());
     if (ts) {
       ts->AddValue(1);
@@ -230,7 +230,7 @@ class TabletServerTestBase : public KuduTest {
       if (resp.has_error() || resp.per_row_errors_size() > 0) {
         LOG(FATAL) << "Failed to insert batch "
                    << first_row_in_batch << "-" << last_row_in_batch
-                   << ": " << SecureDebugString(resp);
+                   << ": " << pb_util::SecureDebugString(resp);
       }
 
       inserted_since_last_report += count / num_batches;
@@ -266,10 +266,10 @@ class TabletServerTestBase : public KuduTest {
       AddTestKeyToPB(RowOperationsPB::DELETE, schema_, rowid, ops);
     }
 
-    SCOPED_TRACE(SecureDebugString(req));
+    SCOPED_TRACE(pb_util::SecureDebugString(req));
     ASSERT_OK(proxy_->Write(req, &resp, &controller));
-    SCOPED_TRACE(SecureDebugString(resp));
-    ASSERT_FALSE(resp.has_error()) << SecureShortDebugString(resp);
+    SCOPED_TRACE(pb_util::SecureDebugString(resp));
+    ASSERT_FALSE(resp.has_error()) << pb_util::SecureShortDebugString(resp);
   }
 
   void BuildTestRow(int index, KuduPartialRow* row) {
@@ -301,9 +301,9 @@ class TabletServerTestBase : public KuduTest {
       rpc.Reset();
       req.set_batch_size_bytes(10000);
       req.set_call_seq_id(call_seq_id);
-      SCOPED_TRACE(SecureDebugString(req));
+      SCOPED_TRACE(pb_util::SecureDebugString(req));
       ASSERT_OK(DCHECK_NOTNULL(proxy)->Scan(req, &resp, &rpc));
-      SCOPED_TRACE(SecureDebugString(resp));
+      SCOPED_TRACE(pb_util::SecureDebugString(resp));
       ASSERT_FALSE(resp.has_error());
 
       StringifyRowsFromResponse(projection, rpc, resp, results);
@@ -419,9 +419,9 @@ class TabletServerTestBase : public KuduTest {
 
     // Send the call
     {
-      SCOPED_TRACE(SecureDebugString(req));
+      SCOPED_TRACE(pb_util::SecureDebugString(req));
       ASSERT_OK(proxy_->Scan(req, &resp, &rpc));
-      SCOPED_TRACE(SecureDebugString(resp));
+      SCOPED_TRACE(pb_util::SecureDebugString(resp));
       ASSERT_TRUE(resp.has_error());
       ASSERT_EQ(expected_code, resp.error().code());
       ASSERT_STR_CONTAINS(resp.error().status().message(), expected_message);
@@ -443,9 +443,9 @@ class TabletServerTestBase : public KuduTest {
 
     // Send the call
     {
-      SCOPED_TRACE(SecureDebugString(req));
+      SCOPED_TRACE(pb_util::SecureDebugString(req));
       ASSERT_OK(proxy_->Scan(req, resp, &rpc));
-      SCOPED_TRACE(SecureDebugString(*resp));
+      SCOPED_TRACE(pb_util::SecureDebugString(*resp));
       ASSERT_FALSE(resp->has_error());
       ASSERT_TRUE(resp->has_more_results());
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_server-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test.cc b/src/kudu/tserver/tablet_server-test.cc
index f4c3e6b..63e4f8a 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -43,6 +43,8 @@ using kudu::rpc::MessengerBuilder;
 using kudu::rpc::RpcController;
 using kudu::clock::Clock;
 using kudu::clock::HybridClock;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::tablet::Tablet;
 using kudu::tablet::TabletReplica;
 using kudu::tablet::TabletSuperBlockPB;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index 21a99cc..77e4f95 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -121,6 +121,8 @@ using kudu::consensus::StartTabletCopyRequestPB;
 using kudu::consensus::StartTabletCopyResponsePB;
 using kudu::consensus::VoteRequestPB;
 using kudu::consensus::VoteResponsePB;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::rpc::RpcContext;
 using kudu::rpc::RpcSidecar;
 using kudu::server::ServerBase;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/ts_tablet_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager-test.cc b/src/kudu/tserver/ts_tablet_manager-test.cc
index 6d3f110..5b4934e4 100644
--- a/src/kudu/tserver/ts_tablet_manager-test.cc
+++ b/src/kudu/tserver/ts_tablet_manager-test.cc
@@ -49,6 +49,7 @@ using consensus::kInvalidOpIdIndex;
 using consensus::RaftConfigPB;
 using master::ReportedTabletPB;
 using master::TabletReportPB;
+using pb_util::SecureShortDebugString;
 using tablet::TabletReplica;
 
 static const char* const kTabletId = "my-tablet-id";

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/tserver/tserver-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tserver-path-handlers.cc b/src/kudu/tserver/tserver-path-handlers.cc
index 329d640..073d209 100644
--- a/src/kudu/tserver/tserver-path-handlers.cc
+++ b/src/kudu/tserver/tserver-path-handlers.cc
@@ -51,6 +51,8 @@ using kudu::consensus::TransactionStatusPB;
 using kudu::MaintenanceManagerStatusPB;
 using kudu::MaintenanceManagerStatusPB_MaintenanceOpPB;
 using kudu::MaintenanceManagerStatusPB_OpInstancePB;
+using kudu::pb_util::SecureDebugString;
+using kudu::pb_util::SecureShortDebugString;
 using kudu::tablet::Tablet;
 using kudu::tablet::TabletReplica;
 using kudu::tablet::TabletStatePB;

http://git-wip-us.apache.org/repos/asf/kudu/blob/dd68c625/src/kudu/util/pb_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/pb_util.h b/src/kudu/util/pb_util.h
index fc2a0a5..d74784b 100644
--- a/src/kudu/util/pb_util.h
+++ b/src/kudu/util/pb_util.h
@@ -500,11 +500,5 @@ class PbTracer : public debug::ConvertableToTraceFormat {
 
 } // namespace pb_util
 
-// TODO(todd) Replacing all Message::ToString call sites for KUDU-1812
-// is much easier if these are available in the 'kudu' namespace. We should
-// consider removing these imports and move them to all call sites.
-using pb_util::SecureDebugString; // NOLINT
-using pb_util::SecureShortDebugString; // NOLINT
-
 } // namespace kudu
 #endif


Mime
View raw message