kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [3/3] kudu git commit: [util/monotime] added handy operators for MonoTime
Date Wed, 17 Aug 2016 19:12:31 GMT
[util/monotime] added handy operators for MonoTime

Change-Id: Ia8a336bc79461adebfb2d5c136d71f90efcd36db
Reviewed-on: http://gerrit.cloudera.org:8080/3999
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <adar@cloudera.com>


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

Branch: refs/heads/master
Commit: 34b7f1eb596bd7112f3c3ca53721a2554ca3fe6b
Parents: b5aa19d
Author: Alexey Serbin <aserbin@cloudera.com>
Authored: Mon Aug 15 19:52:47 2016 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Wed Aug 17 19:12:00 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/batcher.cc                      |   4 +-
 src/kudu/client/client-internal.cc              |  20 +-
 src/kudu/client/client-unittest.cc              |   3 +-
 src/kudu/client/client.cc                       |  40 ++--
 src/kudu/client/meta_cache.cc                   |  15 +-
 src/kudu/client/scan_token-internal.cc          |   3 +-
 src/kudu/client/scanner-internal.cc             |  14 +-
 src/kudu/consensus/consensus_peers.cc           |   8 +-
 src/kudu/consensus/consensus_queue.cc           |   2 +-
 src/kudu/consensus/log_anchor_registry.cc       |   2 +-
 src/kudu/consensus/raft_consensus.cc            |  16 +-
 .../consensus/raft_consensus_quorum-test.cc     |   8 +-
 src/kudu/fs/log_block_manager.cc                |   8 +-
 src/kudu/fs/log_block_manager.h                 |   2 +-
 .../integration-tests/client-stress-test.cc     |   5 +-
 .../integration-tests/cluster_itest_util.cc     |  72 +++---
 src/kudu/integration-tests/cluster_verifier.cc  |  10 +-
 .../integration-tests/create-table-itest.cc     |   5 +-
 src/kudu/integration-tests/delete_table-test.cc |   5 +-
 .../integration-tests/external_mini_cluster.cc  |  18 +-
 .../external_mini_cluster_fs_inspector.cc       |  32 ++-
 .../integration-tests/linked_list-test-util.h   |  16 +-
 .../integration-tests/master_failover-itest.cc  |  12 +-
 .../integration-tests/raft_consensus-itest.cc   |  17 +-
 src/kudu/integration-tests/test_workload.cc     |   5 +-
 .../integration-tests/write_throttling-itest.cc |   4 +-
 src/kudu/master/catalog_manager.cc              |  16 +-
 src/kudu/master/master-test.cc                  |   5 +-
 src/kudu/master/master.cc                       |   2 +-
 src/kudu/master/master_rpc.cc                   |   6 +-
 src/kudu/master/ts_descriptor.cc                |   4 +-
 src/kudu/rpc/connection.cc                      |   4 +-
 src/kudu/rpc/inbound_call.cc                    |  12 +-
 src/kudu/rpc/inbound_call.h                     |   2 +-
 src/kudu/rpc/negotiation.cc                     |   2 +-
 src/kudu/rpc/outbound_call.cc                   |   2 +-
 src/kudu/rpc/reactor-test.cc                    |   2 +-
 src/kudu/rpc/reactor.cc                         |   8 +-
 src/kudu/rpc/rpc-test-base.h                    |   2 +-
 src/kudu/rpc/rpc-test.cc                        |   3 +-
 src/kudu/rpc/rpc.cc                             |   3 +-
 src/kudu/rpc/rpc_controller.cc                  |   2 +-
 src/kudu/rpc/rpc_stub-test.cc                   |   3 +-
 src/kudu/rpc/sasl_rpc-test.cc                   |   6 +-
 src/kudu/rpc/service_queue.h                    |   4 +-
 src/kudu/server/hybrid_clock-test.cc            |   7 +-
 src/kudu/server/hybrid_clock.cc                 |   3 +-
 src/kudu/server/pprof-path-handlers.cc          |   5 +-
 src/kudu/server/server_base.cc                  |   8 +-
 src/kudu/server/webui_util.cc                   |   7 +-
 src/kudu/tablet/compaction-test.cc              |   5 +-
 src/kudu/tablet/mvcc-test.cc                    |   3 +-
 src/kudu/tablet/tablet_mm_ops-test.cc           |   2 +-
 src/kudu/tablet/tablet_peer.cc                  |   6 +-
 .../tablet/transactions/transaction_driver.cc   |   4 +-
 .../tablet/transactions/transaction_tracker.cc  |   4 +-
 .../tablet/transactions/write_transaction.cc    |   4 +-
 src/kudu/tools/ksck.cc                          |   8 +-
 src/kudu/tools/ksck_remote-test.cc              |  17 +-
 src/kudu/tserver/heartbeater.cc                 |   6 +-
 src/kudu/tserver/scanner_metrics.cc             |   2 +-
 src/kudu/tserver/scanners.cc                    |   2 +-
 src/kudu/tserver/scanners.h                     |   2 +-
 src/kudu/tserver/tablet_server-stress-test.cc   |   2 +-
 src/kudu/tserver/tablet_server-test.cc          |   4 +-
 src/kudu/tserver/tablet_service.cc              |  17 +-
 src/kudu/tserver/ts_tablet_manager-test.cc      |   9 +-
 src/kudu/tserver/ts_tablet_manager.cc           |   2 +-
 src/kudu/tserver/tserver-path-handlers.cc       |   2 +-
 src/kudu/util/countdown_latch.h                 |   3 +-
 .../util/debug/trace_event_synthetic_delay.cc   |   6 +-
 src/kudu/util/failure_detector.cc               |   2 +-
 src/kudu/util/metrics.cc                        |   9 +-
 src/kudu/util/monotime-test.cc                  | 231 ++++++++++++++++++-
 src/kudu/util/monotime.cc                       |  74 ++++++
 src/kudu/util/monotime.h                        | 168 ++++++++++++++
 src/kudu/util/net/socket.cc                     |   4 +-
 src/kudu/util/striped64-test.cc                 |   4 +-
 src/kudu/util/striped64.cc                      |   2 +-
 src/kudu/util/test_util.cc                      |   5 +-
 src/kudu/util/threadpool.cc                     |   5 +-
 src/kudu/util/throttler-test.cc                 |  12 +-
 src/kudu/util/throttler.cc                      |   4 +-
 src/kudu/util/trace-test.cc                     |  12 +-
 84 files changed, 736 insertions(+), 370 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/client/batcher.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/batcher.cc b/src/kudu/client/batcher.cc
index 26a5944..0346119 100644
--- a/src/kudu/client/batcher.cc
+++ b/src/kudu/client/batcher.cc
@@ -488,9 +488,7 @@ MonoTime Batcher::ComputeDeadlineUnlocked() const {
                                 << GetStackTrace();
     timeout = MonoDelta::FromSeconds(60);
   }
-  MonoTime ret = MonoTime::Now();
-  ret.AddDelta(timeout);
-  return ret;
+  return MonoTime::Now() + timeout;
 }
 
 void Batcher::FlushAsync(KuduStatusCallback* cb) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/client/client-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-internal.cc b/src/kudu/client/client-internal.cc
index 8f4ab6f..c126ca5 100644
--- a/src/kudu/client/client-internal.cc
+++ b/src/kudu/client/client-internal.cc
@@ -90,27 +90,26 @@ Status RetryFunc(const MonoTime& deadline,
                  const boost::function<Status(const MonoTime&, bool*)>& func) {
   DCHECK(deadline.Initialized());
 
-  MonoTime now = MonoTime::Now();
-  if (deadline.ComesBefore(now)) {
+  if (deadline < MonoTime::Now()) {
     return Status::TimedOut(timeout_msg);
   }
 
   double wait_secs = 0.001;
   const double kMaxSleepSecs = 2;
   while (1) {
-    MonoTime func_stime = now;
+    MonoTime func_stime = MonoTime::Now();
     bool retry = true;
     Status s = func(deadline, &retry);
     if (!retry) {
       return s;
     }
-    now = MonoTime::Now();
-    MonoDelta func_time = now.GetDeltaSince(func_stime);
+    MonoTime now = MonoTime::Now();
+    MonoDelta func_time = now - func_stime;
 
     VLOG(1) << retry_msg << " status=" << s.ToString();
     double secs_remaining = std::numeric_limits<double>::max();
     if (deadline.Initialized()) {
-      secs_remaining = deadline.GetDeltaSince(now).ToSeconds();
+      secs_remaining = (deadline - now).ToSeconds();
     }
     wait_secs = std::min(wait_secs * 1.25, kMaxSleepSecs);
 
@@ -124,8 +123,6 @@ Status RetryFunc(const MonoTime& deadline,
     VLOG(1) << "Waiting for " << HumanReadableElapsedTime::ToShortString(wait_secs)
             << " before retrying...";
     SleepFor(MonoDelta::FromSeconds(wait_secs));
-    now = MonoTime::Now();
-
   }
 
   return Status::TimedOut(timeout_msg);
@@ -155,7 +152,7 @@ Status KuduClient::Data::SyncLeaderMasterRpc(
 
     // Have we already exceeded our deadline?
     MonoTime now = MonoTime::Now();
-    if (deadline.ComesBefore(now)) {
+    if (deadline < now) {
       return Status::TimedOut(Substitute("$0 timed out after deadline expired",
                                          func_name));
     }
@@ -165,8 +162,7 @@ Status KuduClient::Data::SyncLeaderMasterRpc(
     // leader master and retry before the overall deadline expires.
     //
     // TODO: KUDU-683 tracks cleanup for this.
-    MonoTime rpc_deadline = now;
-    rpc_deadline.AddDelta(client->default_rpc_timeout());
+    MonoTime rpc_deadline = now + client->default_rpc_timeout();
     rpc.set_deadline(MonoTime::Earliest(rpc_deadline, deadline));
 
     for (uint32_t required_feature_flag : required_feature_flags) {
@@ -199,7 +195,7 @@ Status KuduClient::Data::SyncLeaderMasterRpc(
     }
 
     if (s.IsTimedOut()) {
-      if (MonoTime::Now().ComesBefore(deadline)) {
+      if (MonoTime::Now() < deadline) {
         LOG(WARNING) << "Unable to send the request (" << req.ShortDebugString()
                      << ") to leader Master (" << leader_master_hostport().ToString()
                      << "): " << s.ToString();

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/client/client-unittest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-unittest.cc b/src/kudu/client/client-unittest.cc
index 8a06846..03e87b8 100644
--- a/src/kudu/client/client-unittest.cc
+++ b/src/kudu/client/client-unittest.cc
@@ -160,8 +160,7 @@ Status TestFunc(const MonoTime& deadline, bool* retry, int* counter) {
 } // anonymous namespace
 
 TEST(ClientUnitTest, TestRetryFunc) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromMilliseconds(100));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromMilliseconds(100);
   int counter = 0;
   Status s = RetryFunc(deadline, "retrying test func", "timed out",
                        boost::bind(TestFunc, _1, _2, &counter));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/client/client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.cc b/src/kudu/client/client.cc
index b1f19de..11cdee1 100644
--- a/src/kudu/client/client.cc
+++ b/src/kudu/client/client.cc
@@ -229,8 +229,7 @@ Status KuduClientBuilder::Build(shared_ptr<KuduClient>* client) {
 
   // Let's allow for plenty of time for discovering the master the first
   // time around.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(c->default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + c->default_admin_operation_timeout();
   RETURN_NOT_OK_PREPEND(c->data_->SetMasterServerProxy(c.get(), deadline),
                         "Could not locate the leader master");
 
@@ -263,14 +262,12 @@ KuduTableCreator* KuduClient::NewTableCreator() {
 
 Status KuduClient::IsCreateTableInProgress(const string& table_name,
                                            bool *create_in_progress) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + default_admin_operation_timeout();
   return data_->IsCreateTableInProgress(this, table_name, deadline, create_in_progress);
 }
 
 Status KuduClient::DeleteTable(const string& table_name) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + default_admin_operation_timeout();
   return data_->DeleteTable(this, table_name, deadline);
 }
 
@@ -280,15 +277,13 @@ KuduTableAlterer* KuduClient::NewTableAlterer(const string& name) {
 
 Status KuduClient::IsAlterTableInProgress(const string& table_name,
                                           bool *alter_in_progress) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + default_admin_operation_timeout();
   return data_->IsAlterTableInProgress(this, table_name, deadline, alter_in_progress);
 }
 
 Status KuduClient::GetTableSchema(const string& table_name,
                                   KuduSchema* schema) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + default_admin_operation_timeout();
   string table_id_ignored;
   PartitionSchema partition_schema;
   return data_->GetTableSchema(this,
@@ -303,8 +298,7 @@ Status KuduClient::ListTabletServers(vector<KuduTabletServer*>* tablet_servers)
   ListTabletServersRequestPB req;
   ListTabletServersResponsePB resp;
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + default_admin_operation_timeout();
   Status s =
       data_->SyncLeaderMasterRpc<ListTabletServersRequestPB, ListTabletServersResponsePB>(
           deadline,
@@ -336,8 +330,7 @@ Status KuduClient::ListTables(vector<string>* tables,
   if (!filter.empty()) {
     req.set_name_filter(filter);
   }
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + default_admin_operation_timeout();
   Status s =
       data_->SyncLeaderMasterRpc<ListTablesRequestPB, ListTablesResponsePB>(
           deadline,
@@ -375,8 +368,7 @@ Status KuduClient::OpenTable(const string& table_name,
   KuduSchema schema;
   string table_id;
   PartitionSchema partition_schema;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + default_admin_operation_timeout();
   RETURN_NOT_OK(data_->GetTableSchema(this,
                                       table_name,
                                       deadline,
@@ -565,9 +557,9 @@ Status KuduTableCreator::Create() {
 
   MonoTime deadline = MonoTime::Now();
   if (data_->timeout_.Initialized()) {
-    deadline.AddDelta(data_->timeout_);
+    deadline += data_->timeout_;
   } else {
-    deadline.AddDelta(data_->client_->default_admin_operation_timeout());
+    deadline += data_->client_->default_admin_operation_timeout();
   }
 
   RETURN_NOT_OK_PREPEND(data_->client_->data_->CreateTable(data_->client_,
@@ -938,8 +930,7 @@ Status KuduTableAlterer::Alter() {
   MonoDelta timeout = data_->timeout_.Initialized() ?
     data_->timeout_ :
     data_->client_->default_admin_operation_timeout();
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   RETURN_NOT_OK(data_->client_->data_->AlterTable(data_->client_, req, deadline,
                                                   data_->has_alter_partitioning_steps));
 
@@ -1158,8 +1149,7 @@ Status KuduScanner::Open() {
 
   VLOG(1) << "Beginning scan " << ToString();
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(data_->configuration().timeout());
+  MonoTime deadline = MonoTime::Now() + data_->configuration().timeout();
   set<string> blacklist;
 
   RETURN_NOT_OK(data_->OpenNextTablet(deadline, &blacklist));
@@ -1238,8 +1228,7 @@ Status KuduScanner::NextBatch(KuduScanBatch* batch) {
     // More data is available in this tablet.
     VLOG(1) << "Continuing scan " << ToString();
 
-    MonoTime batch_deadline = MonoTime::Now();
-    batch_deadline.AddDelta(data_->configuration().timeout());
+    MonoTime batch_deadline = MonoTime::Now() + data_->configuration().timeout();
     data_->PrepareRequest(KuduScanner::Data::CONTINUE);
 
     while (true) {
@@ -1286,8 +1275,7 @@ Status KuduScanner::NextBatch(KuduScanBatch* batch) {
     // server closed it for us.
     VLOG(1) << "Scanning next tablet " << ToString();
     data_->last_primary_key_.clear();
-    MonoTime deadline = MonoTime::Now();
-    deadline.AddDelta(data_->configuration().timeout());
+    MonoTime deadline = MonoTime::Now() + data_->configuration().timeout();
     set<string> blacklist;
 
     RETURN_NOT_OK(data_->OpenNextTablet(deadline, &blacklist));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/client/meta_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/meta_cache.cc b/src/kudu/client/meta_cache.cc
index 4d47901..bc11ccf 100644
--- a/src/kudu/client/meta_cache.cc
+++ b/src/kudu/client/meta_cache.cc
@@ -296,7 +296,7 @@ bool MetaCacheEntry::Contains(const string& partition_key) const {
 
 bool MetaCacheEntry::stale() const {
   DCHECK(Initialized());
-  return expiration_time_.ComesBefore(MonoTime::Now()) ||
+  return expiration_time_ < MonoTime::Now() ||
          (!is_non_covered_range() && tablet_->stale());
 }
 
@@ -311,7 +311,7 @@ string MetaCacheEntry::DebugString(const KuduTable* table) const {
   string upper_bound_string = upper_bound.empty() ? "<end>" :
     table->partition_schema().PartitionKeyDebugString(upper_bound, *table->schema().schema_);
 
-  MonoDelta ttl = expiration_time_.GetDeltaSince(MonoTime::Now());
+  MonoDelta ttl = expiration_time_ - MonoTime::Now();
 
   if (is_non_covered_range()) {
     return strings::Substitute(
@@ -646,12 +646,11 @@ void LookupRpc::SendRpc() {
 
   // See KuduClient::Data::SyncLeaderMasterRpc().
   MonoTime now = MonoTime::Now();
-  if (retrier().deadline().ComesBefore(now)) {
+  if (retrier().deadline() < now) {
     SendRpcCb(Status::TimedOut("timed out after deadline expired"));
     return;
   }
-  MonoTime rpc_deadline = now;
-  rpc_deadline.AddDelta(meta_cache_->client_->default_rpc_timeout());
+  MonoTime rpc_deadline = now + meta_cache_->client_->default_rpc_timeout();
   mutable_retrier()->mutable_controller()->set_deadline(
       MonoTime::Earliest(rpc_deadline, retrier().deadline()));
 
@@ -718,7 +717,7 @@ void LookupRpc::SendRpcCb(const Status& status) {
 
   // Check for more generic errors (TimedOut can come from multiple places).
   if (new_status.IsTimedOut()) {
-    if (MonoTime::Now().ComesBefore(retrier().deadline())) {
+    if (MonoTime::Now() < retrier().deadline()) {
       if (meta_cache_->client_->IsMultiMaster()) {
         LOG(WARNING) << "Leader Master timed out, re-trying...";
         ResetMasterLeaderAndRetry();
@@ -770,8 +769,8 @@ Status MetaCache::ProcessLookupResponse(const LookupRpc& rpc,
   VLOG(2) << "Processing master response for " << rpc.ToString()
           << ". Response: " << rpc.resp().ShortDebugString();
 
-  MonoTime expiration_time = MonoTime::Now();
-  expiration_time.AddDelta(MonoDelta::FromMilliseconds(rpc.resp().ttl_millis()));
+  MonoTime expiration_time = MonoTime::Now() +
+      MonoDelta::FromMilliseconds(rpc.resp().ttl_millis());
 
   std::lock_guard<rw_spinlock> l(lock_);
   TabletMap& tablets_by_key = LookupOrInsert(&tablets_by_table_and_key_,

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/client/scan_token-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scan_token-internal.cc b/src/kudu/client/scan_token-internal.cc
index 43a56da..c724daf 100644
--- a/src/kudu/client/scan_token-internal.cc
+++ b/src/kudu/client/scan_token-internal.cc
@@ -214,8 +214,7 @@ Status KuduScanTokenBuilder::Data::Build(vector<KuduScanToken*>* tokens) {
   pb.set_cache_blocks(configuration_.spec().cache_blocks());
   pb.set_fault_tolerant(configuration_.is_fault_tolerant());
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(client->default_admin_operation_timeout());
+  MonoTime deadline = MonoTime::Now() + client->default_admin_operation_timeout();
 
   PartitionPruner pruner;
   pruner.Init(*table->schema().schema_, table->partition_schema(), configuration_.spec());

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/client/scanner-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scanner-internal.cc b/src/kudu/client/scanner-internal.cc
index 6b0544a..1c9252d 100644
--- a/src/kudu/client/scanner-internal.cc
+++ b/src/kudu/client/scanner-internal.cc
@@ -124,9 +124,8 @@ Status KuduScanner::Data::HandleError(const ScanRpcStatus& err,
   if (backoff) {
     MonoDelta sleep =
         KuduClient::Data::ComputeExponentialBackoff(scan_attempts_);
-    MonoTime now = MonoTime::Now();
-    now.AddDelta(sleep);
-    if (deadline.ComesBefore(now)) {
+    MonoTime now = MonoTime::Now() + sleep;
+    if (deadline < now) {
       Status ret = Status::TimedOut("unable to retry before timeout",
                                     err.status.ToString());
       return last_error_.ok() ?
@@ -182,7 +181,7 @@ ScanRpcStatus KuduScanner::Data::AnalyzeResponse(const Status& rpc_status,
     }
 
     if (rpc_status.IsTimedOut()) {
-      if (overall_deadline.Equals(deadline)) {
+      if (overall_deadline == deadline) {
         return ScanRpcStatus{ScanRpcStatus::OVERALL_DEADLINE_EXCEEDED, rpc_status};
       } else {
         return ScanRpcStatus{ScanRpcStatus::RPC_DEADLINE_EXCEEDED, rpc_status};
@@ -231,8 +230,7 @@ ScanRpcStatus KuduScanner::Data::SendScanRpc(const MonoTime& overall_deadline,
   // if the first server we try happens to be hung.
   MonoTime rpc_deadline;
   if (allow_time_for_failover) {
-    rpc_deadline = MonoTime::Now();
-    rpc_deadline.AddDelta(table_->client()->default_rpc_timeout());
+    rpc_deadline = MonoTime::Now() + table_->client()->default_rpc_timeout();
     rpc_deadline = MonoTime::Earliest(overall_deadline, rpc_deadline);
   } else {
     rpc_deadline = overall_deadline;
@@ -353,9 +351,7 @@ Status KuduScanner::Data::OpenTablet(const string& partition_key,
     // currently have any known leader. We should sleep and retry, since
     // it's likely that the tablet is undergoing a leader election and will
     // soon have one.
-    if (lookup_status.IsServiceUnavailable() &&
-        MonoTime::Now().ComesBefore(deadline)) {
-
+    if (lookup_status.IsServiceUnavailable() && MonoTime::Now() < deadline) {
       // ServiceUnavailable means that we have already blacklisted all of the candidate
       // tablet servers. So, we clear the list so that we will cycle through them all
       // another time.

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/consensus/consensus_peers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_peers.cc b/src/kudu/consensus/consensus_peers.cc
index 21a0807..75cdd2d 100644
--- a/src/kudu/consensus/consensus_peers.cc
+++ b/src/kudu/consensus/consensus_peers.cc
@@ -448,8 +448,8 @@ Status SetPermanentUuidForRemotePeer(const shared_ptr<Messenger>& messenger,
   // TODO generalize this exponential backoff algorithm, as we do the
   // same thing in catalog_manager.cc
   // (AsyncTabletRequestTask::RpcCallBack).
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromMilliseconds(FLAGS_raft_get_node_instance_timeout_ms));
+  MonoTime deadline = MonoTime::Now() +
+      MonoDelta::FromMilliseconds(FLAGS_raft_get_node_instance_timeout_ms);
   int attempt = 1;
   while (true) {
     VLOG(2) << "Getting uuid from remote peer. Request: " << req.ShortDebugString();
@@ -466,8 +466,8 @@ Status SetPermanentUuidForRemotePeer(const shared_ptr<Messenger>& messenger,
     LOG(WARNING) << "Error getting permanent uuid from config peer " << hostport.ToString() << ": "
                  << s.ToString();
     MonoTime now = MonoTime::Now();
-    if (now.ComesBefore(deadline)) {
-      int64_t remaining_ms = deadline.GetDeltaSince(now).ToMilliseconds();
+    if (now < deadline) {
+      int64_t remaining_ms = (deadline - now).ToMilliseconds();
       int64_t base_delay_ms = 1 << (attempt + 3); // 1st retry delayed 2^4 ms, 2nd 2^5, etc..
       int64_t jitter_ms = rand() % 50; // Add up to 50ms of additional random delay.
       int64_t delay_ms = std::min<int64_t>(base_delay_ms + jitter_ms, remaining_ms);

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/consensus/consensus_queue.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_queue.cc b/src/kudu/consensus/consensus_queue.cc
index fefa1d2..a7a6fcf 100644
--- a/src/kudu/consensus/consensus_queue.cc
+++ b/src/kudu/consensus/consensus_queue.cc
@@ -299,7 +299,7 @@ Status PeerMessageQueue::RequestForPeer(const string& uuid,
   }
 
   MonoDelta unreachable_time =
-      MonoTime::Now().GetDeltaSince(peer->last_successful_communication_time);
+      MonoTime::Now() - peer->last_successful_communication_time;
   if (unreachable_time.ToSeconds() > FLAGS_follower_unavailable_considered_failed_sec) {
     if (CountVoters(*queue_state_.active_config) > 2) {
       // We never drop from 2 to 1 automatically, at least for now. We may want

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/consensus/log_anchor_registry.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/log_anchor_registry.cc b/src/kudu/consensus/log_anchor_registry.cc
index 68d8819..5d2f2f6 100644
--- a/src/kudu/consensus/log_anchor_registry.cc
+++ b/src/kudu/consensus/log_anchor_registry.cc
@@ -94,7 +94,7 @@ std::string LogAnchorRegistry::DumpAnchorInfo() const {
     if (!buf.empty()) buf += ", ";
     SubstituteAndAppend(&buf, "LogAnchor[index=$0, age=$1s, owner=$2]",
                         anchor->log_index,
-                        now.GetDeltaSince(anchor->when_registered).ToSeconds(),
+                        (now - anchor->when_registered).ToSeconds(),
                         anchor->owner);
   }
   return buf;

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/consensus/raft_consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index 46cf82d..4847953 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -426,11 +426,9 @@ Status RaftConsensus::StartElection(ElectionMode mode) {
 }
 
 Status RaftConsensus::WaitUntilLeaderForTests(const MonoDelta& timeout) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   while (role() != consensus::RaftPeerPB::LEADER) {
-    MonoTime now = MonoTime::Now();
-    if (!now.ComesBefore(deadline)) {
+    if (MonoTime::Now() >= deadline) {
       return Status::TimedOut(Substitute("Peer $0 is not leader of tablet $1 after $2. Role: $3",
                                          peer_uuid(), tablet_id(), timeout.ToString(), role()));
     }
@@ -1093,9 +1091,7 @@ Status RaftConsensus::UpdateReplica(const ConsensusRequestPB* request,
     RETURN_NOT_OK(SnoozeFailureDetectorUnlocked());
 
     // Also prohibit voting for anyone for the minimum election timeout.
-    withhold_votes_until_ = MonoTime::Now();
-    withhold_votes_until_.AddDelta(MinimumElectionTimeout());
-
+    withhold_votes_until_ = MonoTime::Now() + MinimumElectionTimeout();
 
     // 1 - Early commit pending (and committed) transactions
 
@@ -1348,8 +1344,7 @@ Status RaftConsensus::RequestVote(const VoteRequestPB* request, VoteResponsePB*
   // See also https://ramcloud.stanford.edu/~ongaro/thesis.pdf
   // section 4.2.3.
   MonoTime now = MonoTime::Now();
-  if (!request->ignore_live_leader() &&
-      now.ComesBefore(withhold_votes_until_)) {
+  if (!request->ignore_live_leader() && now < withhold_votes_until_) {
     return RequestVoteRespondLeaderIsAlive(request, response);
   }
 
@@ -1969,8 +1964,7 @@ Status RaftConsensus::SnoozeFailureDetectorUnlocked(const MonoDelta& additional_
     return Status::OK();
   }
 
-  MonoTime time = MonoTime::Now();
-  time.AddDelta(additional_delta);
+  MonoTime time = MonoTime::Now() + additional_delta;
 
   if (allow_logging == ALLOW_LOGGING) {
     LOG_WITH_PREFIX_UNLOCKED(INFO) << "Snoozing failure detection for election timeout "

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 46002b2..d32f7fe 100644
--- a/src/kudu/consensus/raft_consensus_quorum-test.cc
+++ b/src/kudu/consensus/raft_consensus_quorum-test.cc
@@ -77,9 +77,8 @@ void DoNothing(const string& s) {
 }
 
 Status WaitUntilLeaderForTests(RaftConsensus* raft) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(15));
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(15);
+  while (MonoTime::Now() < deadline) {
     if (raft->GetActiveRole() == RaftPeerPB::LEADER) {
       return Status::OK();
     }
@@ -324,8 +323,7 @@ class RaftConsensusQuorumTest : public KuduTest {
           return;
         }
       }
-      MonoDelta elapsed = MonoTime::Now().GetDeltaSince(start);
-      if (elapsed.MoreThan(timeout)) {
+      if (MonoTime::Now() > (start + timeout)) {
         break;
       }
       SleepFor(MonoDelta::FromMilliseconds(1 << backoff_exp));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/fs/log_block_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager.cc b/src/kudu/fs/log_block_manager.cc
index 5f95219..fc9ca64 100644
--- a/src/kudu/fs/log_block_manager.cc
+++ b/src/kudu/fs/log_block_manager.cc
@@ -1419,7 +1419,7 @@ LogBlockContainer* LogBlockManager::GetAvailableContainer(
     std::lock_guard<simple_spinlock> l(lock_);
     // Move containers from disk_full -> available.
     while (!disk_full_containers_.empty() &&
-           disk_full_containers_.top().second.ComesBefore(now)) {
+           disk_full_containers_.top().second < now) {
       available_containers_.push_back(disk_full_containers_.top().first);
       disk_full_containers_.pop();
       disk_full_containers_delta -= 1;
@@ -1778,7 +1778,7 @@ bool FullDiskCache::IsRootFull(const std::string& root_path, MonoTime* expires_o
     expires = FindOrNull(cache_, root_path);
   }
   if (expires == nullptr) return false; // No entry exists.
-  if (expires->ComesBefore(MonoTime::Now())) return false; // Expired.
+  if (*expires < MonoTime::Now()) return false; // Expired.
   if (expires_out != nullptr) {
     *expires_out = *expires;
   }
@@ -1786,8 +1786,8 @@ bool FullDiskCache::IsRootFull(const std::string& root_path, MonoTime* expires_o
 }
 
 void FullDiskCache::MarkRootFull(const string& root_path) {
-  MonoTime expires = MonoTime::Now();
-  expires.AddDelta(MonoDelta::FromSeconds(FLAGS_log_block_manager_full_disk_cache_seconds));
+  MonoTime expires = MonoTime::Now() +
+      MonoDelta::FromSeconds(FLAGS_log_block_manager_full_disk_cache_seconds);
   std::lock_guard<percpu_rwlock> l(lock_);
   InsertOrUpdate(&cache_, root_path, expires); // Last one wins.
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/fs/log_block_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/fs/log_block_manager.h b/src/kudu/fs/log_block_manager.h
index ec8306a..aff8faa 100644
--- a/src/kudu/fs/log_block_manager.h
+++ b/src/kudu/fs/log_block_manager.h
@@ -221,7 +221,7 @@ class LogBlockManager : public BlockManager {
   class ExpiringContainerPairGreaterThanFunctor {
    public:
     bool operator()(const ExpiringContainerPair& a, const ExpiringContainerPair& b) {
-      return b.second.ComesBefore(a.second);
+      return b.second < a.second;
     }
   };
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/client-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/client-stress-test.cc b/src/kudu/integration-tests/client-stress-test.cc
index b102ca5..71b8a1a 100644
--- a/src/kudu/integration-tests/client-stress-test.cc
+++ b/src/kudu/integration-tests/client-stress-test.cc
@@ -239,8 +239,7 @@ TEST_F(ClientStressTest_LowMemory, TestMemoryThrottling) {
   work.Start();
 
   // Wait until we've rejected some number of requests.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(kMaxWaitTime);
+  MonoTime deadline = MonoTime::Now() + kMaxWaitTime;
   while (true) {
     int64_t total_num_rejections = 0;
 
@@ -273,7 +272,7 @@ TEST_F(ClientStressTest_LowMemory, TestMemoryThrottling) {
     }
     if (total_num_rejections >= kMinRejections) {
       break;
-    } else if (deadline.ComesBefore(MonoTime::Now())) {
+    } else if (MonoTime::Now() > deadline) {
       FAIL() << "Ran for " << kMaxWaitTime.ToString() << ", deadline expired and only saw "
              << total_num_rejections << " memory rejections";
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 49eea9f..5af760e 100644
--- a/src/kudu/integration-tests/cluster_itest_util.cc
+++ b/src/kudu/integration-tests/cluster_itest_util.cc
@@ -148,11 +148,9 @@ Status WaitForServersToAgree(const MonoDelta& timeout,
                              const TabletServerMap& tablet_servers,
                              const string& tablet_id,
                              int64_t minimum_index) {
-  MonoTime now = MonoTime::Now();
-  MonoTime deadline = now;
-  deadline.AddDelta(timeout);
+  const MonoTime deadline = MonoTime::Now() + timeout;
 
-  for (int i = 1; now.ComesBefore(deadline); i++) {
+  for (int i = 1; MonoTime::Now() < deadline; i++) {
     vector<TServerDetails*> servers;
     AppendValuesFromMap(tablet_servers, &servers);
     vector<OpId> ids;
@@ -184,8 +182,6 @@ Status WaitForServersToAgree(const MonoDelta& timeout,
 
     LOG(INFO) << "Not converged past " << minimum_index << " yet: " << ids;
     SleepFor(MonoDelta::FromMilliseconds(min(i * 100, 1000)));
-
-    now = MonoTime::Now();
   }
   return Status::TimedOut(Substitute("Index $0 not available on all replicas after $1. ",
                                               minimum_index, timeout.ToString()));
@@ -214,8 +210,8 @@ Status WaitUntilAllReplicasHaveOp(const int64_t log_index,
     } else {
       LOG(WARNING) << "Got error getting last opid for each replica: " << s.ToString();
     }
-    passed = MonoTime::Now().GetDeltaSince(start);
-    if (passed.MoreThan(timeout)) {
+    passed = MonoTime::Now() - start;
+    if (passed > timeout) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(50));
@@ -293,15 +289,14 @@ Status WaitUntilCommittedConfigNumVotersIs(int config_size,
                                            const std::string& tablet_id,
                                            const MonoDelta& timeout) {
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
 
   int backoff_exp = 0;
   const int kMaxBackoffExp = 7;
   Status s;
   ConsensusStatePB cstate;
   while (true) {
-    MonoDelta remaining_timeout = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta remaining_timeout = deadline - MonoTime::Now();
     s = GetConsensusState(replica, tablet_id, CONSENSUS_CONFIG_COMMITTED,
                           remaining_timeout, &cstate);
     if (s.ok()) {
@@ -310,7 +305,7 @@ Status WaitUntilCommittedConfigNumVotersIs(int config_size,
       }
     }
 
-    if (MonoTime::Now().GetDeltaSince(start).MoreThan(timeout)) {
+    if (MonoTime::Now() > start + timeout) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(1 << backoff_exp));
@@ -327,26 +322,25 @@ Status WaitUntilCommittedConfigOpIdIndexIs(int64_t opid_index,
                                            const std::string& tablet_id,
                                            const MonoDelta& timeout) {
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
 
   Status s;
   ConsensusStatePB cstate;
   while (true) {
-    MonoDelta remaining_timeout = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta remaining_timeout = deadline - MonoTime::Now();
     s = GetConsensusState(replica, tablet_id, CONSENSUS_CONFIG_COMMITTED,
                           remaining_timeout, &cstate);
     if (s.ok() && cstate.config().opid_index() == opid_index) {
       return Status::OK();
     }
-    if (MonoTime::Now().GetDeltaSince(start).MoreThan(timeout)) break;
+    if (MonoTime::Now() > deadline) break;
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
   return Status::TimedOut(Substitute("Committed config opid_index does not equal $0 "
                                      "after waiting for $1. "
                                      "Last consensus state: $2. Last status: $3",
                                      opid_index,
-                                     MonoTime::Now().GetDeltaSince(start).ToString(),
+                                     (MonoTime::Now() - start).ToString(),
                                      cstate.ShortDebugString(), s.ToString()));
 }
 
@@ -355,25 +349,24 @@ Status WaitUntilCommittedOpIdIndexIs(int64_t opid_index,
                                      const string& tablet_id,
                                      const MonoDelta& timeout) {
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
 
   Status s;
   OpId op_id;
   while (true) {
-    MonoDelta remaining_timeout = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta remaining_timeout = deadline - MonoTime::Now();
     s = GetLastOpIdForReplica(tablet_id, replica, consensus::COMMITTED_OPID, remaining_timeout,
                               &op_id);
     if (s.ok() && op_id.index() == opid_index) {
       return Status::OK();
     }
-    if (MonoTime::Now().GetDeltaSince(start).MoreThan(timeout)) break;
+    if (MonoTime::Now() > deadline) break;
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
   return Status::TimedOut(Substitute("Committed consensus opid_index does not equal $0 "
                                      "after waiting for $1. Last opid: $2. Last status: $3",
                                      opid_index,
-                                     MonoTime::Now().GetDeltaSince(start).ToString(),
+                                     (MonoTime::Now() - start).ToString(),
                                      OpIdToString(op_id),
                                      s.ToString()));
 }
@@ -401,20 +394,19 @@ Status WaitUntilLeader(const TServerDetails* replica,
                        const string& tablet_id,
                        const MonoDelta& timeout) {
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
 
   int backoff_exp = 0;
   const int kMaxBackoffExp = 7;
   Status s;
   while (true) {
-    MonoDelta remaining_timeout = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta remaining_timeout = deadline - MonoTime::Now();
     s = GetReplicaStatusAndCheckIfLeader(replica, tablet_id, remaining_timeout);
     if (s.ok()) {
       return Status::OK();
     }
 
-    if (MonoTime::Now().GetDeltaSince(start).MoreThan(timeout)) {
+    if (MonoTime::Now() > deadline) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(1 << backoff_exp));
@@ -432,19 +424,18 @@ Status FindTabletLeader(const TabletServerMap& tablet_servers,
   AppendValuesFromMap(tablet_servers, &tservers);
 
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
   Status s;
   int i = 0;
   while (true) {
-    MonoDelta remaining_timeout = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta remaining_timeout = deadline - MonoTime::Now();
     s = GetReplicaStatusAndCheckIfLeader(tservers[i], tablet_id, remaining_timeout);
     if (s.ok()) {
       *leader = tservers[i];
       return Status::OK();
     }
 
-    if (deadline.ComesBefore(MonoTime::Now())) break;
+    if (MonoTime::Now() > deadline) break;
     i = (i + 1) % tservers.size();
     if (i == 0) {
       SleepFor(MonoDelta::FromMilliseconds(10));
@@ -452,7 +443,7 @@ Status FindTabletLeader(const TabletServerMap& tablet_servers,
   }
   return Status::TimedOut(Substitute("Unable to find leader of tablet $0 after $1. "
                                      "Status message: $2", tablet_id,
-                                     MonoTime::Now().GetDeltaSince(start).ToString(),
+                                     (MonoTime::Now() - start).ToString(),
                                      s.ToString()));
 }
 
@@ -651,12 +642,11 @@ Status WaitForNumVotersInConfigOnMaster(const shared_ptr<MasterServiceProxy>& ma
                                         int num_voters,
                                         const MonoDelta& timeout) {
   Status s;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   int num_voters_found = 0;
   while (true) {
     TabletLocationsPB tablet_locations;
-    MonoDelta time_remaining = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta time_remaining = deadline - MonoTime::Now();
     s = GetTabletLocations(master_proxy, tablet_id, time_remaining, &tablet_locations);
     if (s.ok()) {
       num_voters_found = 0;
@@ -665,7 +655,7 @@ Status WaitForNumVotersInConfigOnMaster(const shared_ptr<MasterServiceProxy>& ma
       }
       if (num_voters_found == num_voters) break;
     }
-    if (deadline.ComesBefore(MonoTime::Now())) break;
+    if (MonoTime::Now() > deadline) break;
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
   RETURN_NOT_OK(s);
@@ -682,12 +672,11 @@ Status WaitForNumTabletsOnTS(TServerDetails* ts,
                              const MonoDelta& timeout,
                              vector<ListTabletsResponsePB::StatusAndSchemaPB>* tablets) {
   Status s;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   while (true) {
     s = ListTablets(ts, MonoDelta::FromSeconds(10), tablets);
     if (s.ok() && tablets->size() == count) break;
-    if (deadline.ComesBefore(MonoTime::Now())) break;
+    if (MonoTime::Now() > deadline) break;
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
   RETURN_NOT_OK(s);
@@ -704,8 +693,7 @@ Status WaitUntilTabletInState(TServerDetails* ts,
                               tablet::TabletStatePB state,
                               const MonoDelta& timeout) {
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
   vector<ListTabletsResponsePB::StatusAndSchemaPB> tablets;
   Status s;
   tablet::TabletStatePB last_state = tablet::UNKNOWN;
@@ -726,7 +714,7 @@ Status WaitUntilTabletInState(TServerDetails* ts,
         s = Status::NotFound("Tablet " + tablet_id + " not found");
       }
     }
-    if (deadline.ComesBefore(MonoTime::Now())) {
+    if (MonoTime::Now() > deadline) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(10));
@@ -735,7 +723,7 @@ Status WaitUntilTabletInState(TServerDetails* ts,
                                      "Tablet state: $4, Status message: $5",
                                      tablet_id, ts->uuid(),
                                      tablet::TabletStatePB_Name(state),
-                                     MonoTime::Now().GetDeltaSince(start).ToString(),
+                                     (MonoTime::Now() - start).ToString(),
                                      tablet::TabletStatePB_Name(last_state), s.ToString()));
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/cluster_verifier.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/cluster_verifier.cc b/src/kudu/integration-tests/cluster_verifier.cc
index 8c84807..69c4195 100644
--- a/src/kudu/integration-tests/cluster_verifier.cc
+++ b/src/kudu/integration-tests/cluster_verifier.cc
@@ -58,12 +58,11 @@ void ClusterVerifier::SetScanConcurrency(int concurrency) {
 }
 
 void ClusterVerifier::CheckCluster() {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(checksum_options_.timeout);
+  MonoTime deadline = MonoTime::Now() + checksum_options_.timeout;
 
   Status s;
   double sleep_time = 0.1;
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  while (MonoTime::Now() < deadline) {
     s = DoKsck();
     if (s.ok()) {
       break;
@@ -139,12 +138,11 @@ void ClusterVerifier::CheckRowCountWithRetries(const std::string& table_name,
                                                ComparisonMode mode,
                                                int expected_row_count,
                                                const MonoDelta& timeout) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   Status s;
   while (true) {
     s = DoCheckRowCount(table_name, mode, expected_row_count);
-    if (s.ok() || deadline.ComesBefore(MonoTime::Now())) break;
+    if (s.ok() || deadline < MonoTime::Now()) break;
     LOG(WARNING) << "CheckRowCount() has not succeeded yet: " << s.ToString()
                  << "... will retry";
     SleepFor(MonoDelta::FromMilliseconds(100));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/create-table-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/create-table-itest.cc b/src/kudu/integration-tests/create-table-itest.cc
index 8ffa535..5a15420 100644
--- a/src/kudu/integration-tests/create-table-itest.cc
+++ b/src/kudu/integration-tests/create-table-itest.cc
@@ -283,9 +283,8 @@ TEST_F(CreateTableITest, TestCreateTableWithDeadTServers) {
   }
 
   // Give the lookup threads some time to crash the master.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(15));
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(15);
+  while (MonoTime::Now() < deadline) {
     ASSERT_TRUE(cluster_->master()->IsProcessAlive()) << "Master crashed!";
     SleepFor(MonoDelta::FromMilliseconds(100));
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/delete_table-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/delete_table-test.cc b/src/kudu/integration-tests/delete_table-test.cc
index e09c11d..437730d 100644
--- a/src/kudu/integration-tests/delete_table-test.cc
+++ b/src/kudu/integration-tests/delete_table-test.cc
@@ -223,13 +223,12 @@ void DeleteTableTest::DeleteTabletWithRetries(const TServerDetails* ts,
                                               TabletDataState delete_type,
                                               const MonoDelta& timeout) {
   MonoTime start(MonoTime::Now());
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
   Status s;
   while (true) {
     s = itest::DeleteTablet(ts, tablet_id, delete_type, boost::none, timeout);
     if (s.ok()) return;
-    if (deadline.ComesBefore(MonoTime::Now())) {
+    if (deadline < MonoTime::Now()) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(10));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 4ac0c29..8123dcb 100644
--- a/src/kudu/integration-tests/external_mini_cluster.cc
+++ b/src/kudu/integration-tests/external_mini_cluster.cc
@@ -289,8 +289,7 @@ Status ExternalMiniCluster::AddTabletServer() {
 }
 
 Status ExternalMiniCluster::WaitForTabletServerCount(int count, const MonoDelta& timeout) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
 
   unordered_set<int> masters_to_search;
   for (int i = 0; i < masters_.size(); i++) {
@@ -300,7 +299,7 @@ Status ExternalMiniCluster::WaitForTabletServerCount(int count, const MonoDelta&
   }
 
   while (true) {
-    MonoDelta remaining = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta remaining = deadline - MonoTime::Now();
     if (remaining.ToSeconds() < 0) {
       return Status::TimedOut(Substitute(
           "Timed out waiting for $0 TS(s) to register with all masters", count));
@@ -363,9 +362,8 @@ Status ExternalMiniCluster::WaitForTabletsRunning(ExternalTabletServer* ts,
   ListTabletsRequestPB req;
   ListTabletsResponsePB resp;
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  MonoTime deadline = MonoTime::Now() + timeout;
+  while (MonoTime::Now() < deadline) {
     rpc::RpcController rpc;
     rpc.set_timeout(MonoDelta::FromSeconds(10));
     RETURN_NOT_OK(proxy.ListTablets(req, &resp, &rpc));
@@ -410,8 +408,7 @@ Status ExternalMiniCluster::GetLeaderMasterIndex(int* idx) {
   Synchronizer sync;
   vector<Sockaddr> addrs;
   HostPort leader_master_hp;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(5));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(5);
 
   for (const scoped_refptr<ExternalMaster>& master : masters_) {
     addrs.push_back(master->bound_rpc_addr());
@@ -645,11 +642,10 @@ bool ExternalDaemon::IsProcessAlive() const {
 }
 
 Status ExternalDaemon::WaitForCrash(const MonoDelta& timeout) const {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
 
   int i = 1;
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  while (MonoTime::Now() < deadline) {
     if (!IsProcessAlive()) return Status::OK();
     int sleep_ms = std::min(i++ * 10, 200);
     SleepFor(MonoDelta::FromMilliseconds(sleep_ms));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc b/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
index 7b294c4..dd6dcf4 100644
--- a/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
+++ b/src/kudu/integration-tests/external_mini_cluster_fs_inspector.cc
@@ -223,13 +223,12 @@ Status ExternalMiniClusterFsInspector::CheckTabletDataStateOnTS(
 }
 
 Status ExternalMiniClusterFsInspector::WaitForNoData(const MonoDelta& timeout) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   Status s;
   while (true) {
     s = CheckNoData();
     if (s.ok()) return Status::OK();
-    if (deadline.ComesBefore(MonoTime::Now())) {
+    if (deadline < MonoTime::Now()) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(10));
@@ -238,13 +237,12 @@ Status ExternalMiniClusterFsInspector::WaitForNoData(const MonoDelta& timeout) {
 }
 
 Status ExternalMiniClusterFsInspector::WaitForNoDataOnTS(int index, const MonoDelta& timeout) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   Status s;
   while (true) {
     s = CheckNoDataOnTS(index);
     if (s.ok()) return Status::OK();
-    if (deadline.ComesBefore(MonoTime::Now())) {
+    if (deadline < MonoTime::Now()) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(10));
@@ -257,12 +255,11 @@ Status ExternalMiniClusterFsInspector::WaitForMinFilesInTabletWalDirOnTS(int ind
                                                                          int count,
                                                                          const MonoDelta& timeout) {
   int seen = 0;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   while (true) {
     seen = CountWALSegmentsForTabletOnTS(index, tablet_id);
     if (seen >= count) return Status::OK();
-    if (deadline.ComesBefore(MonoTime::Now())) {
+    if (deadline < MonoTime::Now()) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(10));
@@ -274,14 +271,13 @@ Status ExternalMiniClusterFsInspector::WaitForMinFilesInTabletWalDirOnTS(int ind
 
 Status ExternalMiniClusterFsInspector::WaitForReplicaCount(int expected, const MonoDelta& timeout) {
   Status s;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
   int found;
   while (true) {
     found = CountReplicasInMetadataDirs();
     if (found == expected) return Status::OK();
     if (CountReplicasInMetadataDirs() == expected) return Status::OK();
-    if (deadline.ComesBefore(MonoTime::Now())) {
+    if (MonoTime::Now() > deadline) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(10));
@@ -297,17 +293,16 @@ Status ExternalMiniClusterFsInspector::WaitForTabletDataStateOnTS(
     const vector<TabletDataState>& expected_states,
     const MonoDelta& timeout) {
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(timeout);
+  MonoTime deadline = start + timeout;
   Status s;
   while (true) {
     s = CheckTabletDataStateOnTS(index, tablet_id, expected_states);
     if (s.ok()) return Status::OK();
-    if (deadline.ComesBefore(MonoTime::Now())) break;
+    if (MonoTime::Now() > deadline) break;
     SleepFor(MonoDelta::FromMilliseconds(5));
   }
   return Status::TimedOut(Substitute("Timed out after $0 waiting for correct tablet state: $1",
-                                     MonoTime::Now().GetDeltaSince(start).ToString(),
+                                     (MonoTime::Now() - start).ToString(),
                                      s.ToString()));
 }
 
@@ -317,8 +312,7 @@ Status ExternalMiniClusterFsInspector::WaitForFilePatternInTabletWalDirOnTs(
     const vector<string>& substrings_disallowed,
     const MonoDelta& timeout) {
   Status s;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  MonoTime deadline = MonoTime::Now() + timeout;
 
   string data_dir = cluster_->tablet_server(ts_index)->data_dir();
   string ts_wal_dir = JoinPathSegments(data_dir, FsManager::kWalDirName);
@@ -363,7 +357,7 @@ Status ExternalMiniClusterFsInspector::WaitForFilePatternInTabletWalDirOnTs(
     if (!any_missing_required && !any_present_disallowed) {
       return Status::OK();
     }
-    if (deadline.ComesBefore(MonoTime::Now())) {
+    if (MonoTime::Now() > deadline) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(10));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/linked_list-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/linked_list-test-util.h b/src/kudu/integration-tests/linked_list-test-util.h
index 8b149b9..cccc990 100644
--- a/src/kudu/integration-tests/linked_list-test-util.h
+++ b/src/kudu/integration-tests/linked_list-test-util.h
@@ -344,7 +344,7 @@ class PeriodicWebUIChecker {
       }
       // Sleep until the next period
       const MonoTime end = MonoTime::Now();
-      const MonoDelta elapsed = end.GetDeltaSince(start);
+      const MonoDelta elapsed = end - start;
       const int64_t sleep_ns = period_.ToNanoseconds() - elapsed.ToNanoseconds();
       if (sleep_ns > 0) {
         SleepFor(MonoDelta::FromNanoseconds(sleep_ns));
@@ -446,8 +446,7 @@ Status LinkedListTester::LoadLinkedList(
   RETURN_NOT_OK(ht_clock->Init());
 
   MonoTime start = MonoTime::Now();
-  MonoTime deadline = start;
-  deadline.AddDelta(run_for);
+  MonoTime deadline = start + run_for;
 
   client::sp::shared_ptr<client::KuduSession> session = client_->NewSession();
   session->SetTimeoutMillis(15000);
@@ -462,8 +461,7 @@ Status LinkedListTester::LoadLinkedList(
   }
 
   MonoDelta sample_interval = MonoDelta::FromMicroseconds(run_for.ToMicroseconds() / num_samples);
-  MonoTime next_sample = start;
-  next_sample.AddDelta(sample_interval);
+  MonoTime next_sample = start + sample_interval;
   LOG(INFO) << "Running for: " << run_for.ToString();
   LOG(INFO) << "Sampling every " << sample_interval.ToMicroseconds() << " us";
 
@@ -476,15 +474,15 @@ Status LinkedListTester::LoadLinkedList(
     }
 
     MonoTime now = MonoTime::Now();
-    if (next_sample.ComesBefore(now)) {
+    if (next_sample < now) {
       Timestamp now = ht_clock->Now();
       sampled_timestamps_and_counts_.push_back(
           pair<uint64_t,int64_t>(now.ToUint64(), *written_count));
-      next_sample.AddDelta(sample_interval);
+      next_sample += sample_interval;
       LOG(INFO) << "Sample at HT timestamp: " << now.ToString()
                 << " Inserted count: " << *written_count;
     }
-    if (deadline.ComesBefore(now)) {
+    if (deadline < now) {
       LOG(INFO) << "Finished inserting list. Added " << (*written_count) << " in chain";
       LOG(INFO) << "Last entries inserted had keys:";
       for (int i = 0; i < num_chains_; i++) {
@@ -499,7 +497,7 @@ Status LinkedListTester::LoadLinkedList(
 
     MonoTime flush_start(MonoTime::Now());
     FlushSessionOrDie(session);
-    MonoDelta elapsed = MonoTime::Now().GetDeltaSince(flush_start);
+    MonoDelta elapsed = MonoTime::Now() - flush_start;
     latency_histogram_.Increment(elapsed.ToMicroseconds());
 
     (*written_count) += chains.size();

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/master_failover-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_failover-itest.cc b/src/kudu/integration-tests/master_failover-itest.cc
index d072be8..1744852 100644
--- a/src/kudu/integration-tests/master_failover-itest.cc
+++ b/src/kudu/integration-tests/master_failover-itest.cc
@@ -192,8 +192,7 @@ TEST_F(MasterFailoverTest, TestPauseAfterCreateTableIssued) {
   cluster_->master(leader_idx)->Pause();
   ScopedResumeExternalDaemon resume_daemon(cluster_->master(leader_idx));
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(90));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(90);
   ASSERT_OK(client_->data_->WaitForCreateTableToFinish(client_.get(),
                                                        kTableName, deadline));
   shared_ptr<KuduTable> table;
@@ -301,10 +300,9 @@ TEST_F(MasterFailoverTest, TestKUDU1374) {
   // 5. Leader master sees that all tablets in the table now have the new
   //    schema and ends the AlterTable() operation.
   // 6. The next IsAlterTableInProgress() call returns false.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(90));
   MonoTime now = MonoTime::Now();
-  while (now.ComesBefore(deadline)) {
+  MonoTime deadline = now + MonoDelta::FromSeconds(90);
+  while (now < deadline) {
     bool in_progress;
     ASSERT_OK(client_->IsAlterTableInProgress(kTableName, &in_progress));
     if (!in_progress) {
@@ -314,8 +312,8 @@ TEST_F(MasterFailoverTest, TestKUDU1374) {
     SleepFor(MonoDelta::FromMilliseconds(100));
     now = MonoTime::Now();
   }
-  ASSERT_TRUE(now.ComesBefore(deadline))
-    << "Deadline elapsed before alter table completed";
+  ASSERT_TRUE(now < deadline)
+      << "Deadline elapsed before alter table completed";
 }
 
 TEST_F(MasterFailoverTest, TestMasterUUIDResolution) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 7aff6da..8d6553d 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -148,8 +148,7 @@ class RaftConsensusITest : public TabletServerIntegrationTestBase {
                        vector<string>* results) {
     LOG(INFO) << "Waiting for row count " << expected_count << "...";
     MonoTime start = MonoTime::Now();
-    MonoTime deadline = MonoTime::Now();
-    deadline.AddDelta(MonoDelta::FromSeconds(90));
+    MonoTime deadline = start + MonoDelta::FromSeconds(90);
     while (true) {
       results->clear();
       NO_FATALS(ScanReplica(replica_proxy, results));
@@ -157,14 +156,14 @@ class RaftConsensusITest : public TabletServerIntegrationTestBase {
         return;
       }
       SleepFor(MonoDelta::FromMilliseconds(10));
-      if (!MonoTime::Now().ComesBefore(deadline)) {
+      if (MonoTime::Now() >= deadline) {
         break;
       }
     }
     MonoTime end = MonoTime::Now();
     LOG(WARNING) << "Didn't reach row count " << expected_count;
     FAIL() << "Did not reach expected row count " << expected_count
-           << " after " << end.GetDeltaSince(start).ToString()
+           << " after " << (end - start).ToString()
            << ": rows: " << *results;
   }
 
@@ -1480,8 +1479,7 @@ void RaftConsensusITest::WaitForReplicasReportedToMaster(
     WaitForLeader wait_for_leader,
     bool* has_leader,
     master::TabletLocationsPB* tablet_locations) {
-  MonoTime deadline(MonoTime::Now());
-  deadline.AddDelta(timeout);
+  MonoTime deadline(MonoTime::Now() + timeout);
   while (true) {
     ASSERT_OK(GetTabletLocations(tablet_id, timeout, tablet_locations));
     *has_leader = false;
@@ -1497,7 +1495,7 @@ void RaftConsensusITest::WaitForReplicasReportedToMaster(
         break;
       }
     }
-    if (deadline.ComesBefore(MonoTime::Now())) break;
+    if (deadline < MonoTime::Now()) break;
     SleepFor(MonoDelta::FromMilliseconds(20));
   }
   ASSERT_EQ(num_replicas, tablet_locations->replicas_size()) << tablet_locations->DebugString();
@@ -2219,8 +2217,7 @@ TEST_F(RaftConsensusITest, TestMemoryRemainsConstantDespiteTwoDeadFollowers) {
   workload.Start();
 
   // Run until the leader has rejected several transactions.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(kMaxWaitTime);
+  MonoTime deadline = MonoTime::Now() + kMaxWaitTime;
   while (true) {
     int64_t num_rejections = 0;
     ASSERT_OK(cluster_->tablet_server(leader_ts_idx)->GetInt64Metric(
@@ -2231,7 +2228,7 @@ TEST_F(RaftConsensusITest, TestMemoryRemainsConstantDespiteTwoDeadFollowers) {
         &num_rejections));
     if (num_rejections >= kMinRejections) {
       break;
-    } else if (deadline.ComesBefore(MonoTime::Now())) {
+    } else if (deadline < MonoTime::Now()) {
       FAIL() << "Ran for " << kMaxWaitTime.ToString() << ", deadline expired";
     }
     SleepFor(MonoDelta::FromMilliseconds(200));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/test_workload.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/test_workload.cc b/src/kudu/integration-tests/test_workload.cc
index 4cd9528..c189b3c 100644
--- a/src/kudu/integration-tests/test_workload.cc
+++ b/src/kudu/integration-tests/test_workload.cc
@@ -173,12 +173,11 @@ void TestWorkload::Setup() {
 
   // Retry KuduClient::TableExists() until we make that call retry reliably.
   // See KUDU-1074.
-  MonoTime deadline(MonoTime::Now());
-  deadline.AddDelta(MonoDelta::FromSeconds(10));
+  MonoTime deadline(MonoTime::Now() + MonoDelta::FromSeconds(10));
   Status s;
   while (true) {
     s = client_->TableExists(table_name_, &table_exists);
-    if (s.ok() || deadline.ComesBefore(MonoTime::Now())) break;
+    if (s.ok() || MonoTime::Now() > deadline) break;
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
   CHECK_OK(s);

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/integration-tests/write_throttling-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/write_throttling-itest.cc b/src/kudu/integration-tests/write_throttling-itest.cc
index 29e0fdf..cfcf3cd 100644
--- a/src/kudu/integration-tests/write_throttling-itest.cc
+++ b/src/kudu/integration-tests/write_throttling-itest.cc
@@ -93,7 +93,7 @@ TEST_F(WriteThrottlingTest, ThrottleWriteRpcPerSec) {
       CHECK_OK(session->Apply(insert.release()));
     }
     MonoTime end = MonoTime::Now();
-    MonoDelta delta = end.GetDeltaSince(begin);
+    MonoDelta delta = end - begin;
     double qps = TARGET_QPS / delta.ToSeconds();
     LOG(INFO) << "Iteration " << t << " qps: " << qps;
     ASSERT_LE(qps, TARGET_QPS * 1.2f);
@@ -125,7 +125,7 @@ TEST_F(WriteThrottlingTest, ThrottleWriteBytesPerSec) {
       CHECK_OK(session->Apply(insert.release()));
     }
     MonoTime end = MonoTime::Now();
-    MonoDelta delta = end.GetDeltaSince(begin);
+    MonoDelta delta = end - begin;
     double qps = TARGET_QPS / delta.ToSeconds();
     double bps = TARGET_QPS * BYTES_PER_RPC / delta.ToSeconds();
     LOG(INFO) << "Iteration " << t << " qps: " << qps << " " << bps << " byte/s";

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index b11218e..2290693 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -2209,10 +2209,9 @@ class RetryingTSRpcTask : public MonitoredTask {
       replica_picker_(std::move(replica_picker)),
       table_(table),
       start_ts_(MonoTime::Now()),
+      deadline_(start_ts_ + MonoDelta::FromMilliseconds(FLAGS_unresponsive_ts_rpc_timeout_ms)),
       attempt_(0),
       state_(kStateRunning) {
-    deadline_ = start_ts_;
-    deadline_.AddDelta(MonoDelta::FromMilliseconds(FLAGS_unresponsive_ts_rpc_timeout_ms));
   }
 
   // Send the subclass RPC request.
@@ -2232,8 +2231,8 @@ class RetryingTSRpcTask : public MonitoredTask {
     }
 
     // Calculate and set the timeout deadline.
-    MonoTime timeout = MonoTime::Now();
-    timeout.AddDelta(MonoDelta::FromMilliseconds(FLAGS_master_ts_rpc_timeout_ms));
+    MonoTime timeout = MonoTime::Now() +
+        MonoDelta::FromMilliseconds(FLAGS_master_ts_rpc_timeout_ms);
     const MonoTime& deadline = MonoTime::Earliest(timeout, deadline_);
     rpc_.set_deadline(deadline);
 
@@ -2338,7 +2337,7 @@ class RetryingTSRpcTask : public MonitoredTask {
     MonoTime now = MonoTime::Now();
     // We assume it might take 10ms to process the request in the best case,
     // fail if we have less than that amount of time remaining.
-    int64_t millis_remaining = deadline_.GetDeltaSince(now).ToMilliseconds() - 10;
+    int64_t millis_remaining = (deadline_ - now).ToMilliseconds() - 10;
     // Exponential backoff with jitter.
     int64_t base_delay_ms;
     if (attempt_ <= 12) {
@@ -2353,8 +2352,6 @@ class RetryingTSRpcTask : public MonitoredTask {
       LOG(WARNING) << "Request timed out: " << description();
       MarkFailed();
     } else {
-      MonoTime new_start_time = now;
-      new_start_time.AddDelta(MonoDelta::FromMilliseconds(delay_millis));
       LOG(INFO) << "Scheduling retry of " << description() << " with a delay"
                 << " of " << delay_millis << "ms (attempt = " << attempt_ << ")...";
       master_->messenger()->ScheduleOnReactor(
@@ -2455,8 +2452,7 @@ class AsyncCreateReplica : public RetrySpecificTSRpcTask {
                      const TabletMetadataLock& tablet_lock)
     : RetrySpecificTSRpcTask(master, permanent_uuid, tablet->table()),
       tablet_id_(tablet->tablet_id()) {
-    deadline_ = start_ts_;
-    deadline_.AddDelta(MonoDelta::FromMilliseconds(FLAGS_tablet_creation_timeout_ms));
+    deadline_ = start_ts_ + MonoDelta::FromMilliseconds(FLAGS_tablet_creation_timeout_ms);
 
     TableMetadataLock table_lock(tablet->table().get(), TableMetadataLock::READ);
     req_.set_dest_uuid(permanent_uuid);
@@ -2960,7 +2956,7 @@ void CatalogManager::HandleAssignCreatingTablet(TabletInfo* tablet,
                                                 DeferredAssignmentActions* deferred,
                                                 vector<scoped_refptr<TabletInfo> >* new_tablets) {
   MonoDelta time_since_updated =
-      MonoTime::Now().GetDeltaSince(tablet->last_create_tablet_time());
+      MonoTime::Now() - tablet->last_create_tablet_time();
   int64_t remaining_timeout_ms =
       FLAGS_tablet_creation_timeout_ms - time_since_updated.ToMilliseconds();
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/master/master-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index b4a00ac..ccd75b1 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -920,9 +920,8 @@ TEST_F(MasterTest, TestMasterMetadataConsistentDespiteFailures) {
 
   // Spend some time hammering the master with create/alter/delete operations.
   MonoDelta time_to_run = MonoDelta::FromSeconds(AllowSlowTests() ? 10 : 1);
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(time_to_run);
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  MonoTime deadline = MonoTime::Now() + time_to_run;
+  while (MonoTime::Now() < deadline) {
     int next_action = r.Uniform(3);
     switch (next_action) {
       case 0:

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/master/master.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master.cc b/src/kudu/master/master.cc
index efbf8cf..5a2c099 100644
--- a/src/kudu/master/master.cc
+++ b/src/kudu/master/master.cc
@@ -171,7 +171,7 @@ Status Master::WaitUntilCatalogManagerIsLeaderAndReadyForTests(const MonoDelta&
     }
     SleepFor(MonoDelta::FromMilliseconds(backoff_ms));
     backoff_ms = min(backoff_ms << 1, kMaxBackoffMs);
-  } while (MonoTime::Now().GetDeltaSince(start).LessThan(timeout));
+  } while (MonoTime::Now() < (start + timeout));
   return Status::TimedOut("Maximum time exceeded waiting for master leadership",
                           s.ToString());
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/master/master_rpc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master_rpc.cc b/src/kudu/master/master_rpc.cc
index e2aa5ec..b978b1a 100644
--- a/src/kudu/master/master_rpc.cc
+++ b/src/kudu/master/master_rpc.cc
@@ -137,8 +137,7 @@ string GetLeaderMasterRpc::ToString() const {
 
 void GetLeaderMasterRpc::SendRpc() {
   // Compute the actual deadline to use for each RPC.
-  MonoTime rpc_deadline = MonoTime::Now();
-  rpc_deadline.AddDelta(rpc_timeout_);
+  MonoTime rpc_deadline = MonoTime::Now() + rpc_timeout_;
   MonoTime actual_deadline = MonoTime::Earliest(retrier().deadline(),
                                                 rpc_deadline);
 
@@ -178,8 +177,7 @@ void GetLeaderMasterRpc::SendRpcCb(const Status& status) {
   }
 
   // If our replies timed out but the deadline hasn't passed, retry.
-  if (status.IsTimedOut() &&
-      MonoTime::Now().ComesBefore(retrier().deadline())) {
+  if (status.IsTimedOut() && MonoTime::Now() < retrier().deadline()) {
     mutable_retrier()->DelayedRetry(this, status);
     return;
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/master/ts_descriptor.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_descriptor.cc b/src/kudu/master/ts_descriptor.cc
index eeb83dc..35c8629 100644
--- a/src/kudu/master/ts_descriptor.cc
+++ b/src/kudu/master/ts_descriptor.cc
@@ -102,7 +102,7 @@ void TSDescriptor::UpdateHeartbeatTime() {
 MonoDelta TSDescriptor::TimeSinceHeartbeat() const {
   MonoTime now(MonoTime::Now());
   std::lock_guard<simple_spinlock> l(lock_);
-  return now.GetDeltaSince(last_heartbeat_);
+  return now - last_heartbeat_;
 }
 
 int64_t TSDescriptor::latest_seqno() const {
@@ -117,7 +117,7 @@ void TSDescriptor::DecayRecentReplicaCreationsUnlocked() {
 
   const double kHalflifeSecs = 60;
   MonoTime now = MonoTime::Now();
-  double secs_since_last_decay = now.GetDeltaSince(last_replica_creations_decay_).ToSeconds();
+  double secs_since_last_decay = (now - last_replica_creations_decay_).ToSeconds();
   recent_replica_creations_ *= pow(0.5, secs_since_last_decay / kHalflifeSecs);
 
   // If sufficiently small, reset down to 0 to take advantage of the fast path above.

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/connection.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/connection.cc b/src/kudu/rpc/connection.cc
index 19b6bd8..353b21e 100644
--- a/src/kudu/rpc/connection.cc
+++ b/src/kudu/rpc/connection.cc
@@ -135,8 +135,8 @@ void Connection::Shutdown(const Status &status) {
   shutdown_status_ = status.CloneAndPrepend("RPC connection failed");
 
   if (inbound_ && inbound_->TransferStarted()) {
-    double secs_since_active = reactor_thread_->cur_time()
-        .GetDeltaSince(last_activity_time_).ToSeconds();
+    double secs_since_active =
+        (reactor_thread_->cur_time() - last_activity_time_).ToSeconds();
     LOG(WARNING) << "Shutting down connection " << ToString() << " with pending inbound data ("
                  << inbound_->StatusAsString() << ", last active "
                  << HumanReadableElapsedTime::ToShortString(secs_since_active)

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/inbound_call.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/inbound_call.cc b/src/kudu/rpc/inbound_call.cc
index edadf35..d9c5e8f 100644
--- a/src/kudu/rpc/inbound_call.cc
+++ b/src/kudu/rpc/inbound_call.cc
@@ -209,7 +209,7 @@ void InboundCall::DumpPB(const DumpRunningRpcsRequestPB& req,
   if (req.include_traces() && trace_) {
     resp->set_trace_buffer(trace_->DumpToString());
   }
-  resp->set_micros_elapsed(MonoTime::Now().GetDeltaSince(timing_.time_received)
+  resp->set_micros_elapsed((MonoTime::Now() - timing_.time_received)
                            .ToMicroseconds());
 }
 
@@ -240,7 +240,7 @@ void InboundCall::RecordHandlingStarted(scoped_refptr<Histogram> incoming_queue_
   DCHECK(!timing_.time_handled.Initialized());  // Protect against multiple calls.
   timing_.time_handled = MonoTime::Now();
   incoming_queue_time->Increment(
-      timing_.time_handled.GetDeltaSince(timing_.time_received).ToMicroseconds());
+      (timing_.time_handled - timing_.time_received).ToMicroseconds());
 }
 
 void InboundCall::RecordHandlingCompleted() {
@@ -255,7 +255,7 @@ void InboundCall::RecordHandlingCompleted() {
 
   if (method_info_) {
     method_info_->handler_latency_histogram->Increment(
-        timing_.time_completed.GetDeltaSince(timing_.time_handled).ToMicroseconds());
+        (timing_.time_completed - timing_.time_handled).ToMicroseconds());
   }
 }
 
@@ -265,7 +265,7 @@ bool InboundCall::ClientTimedOut() const {
   }
 
   MonoTime now = MonoTime::Now();
-  int total_time = now.GetDeltaSince(timing_.time_received).ToMilliseconds();
+  int total_time = (now - timing_.time_received).ToMilliseconds();
   return total_time > header_.timeout_millis();
 }
 
@@ -273,9 +273,7 @@ MonoTime InboundCall::GetClientDeadline() const {
   if (!header_.has_timeout_millis() || header_.timeout_millis() == 0) {
     return MonoTime::Max();
   }
-  MonoTime deadline = timing_.time_received;
-  deadline.AddDelta(MonoDelta::FromMilliseconds(header_.timeout_millis()));
-  return deadline;
+  return timing_.time_received + MonoDelta::FromMilliseconds(header_.timeout_millis());
 }
 
 MonoTime InboundCall::GetTimeReceived() const {

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/inbound_call.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/inbound_call.h b/src/kudu/rpc/inbound_call.h
index ac18e39..9f25ae5 100644
--- a/src/kudu/rpc/inbound_call.h
+++ b/src/kudu/rpc/inbound_call.h
@@ -60,7 +60,7 @@ struct InboundCallTiming {
   MonoTime time_completed;  // Time the call handler completed.
 
   MonoDelta TotalDuration() const {
-    return time_completed.GetDeltaSince(time_received);
+    return time_completed - time_received;
   }
 };
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/negotiation.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/negotiation.cc b/src/kudu/rpc/negotiation.cc
index da07492..03e0f99 100644
--- a/src/kudu/rpc/negotiation.cc
+++ b/src/kudu/rpc/negotiation.cc
@@ -128,7 +128,7 @@ static Status WaitForClientConnect(Connection* conn, const MonoTime& deadline) {
   MonoDelta remaining;
   while (true) {
     now = MonoTime::Now();
-    remaining = deadline.GetDeltaSince(now);
+    remaining = deadline - now;
     DVLOG(4) << "Client waiting to connect for negotiation, time remaining until timeout deadline: "
              << remaining.ToString();
     if (PREDICT_FALSE(remaining.ToNanoseconds() <= 0)) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/outbound_call.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/outbound_call.cc b/src/kudu/rpc/outbound_call.cc
index 9e6457f..cfa0316 100644
--- a/src/kudu/rpc/outbound_call.cc
+++ b/src/kudu/rpc/outbound_call.cc
@@ -314,7 +314,7 @@ void OutboundCall::DumpPB(const DumpRunningRpcsRequestPB& req,
   std::lock_guard<simple_spinlock> l(lock_);
   resp->mutable_header()->CopyFrom(header_);
   resp->set_micros_elapsed(
-    MonoTime::Now() .GetDeltaSince(start_time_).ToMicroseconds());
+      (MonoTime::Now() - start_time_).ToMicroseconds());
 }
 
 ///

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/reactor-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/reactor-test.cc b/src/kudu/rpc/reactor-test.cc
index c32e936..2faac2a 100644
--- a/src/kudu/rpc/reactor-test.cc
+++ b/src/kudu/rpc/reactor-test.cc
@@ -70,7 +70,7 @@ TEST_F(ReactorTest, TestFunctionIsCalledAtTheRightTime) {
       MonoDelta::FromMilliseconds(100));
   latch_.Wait();
   MonoTime after = MonoTime::Now();
-  MonoDelta delta = after.GetDeltaSince(before);
+  MonoDelta delta = after - before;
   CHECK_GE(delta.ToMilliseconds(), 100);
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/reactor.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/reactor.cc b/src/kudu/rpc/reactor.cc
index 76de99b..78f63d9 100644
--- a/src/kudu/rpc/reactor.cc
+++ b/src/kudu/rpc/reactor.cc
@@ -263,8 +263,8 @@ void ReactorThread::ScanIdleConnections() {
       continue;
     }
 
-    MonoDelta connection_delta(cur_time_.GetDeltaSince(conn->last_activity_time()));
-    if (connection_delta.MoreThan(connection_keepalive_time_)) {
+    MonoDelta connection_delta(cur_time_ - conn->last_activity_time());
+    if (connection_delta > connection_keepalive_time_) {
       conn->Shutdown(Status::NetworkError(
                        StringPrintf("connection timed out after %s seconds",
                                     connection_keepalive_time_.ToString().c_str())));
@@ -353,8 +353,8 @@ Status ReactorThread::StartConnectionNegotiation(const scoped_refptr<Connection>
   DCHECK(IsCurrentThread());
 
   // Set a limit on how long the server will negotiate with a new client.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromMilliseconds(FLAGS_rpc_negotiation_timeout_ms));
+  MonoTime deadline = MonoTime::Now() +
+      MonoDelta::FromMilliseconds(FLAGS_rpc_negotiation_timeout_ms);
 
   scoped_refptr<Trace> trace(new Trace());
   ADOPT_TRACE(trace.get());

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 cb0a068..ff675fd 100644
--- a/src/kudu/rpc/rpc-test-base.h
+++ b/src/kudu/rpc/rpc-test-base.h
@@ -195,7 +195,7 @@ class CalculatorService : public CalculatorServiceIf {
     // but it isn't.
     if (req->client_timeout_defined()) {
       MonoTime deadline = context->GetClientDeadline();
-      if (deadline.Equals(MonoTime::Max())) {
+      if (deadline == MonoTime::Max()) {
         CalculatorError my_error;
         my_error.set_extra_error_data("Timeout not set");
         context->RespondApplicationError(CalculatorError::app_error_ext.number(),

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-test.cc b/src/kudu/rpc/rpc-test.cc
index 3f11b12..430cd7b 100644
--- a/src/kudu/rpc/rpc-test.cc
+++ b/src/kudu/rpc/rpc-test.cc
@@ -342,8 +342,7 @@ static void AcceptAndReadForever(Socket* listen_sock) {
   Sockaddr remote;
   CHECK_OK(listen_sock->Accept(&server_sock, &remote, 0));
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(10));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(10);
 
   size_t nread;
   uint8_t buf[1024];

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/rpc.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc.cc b/src/kudu/rpc/rpc.cc
index 65218f4..d626a46 100644
--- a/src/kudu/rpc/rpc.cc
+++ b/src/kudu/rpc/rpc.cc
@@ -73,8 +73,7 @@ void RpcRetrier::DelayedRetryCb(Rpc* rpc, const Status& status) {
   if (new_status.ok()) {
     // Has this RPC timed out?
     if (deadline_.Initialized()) {
-      MonoTime now = MonoTime::Now();
-      if (deadline_.ComesBefore(now)) {
+      if (MonoTime::Now() > deadline_) {
         string err_str = Substitute("$0 passed its deadline", rpc->ToString());
         if (!last_error_.ok()) {
           SubstituteAndAppend(&err_str, ": $0", last_error_.ToString());

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/rpc_controller.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_controller.cc b/src/kudu/rpc/rpc_controller.cc
index ae02b0a..cfa73e6 100644
--- a/src/kudu/rpc/rpc_controller.cc
+++ b/src/kudu/rpc/rpc_controller.cc
@@ -87,7 +87,7 @@ void RpcController::set_timeout(const MonoDelta& timeout) {
 }
 
 void RpcController::set_deadline(const MonoTime& deadline) {
-  set_timeout(deadline.GetDeltaSince(MonoTime::Now()));
+  set_timeout(deadline - MonoTime::Now());
 }
 
 void RpcController::SetRequestIdPB(std::unique_ptr<RequestIdPB> request_id) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 71f68a6..67371cb 100644
--- a/src/kudu/rpc/rpc_stub-test.cc
+++ b/src/kudu/rpc/rpc_stub-test.cc
@@ -416,8 +416,7 @@ TEST_F(RpcStubTest, TestEarliestDeadlineFirstQueue) {
         while (!done.load()) {
           // Set a deadline in the future. We'll keep using this same deadline
           // on each of our retries.
-          MonoTime deadline = MonoTime::Now();
-          deadline.AddDelta(MonoDelta::FromSeconds(8));
+          MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(8);
 
           for (int attempt = 1; !done.load(); attempt++) {
             RpcController controller;

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/sasl_rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_rpc-test.cc b/src/kudu/rpc/sasl_rpc-test.cc
index b07254d..a9b60b2 100644
--- a/src/kudu/rpc/sasl_rpc-test.cc
+++ b/src/kudu/rpc/sasl_rpc-test.cc
@@ -175,8 +175,7 @@ static void RunTimeoutNegotiationClient(Socket* sock) {
   SaslClient sasl_client(kSaslAppName, sock->GetFd());
   CHECK_OK(sasl_client.Init(kSaslAppName));
   CHECK_OK(sasl_client.EnableAnonymous());
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromMilliseconds(-100L));
+  MonoTime deadline = MonoTime::Now() - MonoDelta::FromMilliseconds(100L);
   sasl_client.set_deadline(deadline);
   Status s = sasl_client.Negotiate();
   ASSERT_TRUE(s.IsTimedOut()) << "Expected timeout! Got: " << s.ToString();
@@ -194,8 +193,7 @@ static void RunTimeoutNegotiationServer(Socket* sock) {
   SaslServer sasl_server(kSaslAppName, sock->GetFd());
   CHECK_OK(sasl_server.Init(kSaslAppName));
   CHECK_OK(sasl_server.EnableAnonymous());
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromMilliseconds(-100L));
+  MonoTime deadline = MonoTime::Now() - MonoDelta::FromMilliseconds(100L);
   sasl_server.set_deadline(deadline);
   Status s = sasl_server.Negotiate();
   ASSERT_TRUE(s.IsTimedOut()) << "Expected timeout! Got: " << s.ToString();

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/rpc/service_queue.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/service_queue.h b/src/kudu/rpc/service_queue.h
index 57401b9..d68576f 100644
--- a/src/kudu/rpc/service_queue.h
+++ b/src/kudu/rpc/service_queue.h
@@ -127,13 +127,13 @@ class LifoServiceQueue {
                            const InboundCall* b) {
     auto time_a = a->GetClientDeadline();
     auto time_b = b->GetClientDeadline();
-    if (time_a.Equals(time_b)) {
+    if (time_a == time_b) {
       // If two calls have the same deadline (most likely because neither one specified
       // one) then we should order them by arrival order.
       time_a = a->GetTimeReceived();
       time_b = b->GetTimeReceived();
     }
-    return time_a.ComesBefore(time_b);
+    return time_a < time_b;
   }
 
   // Struct functor wrapper for DeadlineLess.

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/server/hybrid_clock-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/hybrid_clock-test.cc b/src/kudu/server/hybrid_clock-test.cc
index 6a351c3..6e67277 100644
--- a/src/kudu/server/hybrid_clock-test.cc
+++ b/src/kudu/server/hybrid_clock-test.cc
@@ -172,7 +172,7 @@ TEST_F(HybridClockTest, TestWaitUntilAfter_TestCase1) {
   ASSERT_OK(s);
 
   MonoTime after = MonoTime::Now();
-  MonoDelta delta = after.GetDeltaSince(before);
+  MonoDelta delta = after - before;
   // The delta should be close to 0, but it takes some time for the hybrid
   // logical clock to decide that it doesn't need to wait.
   ASSERT_LT(delta.ToMicroseconds(), 25000);
@@ -208,13 +208,12 @@ TEST_F(HybridClockTest, TestWaitUntilAfter_TestCase2) {
 
   // Wait with a deadline well in the future. This should succeed.
   {
-    MonoTime deadline = before;
-    deadline.AddDelta(MonoDelta::FromSeconds(60));
+    MonoTime deadline = before + MonoDelta::FromSeconds(60);
     ASSERT_OK(clock_->WaitUntilAfter(wait_until, deadline));
   }
 
   MonoTime after = MonoTime::Now();
-  MonoDelta delta = after.GetDeltaSince(before);
+  MonoDelta delta = after - before;
 
   // In the common case current_max_error >= past_max_error and we should have waited
   // 2 * past_max_error, but if the clock's error is reset between the two reads we might

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/server/hybrid_clock.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/hybrid_clock.cc b/src/kudu/server/hybrid_clock.cc
index 1a5d75e..6d79d1f 100644
--- a/src/kudu/server/hybrid_clock.cc
+++ b/src/kudu/server/hybrid_clock.cc
@@ -111,8 +111,7 @@ Status CheckDeadlineNotWithinMicros(const MonoTime& deadline, int64_t wait_for_u
     // No deadline.
     return Status::OK();
   }
-  int64_t us_until_deadline = deadline.GetDeltaSince(
-      MonoTime::Now()).ToMicroseconds();
+  int64_t us_until_deadline = (deadline - MonoTime::Now()).ToMicroseconds();
   if (us_until_deadline <= wait_for_usec) {
     return Status::TimedOut(Substitute(
         "specified time is $0us in the future, but deadline expires in $1us",


Mime
View raw message