Class ExecutionEnvironment
java.lang.Object
oracle.pgx.api.internal.ApiObject
oracle.pgx.api.executionenvironment.ExecutionEnvironment
public final class ExecutionEnvironment
extends oracle.pgx.api.internal.ApiObject
A session bound environment holding the execution configuration for each task type.
-
Constructor Summary
ConstructorsConstructorDescriptionExecutionEnvironment(PgxSession session, oracle.pgx.api.internal.CoreSessionApi coreSessionApi) -
Method Summary
Modifier and TypeMethodDescriptionbooleanBlocking version ofallowsConcurrentTasksAsync().Checks if the session allows the tasks to run concurrently.Blocking version ofgetValuesAsync().voidreset()Blocking version ofresetAsync().Resets the environment for this session to the configured default values.toString()<T> TwithMaxNumThreads(int maxNumThreads, Supplier<PgxFuture<T>> asyncRequest) Blocking version ofwithMaxNumThreadsAsync(int, Supplier).<T> PgxFuture<T> withMaxNumThreadsAsync(int maxNumThreads, Supplier<PgxFuture<T>> asyncRequest) Executes the given asynchronous request with at mostmaxNumThreads.
-
Constructor Details
-
ExecutionEnvironment
public ExecutionEnvironment(PgxSession session, oracle.pgx.api.internal.CoreSessionApi coreSessionApi)
-
-
Method Details
-
getValuesAsync
-
withMaxNumThreadsAsync
public <T> PgxFuture<T> withMaxNumThreadsAsync(int maxNumThreads, Supplier<PgxFuture<T>> asyncRequest) Executes the given asynchronous request with at mostmaxNumThreads. This affects all task types.- Parameters:
maxNumThreads- the maximum number of threads to use for the requestasyncRequest- the asynchronous request to execute- Returns:
- the result of the asynchronous request
-
resetAsync
-
reset
- Throws:
InterruptedException- if the caller thread gets interrupted while waiting for completion.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
withMaxNumThreads
public <T> T withMaxNumThreads(int maxNumThreads, Supplier<PgxFuture<T>> asyncRequest) throws ExecutionException, InterruptedException Blocking version ofwithMaxNumThreadsAsync(int, Supplier). CallswithMaxNumThreadsAsync(int, Supplier)and waits for returnedPgxFutureto complete.- Throws:
InterruptedException- if the caller thread gets interrupted while waiting for completion.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
getValues
Blocking version ofgetValuesAsync(). CallsgetValuesAsync()and waits for returnedPgxFutureto complete.- Throws:
InterruptedException- if the caller thread gets interrupted while waiting for completion.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
getSession
- Returns:
- the session associated with this execution environment.
-
getIoEnvironment
- Returns:
- the execution environment for IO tasks
-
getAnalysisEnvironment
- Returns:
- the execution environment for analysis tasks
-
getFastAnalysisEnvironment
- Returns:
- the execution environment for fast analysis tasks
-
allowsConcurrentTasksAsync
-
allowsConcurrentTasks
public boolean allowsConcurrentTasks()Blocking version ofallowsConcurrentTasksAsync(). CallsallowsConcurrentTasksAsync()and waits for returnedPgxFutureto complete. -
toString
-