quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject [5/7] incubator-quickstep git commit: Refactor WorkOrderFactory for a better debug info.
Date Mon, 21 Nov 2016 03:23:03 GMT
Refactor WorkOrderFactory for a better debug info.


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

Branch: refs/heads/travis-fix
Commit: 70959876590fb65b8f195a77d7af62e33b166dd4
Parents: 365fff6
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Thu Nov 17 15:09:17 2016 -0800
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Fri Nov 18 11:30:44 2016 -0800

----------------------------------------------------------------------
 query_execution/Shiftboss.cpp             |  1 +
 relational_operators/WorkOrderFactory.cpp | 48 ++++++++++++++------------
 relational_operators/WorkOrderFactory.hpp |  4 +++
 3 files changed, 30 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/70959876/query_execution/Shiftboss.cpp
----------------------------------------------------------------------
diff --git a/query_execution/Shiftboss.cpp b/query_execution/Shiftboss.cpp
index 09d7846..30b2ae2 100644
--- a/query_execution/Shiftboss.cpp
+++ b/query_execution/Shiftboss.cpp
@@ -99,6 +99,7 @@ void Shiftboss::run() {
         DCHECK_EQ(1u, query_contexts_.count(query_id));
 
         WorkOrder *work_order = WorkOrderFactory::ReconstructFromProto(proto.work_order(),
+                                                                       shiftboss_index_,
                                                                        &database_cache_,
                                                                        query_contexts_[query_id].get(),
                                                                        storage_manager_,

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/70959876/relational_operators/WorkOrderFactory.cpp
----------------------------------------------------------------------
diff --git a/relational_operators/WorkOrderFactory.cpp b/relational_operators/WorkOrderFactory.cpp
index 6943a52..871f74d 100644
--- a/relational_operators/WorkOrderFactory.cpp
+++ b/relational_operators/WorkOrderFactory.cpp
@@ -19,6 +19,7 @@
 
 #include "relational_operators/WorkOrderFactory.hpp"
 
+#include <cstddef>
 #include <memory>
 #include <utility>
 #include <vector>
@@ -67,6 +68,7 @@ class Predicate;
 class Scalar;
 
 WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder &proto,
+                                                  const std::size_t shiftboss_index,
                                                   CatalogDatabaseLite *catalog_database,
                                                   QueryContext *query_context,
                                                   StorageManager *storage_manager,
@@ -79,7 +81,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
 
   switch (proto.work_order_type()) {
     case serialization::AGGREGATION: {
-      LOG(INFO) << "Creating AggregationWorkOrder";
+      LOG(INFO) << "Creating AggregationWorkOrder in Shiftboss " << shiftboss_index;
       return new AggregationWorkOrder(
           proto.query_id(),
           proto.GetExtension(serialization::AggregationWorkOrder::block_id),
@@ -89,7 +91,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               proto.GetExtension(serialization::AggregationWorkOrder::lip_deployment_index),
query_context));
     }
     case serialization::BUILD_HASH: {
-      LOG(INFO) << "Creating BuildHashWorkOrder";
+      LOG(INFO) << "Creating BuildHashWorkOrder in Shiftboss " << shiftboss_index;
       vector<attribute_id> join_key_attributes;
       for (int i = 0; i < proto.ExtensionSize(serialization::BuildHashWorkOrder::join_key_attributes);
++i) {
         join_key_attributes.push_back(
@@ -110,7 +112,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               proto.GetExtension(serialization::BuildHashWorkOrder::lip_deployment_index),
query_context));
     }
     case serialization::DELETE: {
-      LOG(INFO) << "Creating DeleteWorkOrder";
+      LOG(INFO) << "Creating DeleteWorkOrder in Shiftboss " << shiftboss_index;
       return new DeleteWorkOrder(
           proto.query_id(),
           catalog_database->getRelationSchemaById(
@@ -124,7 +126,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           bus);
     }
     case serialization::DESTROY_AGGREGATION_STATE: {
-      LOG(INFO) << "Creating DestroyAggregationStateWorkOrder";
+      LOG(INFO) << "Creating DestroyAggregationStateWorkOrder in Shiftboss " <<
shiftboss_index;
       return new DestroyAggregationStateWorkOrder(
           proto.query_id(),
           proto.GetExtension(
@@ -132,7 +134,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           query_context);
     }
     case serialization::DESTROY_HASH: {
-      LOG(INFO) << "Creating DestroyHashWorkOrder";
+      LOG(INFO) << "Creating DestroyHashWorkOrder in Shiftboss " << shiftboss_index;
       return new DestroyHashWorkOrder(
           proto.query_id(),
           proto.GetExtension(
@@ -140,7 +142,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           query_context);
     }
     case serialization::DROP_TABLE: {
-      LOG(INFO) << "Creating DropTableWorkOrder";
+      LOG(INFO) << "Creating DropTableWorkOrder in Shiftboss " << shiftboss_index;
       vector<block_id> blocks;
       for (int i = 0; i < proto.ExtensionSize(serialization::DropTableWorkOrder::block_ids);
++i) {
         blocks.push_back(
@@ -157,7 +159,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           catalog_database);
     }
     case serialization::FINALIZE_AGGREGATION: {
-      LOG(INFO) << "Creating FinalizeAggregationWorkOrder";
+      LOG(INFO) << "Creating FinalizeAggregationWorkOrder in Shiftboss " << shiftboss_index;
       return new FinalizeAggregationWorkOrder(
           proto.query_id(),
           query_context->getAggregationState(proto.GetExtension(
@@ -212,7 +214,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
 
       switch (hash_join_work_order_type) {
         case serialization::HashJoinWorkOrder::HASH_ANTI_JOIN: {
-          LOG(INFO) << "Creating HashAntiJoinWorkOrder";
+          LOG(INFO) << "Creating HashAntiJoinWorkOrder in Shiftboss " << shiftboss_index;
           return new HashAntiJoinWorkOrder(
               proto.query_id(),
               build_relation,
@@ -228,7 +230,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               lip_filter_adaptive_prober);
         }
         case serialization::HashJoinWorkOrder::HASH_INNER_JOIN: {
-          LOG(INFO) << "Creating HashInnerJoinWorkOrder";
+          LOG(INFO) << "Creating HashInnerJoinWorkOrder in Shiftboss " << shiftboss_index;
           return new HashInnerJoinWorkOrder(
               proto.query_id(),
               build_relation,
@@ -252,7 +254,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
                 proto.GetExtension(serialization::HashJoinWorkOrder::is_selection_on_build,
i));
           }
 
-          LOG(INFO) << "Creating HashOuterJoinWorkOrder";
+          LOG(INFO) << "Creating HashOuterJoinWorkOrder in Shiftboss " << shiftboss_index;
           return new HashOuterJoinWorkOrder(
               proto.query_id(),
               build_relation,
@@ -268,7 +270,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               lip_filter_adaptive_prober);
         }
         case serialization::HashJoinWorkOrder::HASH_SEMI_JOIN: {
-          LOG(INFO) << "Creating HashSemiJoinWorkOrder";
+          LOG(INFO) << "Creating HashSemiJoinWorkOrder in Shiftboss " << shiftboss_index;
           return new HashSemiJoinWorkOrder(
               proto.query_id(),
               build_relation,
@@ -288,7 +290,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
       }
     }
     case serialization::INSERT: {
-      LOG(INFO) << "Creating InsertWorkOrder";
+      LOG(INFO) << "Creating InsertWorkOrder in Shiftboss " << shiftboss_index;
       return new InsertWorkOrder(
           proto.query_id(),
           query_context->getInsertDestination(
@@ -297,7 +299,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               proto.GetExtension(serialization::InsertWorkOrder::tuple_index)));
     }
     case serialization::NESTED_LOOP_JOIN: {
-      LOG(INFO) << "Creating NestedLoopsJoinWorkOrder";
+      LOG(INFO) << "Creating NestedLoopsJoinWorkOrder in Shiftboss " << shiftboss_index;
       return new NestedLoopsJoinWorkOrder(
           proto.query_id(),
           catalog_database->getRelationSchemaById(
@@ -315,7 +317,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           storage_manager);
     }
     case serialization::SAMPLE: {
-      LOG(INFO) << "Creating SampleWorkOrder";
+      LOG(INFO) << "Creating SampleWorkOrder in Shiftboss " << shiftboss_index;
       return new SampleWorkOrder(
           proto.query_id(),
           catalog_database->getRelationSchemaById(
@@ -328,7 +330,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           storage_manager);
     }
     case serialization::SAVE_BLOCKS: {
-      LOG(INFO) << "Creating SaveBlocksWorkOrder";
+      LOG(INFO) << "Creating SaveBlocksWorkOrder in Shiftboss " << shiftboss_index;
       return new SaveBlocksWorkOrder(
           proto.query_id(),
           proto.GetExtension(serialization::SaveBlocksWorkOrder::block_id),
@@ -336,7 +338,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           storage_manager);
     }
     case serialization::SELECT: {
-      LOG(INFO) << "Creating SelectWorkOrder";
+      LOG(INFO) << "Creating SelectWorkOrder in Shiftboss " << shiftboss_index;
       const bool simple_projection =
           proto.GetExtension(serialization::SelectWorkOrder::simple_projection);
       vector<attribute_id> simple_selection;
@@ -364,7 +366,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               proto.GetExtension(serialization::SelectWorkOrder::lip_deployment_index), query_context));
     }
     case serialization::SORT_MERGE_RUN: {
-      LOG(INFO) << "Creating SortMergeRunWorkOrder";
+      LOG(INFO) << "Creating SortMergeRunWorkOrder in Shiftboss " << shiftboss_index;
       vector<merge_run_operator::Run> runs;
       for (int i = 0; i < proto.ExtensionSize(serialization::SortMergeRunWorkOrder::runs);
++i) {
         merge_run_operator::Run run;
@@ -393,7 +395,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           bus);
     }
     case serialization::SORT_RUN_GENERATION: {
-      LOG(INFO) << "Creating SortRunGenerationWorkOrder";
+      LOG(INFO) << "Creating SortRunGenerationWorkOrder in Shiftboss " << shiftboss_index;
       return new SortRunGenerationWorkOrder(
           proto.query_id(),
           catalog_database->getRelationSchemaById(
@@ -406,7 +408,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           storage_manager);
     }
     case serialization::TABLE_GENERATOR: {
-      LOG(INFO) << "Creating SortRunGenerationWorkOrder";
+      LOG(INFO) << "Creating SortRunGenerationWorkOrder in Shiftboss " << shiftboss_index;
       return new TableGeneratorWorkOrder(
           proto.query_id(),
           query_context->getGeneratorFunctionHandle(
@@ -415,7 +417,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               proto.GetExtension(serialization::TableGeneratorWorkOrder::insert_destination_index)));
     }
     case serialization::TEXT_SCAN: {
-      LOG(INFO) << "Creating TextScanWorkOrder";
+      LOG(INFO) << "Creating TextScanWorkOrder in Shiftboss " << shiftboss_index;
       return new TextScanWorkOrder(
           proto.query_id(),
           proto.GetExtension(serialization::TextScanWorkOrder::filename),
@@ -427,7 +429,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               proto.GetExtension(serialization::TextScanWorkOrder::insert_destination_index)));
     }
     case serialization::UPDATE: {
-      LOG(INFO) << "Creating UpdateWorkOrder";
+      LOG(INFO) << "Creating UpdateWorkOrder in Shiftboss " << shiftboss_index;
       return new UpdateWorkOrder(
           proto.query_id(),
           catalog_database->getRelationSchemaById(
@@ -445,7 +447,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
           bus);
     }
     case serialization::WINDOW_AGGREGATION: {
-      LOG(INFO) << "Creating WindowAggregationWorkOrder";
+      LOG(INFO) << "Creating WindowAggregationWorkOrder in Shiftboss " << shiftboss_index;
       vector<block_id> blocks;
       for (int i = 0; i < proto.ExtensionSize(serialization::WindowAggregationWorkOrder::block_ids);
++i) {
         blocks.push_back(
@@ -461,7 +463,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const serialization::WorkOrder
               proto.GetExtension(serialization::WindowAggregationWorkOrder::insert_destination_index)));
     }
     default:
-      LOG(FATAL) << "Unknown WorkOrder Type in WorkOrderFactory::ReconstructFromProto";
+      LOG(FATAL) << "Unknown WorkOrder Type in WorkOrderFactory::ReconstructFromProto
in Shiftboss" << shiftboss_index;
   }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/70959876/relational_operators/WorkOrderFactory.hpp
----------------------------------------------------------------------
diff --git a/relational_operators/WorkOrderFactory.hpp b/relational_operators/WorkOrderFactory.hpp
index 45e2cbc..acf3855 100644
--- a/relational_operators/WorkOrderFactory.hpp
+++ b/relational_operators/WorkOrderFactory.hpp
@@ -20,6 +20,8 @@
 #ifndef QUICKSTEP_RELATIONAL_OPERATORS_WORK_ORDER_FACTORY_HPP_
 #define QUICKSTEP_RELATIONAL_OPERATORS_WORK_ORDER_FACTORY_HPP_
 
+#include <cstddef>
+
 #include "utility/Macros.hpp"
 
 #include "tmb/id_typedefs.h"
@@ -50,6 +52,7 @@ class WorkOrderFactory {
    *
    * @param proto The Protocol Buffer representation of a WorkOrder object,
    *        originally generated by RelationalOperator::getAllWorkOrders.
+   * @param shiftboss_index The index of Shiftboss that is using.
    * @param catalog_database The database to resolve relation and attribute
    *        references in.
    * @param query_context A pointer to QueryContext.
@@ -60,6 +63,7 @@ class WorkOrderFactory {
    * @return A new WorkOrder reconstructed from the supplied Protocol Buffer.
    **/
   static WorkOrder* ReconstructFromProto(const serialization::WorkOrder &proto,
+                                         const std::size_t shiftboss_index,
                                          CatalogDatabaseLite *catalog_database,
                                          QueryContext *query_context,
                                          StorageManager *storage_manager,


Mime
View raw message