Skip to content

Commit

Permalink
Adjust parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariatta committed Feb 1, 2023
1 parent d36da87 commit 25c6265
Showing 1 changed file with 7 additions and 5 deletions.
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
)
)
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

0 comments on commit 25c6265

Please sign in to comment.