-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Retry test #3279
Retry test #3279
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @calpeyser,
Thanks for submitting your PR. We are really grateful.
I have a few issues that I would appreciate if you could look into before I can merge. (Also, CI needs to pass.)
Thanks!
@@ -0,0 +1,295 @@ | |||
package main |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
from google.cloud.bigtable.retry import ReadRowsIterator, _create_row_request | ||
from grpc import StatusCode | ||
|
||
BACKOFF_SETTINGS = BackoffSettings( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -13,8 +13,10 @@ | |||
# limitations under the License. | |||
|
|||
"""User friendly container for Google Cloud Bigtable Table.""" | |||
from __future__ import absolute_import, division |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
self.total_timeout = (retry_options.backoff_settings.total_timeout_millis / _MILLIS_PER_SECOND) | ||
self.set_stream() | ||
|
||
def set_start_key(self, start_key): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
while deadline is None or now < deadline: | ||
try: | ||
return six.next(self.stream) | ||
except StopIteration as stop: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
return six.next(self.stream) | ||
except StopIteration as stop: | ||
raise stop | ||
except Exception as exception: # pylint: disable=broad-except |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
except Exception as exception: # pylint: disable=broad-except | ||
code = config.exc_to_code(exception) | ||
if code not in self.retry_options.retry_codes: | ||
raise errors.RetryError( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
' classified as transient', exception) | ||
|
||
# pylint: disable=redefined-variable-type | ||
exc = errors.RetryError( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together!
@@ -1,599 +0,0 @@ | |||
# Copyright 2015 Google Inc. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
def process_write(self, table, payload): | ||
pass | ||
|
||
def process_scan(self, table, range, ids): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,54 @@ | |||
import unittest |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,295 @@ | |||
package main |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
from google.cloud.bigtable.retry import ReadRowsIterator, _create_row_request | ||
from grpc import StatusCode | ||
|
||
BACKOFF_SETTINGS = BackoffSettings( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -274,6 +274,9 @@ def consume_next(self): | |||
|
|||
self._validate_chunk(chunk) | |||
|
|||
if ("ReadRowsIterator" in self._response_iterator.__class__.__name__): | |||
self._response_iterator.set_start_key(chunk.row_key) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Superseded by #3324 |
No description provided.