Google Cloud BigQuery C++ Client  2.1.0
A C++ Client Library for Google Cloud BigQuery
bigquery_read_connection.h
Go to the documentation of this file.
1 // Copyright 2021 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_BIGQUERY_READ_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_H
21 
22 #include "google/cloud/bigquery/bigquery_read_connection_idempotency_policy.h"
23 #include "google/cloud/bigquery/internal/bigquery_read_retry_traits.h"
24 #include "google/cloud/bigquery/internal/bigquery_read_stub.h"
25 #include "google/cloud/backoff_policy.h"
26 #include "google/cloud/options.h"
27 #include "google/cloud/status_or.h"
28 #include "google/cloud/stream_range.h"
29 #include "google/cloud/version.h"
30 #include <memory>
31 
32 namespace google {
33 namespace cloud {
34 namespace bigquery {
36 
37 using BigQueryReadRetryPolicy =
38  ::google::cloud::internal::TraitBasedRetryPolicy<
39  bigquery_internal::BigQueryReadRetryTraits>;
40 
41 using BigQueryReadLimitedTimeRetryPolicy =
42  ::google::cloud::internal::LimitedTimeRetryPolicy<
43  bigquery_internal::BigQueryReadRetryTraits>;
44 
45 using BigQueryReadLimitedErrorCountRetryPolicy =
46  ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47  bigquery_internal::BigQueryReadRetryTraits>;
48 
49 GOOGLE_CLOUD_CPP_DEPRECATED(
50  "applications should not need this."
51  " Please file a bug at https://github.com/googleapis/google-cloud-cpp"
52  " if you do.")
54  google::cloud::bigquery::storage::v1::ReadRowsResponse const& response,
55  google::cloud::bigquery::storage::v1::ReadRowsRequest& request);
56 
57 /**
58  * The `BigQueryReadConnection` object for `BigQueryReadClient`.
59  *
60  * This interface defines virtual methods for each of the user-facing overload
61  * sets in `BigQueryReadClient`. This allows users to inject custom behavior
62  * (e.g., with a Google Mock object) when writing tests that use objects of type
63  * `BigQueryReadClient`.
64  *
65  * To create a concrete instance, see `MakeBigQueryReadConnection()`.
66  *
67  * For mocking, see `bigquery_mocks::MockBigQueryReadConnection`.
68  */
70  public:
71  virtual ~BigQueryReadConnection() = 0;
72 
73  virtual Options options() { return Options{}; }
74 
75  virtual StatusOr<google::cloud::bigquery::storage::v1::ReadSession>
77  google::cloud::bigquery::storage::v1::CreateReadSessionRequest const&
78  request);
79 
80  virtual StreamRange<google::cloud::bigquery::storage::v1::ReadRowsResponse>
82  google::cloud::bigquery::storage::v1::ReadRowsRequest const& request);
83 
84  virtual StatusOr<
85  google::cloud::bigquery::storage::v1::SplitReadStreamResponse>
87  google::cloud::bigquery::storage::v1::SplitReadStreamRequest const&
88  request);
89 };
90 
91 /**
92  * A factory function to construct an object of type `BigQueryReadConnection`.
93  *
94  * The returned connection object should not be used directly; instead it
95  * should be passed as an argument to the constructor of BigQueryReadClient,
96  * and that class used instead.
97  *
98  * The optional @p opts argument may be used to configure aspects of the
99  * returned `BigQueryReadConnection`. Expected options are any of the types in
100  * the following option lists:
101  *
102  * - `google::cloud::CommonOptionList`
103  * - `google::cloud::GrpcOptionList`
104  * - `google::cloud::bigquery::BigQueryReadPolicyOptionList`
105  *
106  * @note Unrecognized options will be ignored. To debug issues with options set
107  * `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment and unexpected
108  * options will be logged.
109  *
110  * @param options (optional) Configure the `BigQueryReadConnection` created by
111  * this function.
112  */
114  Options options = {});
115 
117 namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
118 } // namespace bigquery
119 } // namespace cloud
120 } // namespace google
121 
122 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_H