Just found out there is another way:
http://stackoverflow.com/questions/106336/how-do-i-find-out-what-type-each-object-is-in-a-arraylistobject

On Tue, May 24, 2016 at 4:47 PM, Sinnema, Remon <[email protected]>
wrote:

> You could emit an extra boolean field to distinguish the two cases.
>
>
>
> *From:* Navin Ipe [mailto:[email protected]]
> *Sent:* dinsdag 24 mei 2016 12:52
> *To:* [email protected]
> *Subject:* Distinguishing between streams in an ack() or fail()
>
>
>
> Hi,
>
> In my spout, I'm emitting a string as the messageID and under some
> conditions, I'm also emitting a stream with an ArrayList of strings as the
> tuple.
>
> if (something) {
> collector.emit(new Values(stringTuples), somestring);//tuples, messageID
>
> } else {
>
> collector.emit("streamName1", new Values(anArrayList));
> }
>
> Is there an inbuilt way in ack(Object msgId) to distinguish between the
> ack of streamName1 vs the default stream? Because msgId will have to be
> cast into either a String or an ArrayList.
>
> The only way I can think of it now, is to use a try-catch. Try for String
> casting. If an exception is thrown, catch it and cast as ArrayList.
>
> Is this the best way?
>
>
> --
>
> Regards,
>
> Navin
>



-- 
Regards,
Navin

Reply via email to