当前位置: 首页 > news >正文

山东网站建设服务网站文章优化技巧

山东网站建设服务,网站文章优化技巧,武汉云优化网站建设,做网站什么程序好背景 在使用flink进行集成测试时,我们会使用MiniClusterWithClientResource类,但是当我们断点导致在某个方法执行的时间比较长时,会有错误发生,那么该如何解决这个错误呢? 处理concurrent.TimeoutException: Heartbe…

背景

在使用flink进行集成测试时,我们会使用MiniClusterWithClientResource类,但是当我们断点导致在某个方法执行的时间比较长时,会有错误发生,那么该如何解决这个错误呢?

处理concurrent.TimeoutException: Heartbeat of TaskManager with id错误

其实关键的配置是heartbeat.timeout,这个错误是JobManager抛出的,意思是和某个TaskManager的心跳中断超过了指定的时间,我们把这个参数配置到MiniClusterWithClientResource类中就可以了,代码如下所示:

public class FlinkIntegrationTest {public static final Configuration config = Configuration.fromMap(new HashMap<String, String>() {{put("heartbeat.timeout", "300000");}});@ClassRulepublic static MiniClusterWithClientResource flinkCluster =new MiniClusterWithClientResource(new MiniClusterResourceConfiguration.Builder().setConfiguration(config).setNumberSlotsPerTaskManager(1).setNumberTaskManagers(3).build());@Testpublic void testStateFlatMap() throws Exception {StatefulFlatMap statefulFlatMap = new StatefulFlatMap();StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();// configure your test environmentenv.setParallelism(2);// values are collected in a static variableCollectSink.values.clear();// create a stream of custom elements and apply transformationsenv.fromElements("world", "hi").keyBy(e -> "1").flatMap(statefulFlatMap).addSink(new CollectSink());// executeenv.execute();// verify your resultsassertTrue(CollectSink.values.containsAll(Lists.newArrayList("hello world", "hello hi world")));}@Testpublic void testStateFlatMap1() throws Exception {StatefulFlatMap statefulFlatMap = new StatefulFlatMap();StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();// configure your test environmentenv.setParallelism(2);// values are collected in a static variableCollectSink.values.clear();// create a stream of custom elements and apply transformationsenv.fromElements("world", "hi", "world").keyBy(e -> e).flatMap(statefulFlatMap).addSink(new CollectSink());// executeenv.execute();// verify your resultsassertTrue(CollectSink.values.containsAll(Lists.newArrayList("hello world", "hello hi", "hello world world")));}// create a testing sinkprivate static class CollectSink implements SinkFunction<String> {// must be staticpublic static final List<String> values = Collections.synchronizedList(new ArrayList<>());@Overridepublic void invoke(String value, Context context) throws Exception {values.add(value);}}}
http://www.mnyf.cn/news/38953.html

相关文章:

  • 新乡建站引流推广平台有哪些
  • 公司建网站多少钱百度软件安装
  • 雷神代刷推广网站站长工具网站
  • 微信订阅号做网站seo优化与推广招聘
  • wordpress 跨页面获取上海搜索引擎优化公司排名
  • 淮北发布专业搜索引擎seo服务商
  • 广州做网站商城的公司预防电信网络诈骗
  • 网站建设维护总结现在有哪些推广平台
  • flash 网站设计网站托管代运营
  • 更改网站图片seo岗位是什么意思
  • wordpress4.6手册 chm上海seo培训
  • 西安高端网站建设首选厦门人才网唯一官方网站
  • 做短视频网站有流量吗公司网站策划宣传
  • b2b2c电商网站开发网站推广app软件
  • logo是什么伊思logoseo站长综合查询
  • 搭建一个网站教程网上营销新观察网
  • 网站推广策划思路与执行个人网页设计作品欣赏
  • qwins是哪个网站做的百度搜索引擎的原理
  • 太原网站建设优化玉溪seo
  • 深圳百度推广网站建设美橙互联建站
  • 重庆定制网站制作价格百度数据
  • 国外哪些网站有黄图免费网站推广优化
  • 网站建设 用户管理seo网络推广技术员招聘
  • 一个公司的网站怎么做奶盘seo伪原创工具
  • 大兴企业网站建设公司合肥网站推广
  • 做动画 的 网站有哪些公司快速建站
  • 精神文明建设专题网站软文写作公司
  • 辽源网站建设爱站长尾词
  • 互联网技术培训机构石家庄网站优化
  • 一个网站绑定2个域名网站建设平台哪家好