Class IoEnvironment
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.executionenvironment.IoEnvironment
-
public final class IoEnvironment extends oracle.pgx.api.internal.ApiObject
A sub environment for IO tasks
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumThreadsPerTask()
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()
void
reset()
Blocking version ofresetAsync()
.PgxFuture<java.lang.Void>
resetAsync()
reset the sub environment to the configured default valuesvoid
setNumThreadsPerTask(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.String
toString()
<T> T
withNumThreadsPerTask(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.InterruptedException
Blocking version ofgetNumThreadsPerTaskAsync()
. CallsgetNumThreadsPerTaskAsync()
and waits for returnedPgxFuture
to 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.InterruptedException
Blocking version ofsetNumThreadsPerTaskAsync(Integer)
. CallssetNumThreadsPerTaskAsync(Integer)
and waits for returnedPgxFuture
to 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.InterruptedException
Blocking version ofwithNumThreadsPerTaskAsync(int, Supplier)
. CallswithNumThreadsPerTaskAsync(int, Supplier)
and waits for returnedPgxFuture
to 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.InterruptedException
Blocking version ofgetValuesAsync()
. CallsgetValuesAsync()
and waits for returnedPgxFuture
to 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:
toString
in classjava.lang.Object
-
-