quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject [1/2] incubator-quickstep git commit: CatalogRelation::getPartitionScheme returns a pointer instead of ref. [Forced Update!]
Date Tue, 17 Jan 2017 22:03:47 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/quickstep_partition_parser_support f5c9f568f -> 7992c5252 (forced update)


CatalogRelation::getPartitionScheme returns a pointer instead of ref.


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

Branch: refs/heads/quickstep_partition_parser_support
Commit: e26cc1e037a7a5d07664b99ac2c178b0e8e8bc66
Parents: b0e5968
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Tue Jan 17 13:55:24 2017 -0800
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Tue Jan 17 13:55:24 2017 -0800

----------------------------------------------------------------------
 catalog/CatalogRelation.hpp             | 7 +++----
 relational_operators/SelectOperator.cpp | 4 ++--
 relational_operators/SelectOperator.hpp | 6 +++---
 storage/PreloaderThread.cpp             | 2 +-
 4 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e26cc1e0/catalog/CatalogRelation.hpp
----------------------------------------------------------------------
diff --git a/catalog/CatalogRelation.hpp b/catalog/CatalogRelation.hpp
index c38e526..e1fd79a 100644
--- a/catalog/CatalogRelation.hpp
+++ b/catalog/CatalogRelation.hpp
@@ -111,12 +111,11 @@ class CatalogRelation : public CatalogRelationSchema {
 
   /**
    * @brief Get the partition scheme of the catalog relation.
-   * @warning This is only safe if hasPartitionScheme() is true.
    *
-   * @return A const reference to the partition scheme of the relation.
+   * @return A const pointer to the partition scheme of the relation.
    **/
-  const PartitionScheme& getPartitionScheme() const {
-    return *partition_scheme_;
+  const PartitionScheme* getPartitionScheme() const {
+    return partition_scheme_.get();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e26cc1e0/relational_operators/SelectOperator.cpp
----------------------------------------------------------------------
diff --git a/relational_operators/SelectOperator.cpp b/relational_operators/SelectOperator.cpp
index f5c9ee9..d2759c4 100644
--- a/relational_operators/SelectOperator.cpp
+++ b/relational_operators/SelectOperator.cpp
@@ -68,7 +68,7 @@ bool SelectOperator::getAllWorkOrders(
 
     if (input_relation_.hasPartitionScheme()) {
       const std::size_t num_partitions =
-          input_relation_.getPartitionScheme().getPartitionSchemeHeader().getNumPartitions();
+          input_relation_.getPartitionScheme()->getPartitionSchemeHeader().getNumPartitions();
 
       for (std::size_t part_id = 0; part_id < num_partitions; ++part_id) {
         for (const block_id input_block_id : input_relation_block_ids_in_partition_[part_id])
{
@@ -99,7 +99,7 @@ bool SelectOperator::getAllWorkOrders(
   } else {
     if (input_relation_.hasPartitionScheme()) {
       const std::size_t num_partitions =
-          input_relation_.getPartitionScheme().getPartitionSchemeHeader().getNumPartitions();
+          input_relation_.getPartitionScheme()->getPartitionSchemeHeader().getNumPartitions();
 
       for (std::size_t part_id = 0; part_id < num_partitions; ++part_id) {
         while (num_workorders_generated_in_partition_[part_id] <

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e26cc1e0/relational_operators/SelectOperator.hpp
----------------------------------------------------------------------
diff --git a/relational_operators/SelectOperator.hpp b/relational_operators/SelectOperator.hpp
index 5846eda..989eaac 100644
--- a/relational_operators/SelectOperator.hpp
+++ b/relational_operators/SelectOperator.hpp
@@ -111,7 +111,7 @@ class SelectOperator : public RelationalOperator {
     placement_scheme_ = input_relation.getNUMAPlacementSchemePtr();
 #endif
     if (input_relation.hasPartitionScheme()) {
-      const PartitionScheme &part_scheme = input_relation.getPartitionScheme();
+      const PartitionScheme &part_scheme = *input_relation.getPartitionScheme();
       const PartitionSchemeHeader &part_scheme_header = part_scheme.getPartitionSchemeHeader();
       const std::size_t num_partitions = part_scheme_header.getNumPartitions();
       input_relation_block_ids_in_partition_.resize(num_partitions);
@@ -174,7 +174,7 @@ class SelectOperator : public RelationalOperator {
     placement_scheme_ = input_relation.getNUMAPlacementSchemePtr();
 #endif
     if (input_relation.hasPartitionScheme()) {
-      const PartitionScheme &part_scheme = input_relation.getPartitionScheme();
+      const PartitionScheme &part_scheme = *input_relation.getPartitionScheme();
       const PartitionSchemeHeader &part_scheme_header = part_scheme.getPartitionSchemeHeader();
       const std::size_t num_partitions = part_scheme_header.getNumPartitions();
       input_relation_block_ids_in_partition_.resize(num_partitions);
@@ -213,7 +213,7 @@ class SelectOperator : public RelationalOperator {
   void feedInputBlock(const block_id input_block_id, const relation_id input_relation_id)
override {
     if (input_relation_.hasPartitionScheme()) {
       const partition_id part_id =
-          input_relation_.getPartitionScheme().getPartitionForBlock(input_block_id);
+          input_relation_.getPartitionScheme()->getPartitionForBlock(input_block_id);
       input_relation_block_ids_in_partition_[part_id].push_back(input_block_id);
     } else {
       input_relation_block_ids_.push_back(input_block_id);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e26cc1e0/storage/PreloaderThread.cpp
----------------------------------------------------------------------
diff --git a/storage/PreloaderThread.cpp b/storage/PreloaderThread.cpp
index 7f97a05..edaa143 100644
--- a/storage/PreloaderThread.cpp
+++ b/storage/PreloaderThread.cpp
@@ -93,7 +93,7 @@ std::size_t PreloaderThread::preloadNUMAAware(
       relation.getNUMAPlacementSchemePtr();
   DCHECK(placement_scheme != nullptr);
   DCHECK(relation.hasPartitionScheme());
-  const PartitionScheme &part_scheme = relation.getPartitionScheme();
+  const PartitionScheme &part_scheme = *relation.getPartitionScheme();
   const PartitionSchemeHeader &part_scheme_header =
       part_scheme.getPartitionSchemeHeader();
   const std::size_t num_partitions = part_scheme_header.getNumPartitions();


Mime
View raw message