You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/08/17 19:12:29 UTC

[1/3] kudu git commit: KUDU-1517 Implement doc feedback from Sue M

Repository: kudu
Updated Branches:
  refs/heads/master 854b71563 -> 34b7f1eb5


KUDU-1517 Implement doc feedback from Sue M

Change-Id: I8a7647b3e5d4d36e82e06ce02a45a8811e4efed3
Reviewed-on: http://gerrit.cloudera.org:8080/3638
Tested-by: Kudu Jenkins
Reviewed-by: Mike Percy <mp...@apache.org>


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

Branch: refs/heads/master
Commit: b5aa19de62650da83ebb145cbedf04bf5b39d352
Parents: 854b715
Author: Misty Stanley-Jones <mi...@apache.org>
Authored: Wed Jul 13 14:50:02 2016 -0700
Committer: Misty Stanley-Jones <mi...@apache.org>
Committed: Wed Aug 17 00:39:06 2016 +0000

----------------------------------------------------------------------
 docs/index.adoc         | 64 ++++++++++++++++++++++++++++++++++++--------
 docs/release_notes.adoc | 52 ++---------------------------------
 2 files changed, 55 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b5aa19de/docs/index.adoc
----------------------------------------------------------------------
diff --git a/docs/index.adoc b/docs/index.adoc
index 24d4eef..828afb9 100644
--- a/docs/index.adoc
+++ b/docs/index.adoc
@@ -64,6 +64,34 @@ refreshes of the predictive model based on all historic data
 
 For more information about these and other scenarios, see <<kudu_use_cases>>.
 
+=== Kudu-Impala Integration Features
+`CREATE TABLE`::
+  Impala supports creating and dropping tables using Kudu as the persistence layer.
+  The tables follow the same internal / external approach as other tables in Impala,
+  allowing for flexible data ingestion and querying.
+`INSERT`::
+  Data can be inserted into Kudu tables in Impala using the same syntax as
+  any other Impala table like those using HDFS or HBase for persistence.
+`UPDATE` / `DELETE`::
+  Impala supports the `UPDATE` and `DELETE` SQL commands to modify existing data in
+  a Kudu table row-by-row or as a batch. The syntax of the SQL commands is chosen
+  to be as compatible as possible with existing standards. In addition to simple `DELETE`
+  or `UPDATE` commands, you can specify complex joins with a `FROM` clause in a subquery.
+  Not all types of joins have been tested.
+Flexible Partitioning::
+  Similar to partitioning of tables in Hive, Kudu allows you to dynamically
+  pre-split tables by hash or range into a predefined number of tablets, in order
+  to distribute writes and queries evenly across your cluster. You can partition by
+  any number of primary key columns, by any number of hashes, and an optional list of
+  split rows. See link:schema_design.html[Schema Design].
+Parallel Scan::
+  To achieve the highest possible performance on modern hardware, the Kudu client
+  used by Impala parallelizes scans across multiple tablets.
+High-efficiency queries::
+  Where possible, Impala pushes down predicate evaluation to Kudu, so that predicates
+  are evaluated as close as possible to the data. Query performance is comparable
+  to Parquet in many workloads.
+
 == Concepts and Terms
 [[kudu_columnar_data_store]]
 .Columnar Data Store
@@ -77,10 +105,11 @@ of that column, while ignoring other columns. This means you can fulfill your qu
 while reading a minimal number of blocks on disk. With a row-based store, you need
 to read the entire row, even if you only return values from a few columns.
 
-Data Compression:: Because a given column contains only one type of data, pattern-based
-compression can be orders of magnitude more efficient than compressing mixed data
-types. Combined with the efficiencies of reading data from columns,  compression allows
-you to fulfill your query while reading even fewer blocks from disk. See
+Data Compression:: Because a given column contains only one type of data,
+pattern-based compression can be orders of magnitude more efficient than
+compressing mixed data types, which are used in row-based solutions. Combined
+with the efficiencies of reading data from columns, compression allows you to
+fulfill your query while reading even fewer blocks from disk. See
 link:schema_design.html#encoding[Data Compression]
 
 .Table
@@ -146,10 +175,22 @@ each tablet, the tablet's current state, and start and end keys.
 
 .Logical Replication
 
-Kudu replicates operations, not on-disk data. This is referred to as _logical
-replication_, as opposed to _physical replication_. Physical operations, such as
-compaction, do not need to transmit the data over the network. This results in a
-substantial reduction in network traffic for heavy write scenarios.
+Kudu replicates operations, not on-disk data. This is referred to as _logical replication_,
+as opposed to _physical replication_. This has several advantages:
+
+* Although inserts and updates do transmit data over the network, deletes do not need
+  to move any data. The delete operation is sent to each tablet server, which performs
+  the delete locally.
+
+* Physical operations, such as compaction, do not need to transmit the data over the
+  network in Kudu. This is different from storage systems that use HDFS, where
+  the blocks need to be transmitted over the network to fulfill the required number of
+  replicas.
+
+* Tablets do not need to perform compactions at the same time or on the same schedule,
+  or otherwise remain in sync on the physical storage layer. This decreases the chances
+  of all tablet servers experiencing high latency at the same time, due to compactions
+  or heavy write loads.
 
 == Architectural Overview
 
@@ -192,13 +233,14 @@ is also beneficial in this context, because many time-series workloads read only
 as opposed to the whole row.
 
 In the past, you might have needed to use multiple data stores to handle different
-data access patterns. This practice adds complexity to your application and operations, and
-duplicates storage. Kudu can handle all of these access patterns natively and efficiently,
+data access patterns. This practice adds complexity to your application and operations,
+and duplicates your data, doubling (or worse) the amount of storage
+required. Kudu can handle all of these access patterns natively and efficiently,
 without the need to off-load work to other data stores.
 
 .Predictive Modeling
 
-Data analysts often develop predictive learning models from large sets of data. The
+Data scientists often develop predictive learning models from large sets of data. The
 model and the data may need to be updated or modified often as the learning takes
 place or as the situation being modeled changes. In addition, the scientist may want
 to change one or more factors in the model to see what happens over time. Updating

http://git-wip-us.apache.org/repos/asf/kudu/blob/b5aa19de/docs/release_notes.adoc
----------------------------------------------------------------------
diff --git a/docs/release_notes.adoc b/docs/release_notes.adoc
index 0c6b404..d2555c7 100644
--- a/docs/release_notes.adoc
+++ b/docs/release_notes.adoc
@@ -28,30 +28,9 @@
 :sectlinks:
 :experimental:
 
-== Introducing Kudu
-
-Kudu is a columnar storage manager developed for the Hadoop platform. Kudu shares
-the common technical properties of Hadoop ecosystem applications: it runs on
-commodity hardware, is horizontally scalable, and supports highly available operation.
-
-Kudu\u2019s design sets it apart. Some of Kudu\u2019s benefits include:
-
-* Fast processing of OLAP workloads.
-* Integration with MapReduce, Spark, and other Hadoop ecosystem components.
-* Tight integration with Apache Impala (incubating), making it a good, mutable alternative to
-using HDFS with Parquet. See link:kudu_impala_integration.html[Kudu Impala Integration].
-* Strong but flexible consistency model.
-* Strong performance for running sequential and random workloads simultaneously.
-* Efficient utilization of hardware resources.
-* High availability. Tablet Servers and Masters use the Raft Consensus Algorithm.
-Given a replication factor of `2f+1`, if `f` tablet servers serving a given tablet
-fail, the tablet is still available.
-+
-NOTE: High availability for masters is not supported during the public beta.
+=== Introduction
 
-By combining all of these properties, Kudu targets support for families of
-applications that are difficult or impossible to implement on current-generation
-Hadoop storage technologies.
+If you are new to Kudu, check out its list of link:index.html[features and benefits].
 
 [[rn_0.10.0]]
 === Release notes specific to 0.10.0
@@ -628,33 +607,6 @@ they will be announced to the user group when they occur.
 While multiple drops of beta code are planned, we can't guarantee their schedules
 or contents.
 
-==== Kudu-Impala Integration Features
-`CREATE TABLE`::
-  Impala supports creating and dropping tables using Kudu as the persistence layer.
-  The tables follow the same internal / external approach as other tables in Impala,
-  allowing for flexible data ingestion and querying.
-`INSERT`::
-  Data can be inserted into Kudu tables in Impala using the same mechanisms as
-  any other table with HDFS or HBase persistence.
-`UPDATE` / `DELETE`::
-  Impala supports the `UPDATE` and `DELETE` SQL commands to modify existing data in
-  a Kudu table row-by-row or as a batch. The syntax of the SQL commands is chosen
-  to be as compatible as possible to existing solutions. In addition to simple `DELETE`
-  or `UPDATE` commands, you can specify complex joins in the `FROM` clause of the query
-  using the same syntax as a regular `SELECT` statement.
-Flexible Partitioning::
-  Similar to partitioning of tables in Hive, Kudu allows you to dynamically
-  pre-split tables by hash or range into a predefined number of tablets, in order
-  to distribute writes and queries evenly across your cluster. You can partition by
-  any number of primary key columns, by any number of hashes and an optional list of
-  split rows. See link:schema_design.html[Schema Design].
-Parallel Scan::
-  To achieve the highest possible performance on modern hardware, the Kudu client
-  within Impala parallelizes scans to multiple tablets.
-High-efficiency queries::
-  Where possible, Impala pushes down predicate evaluation to Kudu, so that predicates
-  are evaluated as close as possible to the data. Query performance is comparable
-  to Parquet in many workloads.
 
 [[beta_limitations]]
 ==== Limitations of the Kudu Public Beta


[2/3] kudu git commit: [util/monotime] added handy operators for MonoTime

Posted by to...@apache.org.
http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/server/pprof-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/pprof-path-handlers.cc b/src/kudu/server/pprof-path-handlers.cc
index c1850ee..1537a31 100644
--- a/src/kudu/server/pprof-path-handlers.cc
+++ b/src/kudu/server/pprof-path-handlers.cc
@@ -149,10 +149,9 @@ static void PprofContentionHandler(const Webserver::WebRequest& req, stringstrea
   *output << "sampling period = 1" << endl;
   *output << "cycles/second = " << base::CyclesPerSecond() << endl;
 
-  MonoTime end = MonoTime::Now();
-  end.AddDelta(MonoDelta::FromSeconds(seconds));
+  MonoTime end = MonoTime::Now() + MonoDelta::FromSeconds(seconds);
   StartSynchronizationProfiling();
-  while (MonoTime::Now().ComesBefore(end)) {
+  while (MonoTime::Now() < end) {
     SleepFor(MonoDelta::FromMilliseconds(500));
     FlushSynchronizationProfile(output, &discarded_samples);
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/server/server_base.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/server_base.cc b/src/kudu/server/server_base.cc
index 6d84393..aa7d111 100644
--- a/src/kudu/server/server_base.cc
+++ b/src/kudu/server/server_base.cc
@@ -262,8 +262,8 @@ void ServerBase::MetricsLoggingThread() {
 
   MonoTime next_log = MonoTime::Now();
   while (!stop_metrics_logging_latch_.WaitUntil(next_log)) {
-    next_log = MonoTime::Now();
-    next_log.AddDelta(MonoDelta::FromMilliseconds(options_.metrics_log_interval_ms));
+    next_log = MonoTime::Now() +
+        MonoDelta::FromMilliseconds(options_.metrics_log_interval_ms);
 
     std::stringstream buf;
     buf << "metrics " << GetCurrentTimeMicros() << " ";
@@ -278,7 +278,7 @@ void ServerBase::MetricsLoggingThread() {
     Status s = metric_registry_->WriteAsJson(&writer, metrics, opts);
     if (!s.ok()) {
       WARN_NOT_OK(s, "Unable to collect metrics to log");
-      next_log.AddDelta(kWaitBetweenFailures);
+      next_log += kWaitBetweenFailures;
       continue;
     }
 
@@ -287,7 +287,7 @@ void ServerBase::MetricsLoggingThread() {
     s = log.Append(buf.str());
     if (!s.ok()) {
       WARN_NOT_OK(s, "Unable to write metrics to log");
-      next_log.AddDelta(kWaitBetweenFailures);
+      next_log += kWaitBetweenFailures;
       continue;
     }
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/server/webui_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/webui_util.cc b/src/kudu/server/webui_util.cc
index ebdc353..1b90700 100644
--- a/src/kudu/server/webui_util.cc
+++ b/src/kudu/server/webui_util.cc
@@ -167,11 +167,10 @@ void HtmlOutputTaskList(const std::vector<scoped_refptr<MonitoredTask> >& tasks,
 
     double running_secs = 0;
     if (task->completion_timestamp().Initialized()) {
-      running_secs = task->completion_timestamp().GetDeltaSince(
-        task->start_timestamp()).ToSeconds();
+      running_secs =
+          (task->completion_timestamp() - task->start_timestamp()).ToSeconds();
     } else if (task->start_timestamp().Initialized()) {
-      running_secs = MonoTime::Now().GetDeltaSince(
-        task->start_timestamp()).ToSeconds();
+      running_secs = (MonoTime::Now() - task->start_timestamp()).ToSeconds();
     }
 
     *output << Substitute(

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tablet/compaction-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/compaction-test.cc b/src/kudu/tablet/compaction-test.cc
index 45bb343..738c8ce 100644
--- a/src/kudu/tablet/compaction-test.cc
+++ b/src/kudu/tablet/compaction-test.cc
@@ -749,8 +749,7 @@ TEST_F(TestCompaction, TestCompactionFreesDiskSpace) {
 
   // Block deletion may happen asynchronously, so let's loop for a bit until
   // the space becomes free.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(30));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(30);
   while (true) {
     uint64_t bytes_after;
     ASSERT_OK(env_->GetFileSizeOnDiskRecursively(
@@ -759,7 +758,7 @@ TEST_F(TestCompaction, TestCompactionFreesDiskSpace) {
                             bytes_before, bytes_after);
     if (bytes_after < bytes_before) {
       break;
-    } else if (deadline.ComesBefore(MonoTime::Now())) {
+    } else if (MonoTime::Now() > deadline) {
       FAIL() << "Timed out waiting for compaction to reduce data block disk "
              << "space usage";
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tablet/mvcc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mvcc-test.cc b/src/kudu/tablet/mvcc-test.cc
index 48782f0..7d4ef77 100644
--- a/src/kudu/tablet/mvcc-test.cc
+++ b/src/kudu/tablet/mvcc-test.cc
@@ -607,8 +607,7 @@ TEST_F(MvccTest, TestWaitUntilCleanDeadline) {
 
   // Wait until the 'tx1' timestamp is clean -- this won't happen because the
   // transaction isn't committed yet.
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromMilliseconds(10));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromMilliseconds(10);
   MvccSnapshot snap;
   Status s = mgr.WaitForCleanSnapshotAtTimestamp(tx1, &snap, deadline);
   ASSERT_TRUE(s.IsTimedOut()) << s.ToString();

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tablet/tablet_mm_ops-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_mm_ops-test.cc b/src/kudu/tablet/tablet_mm_ops-test.cc
index 5f9514a..7422230 100644
--- a/src/kudu/tablet/tablet_mm_ops-test.cc
+++ b/src/kudu/tablet/tablet_mm_ops-test.cc
@@ -48,7 +48,7 @@ class KuduTabletMmOpsTest : public TabletTestBase<IntKeyTestSetup<INT64>> {
   void StatsShouldChange(MaintenanceOp* op) {
     SleepFor(MonoDelta::FromMilliseconds(1));
     op->UpdateStats(&stats_);
-    ASSERT_TRUE(next_time_.ComesBefore(stats_.last_modified()));
+    ASSERT_TRUE(next_time_ < stats_.last_modified());
     next_time_ = stats_.last_modified();
   }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tablet/tablet_peer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_peer.cc b/src/kudu/tablet/tablet_peer.cc
index eb9366b..93301c2 100644
--- a/src/kudu/tablet/tablet_peer.cc
+++ b/src/kudu/tablet/tablet_peer.cc
@@ -313,8 +313,8 @@ Status TabletPeer::WaitUntilConsensusRunning(const MonoDelta& timeout) {
       break;
     }
     MonoTime now(MonoTime::Now());
-    MonoDelta elapsed(now.GetDeltaSince(start));
-    if (elapsed.MoreThan(timeout)) {
+    MonoDelta elapsed(now - start);
+    if (elapsed > timeout) {
       return Status::TimedOut(Substitute("Consensus is not running after waiting for $0. State; $1",
                                          elapsed.ToString(), TabletStatePB_Name(cached_state)));
     }
@@ -419,7 +419,7 @@ void TabletPeer::GetInFlightTransactions(Transaction::TraceType trace_type,
       }
       status_pb.set_description(driver->ToString());
       int64_t running_for_micros =
-          MonoTime::Now().GetDeltaSince(driver->start_time()).ToMicroseconds();
+          (MonoTime::Now() - driver->start_time()).ToMicroseconds();
       status_pb.set_running_for_micros(running_for_micros);
       if (trace_type == Transaction::TRACE_TXNS) {
         status_pb.set_trace_buffer(driver->trace()->DumpToString());

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 c97d71b..60af908 100644
--- a/src/kudu/tablet/transactions/transaction_driver.cc
+++ b/src/kudu/tablet/transactions/transaction_driver.cc
@@ -382,7 +382,7 @@ void TransactionDriver::ReplicationFinished(const Status& status) {
       transaction_status_ = status;
     }
     prepare_state_copy = prepare_state_;
-    replication_duration = replication_finished_time.GetDeltaSince(replication_start_time_);
+    replication_duration = replication_finished_time - replication_start_time_;
   }
 
 
@@ -511,7 +511,7 @@ Status TransactionDriver::CommitWait() {
       mutable_state()->tablet_peer()->clock()->WaitUntilAfter(mutable_state()->timestamp(),
                                                               MonoTime::Max()));
   mutable_state()->mutable_metrics()->commit_wait_duration_usec =
-      MonoTime::Now().GetDeltaSince(before).ToMicroseconds();
+      (MonoTime::Now() - before).ToMicroseconds();
   return Status::OK();
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tablet/transactions/transaction_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/transaction_tracker.cc b/src/kudu/tablet/transactions/transaction_tracker.cc
index 4e0033e..fbdb5a6 100644
--- a/src/kudu/tablet/transactions/transaction_tracker.cc
+++ b/src/kudu/tablet/transactions/transaction_tracker.cc
@@ -213,8 +213,8 @@ Status TransactionTracker::WaitForAllToFinish(const MonoDelta& timeout) const {
       break;
     }
 
-    MonoDelta diff = MonoTime::Now().GetDeltaSince(start_time);
-    if (diff.MoreThan(timeout)) {
+    MonoDelta diff = MonoTime::Now() - start_time;
+    if (diff > timeout) {
       return Status::TimedOut(Substitute("Timed out waiting for all transactions to finish. "
                                          "$0 transactions pending. Waited for $1",
                                          txns.size(), diff.ToString()));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 44d3fa3..6387fb1 100644
--- a/src/kudu/tablet/transactions/write_transaction.cc
+++ b/src/kudu/tablet/transactions/write_transaction.cc
@@ -177,7 +177,7 @@ void WriteTransaction::Finish(TransactionResult result) {
         metrics->commit_wait_duration->Increment(state_->metrics().commit_wait_duration_usec);
       }
       uint64_t op_duration_usec =
-          MonoTime::Now().GetDeltaSince(start_time_).ToMicroseconds();
+          (MonoTime::Now() - start_time_).ToMicroseconds();
       switch (state()->external_consistency_mode()) {
         case CLIENT_PROPAGATED:
           metrics->write_op_duration_client_propagated_consistency->Increment(op_duration_usec);
@@ -194,7 +194,7 @@ void WriteTransaction::Finish(TransactionResult result) {
 
 string WriteTransaction::ToString() const {
   MonoTime now(MonoTime::Now());
-  MonoDelta d = now.GetDeltaSince(start_time_);
+  MonoDelta d = now - start_time_;
   WallTime abs_time = WallTime_Now() - d.ToSeconds();
   string abs_time_formatted;
   StringAppendStrftime(&abs_time_formatted, "%Y-%m-%d %H:%M:%S", (time_t)abs_time, true);

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tools/ksck.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index 20e28af..8d7e4f5 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -278,19 +278,17 @@ class ChecksumResultReporter : public RefCountedThreadSafe<ChecksumResultReporte
   // Otherwise, returns true.
   bool WaitFor(const MonoDelta& timeout) const {
     MonoTime start = MonoTime::Now();
-
-    MonoTime deadline = start;
-    deadline.AddDelta(timeout);
+    MonoTime deadline = start + timeout;
 
     bool done = false;
     while (!done) {
       MonoTime now = MonoTime::Now();
-      int rem_ms = deadline.GetDeltaSince(now).ToMilliseconds();
+      int rem_ms = (deadline - now).ToMilliseconds();
       if (rem_ms <= 0) return false;
 
       done = responses_.WaitFor(MonoDelta::FromMilliseconds(std::min(rem_ms, 5000)));
       string status = done ? "finished in " : "running for ";
-      int run_time_sec = MonoTime::Now().GetDeltaSince(start).ToSeconds();
+      int run_time_sec = (MonoTime::Now() - start).ToSeconds();
       Info() << "Checksum " << status << run_time_sec << "s: "
              << responses_.count() << "/" << expected_count_ << " replicas remaining ("
              << HumanReadableNumBytes::ToString(disk_bytes_summed_.Load()) << " from disk, "

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tools/ksck_remote-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck_remote-test.cc b/src/kudu/tools/ksck_remote-test.cc
index 5f87c15..7c8c303 100644
--- a/src/kudu/tools/ksck_remote-test.cc
+++ b/src/kudu/tools/ksck_remote-test.cc
@@ -207,10 +207,9 @@ TEST_F(RemoteKsckTest, TestTabletServersOk) {
 }
 
 TEST_F(RemoteKsckTest, TestTableConsistency) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(30));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(30);
   Status s;
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  while (MonoTime::Now() < deadline) {
     ASSERT_OK(ksck_->CheckMasterRunning());
     ASSERT_OK(ksck_->FetchTableAndTabletInfo());
     ASSERT_OK(ksck_->FetchInfoFromTabletServers());
@@ -228,10 +227,9 @@ TEST_F(RemoteKsckTest, TestChecksum) {
   LOG(INFO) << "Generating row writes...";
   ASSERT_OK(GenerateRowWrites(num_writes));
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(30));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(30);
   Status s;
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  while (MonoTime::Now() < deadline) {
     ASSERT_OK(ksck_->FetchTableAndTabletInfo());
 
     err_stream_.str("");
@@ -275,8 +273,7 @@ TEST_F(RemoteKsckTest, TestChecksumSnapshot) {
 
   uint64_t ts = client_->GetLatestObservedTimestamp();
   MonoTime start(MonoTime::Now());
-  MonoTime deadline = start;
-  deadline.AddDelta(MonoDelta::FromSeconds(30));
+  MonoTime deadline = start + MonoDelta::FromSeconds(30);
   Status s;
   // TODO: We need to loop here because safe time is not yet implemented.
   // Remove this loop when that is done. See KUDU-1056.
@@ -284,13 +281,13 @@ TEST_F(RemoteKsckTest, TestChecksumSnapshot) {
     ASSERT_OK(ksck_->FetchTableAndTabletInfo());
     Status s = ksck_->ChecksumData(ChecksumOptions(MonoDelta::FromSeconds(10), 16, true, ts));
     if (s.ok()) break;
-    if (deadline.ComesBefore(MonoTime::Now())) break;
+    if (MonoTime::Now() > deadline) break;
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
   if (!s.ok()) {
     LOG(WARNING) << Substitute("Timed out after $0 waiting for ksck to become consistent on TS $1. "
                                "Status: $2",
-                               MonoTime::Now().GetDeltaSince(start).ToString(),
+                               (MonoTime::Now() - start).ToString(),
                                ts, s.ToString());
     EXPECT_OK(s); // To avoid ASAN complaints due to thread reading the CountDownLatch.
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tserver/heartbeater.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/heartbeater.cc b/src/kudu/tserver/heartbeater.cc
index 19027bb..d56a8ca 100644
--- a/src/kudu/tserver/heartbeater.cc
+++ b/src/kudu/tserver/heartbeater.cc
@@ -424,15 +424,15 @@ void Heartbeater::Thread::RunThread() {
   last_hb_response_.set_needs_full_tablet_report(true);
 
   while (true) {
-    MonoTime next_heartbeat = MonoTime::Now();
-    next_heartbeat.AddDelta(MonoDelta::FromMilliseconds(GetMillisUntilNextHeartbeat()));
+    MonoTime next_heartbeat =
+        MonoTime::Now() + MonoDelta::FromMilliseconds(GetMillisUntilNextHeartbeat());
 
     // Wait for either the heartbeat interval to elapse, or for an "ASAP" heartbeat,
     // or for the signal to shut down.
     {
       MutexLock l(mutex_);
       while (true) {
-        MonoDelta remaining = next_heartbeat.GetDeltaSince(MonoTime::Now());
+        MonoDelta remaining = next_heartbeat - MonoTime::Now();
         if (remaining.ToMilliseconds() <= 0 ||
             heartbeat_asap_ ||
             !should_run_) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tserver/scanner_metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanner_metrics.cc b/src/kudu/tserver/scanner_metrics.cc
index 2527b98..80f189d 100644
--- a/src/kudu/tserver/scanner_metrics.cc
+++ b/src/kudu/tserver/scanner_metrics.cc
@@ -42,7 +42,7 @@ ScannerMetrics::ScannerMetrics(const scoped_refptr<MetricEntity>& metric_entity)
 
 void ScannerMetrics::SubmitScannerDuration(const MonoTime& time_started) {
   scanner_duration->Increment(
-      MonoTime::Now().GetDeltaSince(time_started).ToMicroseconds());
+      (MonoTime::Now() - time_started).ToMicroseconds());
 }
 
 } // namespace tserver

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tserver/scanners.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.cc b/src/kudu/tserver/scanners.cc
index ab23b4c..e698b61 100644
--- a/src/kudu/tserver/scanners.cc
+++ b/src/kudu/tserver/scanners.cc
@@ -159,7 +159,7 @@ void ScannerManager::RemoveExpiredScanners() {
       SharedScanner& scanner = it->second;
       MonoDelta time_live =
           scanner->TimeSinceLastAccess(MonoTime::Now());
-      if (time_live.MoreThan(scanner_ttl)) {
+      if (time_live > scanner_ttl) {
         // TODO: once we have a metric for the number of scanners expired, make this a
         // VLOG(1).
         LOG(INFO) << "Expiring scanner id: " << it->first << ", of tablet " << scanner->tablet_id()

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tserver/scanners.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.h b/src/kudu/tserver/scanners.h
index d9264e2..3e28d69 100644
--- a/src/kudu/tserver/scanners.h
+++ b/src/kudu/tserver/scanners.h
@@ -238,7 +238,7 @@ class Scanner {
   // Return the delta from the last time this scan was updated to 'now'.
   MonoDelta TimeSinceLastAccess(const MonoTime& now) const {
     std::lock_guard<simple_spinlock> l(lock_);
-    return now.GetDeltaSince(last_access_time_);
+    return now - last_access_time_;
   }
 
   // Returns the time this scan was started.

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tserver/tablet_server-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-stress-test.cc b/src/kudu/tserver/tablet_server-stress-test.cc
index 95af005..cfe24b1 100644
--- a/src/kudu/tserver/tablet_server-stress-test.cc
+++ b/src/kudu/tserver/tablet_server-stress-test.cc
@@ -91,7 +91,7 @@ void TSStressTest::InserterThread(int thread_idx) {
     MonoTime before = MonoTime::Now();
     InsertTestRowsRemote(thread_idx, i, 1);
     MonoTime after = MonoTime::Now();
-    MonoDelta delta = after.GetDeltaSince(before);
+    MonoDelta delta = after - before;
     histogram_->Increment(delta.ToMicroseconds());
   }
   LOG(INFO) << "Inserter thread " << thread_idx << " complete";

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 3ba0b11..9e036ff 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -2033,12 +2033,12 @@ TEST_F(TabletServerTest, TestInsertLatencyMicroBenchmark) {
     MonoTime before = MonoTime::Now();
     InsertTestRowsRemote(0, i, 1);
     MonoTime after = MonoTime::Now();
-    MonoDelta delta = after.GetDeltaSince(before);
+    MonoDelta delta = after - before;
     histogram->Increment(delta.ToMicroseconds());
   }
 
   MonoTime end = MonoTime::Now();
-  double throughput = ((max_rows - warmup) * 1.0) / end.GetDeltaSince(start).ToSeconds();
+  double throughput = ((max_rows - warmup) * 1.0) / (end - start).ToSeconds();
 
   // Generate the JSON.
   std::stringstream out;

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index d5bc836..8b9d770 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -1590,8 +1590,7 @@ Status TabletServiceImpl::HandleContinueScanRequest(const ScanRequestPB* req,
   // TODO: in the future, use the client timeout to set a budget. For now,
   // just use a half second, which should be plenty to amortize call overhead.
   int budget_ms = 500;
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromMilliseconds(budget_ms));
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromMilliseconds(budget_ms);
 
   int64_t rows_scanned = 0;
   while (iter->HasNext()) {
@@ -1622,8 +1621,7 @@ Status TabletServiceImpl::HandleContinueScanRequest(const ScanRequestPB* req,
     }
 
     // TODO: should check if RPC got cancelled, once we implement RPC cancellation.
-    MonoTime now = MonoTime::Now();
-    if (PREDICT_FALSE(!now.ComesBefore(deadline))) {
+    if (PREDICT_FALSE(MonoTime::Now() >= deadline)) {
       TRACE("Deadline expired - responding early");
       break;
     }
@@ -1732,14 +1730,13 @@ Status TabletServiceImpl::HandleScanAtSnapshot(const NewScanRequestPB& scan_pb,
   // has been since the MVCC manager was able to advance its safe time. If it has been
   // a long time, it's likely that the majority of voters for this tablet are down
   // and some writes are "stuck" and therefore won't be committed.
-  MonoTime client_deadline = rpc_context->GetClientDeadline();
   // Subtract a little bit from the client deadline so that it's more likely we actually
   // have time to send our response sent back before it times out.
-  client_deadline.AddDelta(MonoDelta::FromMilliseconds(-10));
+  MonoTime client_deadline =
+      rpc_context->GetClientDeadline() - MonoDelta::FromMilliseconds(10);
 
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(MonoDelta::FromSeconds(5));
-  if (client_deadline.ComesBefore(deadline)) {
+  MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(5);
+  if (client_deadline < deadline) {
     deadline = client_deadline;
   }
 
@@ -1750,7 +1747,7 @@ Status TabletServiceImpl::HandleScanAtSnapshot(const NewScanRequestPB& scan_pb,
           tmp_snap_timestamp, &snap, deadline),
       "could not wait for desired snapshot timestamp to be consistent");
 
-  uint64_t duration_usec = MonoTime::Now().GetDeltaSince(before).ToMicroseconds();
+  uint64_t duration_usec = (MonoTime::Now() - before).ToMicroseconds();
   tablet->metrics()->snapshot_read_inflight_wait_duration->Increment(duration_usec);
   TRACE("All operations in snapshot committed. Waited for $0 microseconds", duration_usec);
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 dfbb7f1..2d01868 100644
--- a/src/kudu/tserver/ts_tablet_manager-test.cc
+++ b/src/kudu/tserver/ts_tablet_manager-test.cc
@@ -241,10 +241,11 @@ TEST_F(TsTabletManagerTest, TestTabletReports) {
       }
     }
     if (found_tablet_2) break;
-    MonoDelta elapsed(MonoTime::Now().GetDeltaSince(start));
-    ASSERT_TRUE(elapsed.LessThan(timeout)) << "Waited too long for tablet-2 to be marked dirty: "
-                                           << elapsed.ToString() << ". "
-                                           << "Latest report: " << report.ShortDebugString();
+    MonoDelta elapsed(MonoTime::Now() - start);
+    ASSERT_TRUE(elapsed < timeout)
+        << "Waited too long for tablet-2 to be marked dirty: "
+        << elapsed.ToString() << ". "
+        << "Latest report: " << report.ShortDebugString();
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/tserver/ts_tablet_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.cc b/src/kudu/tserver/ts_tablet_manager.cc
index 481f569..bdc65dd 100644
--- a/src/kudu/tserver/ts_tablet_manager.cc
+++ b/src/kudu/tserver/ts_tablet_manager.cc
@@ -687,7 +687,7 @@ void TSTabletManager::OpenTablet(const scoped_refptr<TabletMetadata>& meta,
     tablet_peer->RegisterMaintenanceOps(server_->maintenance_manager());
   }
 
-  int elapsed_ms = MonoTime::Now().GetDeltaSince(start).ToMilliseconds();
+  int elapsed_ms = (MonoTime::Now() - start).ToMilliseconds();
   if (elapsed_ms > FLAGS_tablet_start_warn_threshold_ms) {
     LOG(WARNING) << LogPrefix(tablet_id) << "Tablet startup took " << elapsed_ms << "ms";
     if (Trace::CurrentTrace()) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/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 18e95a5..aedf41a 100644
--- a/src/kudu/tserver/tserver-path-handlers.cc
+++ b/src/kudu/tserver/tserver-path-handlers.cc
@@ -417,7 +417,7 @@ void TabletServerPathHandlers::HandleScansPage(const Webserver::WebRequest& req,
 string TabletServerPathHandlers::ScannerToHtml(const Scanner& scanner) const {
   std::stringstream html;
   uint64_t time_in_flight_us =
-      MonoTime::Now().GetDeltaSince(scanner.start_time()).ToMicroseconds();
+      (MonoTime::Now() - scanner.start_time()).ToMicroseconds();
   uint64_t time_since_last_access_us =
       scanner.TimeSinceLastAccess(MonoTime::Now()).ToMicroseconds();
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/countdown_latch.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/countdown_latch.h b/src/kudu/util/countdown_latch.h
index 1816f4c..7024c1c 100644
--- a/src/kudu/util/countdown_latch.h
+++ b/src/kudu/util/countdown_latch.h
@@ -79,8 +79,7 @@ class CountDownLatch {
   // Returns true if the count became zero, false otherwise.
   bool WaitUntil(const MonoTime& when) const {
     ThreadRestrictions::AssertWaitAllowed();
-    MonoDelta relative = when.GetDeltaSince(MonoTime::Now());
-    return WaitFor(relative);
+    return WaitFor(when - MonoTime::Now());
   }
 
   // Waits for the count on the latch to reach zero, or until 'delta' time elapses.

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/debug/trace_event_synthetic_delay.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/debug/trace_event_synthetic_delay.cc b/src/kudu/util/debug/trace_event_synthetic_delay.cc
index ecbe383..0fff9fb 100644
--- a/src/kudu/util/debug/trace_event_synthetic_delay.cc
+++ b/src/kudu/util/debug/trace_event_synthetic_delay.cc
@@ -135,14 +135,12 @@ MonoTime TraceEventSyntheticDelay::CalculateEndTimeLocked(
     return MonoTime();
   else if (mode_ == ALTERNATING && trigger_count_++ % 2)
     return MonoTime();
-  MonoTime end = start_time;
-  end.AddDelta(target_duration_);
-  return end;
+  return start_time + target_duration_;
 }
 
 void TraceEventSyntheticDelay::ApplyDelay(const MonoTime& end_time) {
   TRACE_EVENT0("synthetic_delay", name_.c_str());
-  while (clock_->Now().ComesBefore(end_time)) {
+  while (clock_->Now() < end_time) {
     // Busy loop.
   }
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/failure_detector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/failure_detector.cc b/src/kudu/util/failure_detector.cc
index 696abc2..510cbca 100644
--- a/src/kudu/util/failure_detector.cc
+++ b/src/kudu/util/failure_detector.cc
@@ -91,7 +91,7 @@ Status TimedFailureDetector::MessageFrom(const std::string& name, const MonoTime
 FailureDetector::NodeStatus TimedFailureDetector::GetNodeStatusUnlocked(const std::string& name,
                                                                         const MonoTime& now) {
   Node* node = FindOrDie(nodes_, name);
-  if (now.GetDeltaSince(node->last_heard_of).MoreThan(failure_period_)) {
+  if ((now - node->last_heard_of) > failure_period_) {
     node->status = DEAD;
   }
   return node->status;

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/metrics.cc b/src/kudu/util/metrics.cc
index 27766ac..50ccdcf 100644
--- a/src/kudu/util/metrics.cc
+++ b/src/kudu/util/metrics.cc
@@ -275,16 +275,15 @@ void MetricEntity::RetireOldMetrics() {
       VLOG(3) << "Metric " << it->first << " has become un-referenced. Will retire after "
               << "the retention interval";
       // This is the first time we've seen this metric as retirable.
-      metric->retire_time_ = now;
-      metric->retire_time_.AddDelta(MonoDelta::FromMilliseconds(
-                                      FLAGS_metrics_retirement_age_ms));
+      metric->retire_time_ =
+          now + MonoDelta::FromMilliseconds(FLAGS_metrics_retirement_age_ms);
       ++it;
       continue;
     }
 
     // If we've already seen this metric in a previous scan, check if it's
     // time to retire it yet.
-    if (now.ComesBefore(metric->retire_time_)) {
+    if (now < metric->retire_time_) {
       VLOG(3) << "Metric " << it->first << " is un-referenced, but still within "
               << "the retention interval";
       ++it;
@@ -676,7 +675,7 @@ ScopedLatencyMetric::ScopedLatencyMetric(Histogram* latency_hist)
 ScopedLatencyMetric::~ScopedLatencyMetric() {
   if (latency_hist_ != nullptr) {
     MonoTime time_now = MonoTime::Now();
-    latency_hist_->Increment(time_now.GetDeltaSince(time_started_).ToMicroseconds());
+    latency_hist_->Increment((time_now - time_started_).ToMicroseconds());
   }
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/monotime-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/monotime-test.cc b/src/kudu/util/monotime-test.cc
index 2852768..f193ecd 100644
--- a/src/kudu/util/monotime-test.cc
+++ b/src/kudu/util/monotime-test.cc
@@ -45,9 +45,9 @@ TEST(TestMonoTime, TestComparison) {
   MonoTime future(now);
   future.AddDelta(MonoDelta::FromNanoseconds(1L));
 
-  ASSERT_GT(future.GetDeltaSince(now).ToNanoseconds(), 0);
-  ASSERT_LT(now.GetDeltaSince(future).ToNanoseconds(), 0);
-  ASSERT_EQ(now.GetDeltaSince(now).ToNanoseconds(), 0);
+  ASSERT_GT((future - now).ToNanoseconds(), 0);
+  ASSERT_LT((now - future).ToNanoseconds(), 0);
+  ASSERT_EQ((now - now).ToNanoseconds(), 0);
 
   MonoDelta nano(MonoDelta::FromNanoseconds(1L));
   MonoDelta mil(MonoDelta::FromMilliseconds(1L));
@@ -185,6 +185,231 @@ TEST(TestMonoTime, TestSleepForOverflow) {
   ASSERT_GE(actualSleep.ToNanoseconds(), sleep.ToNanoseconds());
 }
 
+// Test functionality of the handy operators for MonoTime/MonoDelta objects.
+// The test assumes that the core functionality provided by the
+// MonoTime/MonoDelta objects are in place, and it tests that the operators
+// have the expected behavior expressed in terms of already existing,
+// semantically equivalent methods.
+TEST(TestMonoTime, TestOperators) {
+  // MonoTime& MonoTime::operator+=(const MonoDelta& delta);
+  {
+    MonoTime tmp = MonoTime::Now();
+    MonoTime start = tmp;
+    MonoDelta delta = MonoDelta::FromMilliseconds(100);
+    MonoTime o_end = start;
+    o_end += delta;
+    tmp.AddDelta(delta);
+    MonoTime m_end = tmp;
+    EXPECT_TRUE(m_end.Equals(o_end));
+  }
+
+  // MonoTime& MonoTime::operator-=(const MonoDelta& delta);
+  {
+    MonoTime tmp = MonoTime::Now();
+    MonoTime start = tmp;
+    MonoDelta delta = MonoDelta::FromMilliseconds(100);
+    MonoTime o_end = start;
+    o_end -= delta;
+    tmp.AddDelta(MonoDelta::FromNanoseconds(-delta.ToNanoseconds()));
+    MonoTime m_end = tmp;
+    EXPECT_TRUE(m_end.Equals(o_end));
+  }
+
+  // bool operator==(const MonoDelta& lhs, const MonoDelta& rhs);
+  {
+    MonoDelta dn = MonoDelta::FromNanoseconds(0);
+    MonoDelta dm = MonoDelta::FromMicroseconds(0);
+    ASSERT_TRUE(dn.Equals(dm));
+    EXPECT_TRUE(dn == dm);
+    EXPECT_TRUE(dm == dn);
+  }
+
+  // bool operator!=(const MonoDelta& lhs, const MonoDelta& rhs);
+  {
+    MonoDelta dn = MonoDelta::FromNanoseconds(1);
+    MonoDelta dm = MonoDelta::FromMicroseconds(1);
+    ASSERT_FALSE(dn.Equals(dm));
+    EXPECT_TRUE(dn != dm);
+    EXPECT_TRUE(dm != dn);
+  }
+
+  // bool operator<(const MonoDelta& lhs, const MonoDelta& rhs);
+  {
+    MonoDelta d0 = MonoDelta::FromNanoseconds(0);
+    MonoDelta d1 = MonoDelta::FromNanoseconds(1);
+    ASSERT_TRUE(d0.LessThan(d1));
+    EXPECT_TRUE(d0 < d1);
+  }
+
+  // bool operator<=(const MonoDelta& lhs, const MonoDelta& rhs);
+  {
+    MonoDelta d0 = MonoDelta::FromNanoseconds(0);
+    MonoDelta d1 = MonoDelta::FromNanoseconds(1);
+    ASSERT_TRUE(d0.LessThan(d1));
+    EXPECT_TRUE(d0 <= d1);
+
+    MonoDelta d20 = MonoDelta::FromNanoseconds(2);
+    MonoDelta d21 = MonoDelta::FromNanoseconds(2);
+    ASSERT_TRUE(d20.Equals(d21));
+    EXPECT_TRUE(d20 <= d21);
+  }
+
+  // bool operator>(const MonoDelta& lhs, const MonoDelta& rhs);
+  {
+    MonoDelta d0 = MonoDelta::FromNanoseconds(0);
+    MonoDelta d1 = MonoDelta::FromNanoseconds(1);
+    ASSERT_TRUE(d1.MoreThan(d0));
+    EXPECT_TRUE(d1 > d0);
+  }
+
+  // bool operator>=(const MonoDelta& lhs, const MonoDelta& rhs);
+  {
+    MonoDelta d0 = MonoDelta::FromNanoseconds(0);
+    MonoDelta d1 = MonoDelta::FromNanoseconds(1);
+    ASSERT_TRUE(d1.MoreThan(d0));
+    EXPECT_TRUE(d1 >= d1);
+
+    MonoDelta d20 = MonoDelta::FromNanoseconds(2);
+    MonoDelta d21 = MonoDelta::FromNanoseconds(2);
+    ASSERT_TRUE(d20.Equals(d21));
+    EXPECT_TRUE(d21 >= d20);
+  }
+
+  // bool operator==(const MonoTime& lhs, const MonoTime& rhs);
+  {
+    MonoTime t0 = MonoTime::Now();
+    MonoTime t1(t0);
+    ASSERT_TRUE(t0.Equals(t1));
+    ASSERT_TRUE(t1.Equals(t0));
+    EXPECT_TRUE(t0 == t1);
+    EXPECT_TRUE(t1 == t0);
+  }
+
+  // bool operator!=(const MonoTime& lhs, const MonoTime& rhs);
+  {
+    MonoTime t0 = MonoTime::Now();
+    MonoTime t1(t0 + MonoDelta::FromMilliseconds(100));
+    ASSERT_TRUE(!t0.Equals(t1));
+    ASSERT_TRUE(!t1.Equals(t0));
+    EXPECT_TRUE(t0 != t1);
+    EXPECT_TRUE(t1 != t0);
+  }
+
+  // bool operator<(const MonoTime& lhs, const MonoTime& rhs);
+  {
+    MonoTime t0 = MonoTime::Now();
+    MonoTime t1(t0 + MonoDelta::FromMilliseconds(100));
+    ASSERT_TRUE(t0.ComesBefore(t1));
+    ASSERT_FALSE(t1.ComesBefore(t0));
+    EXPECT_TRUE(t0 < t1);
+    EXPECT_FALSE(t1 < t0);
+  }
+
+  // bool operator<=(const MonoTime& lhs, const MonoTime& rhs);
+  {
+    MonoTime t00 = MonoTime::Now();
+    MonoTime t01(t00);
+    ASSERT_TRUE(t00.Equals(t00));
+    ASSERT_TRUE(t00.Equals(t01));
+    ASSERT_TRUE(t01.Equals(t00));
+    ASSERT_TRUE(t01.Equals(t01));
+    EXPECT_TRUE(t00 <= t00);
+    EXPECT_TRUE(t00 <= t01);
+    EXPECT_TRUE(t01 <= t00);
+    EXPECT_TRUE(t01 <= t01);
+
+    MonoTime t1(t00 + MonoDelta::FromMilliseconds(100));
+    ASSERT_TRUE(t00.ComesBefore(t1));
+    ASSERT_TRUE(t01.ComesBefore(t1));
+    ASSERT_FALSE(t1.ComesBefore(t00));
+    ASSERT_FALSE(t1.ComesBefore(t01));
+    EXPECT_TRUE(t00 <= t1);
+    EXPECT_TRUE(t01 <= t1);
+    EXPECT_FALSE(t1 <= t00);
+    EXPECT_FALSE(t1 <= t01);
+  }
+
+  // bool operator>(const MonoTime& lhs, const MonoTime& rhs);
+  {
+    MonoTime t0 = MonoTime::Now();
+    MonoTime t1(t0 + MonoDelta::FromMilliseconds(100));
+    ASSERT_TRUE(t0.ComesBefore(t1));
+    ASSERT_FALSE(t1.ComesBefore(t0));
+    EXPECT_TRUE(t0 < t1);
+    EXPECT_FALSE(t1 < t0);
+  }
+
+  // bool operator>=(const MonoTime& lhs, const MonoTime& rhs);
+  {
+    MonoTime t00 = MonoTime::Now();
+    MonoTime t01(t00);
+    ASSERT_TRUE(t00.Equals(t00));
+    ASSERT_TRUE(t00.Equals(t01));
+    ASSERT_TRUE(t01.Equals(t00));
+    ASSERT_TRUE(t01.Equals(t01));
+    EXPECT_TRUE(t00 >= t00);
+    EXPECT_TRUE(t00 >= t01);
+    EXPECT_TRUE(t01 >= t00);
+    EXPECT_TRUE(t01 >= t01);
+
+    MonoTime t1(t00 + MonoDelta::FromMilliseconds(100));
+    ASSERT_TRUE(t00.ComesBefore(t1));
+    ASSERT_TRUE(t01.ComesBefore(t1));
+    ASSERT_FALSE(t1.ComesBefore(t00));
+    ASSERT_FALSE(t1.ComesBefore(t01));
+    EXPECT_FALSE(t00 >= t1);
+    EXPECT_FALSE(t01 >= t1);
+    EXPECT_TRUE(t1 >= t00);
+    EXPECT_TRUE(t1 >= t01);
+  }
+
+  // MonoDelta operator-(const MonoTime& t0, const MonoTime& t1);
+  {
+    const int64_t deltas[] = { 100, -100 };
+
+    MonoTime tmp = MonoTime::Now();
+    for (auto d : deltas) {
+      MonoDelta delta = MonoDelta::FromMilliseconds(d);
+
+      MonoTime start = tmp;
+      tmp.AddDelta(delta);
+      MonoTime end = tmp;
+      MonoDelta delta_o = end - start;
+      EXPECT_TRUE(delta.Equals(delta_o));
+    }
+  }
+
+  // MonoTime operator+(const MonoTime& t, const MonoDelta& delta);
+  {
+    MonoTime start = MonoTime::Now();
+
+    MonoDelta delta_0 = MonoDelta::FromMilliseconds(0);
+    MonoTime end_0 = start + delta_0;
+    EXPECT_TRUE(end_0.Equals(start));
+
+    MonoDelta delta_1 = MonoDelta::FromMilliseconds(1);
+    MonoTime end_1 = start + delta_1;
+    EXPECT_TRUE(end_1 > end_0);
+    end_0.AddDelta(delta_1);
+    EXPECT_TRUE(end_0.Equals(end_1));
+  }
+
+  // MonoTime operator-(const MonoTime& t, const MonoDelta& delta);
+  {
+    MonoTime start = MonoTime::Now();
+
+    MonoDelta delta_0 = MonoDelta::FromMilliseconds(0);
+    MonoTime end_0 = start - delta_0;
+    EXPECT_TRUE(end_0.Equals(start));
+
+    MonoDelta delta_1 = MonoDelta::FromMilliseconds(1);
+    MonoTime end_1 = start - delta_1;
+    EXPECT_TRUE(end_1 < end_0);
+    end_1.AddDelta(delta_1);
+    EXPECT_TRUE(end_1.Equals(end_0));
+  }
+}
+
 TEST(TestMonoTimePerf, TestMonoTimePerf) {
   alarm(360);
   DoTestMonoTimePerf();

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/monotime.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/monotime.cc b/src/kudu/util/monotime.cc
index 511dd15..b67be42 100644
--- a/src/kudu/util/monotime.cc
+++ b/src/kudu/util/monotime.cc
@@ -223,6 +223,16 @@ bool MonoTime::Equals(const MonoTime& other) const {
   return nanos_ == other.nanos_;
 }
 
+MonoTime& MonoTime::operator+=(const MonoDelta& delta) {
+  this->AddDelta(delta);
+  return *this;
+}
+
+MonoTime& MonoTime::operator-=(const MonoDelta& delta) {
+  this->AddDelta(MonoDelta(-1 * delta.nano_delta_));
+  return *this;
+}
+
 MonoTime::MonoTime(const struct timespec &ts) {
   // Monotonic time resets when the machine reboots.  The 64-bit limitation
   // means that we can't represent times larger than 292 years, which should be
@@ -248,4 +258,68 @@ void SleepFor(const MonoDelta& delta) {
   base::SleepForNanoseconds(delta.ToNanoseconds());
 }
 
+bool operator==(const MonoDelta &lhs, const MonoDelta &rhs) {
+  return lhs.Equals(rhs);
+}
+
+bool operator!=(const MonoDelta &lhs, const MonoDelta &rhs) {
+  return !lhs.Equals(rhs);
+}
+
+bool operator<(const MonoDelta &lhs, const MonoDelta &rhs) {
+  return lhs.LessThan(rhs);
+}
+
+bool operator<=(const MonoDelta &lhs, const MonoDelta &rhs) {
+  return lhs.LessThan(rhs) || lhs.Equals(rhs);
+}
+
+bool operator>(const MonoDelta &lhs, const MonoDelta &rhs) {
+  return lhs.MoreThan(rhs);
+}
+
+bool operator>=(const MonoDelta &lhs, const MonoDelta &rhs) {
+  return lhs.MoreThan(rhs) || lhs.Equals(rhs);
+}
+
+bool operator==(const MonoTime& lhs, const MonoTime& rhs) {
+  return lhs.Equals(rhs);
+}
+
+bool operator!=(const MonoTime& lhs, const MonoTime& rhs) {
+  return !lhs.Equals(rhs);
+}
+
+bool operator<(const MonoTime& lhs, const MonoTime& rhs) {
+  return lhs.ComesBefore(rhs);
+}
+
+bool operator<=(const MonoTime& lhs, const MonoTime& rhs) {
+  return lhs.ComesBefore(rhs) || lhs.Equals(rhs);
+}
+
+bool operator>(const MonoTime& lhs, const MonoTime& rhs) {
+  return rhs.ComesBefore(lhs);
+}
+
+bool operator>=(const MonoTime& lhs, const MonoTime& rhs) {
+  return rhs.ComesBefore(lhs) || rhs.Equals(lhs);
+}
+
+MonoTime operator+(const MonoTime& t, const MonoDelta& delta) {
+  MonoTime tmp(t);
+  tmp.AddDelta(delta);
+  return tmp;
+}
+
+MonoTime operator-(const MonoTime& t, const MonoDelta& delta) {
+  MonoTime tmp(t);
+  tmp.AddDelta(MonoDelta::FromNanoseconds(-delta.ToNanoseconds()));
+  return tmp;
+}
+
+MonoDelta operator-(const MonoTime& t_end, const MonoTime& t_beg) {
+  return t_end.GetDeltaSince(t_beg);
+}
+
 } // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/monotime.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/monotime.h b/src/kudu/util/monotime.h
index 8aa99a8..007c54d 100644
--- a/src/kudu/util/monotime.h
+++ b/src/kudu/util/monotime.h
@@ -131,6 +131,7 @@ class KUDU_EXPORT MonoDelta {
 
   friend class MonoTime;
   FRIEND_TEST(TestMonoTime, TestDeltaConversions);
+
   explicit MonoDelta(int64_t delta);
   int64_t nano_delta_;
 };
@@ -216,6 +217,24 @@ class KUDU_EXPORT MonoTime {
   ///   is the same as the one represented by the other.
   bool Equals(const MonoTime& other) const;
 
+  /// @name Syntactic sugar: increment/decrement operators for MonoTime.
+  ///@{
+  ///
+  /// Add a delta to the point in time represented by the object.
+  ///
+  /// @param [in] delta
+  ///   The delta to add.
+  /// @return Reference to the modified object.
+  MonoTime& operator+=(const MonoDelta& delta);
+
+  /// Substract a delta from the point in time represented by the object.
+  ///
+  /// @param [in] delta
+  ///   The delta to substract.
+  /// @return Reference to the modified object.
+  MonoTime& operator-=(const MonoDelta& delta);
+  ///@}
+
  private:
   friend class MonoDelta;
   FRIEND_TEST(TestMonoTime, TestTimeSpec);
@@ -239,6 +258,155 @@ class KUDU_EXPORT MonoTime {
 ///   The time interval to sleep for.
 void KUDU_EXPORT SleepFor(const MonoDelta& delta);
 
+/// @name Syntactic sugar: binary operators for MonoDelta.
+///@{
+///
+/// @param [in] lhs
+///   A time interval for comparison: the left-hand operand.
+/// @param [in] rhs
+///   A time interval for comparison: the right-hand operand.
+/// @return @c true iff the time interval represented by @c lhs is equal
+///   to the time interval represented by @c rhs.
+bool KUDU_EXPORT operator==(const MonoDelta &lhs, const MonoDelta &rhs);
+
+/// @param [in] lhs
+///   A time interval for comparison: the left-hand operand.
+/// @param [in] rhs
+///   A time interval for comparison: the right-hand operand.
+/// @return @c true iff the time interval represented by @c lhs is not equal
+///   to the time interval represented by @c rhs.
+bool KUDU_EXPORT operator!=(const MonoDelta &lhs, const MonoDelta &rhs);
+
+/// @param [in] lhs
+///   A time interval for comparison: the left-hand operand.
+/// @param [in] rhs
+///   A time interval for comparison: the right-hand operand.
+/// @return @c true iff the time interval represented by @c lhs is shorter
+///   than the time interval represented by @c rhs.
+bool KUDU_EXPORT operator<(const MonoDelta &lhs, const MonoDelta &rhs);
+
+/// @param [in] lhs
+///   A time interval for comparison: the left-hand operand.
+/// @param [in] rhs
+///   A time interval for comparison: the right-hand operand.
+/// @return @c true iff the time interval represented by @c lhs is shorter
+///   than or equal to the time interval represented by @c rhs.
+bool KUDU_EXPORT operator<=(const MonoDelta &lhs, const MonoDelta &rhs);
+
+/// @param [in] lhs
+///   A time interval for comparison: the left-hand operand.
+/// @param [in] rhs
+///   A time interval for comparison: the right-hand operand.
+/// @return @c true iff the time interval represented by @c lhs is longer
+///   than the time interval represented by @c rhs.
+bool KUDU_EXPORT operator>(const MonoDelta &lhs, const MonoDelta &rhs);
+
+/// @param [in] lhs
+///   A time interval for comparison: the left-hand operand.
+/// @param [in] rhs
+///   A time interval for comparison: the right-hand operand.
+/// @return @c true iff the time interval represented by @c lhs is longer
+///   than or equal to the time interval represented by @c rhs.
+bool KUDU_EXPORT operator>=(const MonoDelta &lhs, const MonoDelta &rhs);
+///@}
+
+/// @name Syntactic sugar: binary operators for MonoTime.
+///@{
+///
+/// Check if the specified objects represent the same point in time.
+///
+/// This is a handy operator which is semantically equivalent to
+/// MonoTime::Equals().
+///
+/// @param [in] lhs
+///   The left-hand operand.
+/// @param [in] rhs
+///   The right-hand operand.
+/// @return @c true iff the given objects represent the same point in time.
+bool KUDU_EXPORT operator==(const MonoTime& lhs, const MonoTime& rhs);
+
+/// Check if the specified objects represent different points in time.
+///
+/// This is a handy operator which is semantically equivalent to the negation of
+/// MonoTime::Equals().
+///
+/// @param [in] lhs
+///   The left-hand operand.
+/// @param [in] rhs
+///   The right-hand operand.
+/// @return @c true iff the given object represents a different point in time
+///   than the specified one.
+bool KUDU_EXPORT operator!=(const MonoTime& lhs, const MonoTime& rhs);
+
+/// @param [in] lhs
+///   The left-hand operand.
+/// @param [in] rhs
+///   The right-hand operand.
+/// @return @c true iff the @c lhs object represents an earlier point in time
+///   than the @c rhs object.
+bool KUDU_EXPORT operator<(const MonoTime& lhs, const MonoTime& rhs);
+
+/// @param [in] lhs
+///   The left-hand operand.
+/// @param [in] rhs
+///   The right-hand operand.
+/// @return @c true iff the @c lhs object represents an earlier than or
+///   the same point in time as the @c rhs object.
+bool KUDU_EXPORT operator<=(const MonoTime& lhs, const MonoTime& rhs);
+
+/// @param [in] lhs
+///   The left-hand operand.
+/// @param [in] rhs
+///   The right-hand operand.
+/// @return @c true iff the @c lhs object represents a later point in time
+///   than the @c rhs object.
+bool KUDU_EXPORT operator>(const MonoTime& lhs, const MonoTime& rhs);
+
+/// @param [in] lhs
+///   The left-hand operand.
+/// @param [in] rhs
+///   The right-hand operand.
+/// @return @c true iff the @c lhs object represents a later than or
+///   the same point in time as the @c rhs object.
+bool KUDU_EXPORT operator>=(const MonoTime& lhs, const MonoTime& rhs);
+///@}
+
+/// @name Syntactic sugar: mixed binary operators for MonoTime/MonoDelta.
+///@{
+///
+/// Add the specified time interval to the given point in time.
+///
+/// @param [in] t
+///   A MonoTime object representing the given point in time.
+/// @param [in] delta
+///   A MonoDelta object representing the specified time interval.
+/// @return A MonoTime object representing the resulting point in time.
+MonoTime KUDU_EXPORT operator+(const MonoTime& t, const MonoDelta& delta);
+
+/// Subtract the specified time interval from the given point in time.
+///
+/// @param [in] t
+///   A MonoTime object representing the given point in time.
+/// @param [in] delta
+///   A MonoDelta object representing the specified time interval.
+/// @return A MonoTime object representing the resulting point in time.
+MonoTime KUDU_EXPORT operator-(const MonoTime& t, const MonoDelta& delta);
+
+/// Compute the time interval between the specified points in time.
+///
+/// Semantically, this is equivalent to t0.GetDeltaSince(t1).
+///
+/// @param [in] t_end
+///   The second point in time.  Semantically corresponds to the end
+///   of the resulting time interval.
+/// @param [in] t_beg
+///   The first point in time.  Semantically corresponds to the beginning
+///   of the resulting time interval.
+/// @return A MonoDelta object representing the time interval between the
+///   specified points in time.
+MonoDelta KUDU_EXPORT operator-(const MonoTime& t_end, const MonoTime& t_begin);
+///@}
+
 } // namespace kudu
 
 #endif

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/net/socket.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/net/socket.cc b/src/kudu/util/net/socket.cc
index 150b7b2..5d68a51 100644
--- a/src/kudu/util/net/socket.cc
+++ b/src/kudu/util/net/socket.cc
@@ -434,7 +434,7 @@ Status Socket::BlockingWrite(const uint8_t *buf, size_t buflen, size_t *nwritten
   while (tot_written < buflen) {
     int32_t inc_num_written = 0;
     int32_t num_to_write = buflen - tot_written;
-    MonoDelta timeout = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta timeout = deadline - MonoTime::Now();
     if (PREDICT_FALSE(timeout.ToNanoseconds() <= 0)) {
       return Status::TimedOut("BlockingWrite timed out");
     }
@@ -505,7 +505,7 @@ Status Socket::BlockingRecv(uint8_t *buf, size_t amt, size_t *nread, const MonoT
   while (tot_read < amt) {
     int32_t inc_num_read = 0;
     int32_t num_to_read = amt - tot_read;
-    MonoDelta timeout = deadline.GetDeltaSince(MonoTime::Now());
+    MonoDelta timeout = deadline - MonoTime::Now();
     if (PREDICT_FALSE(timeout.ToNanoseconds() <= 0)) {
       return Status::TimedOut("");
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/striped64-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/striped64-test.cc b/src/kudu/util/striped64-test.cc
index f5dbdcf..6cabdce 100644
--- a/src/kudu/util/striped64-test.cc
+++ b/src/kudu/util/striped64-test.cc
@@ -124,8 +124,8 @@ void RunMultiTest(int64_t num_operations, int64_t num_threads) {
   MultiThreadTest<LongAdder> test(num_operations, num_threads);
   test.Run();
   MonoTime end2 = MonoTime::Now();
-  MonoDelta basic = end1.GetDeltaSince(start);
-  MonoDelta striped = end2.GetDeltaSince(end1);
+  MonoDelta basic = end1 - start;
+  MonoDelta striped = end2 - end1;
   LOG(INFO) << "Basic counter took   " << basic.ToMilliseconds() << "ms.";
   LOG(INFO) << "Striped counter took " << striped.ToMilliseconds() << "ms.";
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/striped64.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/striped64.cc b/src/kudu/util/striped64.cc
index d949735..a0951c7 100644
--- a/src/kudu/util/striped64.cc
+++ b/src/kudu/util/striped64.cc
@@ -32,7 +32,7 @@ namespace internal {
 //
 
 HashCode::HashCode() {
-  Random r(MonoTime::Now().GetDeltaSince(MonoTime::Min()).ToNanoseconds());
+  Random r((MonoTime::Now() - MonoTime::Min()).ToNanoseconds());
   const uint64_t hash = r.Next64();
   code_ = (hash == 0) ? 1 : hash;  // Avoid zero to allow xorShift rehash
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/test_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/test_util.cc b/src/kudu/util/test_util.cc
index b26302a..b002d43 100644
--- a/src/kudu/util/test_util.cc
+++ b/src/kudu/util/test_util.cc
@@ -183,11 +183,10 @@ string GetTestDataDirectory() {
 
 void AssertEventually(const std::function<void(void)>& f,
                       const MonoDelta& timeout) {
-  MonoTime deadline = MonoTime::Now();
-  deadline.AddDelta(timeout);
+  const MonoTime deadline = MonoTime::Now() + timeout;
   int attempts = 0;
 
-  while (MonoTime::Now().ComesBefore(deadline)) {
+  while (MonoTime::Now() < deadline) {
     // Capture any assertion failures within this scope (i.e. from their function)
     // into 'results'
     testing::TestPartResultArray results;

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/threadpool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/threadpool.cc b/src/kudu/util/threadpool.cc
index c7ec317..00cd6f8 100644
--- a/src/kudu/util/threadpool.cc
+++ b/src/kudu/util/threadpool.cc
@@ -254,8 +254,7 @@ void ThreadPool::Wait() {
 }
 
 bool ThreadPool::WaitUntil(const MonoTime& until) {
-  MonoDelta relative = until.GetDeltaSince(MonoTime::Now());
-  return WaitFor(relative);
+  return WaitFor(until - MonoTime::Now());
 }
 
 bool ThreadPool::WaitFor(const MonoDelta& delta) {
@@ -329,7 +328,7 @@ void ThreadPool::DispatchThread(bool permanent) {
 
     // Update metrics
     MonoTime now(MonoTime::Now());
-    int64_t queue_time_us = now.GetDeltaSince(entry.submit_time).ToMicroseconds();
+    int64_t queue_time_us = (now - entry.submit_time).ToMicroseconds();
     TRACE_COUNTER_INCREMENT(queue_time_trace_metric_name_, queue_time_us);
     if (queue_time_us_histogram_) {
       queue_time_us_histogram_->Increment(queue_time_us);

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/throttler-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/throttler-test.cc b/src/kudu/util/throttler-test.cc
index 9bf800d..57563d2 100644
--- a/src/kudu/util/throttler-test.cc
+++ b/src/kudu/util/throttler-test.cc
@@ -33,14 +33,14 @@ TEST_F(ThrottlerTest, TestOpThrottle) {
   MonoTime now = MonoTime::Now();
   Throttler t0(now, 1000, 1000*1000, 1);
   // Fill up bucket
-  now.AddDelta(MonoDelta::FromMilliseconds(2000));
+  now += MonoDelta::FromMilliseconds(2000);
   // Check throttle behavior for 1 second.
   for (int p = 0; p < 10; p++) {
     for (int i = 0; i < 100; i++) {
       ASSERT_TRUE(t0.Take(now, 1, 1));
     }
     ASSERT_FALSE(t0.Take(now, 1, 1));
-    now.AddDelta(MonoDelta::FromMilliseconds(100));
+    now += MonoDelta::FromMilliseconds(100);
   }
 }
 
@@ -49,14 +49,14 @@ TEST_F(ThrottlerTest, TestIOThrottle) {
   MonoTime now = MonoTime::Now();
   Throttler t0(now, 50000, 1000*1000, 1);
   // Fill up bucket
-  now.AddDelta(MonoDelta::FromMilliseconds(2000));
+  now += MonoDelta::FromMilliseconds(2000);
   // Check throttle behavior for 1 second.
   for (int p = 0; p < 10; p++) {
     for (int i = 0; i < 100; i++) {
       ASSERT_TRUE(t0.Take(now, 1, 1000));
     }
     ASSERT_FALSE(t0.Take(now, 1, 1000));
-    now.AddDelta(MonoDelta::FromMilliseconds(100));
+    now += MonoDelta::FromMilliseconds(100);
   }
 }
 
@@ -65,9 +65,9 @@ TEST_F(ThrottlerTest, TestBurst) {
   MonoTime now = MonoTime::Now();
   Throttler t0(now, 2000, 1000*1000, 5);
   // Fill up bucket
-  now.AddDelta(MonoDelta::FromMilliseconds(2000));
+  now += MonoDelta::FromMilliseconds(2000);
   for (int i = 0; i < 100; i++) {
-    now.AddDelta(MonoDelta::FromMilliseconds(1));
+    now += MonoDelta::FromMilliseconds(1);
     ASSERT_TRUE(t0.Take(now, 1, 5000));
   }
   ASSERT_TRUE(t0.Take(now, 1, 100000));

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/throttler.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/throttler.cc b/src/kudu/util/throttler.cc
index 6207bdb..108d5db 100644
--- a/src/kudu/util/throttler.cc
+++ b/src/kudu/util/throttler.cc
@@ -51,12 +51,12 @@ bool Throttler::Take(MonoTime now, uint64_t op, uint64_t byte) {
 }
 
 void Throttler::Refill(MonoTime now) {
-  int64_t d = now.GetDeltaSince(next_refill_).ToMicroseconds();
+  int64_t d = (now - next_refill_).ToMicroseconds();
   if (d < 0) {
     return;
   }
   uint64_t num_period = d / kRefillPeriodMicros + 1;
-  next_refill_.AddDelta(MonoDelta::FromMicroseconds(num_period * kRefillPeriodMicros));
+  next_refill_ += MonoDelta::FromMicroseconds(num_period * kRefillPeriodMicros);
   op_token_ += num_period * op_refill_;
   op_token_ = std::min(op_token_, op_token_max_);
   byte_token_ += num_period * byte_refill_;

http://git-wip-us.apache.org/repos/asf/kudu/blob/34b7f1eb/src/kudu/util/trace-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/trace-test.cc b/src/kudu/util/trace-test.cc
index a30e559..6c38b0c 100644
--- a/src/kudu/util/trace-test.cc
+++ b/src/kudu/util/trace-test.cc
@@ -660,27 +660,27 @@ class TraceEventSyntheticDelayTest : public KuduTest,
     return delay;
   }
 
-  void AdvanceTime(MonoDelta delta) { now_.AddDelta(delta); }
+  void AdvanceTime(MonoDelta delta) { now_ += delta; }
 
   int TestFunction() {
     MonoTime start = Now();
     { TRACE_EVENT_SYNTHETIC_DELAY("test.Delay"); }
     MonoTime end = Now();
-    return end.GetDeltaSince(start).ToMilliseconds();
+    return (end - start).ToMilliseconds();
   }
 
   int AsyncTestFunctionBegin() {
     MonoTime start = Now();
     { TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("test.AsyncDelay"); }
     MonoTime end = Now();
-    return end.GetDeltaSince(start).ToMilliseconds();
+    return (end - start).ToMilliseconds();
   }
 
   int AsyncTestFunctionEnd() {
     MonoTime start = Now();
     { TRACE_EVENT_SYNTHETIC_DELAY_END("test.AsyncDelay"); }
     MonoTime end = Now();
-    return end.GetDeltaSince(start).ToMilliseconds();
+    return (end - start).ToMilliseconds();
   }
 
  private:
@@ -769,11 +769,11 @@ TEST_F(TraceEventSyntheticDelayTest, BeginParallel) {
   EXPECT_FALSE(!end_times[1].Initialized());
 
   delay->EndParallel(end_times[0]);
-  EXPECT_GE(Now().GetDeltaSince(start_time).ToMilliseconds(), kTargetDurationMs);
+  EXPECT_GE((Now() - start_time).ToMilliseconds(), kTargetDurationMs);
 
   start_time = Now();
   delay->EndParallel(end_times[1]);
-  EXPECT_LT(Now().GetDeltaSince(start_time).ToMilliseconds(), kShortDurationMs);
+  EXPECT_LT((Now() - start_time).ToMilliseconds(), kShortDurationMs);
 }
 
 TEST_F(TraceTest, TestVLogTrace) {


[3/3] kudu git commit: [util/monotime] added handy operators for MonoTime

Posted by to...@apache.org.
[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 <ad...@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 <as...@cloudera.com>
Authored: Mon Aug 15 19:52:47 2016 -0700
Committer: Todd Lipcon <to...@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",