Abacn commented on PR #36781:
URL: https://github.com/apache/beam/pull/36781#issuecomment-4282400138
Thanks for persistence. There were lots of back-and-forth on
setDefaultPipelineOptions lately. The latest commit still runs SOURCES.set,
SINKS.set every time gets called. Let me summarizes requirements
- When LineageType option isn't set, there shouldn't be overriden every time
setDefaultPipelineOptions invoked
- When LineageType option has been set before, we check necessity of such
overwrite.
I think the version before the latest one could be a good start point.
Instead of computeSet, we can do something like
```
Class<? extends LineageBase> lineageClass =
options.as(LineageOptions.class).getLineageType();
@Nullable LineageBase currentLineage = SOURCES.get();
if (SOURCES.get() == null || (lineageClass != null &&
!lineageClass.isInstance(currentLineage)) {
// we need to re-generate
synchronized {
...
}
}
```
--
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]