m-trieu commented on code in PR #31317:
URL: https://github.com/apache/beam/pull/31317#discussion_r1619365946
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/Work.java:
##########
@@ -249,4 +310,49 @@ 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();
+
+ /**
+ * {@link WindmillStream.GetDataStream} that connects to the backend
Windmill worker handling
+ * the {@link WorkItem}.
+ */
+ 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();
+
+ public abstract Optional<WindmillStream.GetDataStream> getDataStream();
Review Comment:
yea since for refreshing work we need to group all active work by
getDataStream
--
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]