Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 f36da00c1 -> 0dcd73749


YARN-6719. Fix findbugs warnings in SLSCapacityScheduler.java. Contributed by 
Akira Ajisaka.

(cherry picked from commit 582bdfd423a1c163ed945cf0e686e58de1de39c0)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0dcd7374
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0dcd7374
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0dcd7374

Branch: refs/heads/branch-2.7
Commit: 0dcd73749dd8a761ffcc7915f5f57280a01bfd67
Parents: f36da00
Author: Naganarasimha <naganarasimha...@apache.org>
Authored: Mon Jun 19 12:47:25 2017 +0530
Committer: Naganarasimha <naganarasimha...@apache.org>
Committed: Mon Jun 19 12:53:56 2017 +0530

----------------------------------------------------------------------
 .../hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0dcd7374/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java
----------------------------------------------------------------------
diff --git 
a/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java
 
b/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java
index da5d341..967bcc7 100644
--- 
a/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java
+++ 
b/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java
@@ -83,8 +83,10 @@ import org.apache.log4j.Logger;
 
 import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -485,7 +487,8 @@ public class SLSCapacityScheduler extends CapacityScheduler 
implements
 
     // application running information
     jobRuntimeLogBW = new BufferedWriter(
-            new FileWriter(metricsOutputDir + "/jobruntime.csv"));
+        new OutputStreamWriter(new FileOutputStream(
+            metricsOutputDir + "/jobruntime.csv"), StandardCharsets.UTF_8));
     jobRuntimeLogBW.write("JobID,real_start_time,real_end_time," +
             "simulate_start_time,simulate_end_time" + EOL);
     jobRuntimeLogBW.flush();
@@ -690,7 +693,9 @@ public class SLSCapacityScheduler extends CapacityScheduler 
implements
     public MetricsLogRunnable() {
       try {
         metricsLogBW = new BufferedWriter(
-                new FileWriter(metricsOutputDir + "/realtimetrack.json"));
+            new OutputStreamWriter(new FileOutputStream(
+                metricsOutputDir + "/realtimetrack.json"),
+                StandardCharsets.UTF_8));
         metricsLogBW.write("[");
       } catch (IOException e) {
         e.printStackTrace();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to