Class ExecutionEnvironment
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.executionenvironment.ExecutionEnvironment
-
public final class ExecutionEnvironment extends oracle.pgx.api.internal.ApiObjectA session bound environment holding the execution configuration for each task type.
-
-
Constructor Summary
Constructors Constructor Description ExecutionEnvironment(PgxSession session, oracle.pgx.api.internal.CoreSessionApi coreSessionApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsConcurrentTasks()Blocking version ofallowsConcurrentTasksAsync().PgxFuture<java.lang.Boolean>allowsConcurrentTasksAsync()Checks if the session allows the tasks to run concurrently.CpuEnvironmentgetAnalysisEnvironment()CpuEnvironmentgetFastAnalysisEnvironment()IoEnvironmentgetIoEnvironment()PgxSessiongetSession()UpdateConsistencyModelgetUpdateConsistencyModel()Blocking version ofgetUpdateConsistencyModelAsync().PgxFuture<UpdateConsistencyModel>getUpdateConsistencyModelAsync()Gets the consistency model to be used with in-place updates (if enabled).java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Object>>getValues()Blocking version ofgetValuesAsync().PgxFuture<java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Object>>>getValuesAsync()voidreset()Blocking version ofresetAsync().PgxFuture<java.lang.Void>resetAsync()Resets the environment for this session to the configured default values.voidresetUpdateConsistencyModel()Blocking version ofresetUpdateConsistencyModelAsync().PgxFuture<java.lang.Void>resetUpdateConsistencyModelAsync()Resets the consistency model to be used with in-place updates (if enabled) to the default value, as configured inPgxConfig.getInPlaceUpdateConsistencyModel()voidsetUpdateConsistencyModel(UpdateConsistencyModel model)Blocking version ofsetUpdateConsistencyModelAsync(UpdateConsistencyModel).PgxFuture<java.lang.Void>setUpdateConsistencyModelAsync(UpdateConsistencyModel model)Sets the consistency model to be used with in-place updates (if enabled).java.lang.StringtoString()<T> TwithMaxNumThreads(int maxNumThreads, java.util.function.Supplier<PgxFuture<T>> asyncRequest)Blocking version ofwithMaxNumThreadsAsync(int, Supplier).<T> PgxFuture<T>withMaxNumThreadsAsync(int maxNumThreads, java.util.function.Supplier<PgxFuture<T>> asyncRequest)Executes the given asynchronous request with at mostmaxNumThreads.<T> TwithUpdateConsistencyModel(UpdateConsistencyModel model, java.util.function.Supplier<PgxFuture<T>> asyncRequest)Blocking version ofwithUpdateConsistencyModelAsync(UpdateConsistencyModel, Supplier).<T> PgxFuture<T>withUpdateConsistencyModelAsync(UpdateConsistencyModel model, java.util.function.Supplier<PgxFuture<T>> asyncRequest)Executes the given asynchronous request with the given consistency model (only relevant if in-place updates are enabled).
-
-
-
Constructor Detail
-
ExecutionEnvironment
public ExecutionEnvironment(PgxSession session, oracle.pgx.api.internal.CoreSessionApi coreSessionApi)
-
-
Method Detail
-
getValuesAsync
public PgxFuture<java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Object>>> getValuesAsync()
- Returns:
- the current configuration
-
withMaxNumThreadsAsync
public <T> PgxFuture<T> withMaxNumThreadsAsync(int maxNumThreads, java.util.function.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
public PgxFuture<java.lang.Void> resetAsync()
Resets the environment for this session to the configured default values.
-
reset
public void reset() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.lang.InterruptedException- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
withMaxNumThreads
public <T> T withMaxNumThreads(int maxNumThreads, java.util.function.Supplier<PgxFuture<T>> asyncRequest) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofwithMaxNumThreadsAsync(int, Supplier). CallswithMaxNumThreadsAsync(int, Supplier)and waits for returnedPgxFutureto complete.- Throws:
java.lang.InterruptedException- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
getValues
public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Object>> getValues() throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofgetValuesAsync(). CallsgetValuesAsync()and waits for returnedPgxFutureto complete.- Throws:
java.lang.InterruptedException- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
getSession
public PgxSession getSession()
- Returns:
- the session associated with this execution environment.
-
getIoEnvironment
public IoEnvironment getIoEnvironment()
- Returns:
- the execution environment for IO tasks
-
setUpdateConsistencyModelAsync
public PgxFuture<java.lang.Void> setUpdateConsistencyModelAsync(UpdateConsistencyModel model)
Sets the consistency model to be used with in-place updates (if enabled). If in-place updates are disabled this value is ignored- Parameters:
model- The desired Consistency Model
-
getUpdateConsistencyModelAsync
public PgxFuture<UpdateConsistencyModel> getUpdateConsistencyModelAsync()
Gets the consistency model to be used with in-place updates (if enabled).- Returns:
- The current update consistency model for this session
-
resetUpdateConsistencyModelAsync
public PgxFuture<java.lang.Void> resetUpdateConsistencyModelAsync()
Resets the consistency model to be used with in-place updates (if enabled) to the default value, as configured inPgxConfig.getInPlaceUpdateConsistencyModel()
-
withUpdateConsistencyModelAsync
public <T> PgxFuture<T> withUpdateConsistencyModelAsync(UpdateConsistencyModel model, java.util.function.Supplier<PgxFuture<T>> asyncRequest)
Executes the given asynchronous request with the given consistency model (only relevant if in-place updates are enabled).- Parameters:
model- the update consistency model to useasyncRequest- the asynchronous request to execute- Returns:
- the result of the asynchronous request
-
setUpdateConsistencyModel
public void setUpdateConsistencyModel(UpdateConsistencyModel model)
Blocking version ofsetUpdateConsistencyModelAsync(UpdateConsistencyModel). CallssetUpdateConsistencyModelAsync(UpdateConsistencyModel)and waits for returnedPgxFutureto complete.- Parameters:
model- The desired Consistnecy Model
-
resetUpdateConsistencyModel
public void resetUpdateConsistencyModel()
Blocking version ofresetUpdateConsistencyModelAsync(). CallsresetUpdateConsistencyModelAsync()and waits for returnedPgxFutureto complete.
-
withUpdateConsistencyModel
public <T> T withUpdateConsistencyModel(UpdateConsistencyModel model, java.util.function.Supplier<PgxFuture<T>> asyncRequest)
Blocking version ofwithUpdateConsistencyModelAsync(UpdateConsistencyModel, Supplier). CallswithUpdateConsistencyModelAsync(UpdateConsistencyModel, Supplier)and waits for returnedPgxFutureto complete.
-
getUpdateConsistencyModel
public UpdateConsistencyModel getUpdateConsistencyModel()
Blocking version ofgetUpdateConsistencyModelAsync(). CallsgetUpdateConsistencyModelAsync()and waits for returnedPgxFutureto complete.
-
getAnalysisEnvironment
public CpuEnvironment getAnalysisEnvironment()
- Returns:
- the execution environment for analysis tasks
-
getFastAnalysisEnvironment
public CpuEnvironment getFastAnalysisEnvironment()
- Returns:
- the execution environment for fast analysis tasks
-
allowsConcurrentTasksAsync
public PgxFuture<java.lang.Boolean> allowsConcurrentTasksAsync()
Checks if the session allows the tasks to run concurrently.- Returns:
- true if the session allows concurrent tasks, false otherwise
- Since:
- 3.3.0
-
allowsConcurrentTasks
public boolean allowsConcurrentTasks()
Blocking version ofallowsConcurrentTasksAsync(). CallsallowsConcurrentTasksAsync()and waits for returnedPgxFutureto complete.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-