Google BigQuery Storage v1 API - Class BigQueryWrite.BigQueryWriteBase (3.14.0)

[BindServiceMethod(typeof(BigQueryWrite), "BindService")]
public abstract class BigQueryWrite.BigQueryWriteBase

Reference documentation and code samples for the Google BigQuery Storage v1 API class BigQueryWrite.BigQueryWriteBase.

Base class for server-side implementations of BigQueryWrite

Inheritance

object > BigQueryWrite.BigQueryWriteBase

Namespace

Google.Cloud.BigQuery.Storage.V1

Assembly

Google.Cloud.BigQuery.Storage.V1.dll

Methods

AppendRows(IAsyncStreamReader<AppendRowsRequest>, IServerStreamWriter<AppendRowsResponse>, ServerCallContext)

public virtual Task AppendRows(IAsyncStreamReader<AppendRowsRequest> requestStream, IServerStreamWriter<AppendRowsResponse> responseStream, ServerCallContext context)

Appends data to the given stream.

If offset is specified, the offset is checked against the end of stream. The server returns OUT_OF_RANGE in AppendRowsResponse if an attempt is made to append to an offset beyond the current end of the stream or ALREADY_EXISTS if user provides an offset that has already been written to. User can retry with adjusted offset within the same RPC connection. If offset is not specified, append happens at the end of the stream.

The response contains an optional offset at which the append happened. No offset information will be returned for appends to a default stream.

Responses are received in the same order in which requests are sent. There will be one response for each successful inserted request. Responses may optionally embed error information if the originating AppendRequest was not successfully processed.

The specifics of when successfully appended data is made visible to the table are governed by the type of stream:

  • For COMMITTED streams (which includes the default stream), data is visible immediately upon successful append.

  • For BUFFERED streams, data is made visible via a subsequent FlushRows rpc which advances a cursor to a newer offset in the stream.

  • For PENDING streams, data is not made visible until the stream itself is finalized (via the FinalizeWriteStream rpc), and the stream is explicitly committed via the BatchCommitWriteStreams rpc.

Parameters
NameDescription
requestStreamIAsyncStreamReaderAppendRowsRequest

Used for reading requests from the client.

responseStreamIServerStreamWriterAppendRowsResponse

Used for sending responses back to the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task

A task indicating completion of the handler.

BatchCommitWriteStreams(BatchCommitWriteStreamsRequest, ServerCallContext)

public virtual Task<BatchCommitWriteStreamsResponse> BatchCommitWriteStreams(BatchCommitWriteStreamsRequest request, ServerCallContext context)

Atomically commits a group of PENDING streams that belong to the same parent table.

Streams must be finalized before commit and cannot be committed multiple times. Once a stream is committed, data in the stream becomes available for read operations.

Parameters
NameDescription
requestBatchCommitWriteStreamsRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskBatchCommitWriteStreamsResponse

The response to send back to the client (wrapped by a task).

CreateWriteStream(CreateWriteStreamRequest, ServerCallContext)

public virtual Task<WriteStream> CreateWriteStream(CreateWriteStreamRequest request, ServerCallContext context)

Creates a write stream to the given table. Additionally, every table has a special stream named '_default' to which data can be written. This stream doesn't need to be created using CreateWriteStream. It is a stream that can be used simultaneously by any number of clients. Data written to this stream is considered committed as soon as an acknowledgement is received.

Parameters
NameDescription
requestCreateWriteStreamRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskWriteStream

The response to send back to the client (wrapped by a task).

FinalizeWriteStream(FinalizeWriteStreamRequest, ServerCallContext)

public virtual Task<FinalizeWriteStreamResponse> FinalizeWriteStream(FinalizeWriteStreamRequest request, ServerCallContext context)

Finalize a write stream so that no new data can be appended to the stream. Finalize is not supported on the '_default' stream.

Parameters
NameDescription
requestFinalizeWriteStreamRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskFinalizeWriteStreamResponse

The response to send back to the client (wrapped by a task).

FlushRows(FlushRowsRequest, ServerCallContext)

public virtual Task<FlushRowsResponse> FlushRows(FlushRowsRequest request, ServerCallContext context)

Flushes rows to a BUFFERED stream.

If users are appending rows to BUFFERED stream, flush operation is required in order for the rows to become available for reading. A Flush operation flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in the request.

Flush is not supported on the _default stream, since it is not BUFFERED.

Parameters
NameDescription
requestFlushRowsRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskFlushRowsResponse

The response to send back to the client (wrapped by a task).

GetWriteStream(GetWriteStreamRequest, ServerCallContext)

public virtual Task<WriteStream> GetWriteStream(GetWriteStreamRequest request, ServerCallContext context)

Gets information about a write stream.

Parameters
NameDescription
requestGetWriteStreamRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskWriteStream

The response to send back to the client (wrapped by a task).