From c86177e0630dee4382775ea7dbce89e0f0388939 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 22 Nov 2025 12:28:09 -0800 Subject: [PATCH] add comments --- .../hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java | 5 ++++- .../hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java index a84145046..78cf5a2fc 100644 --- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java +++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java @@ -105,7 +105,10 @@ public class SeaweedFileSystem extends FileSystem { // default, 3) null -> HDFS replication String replicaPlacement = this.getConf().get(FS_SEAWEED_REPLICATION); if (replicaPlacement == null) { - // Not configured, use HDFS replication parameter + // Not configured, use HDFS replication parameter. This creates a "00N" + // replication string, + // placing N (replication-1) extra replicas on different servers in the same + // rack. replicaPlacement = String.format("%03d", replication - 1); } int seaweedBufferSize = this.getConf().getInt(FS_SEAWEED_BUFFER_SIZE, FS_SEAWEED_DEFAULT_BUFFER_SIZE); diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java index a84145046..78cf5a2fc 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java @@ -105,7 +105,10 @@ public class SeaweedFileSystem extends FileSystem { // default, 3) null -> HDFS replication String replicaPlacement = this.getConf().get(FS_SEAWEED_REPLICATION); if (replicaPlacement == null) { - // Not configured, use HDFS replication parameter + // Not configured, use HDFS replication parameter. This creates a "00N" + // replication string, + // placing N (replication-1) extra replicas on different servers in the same + // rack. replicaPlacement = String.format("%03d", replication - 1); } int seaweedBufferSize = this.getConf().getInt(FS_SEAWEED_BUFFER_SIZE, FS_SEAWEED_DEFAULT_BUFFER_SIZE);