quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nav...@apache.org
Subject [4/7] incubator-quickstep git commit: WIP: Add partial bulk insert function in StorageBlock
Date Fri, 02 Sep 2016 23:36:09 GMT
WIP: Add partial bulk insert function in StorageBlock


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

Branch: refs/heads/col_vec_opt
Commit: 769325cb3fe053bd8c90deea7224544720a0136b
Parents: 826990e
Author: Navneet Potti <navsan@gmail.com>
Authored: Wed Aug 10 16:52:01 2016 -0500
Committer: Navneet Potti <navsan@gmail.com>
Committed: Wed Aug 10 16:52:01 2016 -0500

----------------------------------------------------------------------
 storage/StorageBlock.cpp         | 24 ++++++++++++++++++++++++
 storage/StorageBlock.hpp         |  5 +++--
 storage/TupleStorageSubBlock.hpp |  5 +++--
 3 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/769325cb/storage/StorageBlock.cpp
----------------------------------------------------------------------
diff --git a/storage/StorageBlock.cpp b/storage/StorageBlock.cpp
index 21aa12c..e618438 100644
--- a/storage/StorageBlock.cpp
+++ b/storage/StorageBlock.cpp
@@ -284,6 +284,30 @@ tuple_id StorageBlock::bulkInsertTuplesWithRemappedAttributes(
   return num_inserted;
 }
 
+tuple_id StorageBlock::bulkInsertPartialTuples(
+    const std::vector<attribute_id> &attribute_map,
+    ValueAccessor *accessor,
+    const tuple_id max_num_tuples_to_insert) {
+  const tuple_id num_inserted
+      = tuple_store_->bulkInsertPartialTuples(attribute_map,
+                                              accessor,
+                                              max_num_tuples_to_insert);
+  if (num_inserted != 0) {
+    invalidateAllIndexes();
+    dirty_ = true;
+  } else if (tuple_store_->isEmpty()) {
+    if (!accessor->iterationFinishedVirtual()) {
+      throw TupleTooLargeForBlock(0);
+    }
+  }
+  return num_inserted;
+}
+
+void StorageBlock::bulkInsertPartialTuplesFinalize(
+    const tuple_id num_tuples_inserted) {
+  tuple_store_->bulkInsertPartialTuplesFinalize(num_tuples_inserted);
+}
+
 void StorageBlock::sample(const bool is_block_sample,
                           const int percentage,
                           InsertDestinationInterface *destination) const {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/769325cb/storage/StorageBlock.hpp
----------------------------------------------------------------------
diff --git a/storage/StorageBlock.hpp b/storage/StorageBlock.hpp
index 1562f9d..f69ef78 100644
--- a/storage/StorageBlock.hpp
+++ b/storage/StorageBlock.hpp
@@ -345,7 +345,7 @@ class StorageBlock : public StorageBlockBase {
   virtual tuple_id bulkInsertPartialTuples(
       const std::vector<attribute_id> &attribute_map,
       ValueAccessor *accessor,
-      tuple_id max_num_tuples_to_insert) = 0;
+      const tuple_id max_num_tuples_to_insert);
 
   /**
    * @brief Update header after a bulkInsertPartialTuples.
@@ -357,7 +357,8 @@ class StorageBlock : public StorageBlockBase {
    *        advance the header.num_tuples by). Should be equal to the return
    *        value of bulkInsertPartialTuples.
    **/
-  virtual void bulkInsertPartialTuplesFinalize(tuple_id num_tuples_inserted) = 0;
+  virtual void bulkInsertPartialTuplesFinalize(
+      const tuple_id num_tuples_inserted);
   
   /**
    * @brief Perform a random sampling of data on  the StorageBlock. The number

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/769325cb/storage/TupleStorageSubBlock.hpp
----------------------------------------------------------------------
diff --git a/storage/TupleStorageSubBlock.hpp b/storage/TupleStorageSubBlock.hpp
index f937080..08c76a2 100644
--- a/storage/TupleStorageSubBlock.hpp
+++ b/storage/TupleStorageSubBlock.hpp
@@ -303,7 +303,7 @@ class TupleStorageSubBlock {
   virtual tuple_id bulkInsertPartialTuples(
       const std::vector<attribute_id> &attribute_map,
       ValueAccessor *accessor,
-      tuple_id max_num_tuples_to_insert) = 0;
+      const tuple_id max_num_tuples_to_insert) = 0;
 
   /**
    * @brief Update header after a bulkInsertPartialTuples.
@@ -315,7 +315,8 @@ class TupleStorageSubBlock {
    *        advance the header.num_tuples by). Should be equal to the return
    *        value of bulkInsertPartialTuples.
    **/
-  virtual void bulkInsertPartialTuplesFinalize(tuple_id num_tuples_inserted) = 0;
+  virtual void bulkInsertPartialTuplesFinalize(
+      const tuple_id num_tuples_inserted) = 0;
   
   /**
    * @brief Get the (untyped) value of an attribute in a tuple in this buffer.


Mime
View raw message