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

Way to change the mutation timeout in bigtable. #7424

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

juan-rael
Copy link
Contributor

In some cases, we need to set a greater timeout to wait for a request, right now it isn't a way to change this value.

setting the timeout in the mutation batcher we can set this time or set it in blank to take the default value.

def test_mutate_rows_timeout(self):
        table = _Table(self.TABLE_NAME)
        mutation_batcher = MutationsBatcher(table=table, timeout=600000)

        row = DirectRow(row_key=b"row_key")
        row.set_cell("cf1", b"c1", 1)
        row.set_cell("cf1", b"c2", 2)
        row.set_cell("cf1", b"c3", 3)
        row.set_cell("cf1", b"c4", 4)

        mutation_batcher.mutate(row)

        mutation_batcher.flush()

        self.assertEqual(table.mutation_calls, 1)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 22, 2019
Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch! I think we can simplify it a bit.

bigtable/google/cloud/bigtable/table.py Outdated Show resolved Hide resolved
bigtable/google/cloud/bigtable/table.py Outdated Show resolved Hide resolved
bigtable/google/cloud/bigtable/batcher.py Outdated Show resolved Hide resolved
bigtable/google/cloud/bigtable/table.py Outdated Show resolved Hide resolved
bigtable/google/cloud/bigtable/table.py Outdated Show resolved Hide resolved
bigtable/tests/unit/test_batcher.py Outdated Show resolved Hide resolved
@tseaver tseaver added the api: bigtable Issues related to the Bigtable API. label Feb 22, 2019
@juan-rael
Copy link
Contributor Author

I do all the changes. @tseaver

@tseaver tseaver added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 26, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 26, 2019
bigtable/google/cloud/bigtable/batcher.py Outdated Show resolved Hide resolved
bigtable/google/cloud/bigtable/table.py Outdated Show resolved Hide resolved
@juan-rael
Copy link
Contributor Author

resolved it

@tseaver
Copy link
Contributor

tseaver commented Feb 27, 2019

@juan-rael Thanks for working through my review. In future PRs, please don't rebase / squash when replying to review comments: keeping the commits separate makes it easier to verify that the requested change was made. We end up squash-merging the whole thing at the end, anyway.

@tseaver tseaver merged commit 35e0349 into googleapis:master Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants