Add a method to wait for the finish of the experiment (waitForFinish).
This commit is contained in:
parent
70da4f490e
commit
3eca8d2947
@ -16,13 +16,14 @@
|
||||
|
||||
package com.databricks.spark.sql.perf
|
||||
|
||||
import scala.concurrent._
|
||||
import scala.concurrent.duration._
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
|
||||
import org.apache.hadoop.conf.Configuration
|
||||
import org.apache.hadoop.fs.{Path, FileSystem}
|
||||
import org.apache.spark.sql.SQLContext
|
||||
|
||||
import scala.concurrent._
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
|
||||
/**
|
||||
* The configuration used for an iteration of an experiment.
|
||||
* @param sparkVersion The version of Spark.
|
||||
@ -256,6 +257,11 @@ abstract class Dataset(
|
||||
resultsTable
|
||||
}
|
||||
|
||||
/** Waits for the finish of the experiment. */
|
||||
def waitForFinish(timeoutInSeconds: Int) = {
|
||||
Await.result(resultsFuture, timeoutInSeconds.seconds)
|
||||
}
|
||||
|
||||
/** Returns results from an actively running experiment. */
|
||||
def getCurrentResults() = {
|
||||
val tbl = sqlContext.createDataFrame(currentResults)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user