Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@

public class SparkEntry {
public static void main(String[] args) {
int retCode = JobWorkSpace.execute(args);
if (retCode == 2) {
System.exit(1);
} else if (System.getProperty("spark.master").equals("yarn") && System.getProperty("spark.submit.deployMode").equals("cluster")) {
if (retCode == 1) {
throw new RuntimeException("Job failed!");
}
} else {
System.exit(retCode);
}
JobWorkSpace.execute(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,25 @@ import org.apache.spark.internal.Logging
import org.apache.spark.scheduler.KylinJobEventLoop

object JobWorkSpace extends Logging {
def execute(args: Array[String]): Int = {
def execute(args: Array[String]): Unit = {
try {
val (application, appArgs) = resolveArgs(args)
val eventLoop = new KylinJobEventLoop
val worker = new JobWorker(application, appArgs, eventLoop)
val monitor = new JobMonitor(eventLoop)
val workspace = new JobWorkSpace(eventLoop, monitor, worker)
workspace.run()
if (System.getProperty("spark.master").equals("yarn") && System.getProperty("spark.submit.deployMode").equals("cluster")) {
val res = workspace.run()
if (res != 0) {
System.exit(res)
}
} else {
System.exit(workspace.run())
}
} catch {
case throwable: Throwable =>
logError("Error occurred when init job workspace.", throwable)
2
System.exit(1)
}
}

Expand Down