Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] Change log dir to /tmp/raylogs #2677

Merged
merged 4 commits into from
Aug 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor updates
  • Loading branch information
raulchen committed Aug 17, 2018
commit 70b9e9abd7fa97408ee2b118926bed73bbfc79bf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class RunManager {

public static final int INT16_MAX = 32767;

private static final DateTimeFormatter DATE_TIME_FORMATTER =
DateTimeFormatter.ofPattern("Y-m-d_H-M-S");

private RayParameters params;

private PathConfig paths;
Expand All @@ -41,7 +44,6 @@ public class RunManager {

private Random random = new Random();

private DateTimeFormatter logFileDateTimeFormatter = DateTimeFormatter.ofPattern("Y-m-d_H-M-S");

public RunManager(RayParameters params, PathConfig paths, ConfigReader configReader) {
this.params = params;
Expand Down Expand Up @@ -137,7 +139,7 @@ private Process startJavaProcess(RunInfo.ProcessType pt, String mainClass,

String cmd = buildJavaProcessCommand(pt, mainClass, additonalClassPaths, additionalConfigs,
additionalJvmArgs, ip, redisAddr, agentlibAddr);
return startProcess(cmd.split(" "), null, pt, null, redisAddr, ip, redirect, cleanup);
return startProcess(cmd.split(" "), "", pt, null, redisAddr, ip, redirect, cleanup);
}

private String buildJavaProcessCommand(
Expand Down Expand Up @@ -187,7 +189,7 @@ private Process startProcess(String[] cmd, Map<String, String> env, RunInfo.Proc

if (redirect) {
int logId = random.nextInt(10000);
String date = logFileDateTimeFormatter.format(LocalDateTime.now());
String date = DATE_TIME_FORMATTER.format(LocalDateTime.now());
String stdout = String.format("%s/%s-%s-%05d.out", params.log_dir, name, date, logId);
String stderr = String.format("%s/%s-%s-%05d.err", params.log_dir, name, date, logId);
builder.redirectOutput(new File(stdout));
Expand Down