|
@@ -19,9 +19,7 @@ package org.apache.hadoop.yarn.client.cli;
|
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
|
-import java.io.OutputStreamWriter;
|
|
|
import java.io.PrintWriter;
|
|
|
-import java.nio.charset.Charset;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.EnumSet;
|
|
|
import java.util.HashSet;
|
|
@@ -278,8 +276,7 @@ public class ApplicationCLI extends YarnCLI {
|
|
|
}
|
|
|
// Use PrintWriter.println, which uses correct platform line ending.
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
- PrintWriter appAttemptReportStr = new PrintWriter(
|
|
|
- new OutputStreamWriter(baos, Charset.forName("UTF-8")));
|
|
|
+ PrintWriter appAttemptReportStr = new PrintWriter(baos);
|
|
|
if (appAttemptReport != null) {
|
|
|
appAttemptReportStr.println("Application Attempt Report : ");
|
|
|
appAttemptReportStr.print("\tApplicationAttempt-Id : ");
|
|
@@ -338,8 +335,7 @@ public class ApplicationCLI extends YarnCLI {
|
|
|
}
|
|
|
// Use PrintWriter.println, which uses correct platform line ending.
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
- PrintWriter containerReportStr = new PrintWriter(
|
|
|
- new OutputStreamWriter(baos, Charset.forName("UTF-8")));
|
|
|
+ PrintWriter containerReportStr = new PrintWriter(baos);
|
|
|
if (containerReport != null) {
|
|
|
containerReportStr.println("Container Report : ");
|
|
|
containerReportStr.print("\tContainer-Id : ");
|
|
@@ -380,8 +376,7 @@ public class ApplicationCLI extends YarnCLI {
|
|
|
private void listApplications(Set<String> appTypes,
|
|
|
EnumSet<YarnApplicationState> appStates) throws YarnException,
|
|
|
IOException {
|
|
|
- PrintWriter writer = new PrintWriter(
|
|
|
- new OutputStreamWriter(sysout, Charset.forName("UTF-8")));
|
|
|
+ PrintWriter writer = new PrintWriter(sysout);
|
|
|
if (allAppStates) {
|
|
|
for (YarnApplicationState appState : YarnApplicationState.values()) {
|
|
|
appStates.add(appState);
|
|
@@ -483,8 +478,7 @@ public class ApplicationCLI extends YarnCLI {
|
|
|
}
|
|
|
// Use PrintWriter.println, which uses correct platform line ending.
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
- PrintWriter appReportStr = new PrintWriter(
|
|
|
- new OutputStreamWriter(baos, Charset.forName("UTF-8")));
|
|
|
+ PrintWriter appReportStr = new PrintWriter(baos);
|
|
|
if (appReport != null) {
|
|
|
appReportStr.println("Application Report : ");
|
|
|
appReportStr.print("\tApplication-Id : ");
|
|
@@ -560,8 +554,7 @@ public class ApplicationCLI extends YarnCLI {
|
|
|
*/
|
|
|
private void listApplicationAttempts(String applicationId) throws YarnException,
|
|
|
IOException {
|
|
|
- PrintWriter writer = new PrintWriter(
|
|
|
- new OutputStreamWriter(sysout, Charset.forName("UTF-8")));
|
|
|
+ PrintWriter writer = new PrintWriter(sysout);
|
|
|
|
|
|
List<ApplicationAttemptReport> appAttemptsReport = client
|
|
|
.getApplicationAttempts(ConverterUtils.toApplicationId(applicationId));
|
|
@@ -587,8 +580,7 @@ public class ApplicationCLI extends YarnCLI {
|
|
|
*/
|
|
|
private void listContainers(String appAttemptId) throws YarnException,
|
|
|
IOException {
|
|
|
- PrintWriter writer = new PrintWriter(
|
|
|
- new OutputStreamWriter(sysout, Charset.forName("UTF-8")));
|
|
|
+ PrintWriter writer = new PrintWriter(sysout);
|
|
|
|
|
|
List<ContainerReport> appsReport = client
|
|
|
.getContainers(ConverterUtils.toApplicationAttemptId(appAttemptId));
|