Recently I have a netizen to see my "Integrated Kafka to spark streaming--code demonstration Samples and challenges" article,
The Kafka object is placed in the pool and broadcast through broadcast:
Then in the development test phase of the error such as the following:
Then you come to me and say, "The code is almost the same as yours, why do you report this mistake?" ”
In fact, for broadcast operations. Spark must have a serial number, and try not to broadcast the big object.
Later the code came to look down. Find Createkafkaproducerpool This method, create a separate class, the same time this class extends Serializable. What I was feeling was, suppose the Createkafkaproducerpool method. Writing in the main method or driver side should certainly not have this problem, I also recommend this. And I suspect that the cluster is enabled with the Kryo serial number method. And Createkafkaproducerpool method of the class incredibly extends Serializable, puzzled
Important
The closures (anon function going inside rdd.map (...)) is serialized by Spark before distributing them. Hadoop does not has this problem because it binary-serializes the whole. Jar and copies it over the network. Spark uses javaserialization by default, but it's very slow compared to, say, Kryo. So we use the Kryo to does, by using a wrapper (Spark doesn ' t support kryo-serde for closures, not yet).
And Uptill now the Org.dbpedia.extraction.spark.serializeKryoSerializationWrapper class has been working perfectly. Some Freak extractors seem to fail though.
Articles retrieved based on this error
- Https://github.com/dbpedia/distributed-extraction-framework/issues/9
- Http://stackoverflow.com/questions/27277015/sparkcontext-broadcast-jedispool-not-work
- http://apache-spark-user-list.1001560.n3.nabble.com/ Why-does-quot-com-esotericsoftware-kryo-kryoexception-java-u-til-concurrentmodificationexception-quo-tc23067.html
If you have such a problem or some good idea, please reply, THX ~
Com.esotericsoftware.kryo.kryoexception java.util.ConcurentModificationException