lukecwik commented on a change in pull request #15807:
URL: https://github.com/apache/beam/pull/15807#discussion_r738919562
##########
File path:
sdks/java/harness/src/test/java/org/apache/beam/fn/harness/PTransformRunnerFactoryTestContext.java
##########
@@ -210,6 +222,34 @@ public void accept(T input) throws Exception {
};
}
+ public abstract Map<ApiServiceDescriptor, List<DataEndpoint<?>>>
getIncomingDataEndpoints();
+
+ @Override
+ public <T> void addIncomingDataEndpoint(
+ ApiServiceDescriptor apiServiceDescriptor, Coder<T> coder,
FnDataReceiver<T> receiver) {
+ getIncomingDataEndpoints()
+ .computeIfAbsent(apiServiceDescriptor, (unused) -> new ArrayList<>())
+ .add(DataEndpoint.create(getPTransformId(), coder, receiver));
+ }
+
+ public abstract List<TimerEndpoint<?>> getIncomingTimerEndpoints();
+
+ public <T> TimerEndpoint<T> getIncomingTimerEndpoint(String timerFamilyId) {
+ for (TimerEndpoint<?> timerEndpoint : getIncomingTimerEndpoints()) {
+ if (timerFamilyId.equals(timerEndpoint.getTimerFamilyId())) {
+ return (TimerEndpoint<T>) timerEndpoint;
+ }
+ }
Review comment:
It was easy.
--
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]