y1chi commented on a change in pull request #11756:
URL: https://github.com/apache/beam/pull/11756#discussion_r428241083



##########
File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
##########
@@ -460,14 +461,22 @@ public void accept(WindowedValue input) throws Exception {
       // Extract out relevant TimerFamilySpec information in preparation for 
execution.
       for (Map.Entry<String, TimerFamilySpec> entry :
           parDoPayload.getTimerFamilySpecsMap().entrySet()) {
-        String timerFamilyId = entry.getKey();
-        TimeDomain timeDomain =
-            DoFnSignatures.getTimerSpecOrThrow(
-                    doFnSignature.timerDeclarations().get(timerFamilyId), doFn)
-                .getTimeDomain();
+        String timerIdOrTimerFamilyId = entry.getKey();
+        TimeDomain timeDomain;
+        if (timerIdOrTimerFamilyId.startsWith(TimerFamilyDeclaration.PREFIX)) {
+          timeDomain =
+              DoFnSignatures.getTimerFamilySpecOrThrow(
+                      
doFnSignature.timerFamilyDeclarations().get(timerIdOrTimerFamilyId), doFn)
+                  .getTimeDomain();
+        } else {
+          timeDomain =
+              DoFnSignatures.getTimerSpecOrThrow(
+                      
doFnSignature.timerDeclarations().get(timerIdOrTimerFamilyId), doFn)
+                  .getTimeDomain();
+        }
         Coder<Timer<Object>> timerCoder =
             (Coder) 
rehydratedComponents.getCoder(entry.getValue().getTimerFamilyCoderId());
-        timerFamilyInfosBuilder.put(timerFamilyId, KV.of(timeDomain, 
timerCoder));
+        timerFamilyInfosBuilder.put(timerIdOrTimerFamilyId, KV.of(timeDomain, 
timerCoder));

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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to