Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-1253

MessageStream.merge operator broken for nested types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.13.0
    • None
    • None

    Description

      From cpettitt-linkedin:

      I picked up the latest code and found that MessageStream.merge is now broken for nested types. For example, the following:
          final MessageStream<BeamMessage<InT>> inputStream = ...;
          final Collection<MessageStream<BeamMessage<InT>>> sideInputStreams = ...;
          final MessageStream<BeamMessage<OutT>> outputStream =
              inputStream
                  .merge(sideInputStreams);
      Now fails to compile:
      incompatible types: java.util.Collection<org.apache.samza.operators.MessageStream<com.linkedin.beam.runners.samza.runtime.BeamMessage<InT>>> cannot be converted to java.util.Collection<org.apache.samza.operators.MessageStream<? extends com.linkedin.beam.runners.samza.runtime.BeamMessage<InT>>>
      This forces the user to go to raw types, which is not intuitive and certainly not type safe.
      Per http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeArguments.html#FAQ104, I believe we want the parameter type to be
      Collection<? extends MessageStream<? extends M>>
      , which does compile.
      

      Attachments

        Activity

          People

            pmaheshwari Prateek Maheshwari
            pmaheshwari Prateek Maheshwari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: