jiangzzhu commented on code in PR #37459:
URL: https://github.com/apache/beam/pull/37459#discussion_r2760284445


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/action/QueryChangeStreamAction.java:
##########
@@ -379,4 +387,16 @@ private Timestamp getNextReadChangeStreamEndTimestamp() {
     final Timestamp current = Timestamp.now();
     return Timestamp.ofTimeSecondsAndNanos(current.getSeconds() + 2 * 60, 
current.getNanos());
   }
+
+  // For Mutable Change Stream, Spanner only allow the max query end timestamp 
to be 30 minutes in
+  // the future.
+  private Timestamp getBoundedQueryEndTimestamp(Timestamp endTimestamp) {
+    if (this.isMutableChangeStream) {
+      final Timestamp current = Timestamp.now();
+      Timestamp maxTimestamp =
+          Timestamp.ofTimeSecondsAndNanos(current.getSeconds() + 30 * 60, 
current.getNanos());

Review Comment:
   Should we leave some margin for the end timestamp, e.g. 25min or 20min in 
the future, in case that the query is processed too fast and this future 
timestamp still too far in the future?



-- 
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]

Reply via email to