Class SqlRowMerger
java.lang.Object
com.google.cloud.bigtable.data.v2.stub.sql.SqlRowMerger
- All Implemented Interfaces:
com.google.cloud.bigtable.gaxx.reframing.Reframer<com.google.cloud.bigtable.data.v2.internal.SqlRow,ExecuteQueryResponse>
@InternalApi
public final class SqlRowMerger
extends Object
implements com.google.cloud.bigtable.gaxx.reframing.Reframer<com.google.cloud.bigtable.data.v2.internal.SqlRow,ExecuteQueryResponse>
Used to transform a stream of ExecuteQueryResponse objects into rows. This class is not thread
safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the merger has consumable databooleanCheck if the merger contains partially complete (or complete) data.com.google.cloud.bigtable.data.v2.internal.SqlRowpop()pops a completed row from the FIFO queue built from the given responses.voidpush(ExecuteQueryResponse response) Used to add responses to the SqlRowMerger as they are received.
-
Constructor Details
-
SqlRowMerger
- Parameters:
metadataSupplier- a supplier ofResultSetMetadata. This is expected to return successfully once the first call to push has been made.This exists to facilitate plan refresh that can happen after creation of the row merger.
-
-
Method Details
-
push
Used to add responses to the SqlRowMerger as they are received.- Specified by:
pushin interfacecom.google.cloud.bigtable.gaxx.reframing.Reframer<com.google.cloud.bigtable.data.v2.internal.SqlRow,ExecuteQueryResponse> - Parameters:
response- the next response in the stream of query responses
-
hasFullFrame
public boolean hasFullFrame()Check if the merger has consumable data- Specified by:
hasFullFramein interfacecom.google.cloud.bigtable.gaxx.reframing.Reframer<com.google.cloud.bigtable.data.v2.internal.SqlRow,ExecuteQueryResponse> - Returns:
- true if there is a complete row, false otherwise.
-
hasPartialFrame
public boolean hasPartialFrame()Check if the merger contains partially complete (or complete) data.- Specified by:
hasPartialFramein interfacecom.google.cloud.bigtable.gaxx.reframing.Reframer<com.google.cloud.bigtable.data.v2.internal.SqlRow,ExecuteQueryResponse> - Returns:
- true if there is a partial (or complete) batch, false otherwise.
-
pop
public com.google.cloud.bigtable.data.v2.internal.SqlRow pop()pops a completed row from the FIFO queue built from the given responses.- Specified by:
popin interfacecom.google.cloud.bigtable.gaxx.reframing.Reframer<com.google.cloud.bigtable.data.v2.internal.SqlRow,ExecuteQueryResponse>
-