forked from opensci/piflow
add wait process terminate Runnable
This commit is contained in:
parent
e6c4b22e5a
commit
08079e1985
|
@ -51,6 +51,7 @@ object API {
|
|||
val applicationId = spark.sparkContext.applicationId
|
||||
//process.awaitTermination();
|
||||
//spark.close();
|
||||
new Thread( new WaitProcessTerminateRunnable(spark, process)).start()
|
||||
(applicationId,process)
|
||||
}
|
||||
|
||||
|
@ -89,3 +90,10 @@ object API {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class WaitProcessTerminateRunnable(spark : SparkSession, process: Process) extends Runnable {
|
||||
override def run(): Unit = {
|
||||
process.awaitTermination()
|
||||
spark.close()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue