arunpandianp commented on code in PR #33755:
URL: https://github.com/apache/beam/pull/33755#discussion_r1941075955
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/ActiveWorkState.java:
##########
@@ -167,54 +165,28 @@ synchronized ActivateWorkResult
activateWorkForKey(ExecutableWork executableWork
*
* @param failedWork a map from sharding_key to tokens for the corresponding
work.
*/
- synchronized void failWorkForKey(Multimap<Long, WorkId> failedWork) {
- // Note we can't construct a ShardedKey and look it up in activeWork
directly since
- // HeartbeatResponse doesn't include the user key.
- for (Entry<ShardedKey, Deque<ExecutableWork>> entry :
activeWork.entrySet()) {
- Collection<WorkId> failedWorkIds =
failedWork.get(entry.getKey().shardingKey());
- for (WorkId failedWorkId : failedWorkIds) {
- for (ExecutableWork queuedWork : entry.getValue()) {
- WorkItem workItem = queuedWork.work().getWorkItem();
- if (workItem.getWorkToken() == failedWorkId.workToken()
- && workItem.getCacheToken() == failedWorkId.cacheToken()) {
- LOG.debug(
- "Failing work "
- + computationStateCache.getComputation()
- + " "
- + entry.getKey().shardingKey()
- + " "
- + failedWorkId.workToken()
- + " "
- + failedWorkId.cacheToken()
- + ". The work will be retried and is not lost.");
- queuedWork.work().setFailed();
- break;
- }
- }
+ synchronized void failWorkForKey(ImmutableList<WorkIdWithShardingKey>
failedWork) {
+ for (WorkIdWithShardingKey failedId : failedWork) {
+ LinkedHashMap<WorkId, ExecutableWork> workQueue =
activeWork.get(failedId.shardingKey());
Review Comment:
done
--
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]