You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Janus Chow (Jira)" <ji...@apache.org> on 2022/04/22 09:15:00 UTC

[jira] [Created] (HDDS-6630) Remove chosen nodes in PlacementPolicy.getResultSet

Janus Chow created HDDS-6630:
--------------------------------

             Summary: Remove chosen nodes in PlacementPolicy.getResultSet
                 Key: HDDS-6630
                 URL: https://issues.apache.org/jira/browse/HDDS-6630
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Janus Chow
            Assignee: Janus Chow


In `SCMCommonPlacementPolicy.getResultSet()`, the abstract method of "chooseNode" will be invoked each time to get a valid node, the method declarition is as follows:
{code:java}
/**
 * Choose a datanode according to the policy, this function is implemented
 * by the actual policy class.
 *
 * @param healthyNodes - Set of healthy nodes we can choose from.
 * @return DatanodeDetails
 */
public abstract DatanodeDetails chooseNode(
    List<DatanodeDetails> healthyNodes); {code}
For this method, all current implementations of subclasses will remove the chosen node from healthyNodes, but seems this side effect is not explicitly clarified. 

For users trying to implement their own subclasses, they might forget this removal, which might return incorrect values.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org