You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hexiaoqiao (via GitHub)" <gi...@apache.org> on 2023/09/18 03:10:04 UTC

[GitHub] [hadoop] Hexiaoqiao commented on a diff in pull request #6095: HDFS-17197. Show file replication when listing corrupt files.

Hexiaoqiao commented on code in PR #6095:
URL: https://github.com/apache/hadoop/pull/6095#discussion_r1328207545


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -6195,7 +6197,11 @@ Collection<CorruptFileBlockInfo> listCorruptFileBlocks(String path,
         if (inode != null) {
           String src = inode.getFullPathName();
           if (isParentEntry(src, path)) {
-            corruptFiles.add(new CorruptFileBlockInfo(src, blk));
+            int repl = 0;
+            if (inode.isFile()) {
+              repl = inode.asFile().getFileReplication();

Review Comment:
   What will be return if this inode is one EC file here?



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -6131,15 +6131,17 @@ void releaseBackupNode(NamenodeRegistration registration)
   static class CorruptFileBlockInfo {
     final String path;
     final Block block;
+    private final int replication;
     
-    public CorruptFileBlockInfo(String p, Block b) {
+    CorruptFileBlockInfo(String p, Block b, int r) {
       path = p;
       block = b;
+      replication = r;
     }
     
     @Override
     public String toString() {
-      return block.getBlockName() + "\t" + path;
+      return block.getBlockName() + "\t" + replication + "\t" + path;

Review Comment:
   I am a little worried about the compatibility while upstream dependency with this string but we change the format here.



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

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


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