-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathCreateReadSessionRequest.php
More file actions
267 lines (246 loc) · 11.6 KB
/
CreateReadSessionRequest.php
File metadata and controls
267 lines (246 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/bigquery/storage/v1/storage.proto
namespace Google\Cloud\BigQuery\Storage\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;
/**
* Request message for `CreateReadSession`.
*
* Generated from protobuf message <code>google.cloud.bigquery.storage.v1.CreateReadSessionRequest</code>
*/
class CreateReadSessionRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The request project that owns the session, in the form of
* `projects/{project_id}`.
*
* Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
*/
protected $parent = '';
/**
* Required. Session to be created.
*
* Generated from protobuf field <code>.google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
protected $read_session = null;
/**
* Max initial number of streams. If unset or zero, the server will
* provide a value of streams so as to produce reasonable throughput. Must be
* non-negative. The number of streams may be lower than the requested number,
* depending on the amount parallelism that is reasonable for the table.
* There is a default system max limit of 1,000.
* This must be greater than or equal to preferred_min_stream_count.
* Typically, clients should either leave this unset to let the system to
* determine an upper bound OR set this a size for the maximum "units of work"
* it can gracefully handle.
*
* Generated from protobuf field <code>int32 max_stream_count = 3;</code>
*/
protected $max_stream_count = 0;
/**
* The minimum preferred stream count. This parameter can be used to inform
* the service that there is a desired lower bound on the number of streams.
* This is typically a target parallelism of the client (e.g. a Spark
* cluster with N-workers would set this to a low multiple of N to ensure
* good cluster utilization).
* The system will make a best effort to provide at least this number of
* streams, but in some cases might provide less.
*
* Generated from protobuf field <code>int32 preferred_min_stream_count = 4;</code>
*/
protected $preferred_min_stream_count = 0;
/**
* @param string $parent Required. The request project that owns the session, in the form of
* `projects/{project_id}`. Please see
* {@see BigQueryReadClient::projectName()} for help formatting this field.
* @param \Google\Cloud\BigQuery\Storage\V1\ReadSession $readSession Required. Session to be created.
* @param int $maxStreamCount Max initial number of streams. If unset or zero, the server will
* provide a value of streams so as to produce reasonable throughput. Must be
* non-negative. The number of streams may be lower than the requested number,
* depending on the amount parallelism that is reasonable for the table.
* There is a default system max limit of 1,000.
*
* This must be greater than or equal to preferred_min_stream_count.
* Typically, clients should either leave this unset to let the system to
* determine an upper bound OR set this a size for the maximum "units of work"
* it can gracefully handle.
*
* @return \Google\Cloud\BigQuery\Storage\V1\CreateReadSessionRequest
*
* @experimental
*/
public static function build(string $parent, \Google\Cloud\BigQuery\Storage\V1\ReadSession $readSession, int $maxStreamCount): self
{
return (new self())
->setParent($parent)
->setReadSession($readSession)
->setMaxStreamCount($maxStreamCount);
}
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $parent
* Required. The request project that owns the session, in the form of
* `projects/{project_id}`.
* @type \Google\Cloud\BigQuery\Storage\V1\ReadSession $read_session
* Required. Session to be created.
* @type int $max_stream_count
* Max initial number of streams. If unset or zero, the server will
* provide a value of streams so as to produce reasonable throughput. Must be
* non-negative. The number of streams may be lower than the requested number,
* depending on the amount parallelism that is reasonable for the table.
* There is a default system max limit of 1,000.
* This must be greater than or equal to preferred_min_stream_count.
* Typically, clients should either leave this unset to let the system to
* determine an upper bound OR set this a size for the maximum "units of work"
* it can gracefully handle.
* @type int $preferred_min_stream_count
* The minimum preferred stream count. This parameter can be used to inform
* the service that there is a desired lower bound on the number of streams.
* This is typically a target parallelism of the client (e.g. a Spark
* cluster with N-workers would set this to a low multiple of N to ensure
* good cluster utilization).
* The system will make a best effort to provide at least this number of
* streams, but in some cases might provide less.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce();
parent::__construct($data);
}
/**
* Required. The request project that owns the session, in the form of
* `projects/{project_id}`.
*
* Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @return string
*/
public function getParent()
{
return $this->parent;
}
/**
* Required. The request project that owns the session, in the form of
* `projects/{project_id}`.
*
* Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @param string $var
* @return $this
*/
public function setParent($var)
{
GPBUtil::checkString($var, True);
$this->parent = $var;
return $this;
}
/**
* Required. Session to be created.
*
* Generated from protobuf field <code>.google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @return \Google\Cloud\BigQuery\Storage\V1\ReadSession|null
*/
public function getReadSession()
{
return $this->read_session;
}
public function hasReadSession()
{
return isset($this->read_session);
}
public function clearReadSession()
{
unset($this->read_session);
}
/**
* Required. Session to be created.
*
* Generated from protobuf field <code>.google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @param \Google\Cloud\BigQuery\Storage\V1\ReadSession $var
* @return $this
*/
public function setReadSession($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ReadSession::class);
$this->read_session = $var;
return $this;
}
/**
* Max initial number of streams. If unset or zero, the server will
* provide a value of streams so as to produce reasonable throughput. Must be
* non-negative. The number of streams may be lower than the requested number,
* depending on the amount parallelism that is reasonable for the table.
* There is a default system max limit of 1,000.
* This must be greater than or equal to preferred_min_stream_count.
* Typically, clients should either leave this unset to let the system to
* determine an upper bound OR set this a size for the maximum "units of work"
* it can gracefully handle.
*
* Generated from protobuf field <code>int32 max_stream_count = 3;</code>
* @return int
*/
public function getMaxStreamCount()
{
return $this->max_stream_count;
}
/**
* Max initial number of streams. If unset or zero, the server will
* provide a value of streams so as to produce reasonable throughput. Must be
* non-negative. The number of streams may be lower than the requested number,
* depending on the amount parallelism that is reasonable for the table.
* There is a default system max limit of 1,000.
* This must be greater than or equal to preferred_min_stream_count.
* Typically, clients should either leave this unset to let the system to
* determine an upper bound OR set this a size for the maximum "units of work"
* it can gracefully handle.
*
* Generated from protobuf field <code>int32 max_stream_count = 3;</code>
* @param int $var
* @return $this
*/
public function setMaxStreamCount($var)
{
GPBUtil::checkInt32($var);
$this->max_stream_count = $var;
return $this;
}
/**
* The minimum preferred stream count. This parameter can be used to inform
* the service that there is a desired lower bound on the number of streams.
* This is typically a target parallelism of the client (e.g. a Spark
* cluster with N-workers would set this to a low multiple of N to ensure
* good cluster utilization).
* The system will make a best effort to provide at least this number of
* streams, but in some cases might provide less.
*
* Generated from protobuf field <code>int32 preferred_min_stream_count = 4;</code>
* @return int
*/
public function getPreferredMinStreamCount()
{
return $this->preferred_min_stream_count;
}
/**
* The minimum preferred stream count. This parameter can be used to inform
* the service that there is a desired lower bound on the number of streams.
* This is typically a target parallelism of the client (e.g. a Spark
* cluster with N-workers would set this to a low multiple of N to ensure
* good cluster utilization).
* The system will make a best effort to provide at least this number of
* streams, but in some cases might provide less.
*
* Generated from protobuf field <code>int32 preferred_min_stream_count = 4;</code>
* @param int $var
* @return $this
*/
public function setPreferredMinStreamCount($var)
{
GPBUtil::checkInt32($var);
$this->preferred_min_stream_count = $var;
return $this;
}
}