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