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: Threaded MutationsBatcher #722

Merged
merged 24 commits into from
May 10, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust parameters
  • Loading branch information
Mariatta committed Apr 5, 2023
commit 00e03e5512267ab293e009218d6f5a1168be3417
12 changes: 7 additions & 5 deletions google/cloud/bigtable/batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import concurrent.futures
import atexit

FLUSH_COUNT = 1000
FLUSH_COUNT = 100
MAX_MUTATIONS = 100000
MAX_ROW_BYTES = 5242880 # 5MB

MAX_ROW_BYTES = 20 * 1024 * 1024 # 20MB
MAX_BATCH_SIZE = 100 * 1024 * 1024

class MaxMutationsError(ValueError):
"""The number of mutations for bulk request is too big."""
Expand Down Expand Up @@ -60,11 +60,13 @@ def put(self, item, block=True, timeout=None):
item.row_key, mutation_count
)
)
mutianf marked this conversation as resolved.
Show resolved Hide resolved
self.total_size += item.get_mutations_size()
self.total_mutation_count += mutation_count


self._queue.put(item, block=block, timeout=timeout)

self.total_size += item.get_mutations_size()
self.total_mutation_count += mutation_count

def full(self):
"""Check if the queue is full."""
if (
Expand Down