HDFS-15895 : Remove redundant String#format in DFSAdmin#printOpenFiles (#2772)

(cherry picked from commit 9c43b60348)
This commit is contained in:
Viraj Jasani 2021-03-17 11:42:36 +05:30 committed by Takanobu Asanuma
parent aec9d2cff7
commit 17307ee88d

View File

@ -1001,14 +1001,14 @@ public int listOpenFiles(String[] argv) throws IOException {
private void printOpenFiles(RemoteIterator<OpenFileEntry> openFilesIterator) private void printOpenFiles(RemoteIterator<OpenFileEntry> openFilesIterator)
throws IOException { throws IOException {
System.out.println(String.format("%-20s\t%-20s\t%s", "Client Host", System.out.printf("%-20s\t%-20s\t%s%n", "Client Host",
"Client Name", "Open File Path")); "Client Name", "Open File Path");
while (openFilesIterator.hasNext()) { while (openFilesIterator.hasNext()) {
OpenFileEntry openFileEntry = openFilesIterator.next(); OpenFileEntry openFileEntry = openFilesIterator.next();
System.out.println(String.format("%-20s\t%-20s\t%20s", System.out.printf("%-20s\t%-20s\t%20s%n",
openFileEntry.getClientMachine(), openFileEntry.getClientMachine(),
openFileEntry.getClientName(), openFileEntry.getClientName(),
openFileEntry.getFilePath())); openFileEntry.getFilePath());
} }
} }