m-trieu commented on code in PR #30048:
URL: https://github.com/apache/beam/pull/30048#discussion_r1470339493
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/ActiveWorkState.java:
##########
@@ -168,6 +198,18 @@ synchronized void failWorkForKey(Map<Long,
List<FailedTokens>> failedWork) {
}
}
+ private synchronized void incrementActiveWorkBudget(Work work) {
+ GetWorkBudget currentActiveWorkBudget = activeGetWorkBudget.get();
+ activeGetWorkBudget.set(
+ currentActiveWorkBudget.apply(1,
work.getWorkItem().getSerializedSize()));
+ }
+
+ private synchronized void decrementActiveWorkBudget(Work work) {
Review Comment:
will never go negative since guards are in `GetWorkBudget`
```
public final GetWorkBudget build() {
setItems(Math.max(0, items()));
setBytes(Math.max(0, bytes()));
return autoBuild();
}
```
--
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]