quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nav...@apache.org
Subject [5/5] incubator-quickstep git commit: Remove unused AlwaysCreateBlockInsertDestination
Date Wed, 29 Jun 2016 18:05:42 GMT
Remove unused AlwaysCreateBlockInsertDestination


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

Branch: refs/heads/remove_alwayscreateinsertdest
Commit: e7f67705cf494447263ec7e138d20e913c1c8017
Parents: 5c4e8db
Author: Navneet Potti <navsan@gmail.com>
Authored: Mon Jun 27 11:22:47 2016 -0500
Committer: Navneet Potti <nav@cs.wisc.edu>
Committed: Wed Jun 29 13:05:26 2016 -0500

----------------------------------------------------------------------
 storage/InsertDestination.cpp   | 57 ------------------------------------
 storage/InsertDestination.hpp   | 44 ----------------------------
 storage/InsertDestination.proto |  1 -
 3 files changed, 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e7f67705/storage/InsertDestination.cpp
----------------------------------------------------------------------
diff --git a/storage/InsertDestination.cpp b/storage/InsertDestination.cpp
index 2866c5f..2ed3aa3 100644
--- a/storage/InsertDestination.cpp
+++ b/storage/InsertDestination.cpp
@@ -92,15 +92,6 @@ InsertDestination* InsertDestination::ReconstructFromProto(
   }
 
   switch (proto.insert_destination_type()) {
-    case serialization::InsertDestinationType::ALWAYS_CREATE_BLOCK: {
-      return new AlwaysCreateBlockInsertDestination(relation,
-                                                    layout,
-                                                    storage_manager,
-                                                    proto.relational_op_index(),
-                                                    query_id,
-                                                    scheduler_client_id,
-                                                    bus);
-    }
     case serialization::InsertDestinationType::BLOCK_POOL: {
       vector<block_id> blocks;
       for (int i = 0; i < proto.ExtensionSize(serialization::BlockPoolInsertDestination::blocks);
++i) {
@@ -262,54 +253,6 @@ void InsertDestination::insertTuplesFromVector(std::vector<Tuple>::const_iterato
   returnBlock(std::move(dest_block), false);
 }
 
-MutableBlockReference AlwaysCreateBlockInsertDestination::createNewBlock() {
-  const block_id new_id = storage_manager_->createBlock(relation_, *layout_);
-
-  // Notify Foreman to add the newly created block id in the master Catalog.
-  serialization::CatalogRelationNewBlockMessage proto;
-  proto.set_relation_id(relation_.getID());
-  proto.set_block_id(new_id);
-  proto.set_query_id(getQueryID());
-
-  const size_t proto_length = proto.ByteSize();
-  char *proto_bytes = static_cast<char*>(malloc(proto_length));
-  CHECK(proto.SerializeToArray(proto_bytes, proto_length));
-
-  TaggedMessage tagged_msg(static_cast<const void *>(proto_bytes),
-                           proto_length,
-                           kCatalogRelationNewBlockMessage);
-  free(proto_bytes);
-
-  const tmb::MessageBus::SendStatus send_status =
-      QueryExecutionUtil::SendTMBMessage(bus_,
-                                         thread_id_map_.getValue(),
-                                         scheduler_client_id_,
-                                         move(tagged_msg));
-  CHECK(send_status == tmb::MessageBus::SendStatus::kOK)
-      << "CatalogRelationNewBlockMessage could not be sent from InsertDestination to
Foreman.";
-
-  return storage_manager_->getBlockMutable(new_id, relation_);
-}
-
-MutableBlockReference AlwaysCreateBlockInsertDestination::getBlockForInsertion() {
-  SpinMutexLock lock(mutex_);
-  return createNewBlock();
-}
-
-void AlwaysCreateBlockInsertDestination::returnBlock(MutableBlockReference &&block,
const bool full) {
-  {
-    SpinMutexLock lock(mutex_);
-    returned_block_ids_.push_back(block->getID());
-  }
-  if (!block->rebuild()) {
-    LOG_WARNING("Rebuilding of StorageBlock with ID: " << block->getID() <<
-                "invalidated one or more IndexSubBlocks.");
-  }
-  // Due to the nature of this InsertDestination, a block will always be
-  // streamed no matter if it's full or not.
-  sendBlockFilledMessage(block->getID());
-}
-
 MutableBlockReference BlockPoolInsertDestination::createNewBlock() {
   const block_id new_id = storage_manager_->createBlock(relation_, *layout_);
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e7f67705/storage/InsertDestination.hpp
----------------------------------------------------------------------
diff --git a/storage/InsertDestination.hpp b/storage/InsertDestination.hpp
index 5ff33f5..772d250 100644
--- a/storage/InsertDestination.hpp
+++ b/storage/InsertDestination.hpp
@@ -290,50 +290,6 @@ class InsertDestination : public InsertDestinationInterface {
 };
 
 /**
- * @brief Implementation of InsertDestination that always creates new blocks,
- *        leaving some blocks potentially very underfull.
- **/
-class AlwaysCreateBlockInsertDestination : public InsertDestination {
- public:
-  AlwaysCreateBlockInsertDestination(const CatalogRelationSchema &relation,
-                                     const StorageBlockLayout *layout,
-                                     StorageManager *storage_manager,
-                                     const std::size_t relational_op_index,
-                                     const std::size_t query_id,
-                                     const tmb::client_id scheduler_client_id,
-                                     tmb::MessageBus *bus)
-      : InsertDestination(relation,
-                          layout,
-                          storage_manager,
-                          relational_op_index,
-                          query_id,
-                          scheduler_client_id,
-                          bus) {}
-
-  ~AlwaysCreateBlockInsertDestination() override {
-  }
-
- protected:
-  MutableBlockReference getBlockForInsertion() override;
-
-  void returnBlock(MutableBlockReference &&block, const bool full) override;
-
-  MutableBlockReference createNewBlock() override;
-
-  const std::vector<block_id>& getTouchedBlocksInternal() override {
-    return returned_block_ids_;
-  }
-
-  void getPartiallyFilledBlocks(std::vector<MutableBlockReference> *partial_blocks)
override {
-  }
-
- private:
-  std::vector<block_id> returned_block_ids_;
-
-  DISALLOW_COPY_AND_ASSIGN(AlwaysCreateBlockInsertDestination);
-};
-
-/**
  * @brief Implementation of InsertDestination that keeps a pool of
  *        partially-full blocks. Creates new blocks as necessary when
  *        getBlockForInsertion() is called and there are no partially-full

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e7f67705/storage/InsertDestination.proto
----------------------------------------------------------------------
diff --git a/storage/InsertDestination.proto b/storage/InsertDestination.proto
index 6083539..2fb5961 100644
--- a/storage/InsertDestination.proto
+++ b/storage/InsertDestination.proto
@@ -21,7 +21,6 @@ import "catalog/Catalog.proto";
 import "storage/StorageBlockLayout.proto";
 
 enum InsertDestinationType {
-  ALWAYS_CREATE_BLOCK = 0;
   BLOCK_POOL = 1;
   PARTITION_AWARE = 2;
 }


Mime
View raw message