Google Cloud BigQuery C++ Client 2.11.0
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
bigquery_write_client.h
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Generated by the Codegen C++ plugin.
16// If you make any local changes, they will be lost.
17// source: google/cloud/bigquery/storage/v1/storage.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_WRITE_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_WRITE_CLIENT_H
21
22#include "google/cloud/bigquery/storage/v1/bigquery_write_connection.h"
23#include "google/cloud/future.h"
24#include "google/cloud/options.h"
25#include "google/cloud/polling_policy.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/version.h"
28#include <map>
29#include <memory>
30
31namespace google {
32namespace cloud {
33namespace bigquery_storage_v1 {
34GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
35
36///
37/// BigQuery Write API.
38///
39/// The Write API can be used to write data to BigQuery.
40///
41/// For supplementary information about the Write API, see:
42/// https://cloud.google.com/bigquery/docs/write-api
43///
44/// @par Equality
45///
46/// Instances of this class created via copy-construction or copy-assignment
47/// always compare equal. Instances created with equal
48/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
49/// equal share the same underlying resources.
50///
51/// @par Performance
52///
53/// Creating a new instance of this class is a relatively expensive operation,
54/// new objects establish new connections to the service. In contrast,
55/// copy-construction, move-construction, and the corresponding assignment
56/// operations are relatively efficient as the copies share all underlying
57/// resources.
58///
59/// @par Thread Safety
60///
61/// Concurrent access to different instances of this class, even if they compare
62/// equal, is guaranteed to work. Two or more threads operating on the same
63/// instance of this class is not guaranteed to work. Since copy-construction
64/// and move-construction is a relatively efficient operation, consider using
65/// such a copy when using this class from multiple threads.
66///
68 public:
69 explicit BigQueryWriteClient(
70 std::shared_ptr<BigQueryWriteConnection> connection, Options opts = {});
72
73 ///@{
74 /// @name Copy and move support
79 ///@}
80
81 ///@{
82 /// @name Equality
83 friend bool operator==(BigQueryWriteClient const& a,
84 BigQueryWriteClient const& b) {
85 return a.connection_ == b.connection_;
86 }
87 friend bool operator!=(BigQueryWriteClient const& a,
88 BigQueryWriteClient const& b) {
89 return !(a == b);
90 }
91 ///@}
92
93 // clang-format off
94 ///
95 /// Creates a write stream to the given table.
96 /// Additionally, every table has a special stream named '_default'
97 /// to which data can be written. This stream doesn't need to be created using
98 /// CreateWriteStream. It is a stream that can be used simultaneously by any
99 /// number of clients. Data written to this stream is considered committed as
100 /// soon as an acknowledgement is received.
101 ///
102 /// @param parent Required. Reference to the table to which the stream belongs, in the format
103 /// of `projects/{project}/datasets/{dataset}/tables/{table}`.
104 /// @param write_stream Required. Stream to be created.
105 /// @param opts Optional. Override the class-level options, such as retry and
106 /// backoff policies.
107 /// @return the result of the RPC. The response message type
108 /// ([google.cloud.bigquery.storage.v1.WriteStream])
109 /// is mapped to a C++ class using the [Protobuf mapping rules].
110 /// If the request fails, the [`StatusOr`] contains the error details.
111 ///
112 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
113 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
114 /// [Long Running Operation]: https://google.aip.dev/151
115 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
116 /// [`future`]: @ref google::cloud::future
117 /// [`StatusOr`]: @ref google::cloud::StatusOr
118 /// [`Status`]: @ref google::cloud::Status
119 /// [google.cloud.bigquery.storage.v1.CreateWriteStreamRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L386}
120 /// [google.cloud.bigquery.storage.v1.WriteStream]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/stream.proto#L243}
121 ///
122 // clang-format on
123 StatusOr<google::cloud::bigquery::storage::v1::WriteStream> CreateWriteStream(
124 std::string const& parent,
125 google::cloud::bigquery::storage::v1::WriteStream const& write_stream,
126 Options opts = {});
127
128 // clang-format off
129 ///
130 /// Creates a write stream to the given table.
131 /// Additionally, every table has a special stream named '_default'
132 /// to which data can be written. This stream doesn't need to be created using
133 /// CreateWriteStream. It is a stream that can be used simultaneously by any
134 /// number of clients. Data written to this stream is considered committed as
135 /// soon as an acknowledgement is received.
136 ///
137 /// @param request Unary RPCs, such as the one wrapped by this
138 /// function, receive a single `request` proto message which includes all
139 /// the inputs for the RPC. In this case, the proto message is a
140 /// [google.cloud.bigquery.storage.v1.CreateWriteStreamRequest].
141 /// Proto messages are converted to C++ classes by Protobuf, using the
142 /// [Protobuf mapping rules].
143 /// @param opts Optional. Override the class-level options, such as retry and
144 /// backoff policies.
145 /// @return the result of the RPC. The response message type
146 /// ([google.cloud.bigquery.storage.v1.WriteStream])
147 /// is mapped to a C++ class using the [Protobuf mapping rules].
148 /// If the request fails, the [`StatusOr`] contains the error details.
149 ///
150 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
151 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
152 /// [Long Running Operation]: https://google.aip.dev/151
153 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
154 /// [`future`]: @ref google::cloud::future
155 /// [`StatusOr`]: @ref google::cloud::StatusOr
156 /// [`Status`]: @ref google::cloud::Status
157 /// [google.cloud.bigquery.storage.v1.CreateWriteStreamRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L386}
158 /// [google.cloud.bigquery.storage.v1.WriteStream]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/stream.proto#L243}
159 ///
160 // clang-format on
161 StatusOr<google::cloud::bigquery::storage::v1::WriteStream> CreateWriteStream(
162 google::cloud::bigquery::storage::v1::CreateWriteStreamRequest const&
163 request,
164 Options opts = {});
165
166 // clang-format off
167 ///
168 /// Appends data to the given stream.
169 ///
170 /// If `offset` is specified, the `offset` is checked against the end of
171 /// stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an
172 /// attempt is made to append to an offset beyond the current end of the stream
173 /// or `ALREADY_EXISTS` if user provides an `offset` that has already been
174 /// written to. User can retry with adjusted offset within the same RPC
175 /// connection. If `offset` is not specified, append happens at the end of the
176 /// stream.
177 ///
178 /// The response contains an optional offset at which the append
179 /// happened. No offset information will be returned for appends to a
180 /// default stream.
181 ///
182 /// Responses are received in the same order in which requests are sent.
183 /// There will be one response for each successful inserted request. Responses
184 /// may optionally embed error information if the originating AppendRequest was
185 /// not successfully processed.
186 ///
187 /// The specifics of when successfully appended data is made visible to the
188 /// table are governed by the type of stream:
189 ///
190 /// * For COMMITTED streams (which includes the default stream), data is
191 /// visible immediately upon successful append.
192 ///
193 /// * For BUFFERED streams, data is made visible via a subsequent `FlushRows`
194 /// rpc which advances a cursor to a newer offset in the stream.
195 ///
196 /// * For PENDING streams, data is not made visible until the stream itself is
197 /// finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly
198 /// committed via the `BatchCommitWriteStreams` rpc.
199 ///
200 /// @param opts Optional. Override the class-level options, such as retry and
201 /// backoff policies.
202 /// @return An object representing the bidirectional streaming
203 /// RPC. Applications can send multiple request messages and receive
204 /// multiple response messages through this API. Bidirectional streaming
205 /// RPCs can impose restrictions on the sequence of request and response
206 /// messages. Please consult the service documentation for details.
207 /// The request message type ([google.cloud.bigquery.storage.v1.AppendRowsRequest]) and response messages
208 /// ([google.cloud.bigquery.storage.v1.AppendRowsResponse]) are mapped to C++ classes using the
209 /// [Protobuf mapping rules].
210 ///
211 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
212 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
213 /// [Long Running Operation]: https://google.aip.dev/151
214 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
215 /// [`future`]: @ref google::cloud::future
216 /// [`StatusOr`]: @ref google::cloud::StatusOr
217 /// [`Status`]: @ref google::cloud::Status
218 /// [google.cloud.bigquery.storage.v1.AppendRowsRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L406}
219 /// [google.cloud.bigquery.storage.v1.AppendRowsResponse]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L499}
220 ///
221 // clang-format on
222 std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc<
223 google::cloud::bigquery::storage::v1::AppendRowsRequest,
224 google::cloud::bigquery::storage::v1::AppendRowsResponse>>
226
227 // clang-format off
228 ///
229 /// Gets information about a write stream.
230 ///
231 /// @param name Required. Name of the stream to get, in the form of
232 /// `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`.
233 /// @param opts Optional. Override the class-level options, such as retry and
234 /// backoff policies.
235 /// @return the result of the RPC. The response message type
236 /// ([google.cloud.bigquery.storage.v1.WriteStream])
237 /// is mapped to a C++ class using the [Protobuf mapping rules].
238 /// If the request fails, the [`StatusOr`] contains the error details.
239 ///
240 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
241 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
242 /// [Long Running Operation]: https://google.aip.dev/151
243 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
244 /// [`future`]: @ref google::cloud::future
245 /// [`StatusOr`]: @ref google::cloud::StatusOr
246 /// [`Status`]: @ref google::cloud::Status
247 /// [google.cloud.bigquery.storage.v1.GetWriteStreamRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L550}
248 /// [google.cloud.bigquery.storage.v1.WriteStream]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/stream.proto#L243}
249 ///
250 // clang-format on
251 StatusOr<google::cloud::bigquery::storage::v1::WriteStream> GetWriteStream(
252 std::string const& name, Options opts = {});
253
254 // clang-format off
255 ///
256 /// Gets information about a write stream.
257 ///
258 /// @param request Unary RPCs, such as the one wrapped by this
259 /// function, receive a single `request` proto message which includes all
260 /// the inputs for the RPC. In this case, the proto message is a
261 /// [google.cloud.bigquery.storage.v1.GetWriteStreamRequest].
262 /// Proto messages are converted to C++ classes by Protobuf, using the
263 /// [Protobuf mapping rules].
264 /// @param opts Optional. Override the class-level options, such as retry and
265 /// backoff policies.
266 /// @return the result of the RPC. The response message type
267 /// ([google.cloud.bigquery.storage.v1.WriteStream])
268 /// is mapped to a C++ class using the [Protobuf mapping rules].
269 /// If the request fails, the [`StatusOr`] contains the error details.
270 ///
271 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
272 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
273 /// [Long Running Operation]: https://google.aip.dev/151
274 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
275 /// [`future`]: @ref google::cloud::future
276 /// [`StatusOr`]: @ref google::cloud::StatusOr
277 /// [`Status`]: @ref google::cloud::Status
278 /// [google.cloud.bigquery.storage.v1.GetWriteStreamRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L550}
279 /// [google.cloud.bigquery.storage.v1.WriteStream]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/stream.proto#L243}
280 ///
281 // clang-format on
282 StatusOr<google::cloud::bigquery::storage::v1::WriteStream> GetWriteStream(
283 google::cloud::bigquery::storage::v1::GetWriteStreamRequest const&
284 request,
285 Options opts = {});
286
287 // clang-format off
288 ///
289 /// Finalize a write stream so that no new data can be appended to the
290 /// stream. Finalize is not supported on the '_default' stream.
291 ///
292 /// @param name Required. Name of the stream to finalize, in the form of
293 /// `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`.
294 /// @param opts Optional. Override the class-level options, such as retry and
295 /// backoff policies.
296 /// @return the result of the RPC. The response message type
297 /// ([google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse])
298 /// is mapped to a C++ class using the [Protobuf mapping rules].
299 /// If the request fails, the [`StatusOr`] contains the error details.
300 ///
301 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
302 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
303 /// [Long Running Operation]: https://google.aip.dev/151
304 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
305 /// [`future`]: @ref google::cloud::future
306 /// [`StatusOr`]: @ref google::cloud::StatusOr
307 /// [`Status`]: @ref google::cloud::Status
308 /// [google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L594}
309 /// [google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L606}
310 ///
311 // clang-format on
312 StatusOr<google::cloud::bigquery::storage::v1::FinalizeWriteStreamResponse>
313 FinalizeWriteStream(std::string const& name, Options opts = {});
314
315 // clang-format off
316 ///
317 /// Finalize a write stream so that no new data can be appended to the
318 /// stream. Finalize is not supported on the '_default' stream.
319 ///
320 /// @param request Unary RPCs, such as the one wrapped by this
321 /// function, receive a single `request` proto message which includes all
322 /// the inputs for the RPC. In this case, the proto message is a
323 /// [google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest].
324 /// Proto messages are converted to C++ classes by Protobuf, using the
325 /// [Protobuf mapping rules].
326 /// @param opts Optional. Override the class-level options, such as retry and
327 /// backoff policies.
328 /// @return the result of the RPC. The response message type
329 /// ([google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse])
330 /// is mapped to a C++ class using the [Protobuf mapping rules].
331 /// If the request fails, the [`StatusOr`] contains the error details.
332 ///
333 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
334 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
335 /// [Long Running Operation]: https://google.aip.dev/151
336 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
337 /// [`future`]: @ref google::cloud::future
338 /// [`StatusOr`]: @ref google::cloud::StatusOr
339 /// [`Status`]: @ref google::cloud::Status
340 /// [google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L594}
341 /// [google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L606}
342 ///
343 // clang-format on
344 StatusOr<google::cloud::bigquery::storage::v1::FinalizeWriteStreamResponse>
346 google::cloud::bigquery::storage::v1::FinalizeWriteStreamRequest const&
347 request,
348 Options opts = {});
349
350 // clang-format off
351 ///
352 /// Atomically commits a group of `PENDING` streams that belong to the same
353 /// `parent` table.
354 ///
355 /// Streams must be finalized before commit and cannot be committed multiple
356 /// times. Once a stream is committed, data in the stream becomes available
357 /// for read operations.
358 ///
359 /// @param parent Required. Parent table that all the streams should belong to, in the form
360 /// of `projects/{project}/datasets/{dataset}/tables/{table}`.
361 /// @param opts Optional. Override the class-level options, such as retry and
362 /// backoff policies.
363 /// @return the result of the RPC. The response message type
364 /// ([google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse])
365 /// is mapped to a C++ class using the [Protobuf mapping rules].
366 /// If the request fails, the [`StatusOr`] contains the error details.
367 ///
368 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
369 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
370 /// [Long Running Operation]: https://google.aip.dev/151
371 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
372 /// [`future`]: @ref google::cloud::future
373 /// [`StatusOr`]: @ref google::cloud::StatusOr
374 /// [`Status`]: @ref google::cloud::Status
375 /// [google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L566}
376 /// [google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L579}
377 ///
378 // clang-format on
379 StatusOr<
380 google::cloud::bigquery::storage::v1::BatchCommitWriteStreamsResponse>
381 BatchCommitWriteStreams(std::string const& parent, Options opts = {});
382
383 // clang-format off
384 ///
385 /// Atomically commits a group of `PENDING` streams that belong to the same
386 /// `parent` table.
387 ///
388 /// Streams must be finalized before commit and cannot be committed multiple
389 /// times. Once a stream is committed, data in the stream becomes available
390 /// for read operations.
391 ///
392 /// @param request Unary RPCs, such as the one wrapped by this
393 /// function, receive a single `request` proto message which includes all
394 /// the inputs for the RPC. In this case, the proto message is a
395 /// [google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest].
396 /// Proto messages are converted to C++ classes by Protobuf, using the
397 /// [Protobuf mapping rules].
398 /// @param opts Optional. Override the class-level options, such as retry and
399 /// backoff policies.
400 /// @return the result of the RPC. The response message type
401 /// ([google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse])
402 /// is mapped to a C++ class using the [Protobuf mapping rules].
403 /// If the request fails, the [`StatusOr`] contains the error details.
404 ///
405 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
406 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
407 /// [Long Running Operation]: https://google.aip.dev/151
408 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
409 /// [`future`]: @ref google::cloud::future
410 /// [`StatusOr`]: @ref google::cloud::StatusOr
411 /// [`Status`]: @ref google::cloud::Status
412 /// [google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L566}
413 /// [google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L579}
414 ///
415 // clang-format on
416 StatusOr<
417 google::cloud::bigquery::storage::v1::BatchCommitWriteStreamsResponse>
419 BatchCommitWriteStreamsRequest const& request,
420 Options opts = {});
421
422 // clang-format off
423 ///
424 /// Flushes rows to a BUFFERED stream.
425 ///
426 /// If users are appending rows to BUFFERED stream, flush operation is
427 /// required in order for the rows to become available for reading. A
428 /// Flush operation flushes up to any previously flushed offset in a BUFFERED
429 /// stream, to the offset specified in the request.
430 ///
431 /// Flush is not supported on the _default stream, since it is not BUFFERED.
432 ///
433 /// @param write_stream Required. The stream that is the target of the flush operation.
434 /// @param opts Optional. Override the class-level options, such as retry and
435 /// backoff policies.
436 /// @return the result of the RPC. The response message type
437 /// ([google.cloud.bigquery.storage.v1.FlushRowsResponse])
438 /// is mapped to a C++ class using the [Protobuf mapping rules].
439 /// If the request fails, the [`StatusOr`] contains the error details.
440 ///
441 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
442 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
443 /// [Long Running Operation]: https://google.aip.dev/151
444 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
445 /// [`future`]: @ref google::cloud::future
446 /// [`StatusOr`]: @ref google::cloud::StatusOr
447 /// [`Status`]: @ref google::cloud::Status
448 /// [google.cloud.bigquery.storage.v1.FlushRowsRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L612}
449 /// [google.cloud.bigquery.storage.v1.FlushRowsResponse]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L627}
450 ///
451 // clang-format on
452 StatusOr<google::cloud::bigquery::storage::v1::FlushRowsResponse> FlushRows(
453 std::string const& write_stream, Options opts = {});
454
455 // clang-format off
456 ///
457 /// Flushes rows to a BUFFERED stream.
458 ///
459 /// If users are appending rows to BUFFERED stream, flush operation is
460 /// required in order for the rows to become available for reading. A
461 /// Flush operation flushes up to any previously flushed offset in a BUFFERED
462 /// stream, to the offset specified in the request.
463 ///
464 /// Flush is not supported on the _default stream, since it is not BUFFERED.
465 ///
466 /// @param request Unary RPCs, such as the one wrapped by this
467 /// function, receive a single `request` proto message which includes all
468 /// the inputs for the RPC. In this case, the proto message is a
469 /// [google.cloud.bigquery.storage.v1.FlushRowsRequest].
470 /// Proto messages are converted to C++ classes by Protobuf, using the
471 /// [Protobuf mapping rules].
472 /// @param opts Optional. Override the class-level options, such as retry and
473 /// backoff policies.
474 /// @return the result of the RPC. The response message type
475 /// ([google.cloud.bigquery.storage.v1.FlushRowsResponse])
476 /// is mapped to a C++ class using the [Protobuf mapping rules].
477 /// If the request fails, the [`StatusOr`] contains the error details.
478 ///
479 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
480 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
481 /// [Long Running Operation]: https://google.aip.dev/151
482 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
483 /// [`future`]: @ref google::cloud::future
484 /// [`StatusOr`]: @ref google::cloud::StatusOr
485 /// [`Status`]: @ref google::cloud::Status
486 /// [google.cloud.bigquery.storage.v1.FlushRowsRequest]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L612}
487 /// [google.cloud.bigquery.storage.v1.FlushRowsResponse]: @googleapis_reference_link{google/cloud/bigquery/storage/v1/storage.proto#L627}
488 ///
489 // clang-format on
490 StatusOr<google::cloud::bigquery::storage::v1::FlushRowsResponse> FlushRows(
491 google::cloud::bigquery::storage::v1::FlushRowsRequest const& request,
492 Options opts = {});
493
494 private:
495 std::shared_ptr<BigQueryWriteConnection> connection_;
496 Options options_;
497};
498
499GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
500} // namespace bigquery_storage_v1
501} // namespace cloud
502} // namespace google
503
504#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_WRITE_CLIENT_H
BigQuery Write API.
Definition: bigquery_write_client.h:67
StatusOr< google::cloud::bigquery::storage::v1::WriteStream > CreateWriteStream(google::cloud::bigquery::storage::v1::CreateWriteStreamRequest const &request, Options opts={})
Creates a write stream to the given table.
BigQueryWriteClient(BigQueryWriteClient const &)=default
BigQueryWriteClient(BigQueryWriteClient &&)=default
StatusOr< google::cloud::bigquery::storage::v1::FinalizeWriteStreamResponse > FinalizeWriteStream(google::cloud::bigquery::storage::v1::FinalizeWriteStreamRequest const &request, Options opts={})
Finalize a write stream so that no new data can be appended to the stream.
StatusOr< google::cloud::bigquery::storage::v1::BatchCommitWriteStreamsResponse > BatchCommitWriteStreams(std::string const &parent, Options opts={})
Atomically commits a group of PENDING streams that belong to the same parent table.
StatusOr< google::cloud::bigquery::storage::v1::FlushRowsResponse > FlushRows(std::string const &write_stream, Options opts={})
Flushes rows to a BUFFERED stream.
friend bool operator==(BigQueryWriteClient const &a, BigQueryWriteClient const &b)
Definition: bigquery_write_client.h:83
friend bool operator!=(BigQueryWriteClient const &a, BigQueryWriteClient const &b)
Definition: bigquery_write_client.h:87
StatusOr< google::cloud::bigquery::storage::v1::BatchCommitWriteStreamsResponse > BatchCommitWriteStreams(google::cloud::bigquery::storage::v1::BatchCommitWriteStreamsRequest const &request, Options opts={})
Atomically commits a group of PENDING streams that belong to the same parent table.
StatusOr< google::cloud::bigquery::storage::v1::FlushRowsResponse > FlushRows(google::cloud::bigquery::storage::v1::FlushRowsRequest const &request, Options opts={})
Flushes rows to a BUFFERED stream.
BigQueryWriteClient(std::shared_ptr< BigQueryWriteConnection > connection, Options opts={})
StatusOr< google::cloud::bigquery::storage::v1::WriteStream > CreateWriteStream(std::string const &parent, google::cloud::bigquery::storage::v1::WriteStream const &write_stream, Options opts={})
Creates a write stream to the given table.
StatusOr< google::cloud::bigquery::storage::v1::FinalizeWriteStreamResponse > FinalizeWriteStream(std::string const &name, Options opts={})
Finalize a write stream so that no new data can be appended to the stream.
std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::cloud::bigquery::storage::v1::AppendRowsRequest, google::cloud::bigquery::storage::v1::AppendRowsResponse > > AsyncAppendRows(Options opts={})
Appends data to the given stream.
StatusOr< google::cloud::bigquery::storage::v1::WriteStream > GetWriteStream(std::string const &name, Options opts={})
Gets information about a write stream.
BigQueryWriteClient & operator=(BigQueryWriteClient const &)=default
StatusOr< google::cloud::bigquery::storage::v1::WriteStream > GetWriteStream(google::cloud::bigquery::storage::v1::GetWriteStreamRequest const &request, Options opts={})
Gets information about a write stream.
BigQueryWriteClient & operator=(BigQueryWriteClient &&)=default
The BigQueryWriteConnection object for BigQueryWriteClient.
Definition: bigquery_write_connection.h:61
Definition: bigquery_read_client.h:32
Definition: analytics_hub_client.h:30