Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-5115

Inconsistent use of ValueProvider between XmlSource and XmlIO

Details

    • Improvement
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 2.6.0
    • 2.12.0
    • io-java-xml
    • None

    Description

      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.

      public Read<T> from(String fileOrPatternSpec) {
          return from(StaticValueProvider.of(fileOrPatternSpec));
      }
      
      public Read<T> from(ValueProvider<String> fileOrPatternSpec) {
          return toBuilder().setFileOrPatternSpec(fileOrPatternSpec).build();
      }

      Attachments

        Issue Links

          Activity

            People

              iemejia Ismaël Mejía
              Sardtok Sigmund Hansen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m