@InterfaceAudience.Private public interface SparkClient extends Serializable
Modifier and Type | Method and Description |
---|---|
Future<?> |
addFile(URI uri)
Adds a file to the running remote context.
|
Future<?> |
addJar(URI uri)
Adds a jar file to the running remote context.
|
Future<Integer> |
getDefaultParallelism()
Get default parallelism.
|
Future<Integer> |
getExecutorCount()
Get the count of executors.
|
boolean |
isActive()
Check if remote context is still active.
|
<T extends Serializable> |
run(Job<T> job)
Asks the remote context to run a job immediately.
|
void |
stop()
Stops the remote context.
|
<T extends Serializable> |
submit(Job<T> job)
Submits a job for asynchronous execution.
|
<T extends Serializable> |
submit(Job<T> job,
List<JobHandle.Listener<T>> listeners)
Submits a job for asynchronous execution.
|
<T extends Serializable> JobHandle<T> submit(Job<T> job)
job
- The job to execute.<T extends Serializable> JobHandle<T> submit(Job<T> job, List<JobHandle.Listener<T>> listeners)
job
- The job to execute.listeners
- jobhandle listeners to invoke during the job processing<T extends Serializable> Future<T> run(Job<T> job)
Normally, the remote context will queue jobs and execute them based on how many worker threads have been configured. This method will run the submitted job in the same thread processing the RPC message, so that queueing does not apply.
It's recommended that this method only be used to run code that finishes quickly. This avoids interfering with the normal operation of the context.
Note: the JobContext#monitor() functionality is not available when using this method.job
- The job to execute.void stop()
Future<?> addJar(URI uri)
uri
- The location of the jar file.Future<?> addFile(URI uri)
uri
- The location of the file.Future<Integer> getDefaultParallelism()
boolean isActive()
Copyright © 2022 The Apache Software Foundation. All rights reserved.