You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by anshu shukla <an...@gmail.com> on 2017/03/04 05:49:41 UTC

Serialization error on writing custom state (with list of tuples)

Hello all,

I am having the use case with checkpointing of tuples to redis on every
$CHKPT  message from the spout. So my code logic is trying to write List<Tuple>
to redis in preCommit method. But I am getting following serialization
error.
*Any suggestions please ?*

*EXCPETION:*
=======

java.lang.UnsupportedOperationException
        at
org.apache.storm.utils.IndifferentAccessMap.put(IndifferentAccessMap.java:16
9) ~[storm-core-1.0.3.jar:1.0.3]
        at
com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:
162) ~[kryo-3.0.3.jar:?]
        at
com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:
39) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:790)
~[kryo-3.0.
3.jar:?]
        at
com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSe
rializer.java:134) ~[kryo-3.0.3.jar:?]
        at
com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSe
rializer.java:40) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:790)
~[kryo-3.0.
3.jar:?]
        at
org.apache.storm.state.DefaultStateSerializer.deserialize(DefaultStateSerial
izer.java:76) ~[storm-core-1.0.3.jar:1.0.3]
        at
org.apache.storm.redis.state.RedisKeyValueState.get(RedisKeyValueState.java:
143) ~[stormjar.jar:1.0.3]
        at
org.apache.storm.redis.state.RedisKeyValueState.get(RedisKeyValueState.java:
151) ~[stormjar.jar:1.0.3]
        at
storm.starter.OurStatefulBolt.initState(OurStatefulBolt.java:101) ~[stormjar
.jar:1.0.3]
        at storm.starter.OurStatefulBolt.initState(OurStatefulBolt.java:20)
~[stormjar.
:

-- 
Thanks & Regards,
Anshu Shukla

Re: Serialization error on writing custom state (with list of tuples)

Posted by Sree V <sr...@yahoo.com>.
That put() method is not implemented, Anshu.Along with clear(), putAll() and remove() are not implemented.
And they throw that exception to say that they are not implemented.
Feel free to implement them and contribute back ;-)
Thanking you.
With Regards
Sree 

    On Friday, March 3, 2017 9:49 PM, anshu shukla <an...@gmail.com> wrote:
 

 Hello all,
I am having the use case with checkpointing of tuples to redis on every $CHKPT  message from the spout. So my code logic is trying to write List<Tuple> to redis in preCommit method. But I am getting following serialization error. Any suggestions please ? 
EXCPETION:=======
java.lang.UnsupportedOperationException        at org.apache.storm.utils.IndifferentAccessMap.put(IndifferentAccessMap.java:169) ~[storm-core-1.0.3.jar:1.0.3]        at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:162) ~[kryo-3.0.3.jar:?]        at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:39) ~[kryo-3.0.3.jar:?]        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:790) ~[kryo-3.0.3.jar:?]        at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) ~[kryo-3.0.3.jar:?]        at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) ~[kryo-3.0.3.jar:?]        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:790) ~[kryo-3.0.3.jar:?]        at org.apache.storm.state.DefaultStateSerializer.deserialize(DefaultStateSerializer.java:76) ~[storm-core-1.0.3.jar:1.0.3]        at org.apache.storm.redis.state.RedisKeyValueState.get(RedisKeyValueState.java:143) ~[stormjar.jar:1.0.3]        at org.apache.storm.redis.state.RedisKeyValueState.get(RedisKeyValueState.java:151) ~[stormjar.jar:1.0.3]        at storm.starter.OurStatefulBolt.initState(OurStatefulBolt.java:101) ~[stormjar.jar:1.0.3]        at storm.starter.OurStatefulBolt.initState(OurStatefulBolt.java:20) ~[stormjar.:
-- 
Thanks & Regards,
Anshu Shukla