Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ping and warm with metadata #810

Merged
merged 11 commits into from
Jun 26, 2023
Prev Previous commit
Next Next commit
fixed broken ping and warm
daniel-sanche committed Jun 22, 2023
commit 6a35be46ae5357487804bbb86217d4223111d773
8 changes: 6 additions & 2 deletions google/cloud/bigtable/client.py
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
from google.cloud.bigtable_v2.services.bigtable.transports.pooled_grpc_asyncio import (
PooledBigtableGrpcAsyncIOTransport,
)
from google.cloud.bigtable_v2.types.bigtable import PingAndWarmRequest
from google.cloud.client import ClientWithProject
from google.api_core.exceptions import GoogleAPICallError
from google.api_core import retry_async as retries
@@ -190,10 +191,13 @@ async def _ping_and_warm_instances(
- sequence of results or exceptions from the ping requests
"""
ping_rpc = channel.unary_unary(
"/google.bigtable.v2.Bigtable/PingAndWarmChannel"
"/google.bigtable.v2.Bigtable/PingAndWarm",
request_serializer=PingAndWarmRequest.serialize,
)
tasks = [ping_rpc({"name": n}) for n in self._active_instances]
return await asyncio.gather(*tasks, return_exceptions=True)
result_list = await asyncio.gather(*tasks, return_exceptions=True)
# return None in place of empty successful responses
return [r or None for r in result_list]

async def _manage_channel(
self,