Remove unused AlwaysCreateBlockInsertDestination
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 @@
}
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 @@
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_);
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 @@
};
/**
- * @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
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 "storage/StorageBlockLayout.proto";
enum InsertDestinationType {
- ALWAYS_CREATE_BLOCK = 0;
BLOCK_POOL = 1;
PARTITION_AWARE = 2;
}