You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/07/22 02:00:28 UTC

[GitHub] [ozone] jojochuang commented on a change in pull request #2434: HDDS-5462. Multi-raft style placement with permutations for offline data generator

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org