trafficserver-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpeach <>
Subject [GitHub] trafficserver pull request: TS-3418: Second hash ring for consiste...
Date Thu, 17 Dec 2015 03:22:36 GMT
Github user jpeach commented on the pull request:
    > Note that FindParent() used to take a ParentConfigParams. Since the lookup policy
is now spread
    > over the ParentRecord and the the config_params structures, it would be cleaner to
condense all
    > this into a ParentSelectionPolicy object that is passed into FindParent. I think
this would help you
    > separate the ParentSelectionStrategy from owning a ParentRecord pointer too, since
state that the
    > strategy looks at would now be passed in.
    Basically this boils down to
    1. rename ``config_params`` to ``ParentSelectionPolicy``.
    2. The ownership of the ``ParentSelectionPolicy`` is ambiguous since all ``ParentSelectionStrategy``
object have a pointer to it, but it is actually only owned by the ``ParentConfigParams``.
So keep it in ``ParentConfigParams`` (it doesn't need to me malloc'd), and pass it to ``ParentSelectionStrategy``
methods as an argument. ``ParentConfigParams `` now won't implement the ``ParentSelectionStrategy`1
interface, but it doesn't need to.
        class ParentConfigParams : public ConfigInfo
              // implementation of functions from ParentSelectionStrategy.
             void selectParent(bool firstCall, ParentResult *result, RequestData *rdata) {
                return result->rec->selection_strategy->selectParent(policy, firstCall,
result, rdata);
          ParentSelectionPolicy policy;

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

View raw message