Package oracle.pgx.api.frames
Class PgxFrameBuilder
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.Destroyable
-
- oracle.pgx.api.frames.PgxFrameBuilder
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class PgxFrameBuilder extends Destroyable
A frame builder for constructing aPgxFrame
.
-
-
Constructor Summary
Constructors Constructor Description 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)
Create a PgxFrameBuilder, this will also create a FrameBuilder on the server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PgxFrameBuilder
addRows(java.util.Map<java.lang.String,java.lang.Iterable<?>> rows)
Blocking version ofaddRowsAsync(Map)
.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 builderPgxFrame
build(java.lang.String frameName)
Blocking version ofbuildAsync(String)
.PgxFuture<PgxFrame>
buildAsync(java.lang.String frameName)
Builds a frame with the previously given schema and rowsPgxFuture<java.lang.Void>
destroyAsync()
Requests destruction of this object.-
Methods inherited from class oracle.pgx.api.Destroyable
close, destroy
-
-
-
-
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 sessioncore
- the Core to useschema
- the schema of the frame to buildbuildCallback
- 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 ofaddRowsAsync(Map)
. CallsaddRowsAsync(Map)
and waits for the returnedPgxFuture
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 ofbuildAsync(String)
. CallsbuildAsync(String)
and waits for the returnedPgxFuture
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 classDestroyable
- Returns:
- a future which will be completed once the destruction request finishes.
-
-