[
https://issues.apache.org/jira/browse/BEAM-5115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexey Romanenko resolved BEAM-5115.
------------------------------------
Resolution: Fixed
Fix Version/s: 2.12.0
> Inconsistent use of ValueProvider between XmlSource and XmlIO
> -------------------------------------------------------------
>
> Key: BEAM-5115
> URL: https://issues.apache.org/jira/browse/BEAM-5115
> Project: Beam
> Issue Type: Improvement
> Components: io-java-text
> Affects Versions: 2.6.0
> Reporter: Sigmund Hansen
> Assignee: Ismaël Mejía
> Priority: Major
> Fix For: 2.12.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> XmlIO.Read.from takes a String as an argument, which is then used to create a
> StaticValueProvider for the XmlSource that is built later on. As XmlSource
> takes a ValueProvider<String> to specify the file source(s) to read from.
> I would suggest to store a ValueProvider<String> in XmlIO.Read.Builder
> instead of a String, and overload from with two implementations. One being a
> wrapper creating a StaticValueProvider, i.e.
> {code:java}
> public Read<T> from(String fileOrPatternSpec) {
> return from(StaticValueProvider.of(fileOrPatternSpec));
> }
> public Read<T> from(ValueProvider<String> fileOrPatternSpec) {
> return toBuilder().setFileOrPatternSpec(fileOrPatternSpec).build();
> }{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)