Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 6f27109

Browse files
fix: remove gRPC send/recv limits; expose client transport (#117)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * build(java): use actions/github-script v3 tag rather than full semver So that renovate-bot stops proposing PRs like [this](https://github.com/googleapis/java-bigquerydatatransfer/pull/515/files)! Source-Author: Stephanie Wang <stephaniewang526@users.noreply.github.com> Source-Date: Tue Nov 17 13:02:02 2020 -0500 Source-Repo: googleapis/synthtool Source-Sha: 7fcc405a579d5d53a726ff3da1b7c8c08f0f2d58 Source-Link: googleapis/synthtool@7fcc405 * chore: migrate redis to the Java microgenerator Committer: @miraleung PiperOrigin-RevId: 346121774 Source-Author: Google APIs <noreply@google.com> Source-Date: Mon Dec 7 10:20:09 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: fa1a1755bb7d1d211261906886d9608359ba23d9 Source-Link: googleapis/googleapis@fa1a175 * feat: Add ListSkus, ListOffers API definitions for Cloud Channel API. PiperOrigin-RevId: 346583784 Source-Author: Google APIs <noreply@google.com> Source-Date: Wed Dec 9 10:34:16 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: a53dc0292aad8a7739e44c2165476874ddc487bf Source-Link: googleapis/googleapis@a53dc02 * feat: Add the `UNORDERED_LIST` enum value for `google.api.field_behavior`. Also includes minor documentation changes that seem to have been made in the interim and never published. PiperOrigin-RevId: 346664095 Source-Author: Google APIs <noreply@google.com> Source-Date: Wed Dec 9 16:35:05 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 468a94a87b9f80d22d1f5e3076d5bab73a5c996f Source-Link: googleapis/googleapis@468a94a * docs: restructured AudioConfig API PiperOrigin-RevId: 346910607 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Dec 10 18:45:11 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: c38c7708c09271e3dd4799541583f9fd0e95fc6a Source-Link: googleapis/googleapis@c38c770 * chore: add resource_definitions for Cluster and Service Committer: @miraleung PiperOrigin-RevId: 347029491 Source-Author: Google APIs <noreply@google.com> Source-Date: Fri Dec 11 10:43:21 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: bddb3d7479894576e61a6c88fa745bb24f4c98f7 Source-Link: googleapis/googleapis@bddb3d7 * chore: update gapic-generator-java to 0.0.11 Committer: @miraleung PiperOrigin-RevId: 347036369 Source-Author: Google APIs <noreply@google.com> Source-Date: Fri Dec 11 11:13:47 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 6d65640b1fcbdf26ea76cb720de0ac138cae9bed Source-Link: googleapis/googleapis@6d65640 * fix: remove client recv msg limit fix: add enums to `types/__init__.py` PiperOrigin-RevId: 347055288 Source-Author: Google APIs <noreply@google.com> Source-Date: Fri Dec 11 12:44:37 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: dd372aa22ded7a8ba6f0e03a80e06358a3fa0907 Source-Link: googleapis/googleapis@dd372aa * fix: fixed config for Python and Java grpc lib PiperOrigin-RevId: 348952930 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Dec 24 13:19:36 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 69697504d9eba1d064820c3085b4750767be6d08 Source-Link: googleapis/googleapis@6969750
1 parent ee093a8 commit 6f27109

41 files changed

Lines changed: 486 additions & 170 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google/cloud/dataproc_v1/services/autoscaling_policy_service/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_transport_registry["grpc"] = AutoscalingPolicyServiceGrpcTransport
3131
_transport_registry["grpc_asyncio"] = AutoscalingPolicyServiceGrpcAsyncIOTransport
3232

33-
3433
__all__ = (
3534
"AutoscalingPolicyServiceTransport",
3635
"AutoscalingPolicyServiceGrpcTransport",

google/cloud/dataproc_v1/services/autoscaling_policy_service/transports/grpc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def __init__(
148148
ssl_credentials=ssl_credentials,
149149
scopes=scopes or self.AUTH_SCOPES,
150150
quota_project_id=quota_project_id,
151+
options=[
152+
("grpc.max_send_message_length", -1),
153+
("grpc.max_receive_message_length", -1),
154+
],
151155
)
152156
self._ssl_channel_credentials = ssl_credentials
153157
else:
@@ -166,6 +170,10 @@ def __init__(
166170
ssl_credentials=ssl_channel_credentials,
167171
scopes=scopes or self.AUTH_SCOPES,
168172
quota_project_id=quota_project_id,
173+
options=[
174+
("grpc.max_send_message_length", -1),
175+
("grpc.max_receive_message_length", -1),
176+
],
169177
)
170178

171179
self._stubs = {} # type: Dict[str, Callable]
@@ -192,7 +200,7 @@ def create_channel(
192200
) -> grpc.Channel:
193201
"""Create and return a gRPC channel object.
194202
Args:
195-
address (Optionsl[str]): The host for the channel to use.
203+
address (Optional[str]): The host for the channel to use.
196204
credentials (Optional[~.Credentials]): The
197205
authorization credentials to attach to requests. These
198206
credentials identify this application to the service. If

google/cloud/dataproc_v1/services/autoscaling_policy_service/transports/grpc_asyncio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ def __init__(
193193
ssl_credentials=ssl_credentials,
194194
scopes=scopes or self.AUTH_SCOPES,
195195
quota_project_id=quota_project_id,
196+
options=[
197+
("grpc.max_send_message_length", -1),
198+
("grpc.max_receive_message_length", -1),
199+
],
196200
)
197201
self._ssl_channel_credentials = ssl_credentials
198202
else:
@@ -211,6 +215,10 @@ def __init__(
211215
ssl_credentials=ssl_channel_credentials,
212216
scopes=scopes or self.AUTH_SCOPES,
213217
quota_project_id=quota_project_id,
218+
options=[
219+
("grpc.max_send_message_length", -1),
220+
("grpc.max_receive_message_length", -1),
221+
],
214222
)
215223

216224
# Run the base constructor.

google/cloud/dataproc_v1/services/cluster_controller/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
_transport_registry["grpc"] = ClusterControllerGrpcTransport
2929
_transport_registry["grpc_asyncio"] = ClusterControllerGrpcAsyncIOTransport
3030

31-
3231
__all__ = (
3332
"ClusterControllerTransport",
3433
"ClusterControllerGrpcTransport",

google/cloud/dataproc_v1/services/cluster_controller/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def __init__(
149149
ssl_credentials=ssl_credentials,
150150
scopes=scopes or self.AUTH_SCOPES,
151151
quota_project_id=quota_project_id,
152+
options=[
153+
("grpc.max_send_message_length", -1),
154+
("grpc.max_receive_message_length", -1),
155+
],
152156
)
153157
self._ssl_channel_credentials = ssl_credentials
154158
else:
@@ -167,9 +171,14 @@ def __init__(
167171
ssl_credentials=ssl_channel_credentials,
168172
scopes=scopes or self.AUTH_SCOPES,
169173
quota_project_id=quota_project_id,
174+
options=[
175+
("grpc.max_send_message_length", -1),
176+
("grpc.max_receive_message_length", -1),
177+
],
170178
)
171179

172180
self._stubs = {} # type: Dict[str, Callable]
181+
self._operations_client = None
173182

174183
# Run the base constructor.
175184
super().__init__(
@@ -193,7 +202,7 @@ def create_channel(
193202
) -> grpc.Channel:
194203
"""Create and return a gRPC channel object.
195204
Args:
196-
address (Optionsl[str]): The host for the channel to use.
205+
address (Optional[str]): The host for the channel to use.
197206
credentials (Optional[~.Credentials]): The
198207
authorization credentials to attach to requests. These
199208
credentials identify this application to the service. If
@@ -240,13 +249,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
240249
client.
241250
"""
242251
# Sanity check: Only create a new client if we do not already have one.
243-
if "operations_client" not in self.__dict__:
244-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
245-
self.grpc_channel
246-
)
252+
if self._operations_client is None:
253+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
247254

248255
# Return the client from cache.
249-
return self.__dict__["operations_client"]
256+
return self._operations_client
250257

251258
@property
252259
def create_cluster(

google/cloud/dataproc_v1/services/cluster_controller/transports/grpc_asyncio.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ def __init__(
194194
ssl_credentials=ssl_credentials,
195195
scopes=scopes or self.AUTH_SCOPES,
196196
quota_project_id=quota_project_id,
197+
options=[
198+
("grpc.max_send_message_length", -1),
199+
("grpc.max_receive_message_length", -1),
200+
],
197201
)
198202
self._ssl_channel_credentials = ssl_credentials
199203
else:
@@ -212,6 +216,10 @@ def __init__(
212216
ssl_credentials=ssl_channel_credentials,
213217
scopes=scopes or self.AUTH_SCOPES,
214218
quota_project_id=quota_project_id,
219+
options=[
220+
("grpc.max_send_message_length", -1),
221+
("grpc.max_receive_message_length", -1),
222+
],
215223
)
216224

217225
# Run the base constructor.
@@ -225,6 +233,7 @@ def __init__(
225233
)
226234

227235
self._stubs = {}
236+
self._operations_client = None
228237

229238
@property
230239
def grpc_channel(self) -> aio.Channel:
@@ -244,13 +253,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
244253
client.
245254
"""
246255
# Sanity check: Only create a new client if we do not already have one.
247-
if "operations_client" not in self.__dict__:
248-
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
256+
if self._operations_client is None:
257+
self._operations_client = operations_v1.OperationsAsyncClient(
249258
self.grpc_channel
250259
)
251260

252261
# Return the client from cache.
253-
return self.__dict__["operations_client"]
262+
return self._operations_client
254263

255264
@property
256265
def create_cluster(

google/cloud/dataproc_v1/services/job_controller/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
_transport_registry["grpc"] = JobControllerGrpcTransport
2929
_transport_registry["grpc_asyncio"] = JobControllerGrpcAsyncIOTransport
3030

31-
3231
__all__ = (
3332
"JobControllerTransport",
3433
"JobControllerGrpcTransport",

google/cloud/dataproc_v1/services/job_controller/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def __init__(
149149
ssl_credentials=ssl_credentials,
150150
scopes=scopes or self.AUTH_SCOPES,
151151
quota_project_id=quota_project_id,
152+
options=[
153+
("grpc.max_send_message_length", -1),
154+
("grpc.max_receive_message_length", -1),
155+
],
152156
)
153157
self._ssl_channel_credentials = ssl_credentials
154158
else:
@@ -167,9 +171,14 @@ def __init__(
167171
ssl_credentials=ssl_channel_credentials,
168172
scopes=scopes or self.AUTH_SCOPES,
169173
quota_project_id=quota_project_id,
174+
options=[
175+
("grpc.max_send_message_length", -1),
176+
("grpc.max_receive_message_length", -1),
177+
],
170178
)
171179

172180
self._stubs = {} # type: Dict[str, Callable]
181+
self._operations_client = None
173182

174183
# Run the base constructor.
175184
super().__init__(
@@ -193,7 +202,7 @@ def create_channel(
193202
) -> grpc.Channel:
194203
"""Create and return a gRPC channel object.
195204
Args:
196-
address (Optionsl[str]): The host for the channel to use.
205+
address (Optional[str]): The host for the channel to use.
197206
credentials (Optional[~.Credentials]): The
198207
authorization credentials to attach to requests. These
199208
credentials identify this application to the service. If
@@ -240,13 +249,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
240249
client.
241250
"""
242251
# Sanity check: Only create a new client if we do not already have one.
243-
if "operations_client" not in self.__dict__:
244-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
245-
self.grpc_channel
246-
)
252+
if self._operations_client is None:
253+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
247254

248255
# Return the client from cache.
249-
return self.__dict__["operations_client"]
256+
return self._operations_client
250257

251258
@property
252259
def submit_job(self) -> Callable[[jobs.SubmitJobRequest], jobs.Job]:

google/cloud/dataproc_v1/services/job_controller/transports/grpc_asyncio.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ def __init__(
194194
ssl_credentials=ssl_credentials,
195195
scopes=scopes or self.AUTH_SCOPES,
196196
quota_project_id=quota_project_id,
197+
options=[
198+
("grpc.max_send_message_length", -1),
199+
("grpc.max_receive_message_length", -1),
200+
],
197201
)
198202
self._ssl_channel_credentials = ssl_credentials
199203
else:
@@ -212,6 +216,10 @@ def __init__(
212216
ssl_credentials=ssl_channel_credentials,
213217
scopes=scopes or self.AUTH_SCOPES,
214218
quota_project_id=quota_project_id,
219+
options=[
220+
("grpc.max_send_message_length", -1),
221+
("grpc.max_receive_message_length", -1),
222+
],
215223
)
216224

217225
# Run the base constructor.
@@ -225,6 +233,7 @@ def __init__(
225233
)
226234

227235
self._stubs = {}
236+
self._operations_client = None
228237

229238
@property
230239
def grpc_channel(self) -> aio.Channel:
@@ -244,13 +253,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
244253
client.
245254
"""
246255
# Sanity check: Only create a new client if we do not already have one.
247-
if "operations_client" not in self.__dict__:
248-
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
256+
if self._operations_client is None:
257+
self._operations_client = operations_v1.OperationsAsyncClient(
249258
self.grpc_channel
250259
)
251260

252261
# Return the client from cache.
253-
return self.__dict__["operations_client"]
262+
return self._operations_client
254263

255264
@property
256265
def submit_job(self) -> Callable[[jobs.SubmitJobRequest], Awaitable[jobs.Job]]:

google/cloud/dataproc_v1/services/workflow_template_service/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_transport_registry["grpc"] = WorkflowTemplateServiceGrpcTransport
3131
_transport_registry["grpc_asyncio"] = WorkflowTemplateServiceGrpcAsyncIOTransport
3232

33-
3433
__all__ = (
3534
"WorkflowTemplateServiceTransport",
3635
"WorkflowTemplateServiceGrpcTransport",

0 commit comments

Comments
 (0)