Skip to content

Commit

Permalink
add charset to getBytes() (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
Deegue authored Aug 4, 2023
1 parent fb8caac commit 8613326
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/agent/src/main/java/org/apache/spark/raydp/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.PrintStream;
import java.lang.instrument.Instrumentation;
import java.lang.management.ManagementFactory;
import java.nio.charset.Charset;


public class Agent {
Expand Down Expand Up @@ -82,8 +83,8 @@ public static void premain(String agentArgs, Instrumentation inst)
// TODO: uncomment after the ray PR #33665 released
// String prefix = System.getProperty("ray.logging.file-prefix", "java-worker");
// if ("java-worker".equals(prefix)) {
String file = new String(
(logDir + "/" + prefix + "-" + jobId + "-" + pid + ".log").getBytes(), "UTF-8");
String file = new String((logDir + "/" + prefix + "-" + jobId + "-" + pid + ".log")
.getBytes(Charset.forName("UTF-8")), "UTF-8");
try (FileWriter writer = new FileWriter(file)) {
writer.write(":job_id:" + jobId + "\n");
}
Expand Down

0 comments on commit 8613326

Please sign in to comment.