Skip to content

Commit 0d43287

Browse files
author
u0028003
committed
Lots of refactoring and polishing of the JobRunner app classes.
1 parent 8843a55 commit 0d43287

File tree

5 files changed

+1555
-93
lines changed

5 files changed

+1555
-93
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
package edu.utah.hci.aws.apps.jobrunner;
2+
3+
import java.io.File;
4+
import java.io.FileWriter;
5+
import java.io.IOException;
6+
import java.io.PrintWriter;
7+
8+
public class JRJob {
9+
10+
//fields
11+
12+
// s3://hcibioinfo-jobrunner/Jobs/Patient1/JobB/
13+
private String s3UrlRunningJobPath = null;
14+
15+
// testJob.sh
16+
private String scriptFileName = null;
17+
18+
// testJob.sh_JR_START
19+
private String startScriptFileName = null;
20+
21+
// testJob.sh_JR_REQUESTED_u00280003.local
22+
private String requestFileName = null;
23+
24+
// testJob.sh_JR_RUNNING_u00280003.local
25+
private String runningFileName = null;
26+
27+
// workingDir/RunningJob/Patient1/JobB/
28+
private File localJobDir;
29+
30+
// workingDir/RunningJob/Patient1/JobB/testJob.sh_JR_LOG.txt
31+
private File jobLogFile;
32+
private PrintWriter jobLogOut = null;
33+
34+
// completed without issue?
35+
private boolean completedOK;
36+
37+
//constructor
38+
public JRJob(String s3UrlRunningJobPath, String jobScript, String jobStartScript) {
39+
this.s3UrlRunningJobPath = s3UrlRunningJobPath;
40+
this.scriptFileName = jobScript;
41+
this.startScriptFileName = jobStartScript;
42+
}
43+
44+
public String getS3UrlRunningJobPath() {
45+
return s3UrlRunningJobPath;
46+
}
47+
48+
public String getScriptFileName() {
49+
return scriptFileName;
50+
}
51+
52+
public void setJobRequestFileName(String requestFileName) {
53+
this.requestFileName = requestFileName;
54+
}
55+
56+
public void setJobRunningFileName(String jobRunningFileName) {
57+
runningFileName = jobRunningFileName;
58+
}
59+
60+
public String getRequestFileName() {
61+
return requestFileName;
62+
}
63+
64+
public String getRunningFileName() {
65+
return runningFileName;
66+
}
67+
68+
public void setLocalJobDir(File localJobDir) {
69+
this.localJobDir= localJobDir;
70+
}
71+
72+
public File getLocalJobDir() {
73+
return localJobDir;
74+
}
75+
76+
public void setJobLogFile(File jobLogFile) throws IOException {
77+
this.jobLogFile = jobLogFile;
78+
jobLogOut = new PrintWriter( new FileWriter (jobLogFile));
79+
}
80+
81+
public File getJobLogFile() {
82+
return jobLogFile;
83+
}
84+
85+
public PrintWriter getJobLogOut() {
86+
return jobLogOut;
87+
}
88+
89+
public String getStartScriptFileName() {
90+
return startScriptFileName;
91+
}
92+
93+
public boolean isCompletedOK() {
94+
return completedOK;
95+
}
96+
97+
public void setCompletedOK(boolean completedOK) {
98+
this.completedOK = completedOK;
99+
}
100+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package edu.utah.hci.aws.apps.jobrunner;
2+
3+
import java.io.File;
4+
5+
public class Job {
6+
String s3UrlShellScript;
7+
String s3UrlInitScript;
8+
String s3UrlTermScript;
9+
String s3UrlRequest;
10+
String s3UrlRunning;
11+
String s3UrlErrorLog;
12+
String s3UrlCompleteLog;
13+
File localLog;
14+
15+
}

0 commit comments

Comments
 (0)