com.esotericsoftware.kryo.kryoexception java.util.ConcurentModificationException
近期 有网友看我的“整合Kafka到Spark Streaming——代码演示样例和挑战”文章,
讲 kafka对象 放到 pool 并通过broadcast广播出去:
然后 在开发測试阶段 报错例如以下:
然后就找我,说“代码都跟你的差点儿相同呀,为什么就报这个错呢?”
事实上 对于广播操作。spark 肯定要序列号的,还有尽量不要把大对象广播出去,
后来 把代码要过来看了下。发现 createKafkaProducerPool这种方法 ,单独创建了一个类,同一时候这个类 extends Serializable 。我当时的感觉就是,假设createKafkaProducerPool方法 。写在main方法 or Driver端 应该就肯定不会有这个问题,我也建议这样搞的。还有 我怀疑 集群是启用了Kryo序列号方式。而createKafkaProducerPool方法所在类居然 extends Serializable ,不解
important:
The closures (anon function going inside RDD.map(…)) are serialized by Spark before distributing them. Hadoop does not have this problem because it binary-serializes the whole .jar and copies it over the network. Spark uses JavaSerialization by default, but it is very slow compared to, say, Kryo. So we use Kryo to do that 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.
依据这个错误检索的文章
- 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
假设大家有遇到这样问题或者什么好想法,请回复,THX ~
com.esotericsoftware.kryo.kryoexception java.util.ConcurentModificationException的更多相关文章
- 【转】java.util.Arrays.asList 的用法
DK 1.4对java.util.Arrays.asList的定义,函数参数是Object[].所以,在1.4中asList()并不支持基本类型的数组作参数. JDK 1.5中,java.util.A ...
- Java程序日志:java.util.logging.Logger类
一.Logger 的级别 比log4j的级别详细,全部定义在java.util.logging.Level里面.各级别按降序排列如下:SEVERE(最高值)WARNINGINFOCONFIGFINEF ...
- Android中使用java.util.Properties犯的错
今天尝试使用java.util.Properties来保存应用配置,然而遇到了好几个问题,对于熟悉此内容的来说可能都是猪一样的错误,但难免有像我一样的新手再次遇到,希望此文能有所帮助. 错误1 jav ...
- java.util.ConcurrentModificationException 解决办法(转载)
今天在项目的中有一个需求,需要在一个Set类型的集合中删除满足条件的对象,这时想当然地想到直接调用Set的remove(Object o)方法将指定的对象删除即可,测试代码: public cla ...
- java util 下的concurrent包
------------------------------------------java util 下的concurrent包--------并发包--------------------.jav ...
- 原子类java.util.concurrent.atomic.*原理分析
原子类java.util.concurrent.atomic.*原理分析 在并发编程下,原子操作类的应用可以说是无处不在的.为解决线程安全的读写提供了很大的便利. 原子类保证原子的两个关键的点就是:可 ...
- 错误:java.util.Map is an interface, and JAXB can't handle interfaces.
问题: 在整合spring+cxf时报错java.util.Map is an interface, and JAXB can't handle interfaces. 解决方法: 将服务端的serv ...
- 解决springmvc报No converter found for return value of type: class java.util.ArrayList问题
一.背景 最近闲来无事,想自己搭建一套Spring+SpringMVC+Mybatis+Mysql的环境(搭建步骤会在以后博客中给出),结果运行程序时,适用@ResponseBody注解进行返回Lis ...
- Java源码之 java.util.concurrent 学习笔记01
准备花点时间看看 java.util.concurrent这个包的源代码,来提高自己对Java的认识,努力~~~ 参阅了@梧留柒的博客!边看源码,边通过前辈的博客学习! 包下的代码结构分类: 1.ja ...
随机推荐
- bzoj 1934 最小割
收获: 1.流量为0的边可以不加入. 2.最小割方案要与决策方案对应. #include <cstdio> #include <cmath> #include <cstr ...
- python开发_tkinter_菜单的不同选项
python的tkinter模块中,菜单也可以由你自定义你的风格 下面是我做的demo 运行效果: ====================================== 代码部分: ===== ...
- poj 3660 Cow Contest Flyod
Cow Contest Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5989 Accepted: 3234 Descr ...
- POJ 1321 棋盘问题 DFS 期末前水一水就好……
A - 棋盘问题 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Sta ...
- GPS坐标定位与距离计算
Android获取当前位置(GPS和网络定位) 1.比较: GPS准确度高但耗电多,网络定位耗电少但准确度低 2.代码 ①添加权限: AndroidManifest.xml: <!-- 两种pr ...
- 文件上传demo
前端代码: <form action="upload.php" enctype="multipart/form-data" method="po ...
- spring---aop(7)---Spring AOP中expose-proxy介绍
写在前面 expose-proxy.为是否暴露当前代理对象为ThreadLocal模式. SpringAOP对于最外层的函数只拦截public方法,不拦截protected和private方法(后续讲 ...
- python 编程语言基础技术框架
python标识符身份 id方法查看唯一标示符,内存地址 >>> a = "str" >>> b = 2 >>> id(a) ...
- Android File Hierarchy : System Structure Architecture Layout
Most of the Android user are using their Android phone just for calls, SMS, browsing and basic apps, ...
- x-superobject
x-superobject GITHUB: https://github.com/onryldz/x-superobject **Delphi Cross Platform Rapid JSON**- ...