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:48:22 UTC

incubator-quickstep git commit: Remove unused AlwaysCreateBlockInsertDestination [Forced Update!]

Repository: incubator-quickstep
Updated Branches:
  refs/heads/remove_alwayscreateinsertdest 9d15b04ac -> f5a103e63 (forced update)


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/f5a103e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/f5a103e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/f5a103e6

Branch: refs/heads/remove_alwayscreateinsertdest
Commit: f5a103e63abb907d594643531de85068a809e04a
Parents: 7671a58
Author: Navneet Potti <na...@gmail.com>
Authored: Mon Jun 27 11:22:47 2016 -0500
Committer: Navneet Potti <na...@gmail.com>
Committed: Sat Jul 9 00:32:11 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/f5a103e6/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/f5a103e6/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/f5a103e6/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;
 }