Class IoEnvironment
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.executionenvironment.IoEnvironment
-
public final class IoEnvironment extends oracle.pgx.api.internal.ApiObjectA sub environment for IO tasks
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetNumThreadsPerTask()Blocking version ofgetNumThreadsPerTaskAsync().PgxFuture<java.lang.Integer>getNumThreadsPerTaskAsync()java.util.Map<java.lang.String,java.lang.Object>getValues()Blocking version ofgetValuesAsync().PgxFuture<java.util.Map<java.lang.String,java.lang.Object>>getValuesAsync()voidreset()Blocking version ofresetAsync().PgxFuture<java.lang.Void>resetAsync()reset the sub environment to the configured default valuesvoidsetNumThreadsPerTask(java.lang.Integer numThreadsPerTask)Blocking version ofsetNumThreadsPerTaskAsync(Integer).PgxFuture<java.lang.Void>setNumThreadsPerTaskAsync(java.lang.Integer numThreadsPerTask)Sets the current value for the number of threads used for IO tasksjava.lang.StringtoString()<T> TwithNumThreadsPerTask(int numThreads, java.util.function.Supplier<PgxFuture<T>> asyncSupplier)Blocking version ofwithNumThreadsPerTaskAsync(int, Supplier).<T> PgxFuture<T>withNumThreadsPerTaskAsync(int numThreads, java.util.function.Supplier<PgxFuture<T>> asyncRequest)Executes the given asynchronous request with the number of threads used for IO tasks
-
-
-
Method Detail
-
getNumThreadsPerTaskAsync
public PgxFuture<java.lang.Integer> getNumThreadsPerTaskAsync()
- Returns:
- the current value for the number of thread used for IO tasks
- See Also:
EnterpriseSchedulerConfig.Field.NUM_IO_THREADS_PER_TASK
-
setNumThreadsPerTaskAsync
public PgxFuture<java.lang.Void> setNumThreadsPerTaskAsync(java.lang.Integer numThreadsPerTask)
Sets the current value for the number of threads used for IO tasks- Parameters:
numThreadsPerTask- the number of threads to use for IO tasks- See Also:
EnterpriseSchedulerConfig.Field.NUM_IO_THREADS_PER_TASK
-
withNumThreadsPerTaskAsync
public <T> PgxFuture<T> withNumThreadsPerTaskAsync(int numThreads, java.util.function.Supplier<PgxFuture<T>> asyncRequest)
Executes the given asynchronous request with the number of threads used for IO tasks- Parameters:
numThreads- the temporary number of threads for IO tasksasyncRequest- an asynchronous request- Returns:
- the result of the asynchronous request
-
getNumThreadsPerTask
public int getNumThreadsPerTask() throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofgetNumThreadsPerTaskAsync(). CallsgetNumThreadsPerTaskAsync()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.
-
setNumThreadsPerTask
public void setNumThreadsPerTask(java.lang.Integer numThreadsPerTask) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofsetNumThreadsPerTaskAsync(Integer). CallssetNumThreadsPerTaskAsync(Integer)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.
-
withNumThreadsPerTask
public <T> T withNumThreadsPerTask(int numThreads, java.util.function.Supplier<PgxFuture<T>> asyncSupplier) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofwithNumThreadsPerTaskAsync(int, Supplier). CallswithNumThreadsPerTaskAsync(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.
-
getValuesAsync
public final PgxFuture<java.util.Map<java.lang.String,java.lang.Object>> getValuesAsync()
- Returns:
- the current configuration of the sub environment
-
resetAsync
public final PgxFuture<java.lang.Void> resetAsync()
reset the sub environment to the configured default values
-
reset
public final 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.
-
getValues
public final java.util.Map<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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-