Add missing params to Python Bigtable MutationsBatcher #31791
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
In https://github.com/apache/beam/pull/27085/files, we replaced
_MutationsBatcher
withMutationsBatcher
fromgoogle.cloud.bigtable.batcher
.However we didn't set
flush_count
andmax_row_bytes
ofMutationsBatcher
thus both constantsFLUSH_COUNT
andMAX_ROW_BYTES
are currently not in used.=> This PR fixed that issue
Implication
Although, in
google.cloud.bigtable
library,MutationsBatcher
also set default value forflush-count
but there is currently a discrepancy between default value in documentation1000
and actual default value100
See moreFor small/medium size use cases, there shouldn't be any problems. But I have 1 use case in which 1 million rows are written to Bigtable and
flush_count: 100
is too low which creates a lot of requests to Bigtable server.One potential improvement is to allow both
flush_count
andmax_row_bytes
to be configurable. But this is open-to further discussion and out of scope of this PR.GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.