Github user zuyu commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/14#discussion_r66688816
  
    --- Diff: query_execution/Foreman.hpp ---
    @@ -71,233 +65,31 @@ class Foreman final : public ForemanLite {
        * @note If cpu_id is not specified, Foreman thread can be possibly moved
        *       around on different CPUs by the OS.
       **/
    -  Foreman(tmb::MessageBus *bus,
    +  Foreman(const tmb::client_id main_thread_client_id,
    +          WorkerDirectory *worker_directory,
    +          tmb::MessageBus *bus,
               CatalogDatabaseLite *catalog_database,
               StorageManager *storage_manager,
               const int cpu_id = -1,
    -          const int num_numa_nodes = 1)
    -      : ForemanLite(bus, cpu_id),
    -        catalog_database_(DCHECK_NOTNULL(catalog_database)),
    -        storage_manager_(DCHECK_NOTNULL(storage_manager)),
    -        max_msgs_per_worker_(1),
    -        num_numa_nodes_(num_numa_nodes) {
    -    bus_->RegisterClientAsSender(foreman_client_id_, kWorkOrderMessage);
    -    bus_->RegisterClientAsSender(foreman_client_id_, 
kRebuildWorkOrderMessage);
    -    // NOTE : Foreman thread sends poison messages in the optimizer's
    -    // ExecutionGeneratorTest.
    -    bus_->RegisterClientAsSender(foreman_client_id_, kPoisonMessage);
    -
    -    bus_->RegisterClientAsReceiver(foreman_client_id_,
    -                                   kWorkOrderCompleteMessage);
    -    bus_->RegisterClientAsReceiver(foreman_client_id_,
    -                                   kRebuildWorkOrderCompleteMessage);
    -    bus_->RegisterClientAsReceiver(foreman_client_id_, 
kCatalogRelationNewBlockMessage);
    -    bus_->RegisterClientAsReceiver(foreman_client_id_, 
kDataPipelineMessage);
    -    bus_->RegisterClientAsReceiver(foreman_client_id_,
    -                                   kWorkOrdersAvailableMessage);
    -    bus_->RegisterClientAsReceiver(foreman_client_id_,
    -                                   kWorkOrderFeedbackMessage);
    -  }
    +          const std::size_t num_numa_nodes = 1);
     
       ~Foreman() override {}
     
    -  /**
    -   * @brief Set the Query plan DAG for the query to be executed.
    -   *
    -   * @param query_plan_dag A pointer to the query plan DAG.
    -   **/
    -  inline void setQueryPlan(DAG<RelationalOperator, bool> *query_plan_dag) {
    -    query_dag_ = query_plan_dag;
    -  }
    -
    -  /**
    -   * @brief Reconstruct the QueryContext for the query to be executed.
    -   *
    -   * @param proto The serialized QueryContext.
    -   **/
    -  inline void reconstructQueryContextFromProto(const 
serialization::QueryContext &proto) {
    -    query_context_.reset(
    -        new QueryContext(proto, *catalog_database_, storage_manager_, 
foreman_client_id_, bus_));
    -  }
    -
    -  /**
    -   * @brief Set the WorkerDirectory pointer.
    -   *
    -   * @param workers A pointer to the WorkerDirectory.
    -   **/
    -  void setWorkerDirectory(WorkerDirectory *workers) {
    -    workers_ = workers;
    -  }
    -
    -  /**
    -   * @brief Set the maximum number of messages that should be allocated to 
each
    -   *        worker during a single round of WorkOrder dispatch.
    -   *
    -   * @param max_msgs_per_worker Maximum number of messages.
    -   **/
    -  void setMaxMessagesPerWorker(const std::size_t max_msgs_per_worker) {
    -    max_msgs_per_worker_ = max_msgs_per_worker;
    -  }
    -
      protected:
       /**
    -   * @brief The foreman receives a DAG of relational operators, asks 
relational
    -   *        operators to produce the workorders and based on the response 
it gets
    -   *        pipelines the intermediate output to dependent relational 
operators.
    -   *
    -   * @note  The workers who get the messages from the Foreman execute and
    -   *        subsequently delete the WorkOrder contained in the message.
    +   * @brief Run the event-based loop in the Foreman thread.
    --- End diff --
    
    We could delete all the comments for a overridden method.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to