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

This commit is contained in:
Viraj Jasani 2021-03-17 11:42:36 +05:30 committed by GitHub
parent 9ba60c33d8
commit 9c43b60348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1024,14 +1024,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());
} }
} }