m-trieu commented on code in PR #31317:
URL: https://github.com/apache/beam/pull/31317#discussion_r1621334710


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/Work.java:
##########
@@ -249,4 +308,42 @@ private boolean isCommitPending() {
 
     abstract Instant startTime();
   }
+
+  @AutoValue
+  public abstract static class ProcessingContext {
+
+    private static ProcessingContext.Builder builder(
+        String computationId,
+        BiFunction<String, KeyedGetDataRequest, KeyedGetDataResponse> 
getKeyedDataFn) {
+      return new AutoValue_Work_ProcessingContext.Builder()
+          .setComputationId(computationId)
+          .setKeyedDataFetcher(
+              request -> 
Optional.ofNullable(getKeyedDataFn.apply(computationId, request)));
+    }
+
+    /** Computation that the {@link Work} belongs to. */
+    public abstract String computationId();
+
+    /** Handles GetData requests to streaming backend. */
+    public abstract Function<KeyedGetDataRequest, 
Optional<KeyedGetDataResponse>>
+        keyedDataFetcher();
+
+    /**
+     * {@link WorkCommitter} that commits completed work to the backend 
Windmill worker handling the
+     * {@link WorkItem}.
+     */
+    public abstract Consumer<Commit> workCommitter();

Review Comment:
   its automatically checked at runtime, but changed so it can be compile time 
guard



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