kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject [1/2] kudu git commit: Timestamp::FromUint64 should return void
Date Thu, 11 Aug 2016 20:45:06 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 78d36da24 -> b811cbc7e


Timestamp::FromUint64 should return void

It does no validation, can't fail, and has the same signature as one of
Timestamp's explicit constructors.

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


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

Branch: refs/heads/master
Commit: 7a508942f05681750990d065f398bbf027ca6977
Parents: 78d36da
Author: Mike Percy <mpercy@apache.org>
Authored: Fri Jul 29 17:18:17 2016 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Thu Aug 11 20:44:19 2016 +0000

----------------------------------------------------------------------
 src/kudu/common/timestamp.cc        | 3 +--
 src/kudu/common/timestamp.h         | 2 +-
 src/kudu/tablet/delta_stats.cc      | 4 ++--
 src/kudu/tablet/tablet_bootstrap.cc | 3 +--
 4 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/7a508942/src/kudu/common/timestamp.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/timestamp.cc b/src/kudu/common/timestamp.cc
index 25d1325..7591b40 100644
--- a/src/kudu/common/timestamp.cc
+++ b/src/kudu/common/timestamp.cc
@@ -47,9 +47,8 @@ uint64_t Timestamp::ToUint64() const {
   return v;
 }
 
-Status Timestamp::FromUint64(uint64_t value) {
+void Timestamp::FromUint64(uint64_t value) {
   v = value;
-  return Status::OK();
 }
 
 }  // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/7a508942/src/kudu/common/timestamp.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/timestamp.h b/src/kudu/common/timestamp.h
index e2c843c..9c9731a 100644
--- a/src/kudu/common/timestamp.h
+++ b/src/kudu/common/timestamp.h
@@ -58,7 +58,7 @@ class Timestamp {
   uint64_t ToUint64() const;
 
   // Sets this Timestamp from 'value'
-  Status FromUint64(uint64_t value);
+  void FromUint64(uint64_t value);
 
   val_type value() const { return v; }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7a508942/src/kudu/tablet/delta_stats.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/delta_stats.cc b/src/kudu/tablet/delta_stats.cc
index 4594ca6..f46becb 100644
--- a/src/kudu/tablet/delta_stats.cc
+++ b/src/kudu/tablet/delta_stats.cc
@@ -105,8 +105,8 @@ Status DeltaStats::InitFromPB(const DeltaStatsPB& pb) {
   for (const DeltaStatsPB::ColumnStats stats : pb.column_stats()) {
     IncrUpdateCount(ColumnId(stats.col_id()), stats.update_count());
   }
-  RETURN_NOT_OK(max_timestamp_.FromUint64(pb.max_timestamp()));
-  RETURN_NOT_OK(min_timestamp_.FromUint64(pb.min_timestamp()));
+  max_timestamp_.FromUint64(pb.max_timestamp());
+  min_timestamp_.FromUint64(pb.min_timestamp());
   return Status::OK();
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/7a508942/src/kudu/tablet/tablet_bootstrap.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_bootstrap.cc b/src/kudu/tablet/tablet_bootstrap.cc
index abc8813..2733881 100644
--- a/src/kudu/tablet/tablet_bootstrap.cc
+++ b/src/kudu/tablet/tablet_bootstrap.cc
@@ -1500,8 +1500,7 @@ Status TabletBootstrap::FilterOperation(const OperationResultPB&
op_result,
 }
 
 Status TabletBootstrap::UpdateClock(uint64_t timestamp) {
-  Timestamp ts;
-  RETURN_NOT_OK(ts.FromUint64(timestamp));
+  Timestamp ts(timestamp);
   RETURN_NOT_OK(clock_->Update(ts));
   return Status::OK();
 }


Mime
View raw message