szetszwo commented on a change in pull request #2842:
URL: https://github.com/apache/ozone/pull/2842#discussion_r754210565
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java
##########
@@ -163,6 +163,8 @@
private Predicate<LayoutVersionProto> layoutMatchCondition;
private Predicate<LayoutVersionProto> layoutMisMatchCondition;
+ private final ConfigurationSource configuration;
Review comment:
Don't add this field. Pass the conf in the CapacityPipelineChoosePolicy
constructor.
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/choose/algorithms/PipelineChoosePolicyFactory.java
##########
@@ -45,6 +46,18 @@ private PipelineChoosePolicyFactory() {
}
public static PipelineChoosePolicy getPolicy(
+ ConfigurationSource conf, NodeStateManager nodeStateManager)
+ throws SCMException {
+ ScmConfig scmConfig = conf.getObject(ScmConfig.class);
+ if (scmConfig.getPipelineChoosePolicyName()
+ .equals(CapacityPipelineChoosePolicy.class.getName())) {
+ return new CapacityPipelineChoosePolicy(nodeStateManager);
Review comment:
Pass the conf.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]