public class ChangeStreamResultSet
extends java.lang.Object
implements java.lang.AutoCloseable
ResultSet
that provides telemetry for the streamed records. It
will be returned for a change stream query. By using this class one can obtain the following
metadata:
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the current change stream
ResultSet . |
com.google.cloud.spanner.Struct |
getCurrentRowAsStruct()
Returns the record at the current pointer as a
Struct . |
ChangeStreamResultSetMetadata |
getMetadata()
Returns the gathered metadata for the change stream query so far.
|
java.lang.String |
getPgJsonb(int index)
Returns the record at the current pointer as
JsonB . |
boolean |
next()
Moves the pointer to the next record in the
ResultSet if there is one. |
public boolean next()
ResultSet
if there is one. It also gathers
metrics for the next record, such as:
public com.google.cloud.spanner.Struct getCurrentRowAsStruct()
Struct
. It also updates the timestamp at
which the record was read.
If next()
was not called or if it was called but there are no
more records in the stream, null will be returned.
Should only be used for GoogleSQL databases.
Struct
or nullpublic java.lang.String getPgJsonb(int index)
JsonB
. It also updates the timestamp at
which the record was read.
If next()
was not called or if it was called but there are no
more records in the stream, null will be returned.
Should only be used for PostgreSQL databases.
Struct
or nullpublic ChangeStreamResultSetMetadata getMetadata()
ChangeStreamResultSetMetadata
contained telemetry information for the query
so farpublic void close()
ResultSet
. The stream will be terminated when this
method is called.
This method must always be called after the consumption of the result set or when an error occurs. This makes sure there are no Session leaks and all the underlying resources are released.
close
in interface java.lang.AutoCloseable