You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "pabloem (via GitHub)" <gi...@apache.org> on 2023/03/07 17:27:27 UTC

[GitHub] [beam] pabloem commented on a diff in pull request #25701: Fix DatastoreIO bug causing low throughput on certain writes

pabloem commented on code in PR #25701:
URL: https://github.com/apache/beam/pull/25701#discussion_r1128268864


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1.java:
##########
@@ -1542,12 +1542,26 @@ public void startBundle(StartBundleContext c) {
       }
     }
 
+    private static com.google.datastore.v1.Key getKey(Mutation m) {
+      if (m.hasUpsert()) {
+        return m.getUpsert().getKey();
+      } else if (m.hasInsert()) {
+        return m.getInsert().getKey();
+      } else if (m.hasDelete()) {
+        return m.getDelete();
+      } else if (m.hasUpdate()) {
+        return m.getUpdate().getKey();
+      } else {
+        throw new IllegalArgumentException(String.format("Mutation %s is not valid.", m));

Review Comment:
   ok I've done that. Thanks Yi!



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org