ryucc commented on code in PR #25068:
URL: https://github.com/apache/beam/pull/25068#discussion_r1083042856
##########
runners/samza/src/main/java/org/apache/beam/runners/samza/runtime/SamzaDoFnRunners.java:
##########
@@ -316,12 +322,25 @@ public FnDataReceiver<FnOutT> create(String
pCollectionId) {
final TimerReceiverFactory timerReceiverFactory =
new TimerReceiverFactory(stageBundleFactory,
this::timerDataConsumer, windowCoder);
+ Map<String, String> transformFullNameToUniqueName =
+ pTransformNodes.stream()
+ .collect(
+ Collectors.toMap(
+ pTransformNode -> pTransformNode.getId(),
+ pTransformNode ->
pTransformNode.getTransform().getUniqueName()));
Review Comment:
By computation I mean lines that are not pure assignment.
The constructor is usually not unit tested. If we add computation logic on
to it, we would want to add a unit test onto it. Ending in something like
```
class SdkHarnessDoFnRunner {
@VisibleForTesting
public Map<String, String> getTransformFullNameToUniqueName(){...}
}
class SdkHarnessDoFnRunnerTest {
@Test
public voidTestConstructor() {
SdkHarnessDoFnRunner runner = new SdkHarnessDoFnRunner(...);
assertEquals(runner.getTransformFullNameToUniqueName, expected);
}
}
```
I'd rather not have extra stuff inside the constructor.
--
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]