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

(cherry picked from commit 3d50855952)
This commit is contained in:
Xiaoyu Yao 2015-10-14 13:22:58 -07:00
parent 8651677446
commit c1f68b3cd9
2 changed files with 5 additions and 4 deletions

View File

@ -1234,6 +1234,8 @@ Release 2.8.0 - UNRELEASED
HDFS-9187. Fix null pointer error in Globber when FS was not constructed
via FileSystem#createFileSystem (cmccabe)
HDFS-9210. Fix some misuse of %n in VolumeScanner#printStats. (xyao)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -216,9 +216,8 @@ public class VolumeScanner extends Thread {
}
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 class VolumeScanner extends Thread {
stats.lastBlockScanned.toString())));
p.append(String.format("More blocks to scan in period : %57s%n",
!stats.eof));
p.append("%n");
p.append(String.format("%n"));
}
}