quickstep-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbdeshmukh <...@git.apache.org>
Subject [GitHub] incubator-quickstep pull request #281: Simplified the work order generation.
Date Fri, 22 Sep 2017 16:57:48 GMT
Github user hbdeshmukh commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/281#discussion_r140544741
  
    --- Diff: query_execution/tests/QueryManagerSingleNode_unittest.cpp ---
    @@ -753,99 +752,51 @@ TEST_F(QueryManagerTest, MultipleNodesNoOutputTest) {
        *
        **/
       for (QueryPlan::DAGNodeIndex i = 0; i < kNumNodes - 1; ++i) {
    -    query_plan_->addDirectDependency(ids[i + 1], ids[i], false);
    -    static_cast<MockOperator*>(query_plan_->getQueryPlanDAGMutable()->getNodePayloadMutable(ids[i]))
    +    query_plan_->addDirectDependency(i + 1, i, false);
    +    static_cast<MockOperator*>(query_plan_->getQueryPlanDAGMutable()->getNodePayloadMutable(i))
             ->setOutputRelationID(0xdead);
       }
     
       std::vector<const MockOperator*> operators;
       for (QueryPlan::DAGNodeIndex i = 0; i < kNumNodes; ++i) {
    -    operators.push_back(static_cast<const MockOperator*>(&query_plan_->getQueryPlanDAG().getNodePayload(ids[i])));
    +    operators.push_back(static_cast<const MockOperator*>(&query_plan_->getQueryPlanDAG().getNodePayload(i)));
       }
     
       constructQueryManager();
     
       // operators[0] should have produced a workorder by now.
    +  EXPECT_EQ(1, operators[0]->getNumCalls(MockOperator::kGetAllWorkOrders));
       EXPECT_EQ(1, operators[0]->getNumWorkOrders());
     
       unique_ptr<WorkerMessage> worker_message;
    -  worker_message.reset(query_manager_->getNextWorkerMessage(ids[0], -1));
    +  worker_message.reset(query_manager_->getNextWorkerMessage(0, -1));
     
       EXPECT_TRUE(worker_message != nullptr);
       EXPECT_EQ(WorkerMessage::WorkerMessageType::kWorkOrder,
                 worker_message->getType());
     
    -  EXPECT_EQ(ids[0], worker_message->getRelationalOpIndex());
    +  EXPECT_EQ(0, worker_message->getRelationalOpIndex());
     
       delete worker_message->getWorkOrder();
     
    -  EXPECT_EQ(1, getNumWorkOrdersInExecution(ids[0]));
    -  EXPECT_FALSE(getOperatorFinishedStatus(ids[0]));
    +  EXPECT_EQ(1, getNumWorkOrdersInExecution(0));
    +  EXPECT_FALSE(getOperatorFinishedStatus(0));
     
    -  for (QueryPlan::DAGNodeIndex i = 0; i < kNumNodes; ++i) {
    -    EXPECT_EQ(1, operators[ids[i]]->getNumCalls(MockOperator::kGetAllWorkOrders));
    +  for (QueryPlan::DAGNodeIndex i = 1; i < kNumNodes; ++i) {
    +    EXPECT_EQ(0, operators[i]->getNumCalls(MockOperator::kGetAllWorkOrders));
       }
     
       // Send a message to QueryManager upon workorder (generated by operators[0])
       // completion.
    -  EXPECT_TRUE(placeWorkOrderCompleteMessage(ids[0]));
    +  EXPECT_TRUE(placeWorkOrderCompleteMessage(0));
     
       for (QueryPlan::DAGNodeIndex i = 0; i < kNumNodes; ++i) {
    -    EXPECT_EQ(0, getNumWorkOrdersInExecution(ids[i]));
    -    EXPECT_TRUE(getOperatorFinishedStatus(ids[i]));
    +    EXPECT_EQ(0, getNumWorkOrdersInExecution(i));
    +    EXPECT_TRUE(getOperatorFinishedStatus(i));
         if (i < kNumNodes - 1) {
           EXPECT_EQ(1, operators[i + 1]->getNumCalls(MockOperator::kDoneFeedingInputBlocks));
         }
       }
     }
     
    -TEST_F(QueryManagerTest, OutOfOrderWorkOrderCompletionTest) {
    --- End diff --
    
    Why is this scenario not worthy to check? 


---

Mime
View raw message