sodonnel commented on a change in pull request #2096:
URL: https://github.com/apache/ozone/pull/2096#discussion_r611545869
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerStateManager.java
##########
@@ -237,39 +239,33 @@ void loadContainer(final ContainerInfo containerInfo)
throws SCMException {
/**
* Allocates a new container based on the type, replication etc.
- *
- * @param pipelineManager -- Pipeline Manager class.
- * @param type -- Replication type.
- * @param replicationFactor - Replication replicationFactor.
- * @return ContainerWithPipeline
- * @throws IOException on Failure.
*/
ContainerInfo allocateContainer(final PipelineManager pipelineManager,
- final HddsProtos.ReplicationType type,
- final HddsProtos.ReplicationFactor replicationFactor, final String owner)
+ final ReplicationConfig replicationConfig, final String owner)
throws IOException {
final List<Pipeline> pipelines = pipelineManager
- .getPipelines(type, replicationFactor, Pipeline.PipelineState.OPEN);
+ .getPipelines(replicationConfig, Pipeline.PipelineState.OPEN);
Pipeline pipeline;
- boolean bgCreateOne = (type == ReplicationType.RATIS) && replicationFactor
- == ReplicationFactor.ONE && autoCreateRatisOne;
- boolean bgCreateThree = (type == ReplicationType.RATIS) &&
replicationFactor
- == ReplicationFactor.THREE;
+ boolean bgCreateOne = RatisReplicationConfig
+ .hasFactor(replicationConfig, ReplicationFactor.ONE)
+ && autoCreateRatisOne;
+ boolean bgCreateThree = RatisReplicationConfig
+ .hasFactor(replicationConfig, ReplicationFactor.ONE);
Review comment:
Is this last line of the change a mistake? The original code had THREE
but this last line has ONE.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]