But suppose I want to replay value in the tuple to the older taskID or
StreamID etc. all those details will be lost . (I am doing this for
replaying tuples after state migration.)

On Tue, Mar 21, 2017 at 9:31 AM, Arun Mahadevan <[email protected]> wrote:

> Storm uses Kryo to serialize Tuples. Check this https://github.com/apache/
> storm/blob/master/storm-core/src/jvm/org/apache/storm/serialization/
> KryoTupleSerializer.java
>
>
>
> Instead of serializing the entire tuple yourself may be you just want to
> serialize the relevant values within the tuple.
>
>
>
>
>
> *From: *anshu shukla <[email protected]>
> *Reply-To: *"[email protected]" <[email protected]>
> *Date: *Tuesday, March 21, 2017 at 8:40 AM
> *To: *"[email protected]" <[email protected]>
> *Subject: *Converting storm tuple to bytearray
>
>
>
> Hello,
>
>
>
> *1- Can anyone explain how to convert storm tuple to byte array. I have
> used the following code. *
>
>
>
> *private byte*[] convertToBytes(Object object) *throws *IOException {
>
>     *try *(ByteArrayOutputStream bos = *new *ByteArrayOutputStream();
>     ObjectOutput out = *new *ObjectOutputStream(bos)) {
>
>      out.writeObject(object);
>
>         *return *bos.toByteArray(); } }
>
>
>
> *Getting the following error :*
>
> java.io.NotSerializableException: org.apache.storm.tuple.TupleImpl
>
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183)
>
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
>
> at storm.starter.OurStatefulBoltByteArrayTuple.convertToBytes(
> OurStatefulBoltByteArrayTuple.java:200)
>
>
>
> *2- If the conversion can not be done like this then how does storm does
> serialization of tuple over the network. Can anyone point me out that code
> logic? *
>



-- 
Thanks & Regards,
Anshu Shukla

Reply via email to