pabloem commented on a change in pull request #16436:
URL: https://github.com/apache/beam/pull/16436#discussion_r797956921
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1.java
##########
@@ -1458,6 +1461,12 @@ public void startBundle(StartBundleContext c) {
public void processElement(ProcessContext c) throws Exception {
Mutation write = c.element();
int size = write.getSerializedSize();
+
+ if (!uniqueMutations.add(c.element())) {
+ batchSize.update(mutations.size());
+ flushBatch();
+ }
+
if (mutations.size() > 0
&& mutationsSize + size >=
DatastoreV1.DATASTORE_BATCH_UPDATE_BYTES_LIMIT) {
flushBatch();
Review comment:
we also need to add the batch size here. In fact, maybe update the batch
size within `flushBatch`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]