diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index fdf69d9d21..ee9dcc2b4f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -2664,6 +2664,9 @@ Release 2.8.0 - UNRELEASED HDFS-9708. FSNamesystem.initAuditLoggers() doesn't trim classnames (Mingliang Liu via stevel) + HDFS-9210. Fix some misuse of %n in VolumeScanner#printStats. + (Xiaoyu Yao) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java index 212e13b369..d1f2d05176 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java @@ -216,9 +216,8 @@ private static double positiveMsToHours(long ms) { } public void printStats(StringBuilder p) { - p.append("Block scanner information for volume " + - volume.getStorageID() + " with base path " + volume.getBasePath() + - "%n"); + p.append(String.format("Block scanner information for volume %s with base" + + " path %s%n", volume.getStorageID(), volume.getBasePath())); synchronized (stats) { p.append(String.format("Bytes verified in last hour : %57d%n", stats.bytesScannedInPastHour)); @@ -245,7 +244,7 @@ public void printStats(StringBuilder p) { stats.lastBlockScanned.toString()))); p.append(String.format("More blocks to scan in period : %57s%n", !stats.eof)); - p.append("%n"); + p.append(System.lineSeparator()); } }