List of usage examples for org.apache.spark.launcher SparkAppHandle addListener
void addListener(Listener l);
From source file:com.thinkbiganalytics.spark.shell.SparkLauncherSparkShellProcess.java
License:Apache License
/** * Constructs a {@code SparkLauncherSparkShellProcess} with the specified process. * * @param handle the Spark Launcher app handle * @param clientId the client identifier * @param clientSecret the client secret * @param timeout the maximum time to wait for the client to be ready * @param unit the time unit of the {@code timeout} argument *//* w w w.j a va 2 s . c o m*/ public SparkLauncherSparkShellProcess(@Nonnull final SparkAppHandle handle, @Nonnull final String clientId, @Nonnull final String clientSecret, final long timeout, @Nonnull final TimeUnit unit) { this.handle = handle; this.clientId = clientId; this.clientSecret = clientSecret; readyTime = DateTimeUtils.currentTimeMillis() + unit.toMillis(timeout); // Listen for state changes handle.addListener(this); }