Class PgxFrameBuilder

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class PgxFrameBuilder
    extends Destroyable
    A frame builder for constructing a PgxFrame.
    • Constructor Detail

      • PgxFrameBuilder

        public PgxFrameBuilder​(SessionContext sessionContext,
                               oracle.pgx.api.internal.Core core,
                               java.util.List<ColumnDescriptor> schema,
                               java.util.function.Function<oracle.pgx.api.internal.FrameMetaData,​PgxFrame> buildCallback)
                        throws java.util.concurrent.ExecutionException,
                               java.lang.InterruptedException
        Create a PgxFrameBuilder, this will also create a FrameBuilder on the server.
        Parameters:
        sessionContext - the context of the current session
        core - the Core to use
        schema - the schema of the frame to build
        buildCallback - a function to process the FrameMetaData into a PgxFrame
        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.
        Since:
        21.3
    • Method Detail

      • addRows

        public PgxFrameBuilder addRows​(java.util.Map<java.lang.String,​java.lang.Iterable<?>> rows)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of addRowsAsync(Map). Calls addRowsAsync(Map) and waits for the returned PgxFuture to complete.
        Parameters:
        rows - the input rows
        Returns:
        this builder
        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.
        Since:
        21.3
      • addRowsAsync

        public PgxFuture<PgxFrameBuilder> addRowsAsync​(java.util.Map<java.lang.String,​java.lang.Iterable<?>> rows)
        Validates the news rows with the previously specified schema and adds them to the current frame builder
        Parameters:
        rows - the input rows
        Returns:
        this builder
        Since:
        21.3
      • build

        public PgxFrame build​(java.lang.String frameName)
                       throws java.util.concurrent.ExecutionException,
                              java.lang.InterruptedException
        Blocking version of buildAsync(String). Calls buildAsync(String) and waits for the returned PgxFuture to complete.
        Parameters:
        frameName - name of the frame
        Returns:
        the newly created frame
        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.
        Since:
        21.3
      • buildAsync

        public PgxFuture<PgxFrame> buildAsync​(java.lang.String frameName)
        Builds a frame with the previously given schema and rows
        Parameters:
        frameName - name of the frame
        Returns:
        the newly created frame
        Since:
        21.3
      • destroyAsync

        public PgxFuture<java.lang.Void> destroyAsync()
        Description copied from class: Destroyable
        Requests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.
        Specified by:
        destroyAsync in class Destroyable
        Returns:
        a future which will be completed once the destruction request finishes.