gemini-code-assist[bot] commented on code in PR #36534:
URL: https://github.com/apache/beam/pull/36534#discussion_r2505021406


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindmillKeyedWorkItem.java:
##########
@@ -108,13 +115,22 @@ public Iterable<WindowedValue<ElemT>> elementsIterable() {
                 Collection<? extends BoundedWindow> windows =
                     WindmillSink.decodeMetadataWindows(windowsCoder, 
message.getMetadata());
                 PaneInfo paneInfo = 
WindmillSink.decodeMetadataPane(message.getMetadata());
+                // Draining value is based on upstream data
+                boolean drainingValueFromUpstream = false;
                 if (WindowedValues.WindowedValueCoder.isMetadataSupported()) {
-                  WindmillSink.decodeAdditionalMetadata(windowsCoder, 
message.getMetadata());
+                  BeamFnApi.Elements.ElementMetadata elementMetadata =
+                      WindmillSink.decodeAdditionalMetadata(windowsCoder, 
message.getMetadata());
+                  drainingValueFromUpstream =
+                      elementMetadata.hasDrain()
+                          ? (elementMetadata.getDrain()
+                              == BeamFnApi.Elements.DrainMode.Enum.DRAINING)
+                          : false;

Review Comment:
   Thank you for the positive feedback! I'm glad I could be helpful.



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