HDFS-9210. Fix some misuse of %n in VolumeScanner#printStats. Contributed by Xiaoyu Yao.

This commit is contained in:
Xiaoyu Yao 2016-02-01 11:55:27 -08:00
parent 59a212b6e1
commit b11008d54d
2 changed files with 6 additions and 4 deletions

View File

@ -2664,6 +2664,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9708. FSNamesystem.initAuditLoggers() doesn't trim classnames HDFS-9708. FSNamesystem.initAuditLoggers() doesn't trim classnames
(Mingliang Liu via stevel) (Mingliang Liu via stevel)
HDFS-9210. Fix some misuse of %n in VolumeScanner#printStats.
(Xiaoyu Yao)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -216,9 +216,8 @@ public class VolumeScanner extends Thread {
} }
public void printStats(StringBuilder p) { public void printStats(StringBuilder p) {
p.append("Block scanner information for volume " + p.append(String.format("Block scanner information for volume %s with base" +
volume.getStorageID() + " with base path " + volume.getBasePath() + " path %s%n", volume.getStorageID(), volume.getBasePath()));
"%n");
synchronized (stats) { synchronized (stats) {
p.append(String.format("Bytes verified in last hour : %57d%n", p.append(String.format("Bytes verified in last hour : %57d%n",
stats.bytesScannedInPastHour)); stats.bytesScannedInPastHour));
@ -245,7 +244,7 @@ public class VolumeScanner extends Thread {
stats.lastBlockScanned.toString()))); stats.lastBlockScanned.toString())));
p.append(String.format("More blocks to scan in period : %57s%n", p.append(String.format("More blocks to scan in period : %57s%n",
!stats.eof)); !stats.eof));
p.append("%n"); p.append(System.lineSeparator());
} }
} }