Google Cloud BigQuery C++ Client 2.13.0
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
bigquery_read_connection.h
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_STORAGE_V1_BIGQUERY_READ_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_READ_CONNECTION_H
21
22#include "google/cloud/bigquery/storage/v1/bigquery_read_connection_idempotency_policy.h"
23#include "google/cloud/bigquery/storage/v1/internal/bigquery_read_retry_traits.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/options.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/stream_range.h"
28#include "google/cloud/version.h"
29#include <google/cloud/bigquery/storage/v1/storage.pb.h>
30#include <memory>
31
32namespace google {
33namespace cloud {
34namespace bigquery_storage_v1 {
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
36
37using BigQueryReadRetryPolicy =
38 ::google::cloud::internal::TraitBasedRetryPolicy<
39 bigquery_storage_v1_internal::BigQueryReadRetryTraits>;
40
41using BigQueryReadLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 bigquery_storage_v1_internal::BigQueryReadRetryTraits>;
44
45using BigQueryReadLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 bigquery_storage_v1_internal::BigQueryReadRetryTraits>;
48
49/**
50 * The `BigQueryReadConnection` object for `BigQueryReadClient`.
51 *
52 * This interface defines virtual methods for each of the user-facing overload
53 * sets in `BigQueryReadClient`. This allows users to inject custom behavior
54 * (e.g., with a Google Mock object) when writing tests that use objects of type
55 * `BigQueryReadClient`.
56 *
57 * To create a concrete instance, see `MakeBigQueryReadConnection()`.
58 *
59 * For mocking, see `bigquery_storage_v1_mocks::MockBigQueryReadConnection`.
60 */
62 public:
63 virtual ~BigQueryReadConnection() = 0;
64
65 virtual Options options() { return Options{}; }
66
67 virtual StatusOr<google::cloud::bigquery::storage::v1::ReadSession>
69 google::cloud::bigquery::storage::v1::CreateReadSessionRequest const&
70 request);
71
72 virtual StreamRange<google::cloud::bigquery::storage::v1::ReadRowsResponse>
74 google::cloud::bigquery::storage::v1::ReadRowsRequest const& request);
75
76 virtual StatusOr<
77 google::cloud::bigquery::storage::v1::SplitReadStreamResponse>
79 google::cloud::bigquery::storage::v1::SplitReadStreamRequest const&
80 request);
81};
82
83/**
84 * A factory function to construct an object of type `BigQueryReadConnection`.
85 *
86 * The returned connection object should not be used directly; instead it
87 * should be passed as an argument to the constructor of BigQueryReadClient.
88 *
89 * The optional @p options argument may be used to configure aspects of the
90 * returned `BigQueryReadConnection`. Expected options are any of the types in
91 * the following option lists:
92 *
93 * - `google::cloud::CommonOptionList`
94 * - `google::cloud::GrpcOptionList`
95 * - `google::cloud::UnifiedCredentialsOptionList`
96 * - `google::cloud::bigquery_storage_v1::BigQueryReadPolicyOptionList`
97 *
98 * @note Unexpected options will be ignored. To log unexpected options instead,
99 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
100 *
101 * @param options (optional) Configure the `BigQueryReadConnection` created by
102 * this function.
103 */
105 Options options = {});
106
107GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
108namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
109} // namespace bigquery_storage_v1
110} // namespace cloud
111} // namespace google
112
113#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_READ_CONNECTION_H
The BigQueryReadConnection object for BigQueryReadClient.
Definition: bigquery_read_connection.h:61
virtual StreamRange< google::cloud::bigquery::storage::v1::ReadRowsResponse > ReadRows(google::cloud::bigquery::storage::v1::ReadRowsRequest const &request)
virtual StatusOr< google::cloud::bigquery::storage::v1::ReadSession > CreateReadSession(google::cloud::bigquery::storage::v1::CreateReadSessionRequest const &request)
virtual StatusOr< google::cloud::bigquery::storage::v1::SplitReadStreamResponse > SplitReadStream(google::cloud::bigquery::storage::v1::SplitReadStreamRequest const &request)
virtual Options options()
Definition: bigquery_read_connection.h:65
Definition: bigquery_read_client.h:32
std::shared_ptr< BigQueryReadConnection > MakeBigQueryReadConnection(Options options={})
A factory function to construct an object of type BigQueryReadConnection.
Definition: analytics_hub_client.h:30