-
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
Add max_message_length for larger rows. #2907
Add max_message_length for larger rows. #2907
Conversation
self.assertEqual(partial_row_data.row_key, ROW_KEY) | ||
cell = partial_row_data.cells[COLUMN_FAMILY_ID1] | ||
column = cell[COL_NAME1] | ||
self.assertIsNotNone(column[0].value) |
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.
@@ -76,8 +76,15 @@ def _make_data_stub(client): | |||
:returns: A gRPC stub object. | |||
""" | |||
if client.emulator_host is None: | |||
one_hundred_mb = 100 * 1024 * 1024 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -480,22 +480,29 @@ def make_secure_channel(credentials, user_agent, host): | |||
:type host: str | |||
:param host: The host for the service. | |||
|
|||
:type extra_options: tuple | |||
:param extra_options: Extra gRPC options used when creating the channel. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
self.assertEqual(partial_row_data.row_key, ROW_KEY) | ||
cell = partial_row_data.cells[COLUMN_FAMILY_ID1] | ||
column = cell[COL_NAME1] | ||
self.assertIsNotNone(column[0].value) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
row = self._table.row(ROW_KEY) | ||
self.rows_to_delete.append(row) | ||
|
||
data = '1' * 10 * 1024 * 1024 # 10MB of 1's. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -356,6 +356,21 @@ def _write_to_row(self, row1=None, row2=None, row3=None, row4=None): | |||
cell4 = Cell(CELL_VAL4, timestamp4) | |||
return cell1, cell2, cell3, cell4 | |||
|
|||
def test_read_large_row(self): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
# NOTE: 'grpc.max_message_length' will be deprecated in the 1.1 release | ||
# of grpcio in favor of 'grpc.max_receive_message_length' and | ||
# 'grpc.max_send_message_length'. | ||
max_msg_length = (('grpc.max_message_length', one_hundred_mb), |
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.
@@ -76,8 +76,15 @@ def _make_data_stub(client): | |||
:returns: A gRPC stub object. | |||
""" | |||
if client.emulator_host is None: | |||
one_hundred_mb = 100 * 1024 * 1024 | |||
# NOTE: 'grpc.max_message_length' will be deprecated in the 1.1 release |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Added Nathaniel's feedback and updated the constant. |
# grpcio 1.1 and later. | ||
max_msg_length = (('grpc.max_message_length', _MAX_MSG_LENGTH_100MB), | ||
('grpc.max_receive_message_length', | ||
_MAX_MSG_LENGTH_100MB)) |
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.
78aa62a
to
878fb58
Compare
Reformatted and squashed. |
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.
General comment: Are you planning to add a system test where two cells combined exceed 10MB but neither does individually?
@@ -65,6 +65,13 @@ | |||
READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/bigtable.data.readonly' | |||
"""Scope for reading table data.""" | |||
|
|||
# NOTE: 'grpc.max_message_length' will no longer be recognized in | |||
# grpcio 1.1 and later. |
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.
|
||
with self.assertRaises(Exception): | ||
partial_row_data = self._table.read_row(ROW_KEY) | ||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
row = self._table.row(ROW_KEY) | ||
self.rows_to_delete.append(row) | ||
|
||
data = '1' * 101 * 1024 * 1024 # 11MB of 1's. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
data = '1' * 101 * 1024 * 1024 # 11MB of 1's. | ||
row.set_cell(COLUMN_FAMILY_ID1, COL_NAME1, data) | ||
with self.assertRaises(Exception): |
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.
self.rows_to_delete.append(row) | ||
|
||
number_of_bytes = 10 * 1024 * 1024 | ||
data = '1' * number_of_bytes # 10MB of 1's. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
dc49e57
to
11d33bb
Compare
@dhermes and @nathanielmanistaatgoogle If this looks good, I'll squash and merge. |
38e46d5
to
8e950a8
Compare
Squashed. |
_MAX_MSG_LENGTH_100MB = 100 * 1024 * 1024 | ||
_GRPC_MAX_LENGTH_OPTIONS = ( | ||
('grpc.max_message_length', _MAX_MSG_LENGTH_100MB), | ||
('grpc.max_receive_message_length', _MAX_MSG_LENGTH_100MB) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -30,6 +30,7 @@ | |||
from google.cloud.bigtable.row_data import Cell | |||
from google.cloud.bigtable.row_data import PartialRowData | |||
from google.cloud.environment_vars import BIGTABLE_EMULATOR | |||
from grpc._channel import _Rendezvous |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
cell = partial_row_data.cells[COLUMN_FAMILY_ID1] | ||
column = cell[COL_NAME1] | ||
value = column[0].value | ||
self.assertIsNotNone(value) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
row.set_cell(COLUMN_FAMILY_ID1, COL_NAME1, data) | ||
row.commit() | ||
row.set_cell(COLUMN_FAMILY_ID1, COL_NAME1, data) | ||
row.commit() |
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.
row.commit() | ||
|
||
with self.assertRaises(_Rendezvous): | ||
self._table.read_row(ROW_KEY) |
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.
@@ -356,6 +357,46 @@ def _write_to_row(self, row1=None, row2=None, row3=None, row4=None): | |||
cell4 = Cell(CELL_VAL4, timestamp4) | |||
return cell1, cell2, cell3, cell4 | |||
|
|||
def test_read_large_cell_limit(self): |
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.
with self.assertRaises(_Rendezvous): | ||
row.commit() | ||
self.assertEqual(len(column), 1) | ||
self.assertEqual(len(column[0].value), number_of_bytes) |
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.
c5990c1
to
85c6bf3
Compare
Squashed. |
…receive-length Add max_message_length for larger rows.
Closes #2880
/cc @nathanielmanistaatgoogle @sduskis