quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianq...@apache.org
Subject [21/40] incubator-quickstep git commit: Minor refactored RangePartitionSchemeHeader::getProto.
Date Wed, 29 Mar 2017 00:08:25 GMT
Minor refactored RangePartitionSchemeHeader::getProto.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/4ad6cec7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/4ad6cec7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/4ad6cec7

Branch: refs/heads/new-op
Commit: 4ad6cec7b135759db8d920470a5af13e40c502e7
Parents: 15d96da
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Fri Mar 17 12:29:34 2017 -0700
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Fri Mar 17 15:42:28 2017 -0700

----------------------------------------------------------------------
 catalog/PartitionSchemeHeader.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/4ad6cec7/catalog/PartitionSchemeHeader.cpp
----------------------------------------------------------------------
diff --git a/catalog/PartitionSchemeHeader.cpp b/catalog/PartitionSchemeHeader.cpp
index a4a9063..0472fe6 100644
--- a/catalog/PartitionSchemeHeader.cpp
+++ b/catalog/PartitionSchemeHeader.cpp
@@ -113,7 +113,8 @@ serialization::PartitionSchemeHeader PartitionSchemeHeader::getProto()
const {
       proto.set_partition_type(serialization::PartitionSchemeHeader::HASH);
       break;
     case PartitionType::kRange:
-      LOG(FATAL) << "RangePartitionSchemeHeader should call the overridden method.";
+      proto.set_partition_type(serialization::PartitionSchemeHeader::RANGE);
+      break;
     default:
       LOG(FATAL) << "Invalid Partition Type.";
   }
@@ -125,11 +126,7 @@ serialization::PartitionSchemeHeader PartitionSchemeHeader::getProto()
const {
 }
 
 serialization::PartitionSchemeHeader RangePartitionSchemeHeader::getProto() const {
-  serialization::PartitionSchemeHeader proto;
-
-  proto.set_partition_type(serialization::PartitionSchemeHeader::RANGE);
-  proto.set_num_partitions(num_partitions_);
-  proto.set_partition_attribute_id(partition_attribute_id_);
+  serialization::PartitionSchemeHeader proto = PartitionSchemeHeader::getProto();
 
   proto.MutableExtension(serialization::RangePartitionSchemeHeader::partition_attr_type)
       ->MergeFrom(partition_attr_type_->getProto());


Mime
View raw message