Class IoEnvironment


  • public final class IoEnvironment
    extends oracle.pgx.api.internal.ApiObject
    A sub environment for IO tasks
    • Method Detail

      • 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 tasks
        asyncRequest - an asynchronous request
        Returns:
        the result of the asynchronous request
      • getNumThreadsPerTask

        public int getNumThreadsPerTask()
                                 throws java.util.concurrent.ExecutionException,
                                        java.lang.InterruptedException
        Blocking version of getNumThreadsPerTaskAsync(). Calls getNumThreadsPerTaskAsync() and waits for returned PgxFuture 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 of setNumThreadsPerTaskAsync(Integer). Calls setNumThreadsPerTaskAsync(Integer) and waits for returned PgxFuture 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 of withNumThreadsPerTaskAsync(int, Supplier). Calls withNumThreadsPerTaskAsync(int, Supplier) and waits for returned PgxFuture 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
        Blocking version of resetAsync(). Calls resetAsync() and waits for returned PgxFuture 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.
      • getValues

        public final java.util.Map<java.lang.String,​java.lang.Object> getValues()
                                                                               throws java.util.concurrent.ExecutionException,
                                                                                      java.lang.InterruptedException
        Blocking version of getValuesAsync(). Calls getValuesAsync() and waits for returned PgxFuture 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 class java.lang.Object