You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Ismaël Mejía (JIRA)" <ji...@apache.org> on 2019/03/15 13:20:00 UTC
[jira] [Assigned] (BEAM-5115) Inconsistent use of ValueProvider
between XmlSource and XmlIO
[ https://issues.apache.org/jira/browse/BEAM-5115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ismaël Mejía reassigned BEAM-5115:
----------------------------------
Assignee: Ismaël Mejía
> 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
>
> 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)