jojochuang commented on a change in pull request #2434:
URL: https://github.com/apache/ozone/pull/2434#discussion_r674451623



##########
File path: 
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/containergenerator/GeneratorDatanode.java
##########
@@ -193,12 +196,43 @@ private String getScmIdFromStoragePath(Path hddsDir)
     return scmDirName.toString();
   }
 
-  private void generateData(long index) throws Exception {
+
+  /**
+   * Return the placement of the container with ONE based indexes.
+   * (first datanode is 1).
+   */
+  @VisibleForTesting
+  public static Set<Integer> getPlacement(
+      long containerId,
+      int maxDatanodes,
+      int overlap) {
+    int parallelPipelines = maxDatanodes / 3;
+    int startOffset = (int) ((containerId % parallelPipelines) * 3);
+
+    int pipelineLevel = (int) (containerId / parallelPipelines);

Review comment:
       the variable name pipelineLevel is a little indirect to me. If we can 
find a better name for it...

##########
File path: 
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/containergenerator/GeneratorDatanode.java
##########
@@ -193,12 +196,43 @@ private String getScmIdFromStoragePath(Path hddsDir)
     return scmDirName.toString();
   }
 
-  private void generateData(long index) throws Exception {
+
+  /**
+   * Return the placement of the container with ONE based indexes.
+   * (first datanode is 1).
+   */
+  @VisibleForTesting
+  public static Set<Integer> getPlacement(
+      long containerId,
+      int maxDatanodes,
+      int overlap) {
+    int parallelPipelines = maxDatanodes / 3;

Review comment:
       we assume maxDatanodes is always multiple of 3?




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