@@ -25,6 +25,7 @@ inline namespace BIGTABLE_CLIENT_NS {
2525// Cloud Bigtable doesn't accept more than this in a single request.
2626auto constexpr kBigtableMutationLimit = 100000 ;
2727// Maximum mutations that can be outstanding in the Cloud Bigtable front end.
28+ // NOTE: this is a system-wide limit, but it is only enforced per process.
2829auto constexpr kBigtableOutstandingMutationLimit = 300000 ;
2930// Let's make the default slightly smaller, so that overheads or
3031// miscalculations don't tip us over.
@@ -41,6 +42,20 @@ MutationBatcher::Options::Options()
4142 max_outstanding_size(kDefaultMaxOutstandingSize ),
4243 max_outstanding_mutations(kBigtableOutstandingMutationLimit ) {}
4344
45+ MutationBatcher::Options& MutationBatcher::Options::SetMaxMutationsPerBatch (
46+ size_t max_mutations_per_batch_arg) {
47+ max_mutations_per_batch = std::min<std::size_t >(max_mutations_per_batch_arg,
48+ kBigtableMutationLimit );
49+ return *this ;
50+ }
51+
52+ MutationBatcher::Options& MutationBatcher::Options::SetMaxOutstandingMutations (
53+ size_t max_outstanding_mutations_arg) {
54+ max_outstanding_mutations = std::min<std::size_t >(
55+ max_outstanding_mutations_arg, kBigtableOutstandingMutationLimit );
56+ return *this ;
57+ }
58+
4459std::pair<future<void >, future<Status>> MutationBatcher::AsyncApply (
4560 CompletionQueue& cq, SingleRowMutation mut) {
4661 AdmissionPromise admission_promise;
0 commit comments