You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by rishi007bansod <ri...@gmail.com> on 2017/01/11 13:35:15 UTC

Convert stream data

Stream data coming to ignite data streamer is of form <String, String>
I want to convert this <key, value> type to user defined objects 
For example, <String, String> ==> <Integer, String> 
I have read about stream adapter, but there is no example explaining how
this can be done. Is there any example for same?(so that data gets added in
<Integer, String> format only). 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Convert-stream-data-key-value-tp10033.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Convert stream data

Posted by Andrey Gura <ag...@apache.org>.
You can just wrap your IgniteDataStreamer instance, override addData()
method and pass this wrapper instance to your streamer (I suspect it
is KafkaStreamer). All conversions you can execute in overriden
addData() method.

On Thu, Jan 12, 2017 at 7:40 AM, rishi007bansod
<ri...@gmail.com> wrote:
> So, you are suggesting generics in streamadaptor should be modified to
> <object,object> from <string,string> in my case? But keydecoder and
> valuedecoder  used with stream allows only string(or byte array) format
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Convert-stream-data-key-value-tp10033p10050.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Convert stream data

Posted by rishi007bansod <ri...@gmail.com>.
ok :) thanks!!



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Convert-stream-data-key-value-tp10033p10069.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Convert stream data

Posted by vkulichenko <va...@gmail.com>.
Well, you should've mentioned that you're using KafkaStreamer :) If so, then
this was indeed fixed in IGNITE-4140, but as it's backward incompatible
change, it will be available only in 2.0/

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Convert-stream-data-key-value-tp10033p10064.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Convert stream data

Posted by rishi007bansod <ri...@gmail.com>.
So, you are suggesting generics in streamadaptor should be modified to
<object,object> from <string,string> in my case? But keydecoder and
valuedecoder  used with stream allows only string(or byte array) format



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Convert-stream-data-key-value-tp10033p10050.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Convert stream data

Posted by vkulichenko <va...@gmail.com>.
Current API doesn't really allow this if you use specific generics. However,
you can do this in unchecked manner and switch to <Object, Object>. A little
dirty, but should work.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Convert-stream-data-key-value-tp10033p10044.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.