aryangupta1998 commented on PR #8216:
URL: https://github.com/apache/ozone/pull/8216#issuecomment-2779767638
Thanks for the patch @priyeshkaratha,
Can we refactor the exceedPipelineNumberLimit() in
RatisPipelineProvider.java a little bit for better readability?
Maybe something like,
```
private boolean exceedPipelineNumberLimit(
RatisReplicationConfig replicationConfig) {
if (replicationConfig.getReplicationFactor() != ReplicationFactor.THREE)
{
// Only put limits for Factor THREE pipelines.
return false;
}
PipelineStateManager pipelineStateManager = getPipelineStateManager();
// Per datanode limit
int allPipelinesExceptClosed =
pipelineStateManager.getPipelines(replicationConfig).size() -
pipelineStateManager.getPipelines(replicationConfig,
PipelineState.CLOSED).size();
if (maxPipelinePerDatanode > 0) {
int maxAllowedPipelines = maxPipelinePerDatanode *
getNodeManager().getNodeCount(NodeStatus.inServiceHealthy()) /
replicationConfig.getRequiredNodes();
return allPipelinesExceptClosed >= maxAllowedPipelines;
}
// Global limit
if (pipelineNumberLimit > 0) {
int allRatisOnePipelines =
pipelineStateManager.getPipelines(RatisReplicationConfig.getInstance(ReplicationFactor.ONE)).size();
return allPipelinesExceptClosed >=
(pipelineNumberLimit - allRatisOnePipelines);
}
return false;
}
```
As you have already fixed the tests and if you don't have any more new
changes, you may move your PR from the draft stage so that CI checks can run!
--
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]