Prateek Maheshwari created SAMZA-1253:
-----------------------------------------
Summary: MessageStream.merge operator broken for nested types
Key: SAMZA-1253
URL: https://issues.apache.org/jira/browse/SAMZA-1253
Project: Samza
Issue Type: Bug
Reporter: Prateek Maheshwari
Assignee: Prateek Maheshwari
Fix For: 0.13.0
>From [~cpettitt-linkedin]:
{code}
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.
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)