You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@quickstep.apache.org by zuyu <gi...@git.apache.org> on 2016/09/24 22:09:21 UTC

[GitHub] incubator-quickstep pull request #102: Refactored RebuildStatus.

GitHub user zuyu opened a pull request:

    https://github.com/apache/incubator-quickstep/pull/102

    Refactored RebuildStatus.

    Assigned to @hbdeshmukh. Thanks.
    
    This PR wraps the rebuild status into a dedicate struct. It also allows future extension info for the distributed versions.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-quickstep refactor-rebuild-status

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-quickstep/pull/102.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #102
    
----
commit 6b377d5d6c6f2e05ef74a4c1a022590af2db6571
Author: Zuyu Zhang <zu...@twitter.com>
Date:   2016-09-24T22:05:16Z

    Refactored RebuildStatus.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep pull request #102: Refactored RebuildStatus.

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-quickstep/pull/102


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep pull request #102: Refactored RebuildStatus.

Posted by hbdeshmukh <gi...@git.apache.org>.
Github user hbdeshmukh commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/102#discussion_r80522341
  
    --- Diff: query_execution/QueryExecutionState.hpp ---
    @@ -92,8 +92,15 @@ class QueryExecutionState {
                                    const std::size_t num_rebuild_workorders,
                                    const bool rebuild_initiated) {
         DCHECK(operator_index < num_operators_);
    -    rebuild_status_[operator_index].second = num_rebuild_workorders;
    -    rebuild_status_[operator_index].first = rebuild_initiated;
    +    auto search_res = rebuild_status_.find(operator_index);
    +    if (search_res != rebuild_status_.end()) {
    +      search_res->second.has_initiated = rebuild_initiated;
    +      search_res->second.num_pending_workorders = num_rebuild_workorders;
    +    } else {
    +      RebuildStatus rebuild_status(rebuild_initiated, num_rebuild_workorders);
    +
    +      rebuild_status_.emplace(operator_index, std::move(rebuild_status));
    --- End diff --
    
    Sounds good. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep pull request #102: Refactored RebuildStatus.

Posted by zuyu <gi...@git.apache.org>.
Github user zuyu commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/102#discussion_r80521815
  
    --- Diff: query_execution/QueryExecutionState.hpp ---
    @@ -92,8 +92,15 @@ class QueryExecutionState {
                                    const std::size_t num_rebuild_workorders,
                                    const bool rebuild_initiated) {
         DCHECK(operator_index < num_operators_);
    -    rebuild_status_[operator_index].second = num_rebuild_workorders;
    -    rebuild_status_[operator_index].first = rebuild_initiated;
    +    auto search_res = rebuild_status_.find(operator_index);
    +    if (search_res != rebuild_status_.end()) {
    +      search_res->second.has_initiated = rebuild_initiated;
    +      search_res->second.num_pending_workorders = num_rebuild_workorders;
    +    } else {
    +      RebuildStatus rebuild_status(rebuild_initiated, num_rebuild_workorders);
    +
    +      rebuild_status_.emplace(operator_index, std::move(rebuild_status));
    --- End diff --
    
    If we try to use `forward_as_tuple` (which produces a rvalue expression), it actually looks like as following:
    
    ```
          rebuild_status_.emplace(std::piecewise_construct,
                                  std::forward_as_tuple(operator_index),
                                  std::forward_as_tuple(rebuild_initiated, num_rebuild_workorders));
    ```
    
    But I personally prefer the existing version, as it is more straightforward.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep issue #102: Refactored RebuildStatus.

Posted by hbdeshmukh <gi...@git.apache.org>.
Github user hbdeshmukh commented on the issue:

    https://github.com/apache/incubator-quickstep/pull/102
  
    Hi @zuyu 
    
    This looks good to me except a small clarifying question. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep issue #102: Refactored RebuildStatus.

Posted by hbdeshmukh <gi...@git.apache.org>.
Github user hbdeshmukh commented on the issue:

    https://github.com/apache/incubator-quickstep/pull/102
  
    LGTM, merging. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---