Sigmund Hansen created BEAM-5115:
------------------------------------

             Summary: 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: Eugene Kirpichov


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)

Reply via email to