You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by na...@apache.org on 2016/07/09 05:46:50 UTC

[10/10] incubator-quickstep git commit: Revert "Remove unused flag always_mark_full in InsertDestinationInterface"

Revert "Remove unused flag always_mark_full in InsertDestinationInterface"

This reverts commit 0563baff2852b0d4e144c35977fd833d2adb0040.


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

Branch: refs/heads/remove_alwayscreateinsertdest
Commit: 9d15b04acf52bbe4861ca22ce394f56d3d821988
Parents: 0563baf
Author: Navneet Potti <na...@gmail.com>
Authored: Sat Jul 9 00:18:12 2016 -0500
Committer: Navneet Potti <na...@gmail.com>
Committed: Sat Jul 9 00:18:12 2016 -0500

----------------------------------------------------------------------
 storage/InsertDestination.cpp          | 19 +++++++++++--------
 storage/InsertDestination.hpp          | 10 ++++++----
 storage/InsertDestinationInterface.hpp | 10 ++++++++--
 3 files changed, 25 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/9d15b04a/storage/InsertDestination.cpp
----------------------------------------------------------------------
diff --git a/storage/InsertDestination.cpp b/storage/InsertDestination.cpp
index 99ba36b..2ed3aa3 100644
--- a/storage/InsertDestination.cpp
+++ b/storage/InsertDestination.cpp
@@ -189,7 +189,7 @@ void InsertDestination::insertTupleInBatch(const Tuple &tuple) {
   returnBlock(std::move(output_block), false);
 }
 
-void InsertDestination::bulkInsertTuples(ValueAccessor *accessor) {
+void InsertDestination::bulkInsertTuples(ValueAccessor *accessor, bool always_mark_full) {
   InvokeOnAnyValueAccessor(
       accessor,
       [&](auto *accessor) -> void {  // NOLINT(build/c++11)
@@ -204,7 +204,7 @@ void InsertDestination::bulkInsertTuples(ValueAccessor *accessor) {
         // Bulk insert into output_block was successful. output_block
         // will be rebuilt when there won't be any more insertions to it.
         this->returnBlock(std::move(output_block),
-                          !accessor->iterationFinished());
+                          always_mark_full || !accessor->iterationFinished());
       }
     }
   });
@@ -212,7 +212,8 @@ void InsertDestination::bulkInsertTuples(ValueAccessor *accessor) {
 
 void InsertDestination::bulkInsertTuplesWithRemappedAttributes(
     const std::vector<attribute_id> &attribute_map,
-    ValueAccessor *accessor) {
+    ValueAccessor *accessor,
+    bool always_mark_full) {
   InvokeOnAnyValueAccessor(
       accessor,
       [&](auto *accessor) -> void {  // NOLINT(build/c++11)
@@ -229,7 +230,7 @@ void InsertDestination::bulkInsertTuplesWithRemappedAttributes(
         // Bulk insert into output_block was successful. output_block
         // will be rebuilt when there won't be any more insertions to it.
         this->returnBlock(std::move(output_block),
-                          !accessor->iterationFinished());
+                          always_mark_full || !accessor->iterationFinished());
       }
     }
   });
@@ -465,7 +466,7 @@ void PartitionAwareInsertDestination::insertTupleInBatch(const Tuple &tuple) {
   returnBlockInPartition(std::move(output_block), false, part_id);
 }
 
-void PartitionAwareInsertDestination::bulkInsertTuples(ValueAccessor *accessor) {
+void PartitionAwareInsertDestination::bulkInsertTuples(ValueAccessor *accessor, bool always_mark_full) {
   const std::size_t num_partitions = partition_scheme_header_->getNumPartitions();
   const attribute_id partition_attribute_id = partition_scheme_header_->getPartitionAttributeId();
 
@@ -473,6 +474,7 @@ void PartitionAwareInsertDestination::bulkInsertTuples(ValueAccessor *accessor)
       accessor,
       [this,
        &partition_attribute_id,
+       &always_mark_full,
        &num_partitions](auto *accessor) -> void {  // NOLINT(build/c++11)
     std::vector<std::unique_ptr<TupleIdSequence>> partition_membership;
     partition_membership.resize(num_partitions);
@@ -511,7 +513,7 @@ void PartitionAwareInsertDestination::bulkInsertTuples(ValueAccessor *accessor)
           // Bulk insert into output_block was successful. output_block
           // will be rebuilt when there won't be any more insertions to it.
           this->returnBlockInPartition(std::move(output_block),
-                                       !adapter[partition]->iterationFinished(),
+                                       always_mark_full || !adapter[partition]->iterationFinished(),
                                        partition);
         }
       }
@@ -520,7 +522,7 @@ void PartitionAwareInsertDestination::bulkInsertTuples(ValueAccessor *accessor)
 }
 
 void PartitionAwareInsertDestination::bulkInsertTuplesWithRemappedAttributes(
-    const std::vector<attribute_id> &attribute_map, ValueAccessor *accessor) {
+    const std::vector<attribute_id> &attribute_map, ValueAccessor *accessor, bool always_mark_full) {
   const std::size_t num_partitions = partition_scheme_header_->getNumPartitions();
   const attribute_id partition_attribute_id = partition_scheme_header_->getPartitionAttributeId();
 
@@ -529,6 +531,7 @@ void PartitionAwareInsertDestination::bulkInsertTuplesWithRemappedAttributes(
       [this,
        &partition_attribute_id,
        &attribute_map,
+       &always_mark_full,
        &num_partitions](auto *accessor) -> void {  // NOLINT(build/c++11)
     std::vector<std::unique_ptr<TupleIdSequence>> partition_membership;
     partition_membership.resize(num_partitions);
@@ -567,7 +570,7 @@ void PartitionAwareInsertDestination::bulkInsertTuplesWithRemappedAttributes(
           // Bulk insert into output_block was successful. output_block
           // will be rebuilt when there won't be any more insertions to it.
           this->returnBlockInPartition(std::move(output_block),
-                                       !adapter[partition]->iterationFinished(),
+                                       always_mark_full || !adapter[partition]->iterationFinished(),
                                        partition);
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/9d15b04a/storage/InsertDestination.hpp
----------------------------------------------------------------------
diff --git a/storage/InsertDestination.hpp b/storage/InsertDestination.hpp
index 66c6b74..772d250 100644
--- a/storage/InsertDestination.hpp
+++ b/storage/InsertDestination.hpp
@@ -143,11 +143,12 @@ class InsertDestination : public InsertDestinationInterface {
 
   void insertTupleInBatch(const Tuple &tuple) override;
 
-  void bulkInsertTuples(ValueAccessor *accessor) override;
+  void bulkInsertTuples(ValueAccessor *accessor, bool always_mark_full = false) override;
 
   void bulkInsertTuplesWithRemappedAttributes(
       const std::vector<attribute_id> &attribute_map,
-      ValueAccessor *accessor) override;
+      ValueAccessor *accessor,
+      bool always_mark_full = false) override;
 
   void insertTuplesFromVector(std::vector<Tuple>::const_iterator begin,
                               std::vector<Tuple>::const_iterator end) override;
@@ -465,11 +466,12 @@ class PartitionAwareInsertDestination : public InsertDestination {
 
   void insertTupleInBatch(const Tuple &tuple) override;
 
-  void bulkInsertTuples(ValueAccessor *accessor) override;
+  void bulkInsertTuples(ValueAccessor *accessor, bool always_mark_full = false) override;
 
   void bulkInsertTuplesWithRemappedAttributes(
       const std::vector<attribute_id> &attribute_map,
-      ValueAccessor *accessor) override;
+      ValueAccessor *accessor,
+      bool always_mark_full = false) override;
 
   void insertTuplesFromVector(std::vector<Tuple>::const_iterator begin,
                               std::vector<Tuple>::const_iterator end) override;

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/9d15b04a/storage/InsertDestinationInterface.hpp
----------------------------------------------------------------------
diff --git a/storage/InsertDestinationInterface.hpp b/storage/InsertDestinationInterface.hpp
index 5e2d085..a66a149 100644
--- a/storage/InsertDestinationInterface.hpp
+++ b/storage/InsertDestinationInterface.hpp
@@ -95,8 +95,11 @@ class InsertDestinationInterface {
    *
    * @param accessor A ValueAccessor whose tuples will by inserted into blocks
    *        from this InsertDestination.
+   * @param always_mark_full If \c true, always mark the blocks full after
+   *        insertion from ValueAccessor even when partially full.
    **/
-  virtual void bulkInsertTuples(ValueAccessor *accessor) = 0;
+  virtual void bulkInsertTuples(ValueAccessor *accessor,
+                                bool always_mark_full = false) = 0;
 
   /**
    * @brief Bulk-insert tuples from a ValueAccessor with differently-ordered
@@ -107,10 +110,13 @@ class InsertDestinationInterface {
    *        corresponding attributes which should be read from accessor.
    * @param accessor A ValueAccessor whose tuples will by inserted into blocks
    *        from this InsertDestination.
+   * @param always_mark_full If \c true, always mark the blocks full after
+   *        insertion from ValueAccessor even when partially full.
    **/
   virtual void bulkInsertTuplesWithRemappedAttributes(
       const std::vector<attribute_id> &attribute_map,
-      ValueAccessor *accessor) = 0;
+      ValueAccessor *accessor,
+      bool always_mark_full = false) = 0;
 
   /**
    * @brief Insert tuples from a range of Tuples in a vector.