adoroszlai commented on code in PR #10272:
URL: https://github.com/apache/ozone/pull/10272#discussion_r3248239797


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -187,7 +187,8 @@ private int getMaximumPipelines(ECReplicationConfig 
repConfig) {
     int volumeBasedCount = 0;
     if (factor > 0) {
       int volumes = nodeManager.totalHealthyVolumeCount();
-      volumeBasedCount = (int) factor * volumes / repConfig.getRequiredNodes();
+      volumeBasedCount =
+          (int) (factor * volumes / repConfig.getRequiredNodes());

Review Comment:
   nit: no need to wrap to new line



##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestWritableECContainerProvider.java:
##########
@@ -194,6 +194,23 @@ void testPipelinesCreatedBasedOnTotalDiskCountWithFactor(
     assertReusesExisting(allocated, pipelineLimit);
   }
 
+  @ParameterizedTest
+  @MethodSource("policies")
+  void testPipelinesCreatedBasedOnTotalDiskCountWithFractionalFactor(
+      PipelineChoosePolicy policy) throws IOException {
+    provider = createSubject(policy);
+    double factor = 0.5;
+    providerConf.setMinimumPipelines(1);
+    providerConf.setPipelinePerVolumeFactor(factor);
+    nodeManager.setNumHealthyVolumes(20);
+
+    int volumeCount = nodeManager.totalHealthyVolumeCount();
+    int pipelineLimit =
+        (int) (factor * volumeCount / repConfig.getRequiredNodes());
+    Set<ContainerInfo> allocated = assertDistinctContainers(pipelineLimit);
+    assertReusesExisting(allocated, pipelineLimit);
+  }
+

Review Comment:
   I don't think we need a separate test case (with duplicated code) to test 
both fractional and integer factors.  Integer factor can be simply replaced 
with fractional one in existing test case.



-- 
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]

Reply via email to