You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by zu...@apache.org on 2017/03/17 22:43:22 UTC
[3/3] incubator-quickstep git commit: Minor refactored
RangePartitionSchemeHeader::getProto.
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/range-partition-get-proto
Commit: 4ad6cec7b135759db8d920470a5af13e40c502e7
Parents: 15d96da
Author: Zuyu Zhang <zu...@apache.org>
Authored: Fri Mar 17 12:29:34 2017 -0700
Committer: Zuyu Zhang <zu...@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());