Skip to content

Commit d74f328

Browse files
authored
HDFS-16525.System.err should be used when error occurs in multiple methods in DFSAdmin class (#4122)
1 parent 6a95c3a commit d74f328

File tree

2 files changed

+115
-105
lines changed

2 files changed

+115
-105
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ public int saveNamespace(String[] argv) throws IOException {
904904
+ proxy.getAddress());
905905
}
906906
}catch (IOException ioe){
907-
System.out.println("Save namespace failed for " +
907+
System.err.println("Save namespace failed for " +
908908
proxy.getAddress());
909909
exceptions.add(ioe);
910910
}
@@ -961,7 +961,7 @@ public int restoreFailedStorage(String arg) throws IOException {
961961
System.out.println("restoreFailedStorage is set to " + res + " for "
962962
+ proxy.getAddress());
963963
} catch (IOException ioe){
964-
System.out.println("restoreFailedStorage failed for "
964+
System.err.println("restoreFailedStorage failed for "
965965
+ proxy.getAddress());
966966
exceptions.add(ioe);
967967
}
@@ -1004,7 +1004,7 @@ public int refreshNodes() throws IOException {
10041004
System.out.println("Refresh nodes successful for " +
10051005
proxy.getAddress());
10061006
}catch (IOException ioe){
1007-
System.out.println("Refresh nodes failed for " +
1007+
System.err.println("Refresh nodes failed for " +
10081008
proxy.getAddress());
10091009
exceptions.add(ioe);
10101010
}
@@ -1060,7 +1060,7 @@ public int listOpenFiles(String[] argv) throws IOException {
10601060
openFilesRemoteIterator = dfs.listOpenFiles(openFilesTypes, path);
10611061
printOpenFiles(openFilesRemoteIterator);
10621062
} catch (IOException ioe){
1063-
System.out.println("List open files failed.");
1063+
System.err.println("List open files failed.");
10641064
throw ioe;
10651065
}
10661066
return 0;
@@ -1494,7 +1494,7 @@ public int finalizeUpgrade() throws IOException {
14941494
System.out.println("Finalize upgrade successful for " +
14951495
proxy.getAddress());
14961496
}catch (IOException ioe){
1497-
System.out.println("Finalize upgrade failed for " +
1497+
System.err.println("Finalize upgrade failed for " +
14981498
proxy.getAddress());
14991499
exceptions.add(ioe);
15001500
}
@@ -1623,7 +1623,7 @@ public int metaSave(String[] argv, int idx) throws IOException {
16231623
throw re;
16241624
}
16251625
} catch (IOException ioe) {
1626-
System.out.println("Created metasave file " + pathname
1626+
System.err.println("Created metasave file " + pathname
16271627
+ " in the log directory of namenode " + proxy.getAddress()
16281628
+ " failed");
16291629
exceptions.add(ioe);
@@ -1722,7 +1722,7 @@ public int refreshServiceAcl() throws IOException {
17221722
System.out.println("Refresh service acl successful for "
17231723
+ proxy.getAddress());
17241724
}catch (IOException ioe){
1725-
System.out.println("Refresh service acl failed for "
1725+
System.err.println("Refresh service acl failed for "
17261726
+ proxy.getAddress());
17271727
exceptions.add(ioe);
17281728
}
@@ -1775,7 +1775,7 @@ public int refreshUserToGroupsMappings() throws IOException {
17751775
System.out.println("Refresh user to groups mapping successful for "
17761776
+ proxy.getAddress());
17771777
}catch (IOException ioe){
1778-
System.out.println("Refresh user to groups mapping failed for "
1778+
System.err.println("Refresh user to groups mapping failed for "
17791779
+ proxy.getAddress());
17801780
exceptions.add(ioe);
17811781
}
@@ -1830,7 +1830,7 @@ public int refreshSuperUserGroupsConfiguration() throws IOException {
18301830
System.out.println("Refresh super user groups configuration " +
18311831
"successful for " + proxy.getAddress());
18321832
}catch (IOException ioe){
1833-
System.out.println("Refresh super user groups configuration " +
1833+
System.err.println("Refresh super user groups configuration " +
18341834
"failed for " + proxy.getAddress());
18351835
exceptions.add(ioe);
18361836
}
@@ -1879,7 +1879,7 @@ public int refreshCallQueue() throws IOException {
18791879
System.out.println("Refresh call queue successful for "
18801880
+ proxy.getAddress());
18811881
}catch (IOException ioe){
1882-
System.out.println("Refresh call queue failed for "
1882+
System.err.println("Refresh call queue failed for "
18831883
+ proxy.getAddress());
18841884
exceptions.add(ioe);
18851885
}

0 commit comments

Comments
 (0)