Class AppendRowsStream (2.21.0)

AppendRowsStream(
    client: google.cloud.bigquery_storage_v1beta2.services.big_query_write.client.BigQueryWriteClient,
    initial_request_template: google.cloud.bigquery_storage_v1beta2.types.storage.AppendRowsRequest,
    metadata: typing.Sequence[typing.Tuple[str, str]] = (),
)

A manager object which can append rows to a stream.

Properties

is_active

bool: True if this manager is actively streaming.

Note that False does not indicate this is complete shut down, just that it stopped getting new messages.

Methods

AppendRowsStream

AppendRowsStream(
    client: google.cloud.bigquery_storage_v1beta2.services.big_query_write.client.BigQueryWriteClient,
    initial_request_template: google.cloud.bigquery_storage_v1beta2.types.storage.AppendRowsRequest,
    metadata: typing.Sequence[typing.Tuple[str, str]] = (),
)

Construct a stream manager.

add_close_callback

add_close_callback(callback: typing.Callable)

Schedules a callable when the manager closes.

Parameter
NameDescription
callback Callable

The method to call.

close

close(reason: typing.Optional[Exception] = None)

Stop consuming messages and shutdown all helper threads.

This method is idempotent. Additional calls will have no effect.

send

send(
    request: google.cloud.bigquery_storage_v1beta2.types.storage.AppendRowsRequest,
) -> google.cloud.bigquery_storage_v1beta2.writer.AppendRowsFuture

Send an append rows request to the open stream.