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

重庆永川网站建设价格网站排名优化培训电话

重庆永川网站建设价格,网站排名优化培训电话,百度怎么发布店铺信息,备案域名批量查询文章目录 背景主要步骤代码 背景 通常使用flink 提供的高级算子来编写flink 任务,对底层不是很了解,尤其是如何生成作业图的细节 下面通过构造一个有向无环图,来实际看一下 主要步骤 1.增加source 2.增加operator 3. 增加一条边&#xff0…

文章目录

      • 背景
      • 主要步骤
      • 代码

背景

通常使用flink 提供的高级算子来编写flink 任务,对底层不是很了解,尤其是如何生成作业图的细节
下面通过构造一个有向无环图,来实际看一下

主要步骤

1.增加source
2.增加operator
3. 增加一条边,连接source和operator
4. 增加sink
5. 增加一条边,连接operator和sink

代码

 // Step 1: Create basic configurationsConfiguration configuration = new Configuration();ExecutionConfig executionConfig = new ExecutionConfig();CheckpointConfig checkpointConfig = new CheckpointConfig();SavepointRestoreSettings savepointRestoreSettings = SavepointRestoreSettings.none();// Step 2: Create a new StreamGraph instanceStreamGraph streamGraph = new StreamGraph(configuration, executionConfig, checkpointConfig, savepointRestoreSettings);// Step 3: Add a source operatorGeneratorFunction<Long, String> generatorFunction = index -> "Number: " + index;DataGeneratorSource<String> source = new DataGeneratorSource<>(generatorFunction, Long.MAX_VALUE, RateLimiterStrategy.perSecond(1), Types.STRING);SourceOperatorFactory<String> sourceOperatorFactory = new SourceOperatorFactory<>(source, WatermarkStrategy.noWatermarks());streamGraph.addSource(1, "sourceNode", "sourceDescription", sourceOperatorFactory, TypeInformation.of(String.class), TypeInformation.of(String.class), "sourceSlot");// Step 4: Add a map operator to transform the dataStreamMap<String, String> mapOperator = new StreamMap<>(new MapFunction<String, String>() {@Overridepublic String map(String value) throws Exception {return value;}});SimpleOperatorFactory<String> mapOperatorFactory = SimpleOperatorFactory.of(mapOperator);streamGraph.addOperator(2, "mapNode", "mapDescription", mapOperatorFactory, TypeInformation.of(String.class), TypeInformation.of(String.class), "mapSlot");// Step 5: Connect source and map operatorstreamGraph.addEdge(1, 2, 0);// Step 6: Add a sink operator to consume the dataStreamMap<String, String> sinkOperator = new StreamMap<>(new MapFunction<String, String>() {@Overridepublic String map(String value) throws Exception {System.out.println(value);return value;}});SimpleOperatorFactory<String> sinkOperatorFactory = SimpleOperatorFactory.of(sinkOperator);streamGraph.addSink(3, "sinkNode", "sinkDescription", sinkOperatorFactory, TypeInformation.of(String.class), TypeInformation.of(String.class), "sinkSlot");// Step 7: Connect map and sink operatorstreamGraph.addEdge(2, 3, 0);streamGraph.setTimeCharacteristic(TimeCharacteristic.ProcessingTime);streamGraph.setMaxParallelism(1,1);streamGraph.setMaxParallelism(2,1);streamGraph.setMaxParallelism(3,1);streamGraph.setGlobalStreamExchangeMode(GlobalStreamExchangeMode.ALL_EDGES_PIPELINED);// Step 8: Convert StreamGraph to JobGraphJobGraph jobGraph = streamGraph.getJobGraph();// Step 9: Set up a MiniCluster for local executionMiniClusterConfiguration miniClusterConfig = new MiniClusterConfiguration.Builder().setNumTaskManagers(10).setNumSlotsPerTaskManager(10).build();MiniCluster miniCluster = new MiniCluster(miniClusterConfig);// Step 10: Start the MiniClusterminiCluster.start();// Step 11: Submit the job to the MiniClusterJobExecutionResult result = miniCluster.executeJobBlocking(jobGraph);System.out.println("Job completed with result: " + result);// Step 12: Stop the MiniClusterminiCluster.close();
http://www.hotlads.com/news/4648.html

相关文章:

  • 网站建设基础百度百科申请百度收录网址
  • 做vue用哪个网站网络营销理论
  • 网站中的下拉菜单百度网站推广申请
  • 如何做网站豆瓣班级优化大师下载
  • 网站建设哪家公司靠谱seo公司
  • 做定制校服的网站百度seo营销推广多少钱
  • 手机网站qq登录插件网站seo优化方案项目策划书
  • 一般网站做响应式吗合肥品牌seo
  • 常州seo网站推广友情链接交换形式有哪些
  • 用jsp做电影网站的界面手机百度2022年新版本下载
  • 网站源码 com大全网络推广运营优化
  • 山西2地又检出阳性优化设计五年级下册语文答案
  • 网站改版建议pr的选择应该优先选择的链接为
  • Python做网站 性能沈阳专业seo
  • cad图做网站链接黄页网络的推广网站有哪些
  • 手机网页游戏大全seo推广外包报价表
  • 网站赞赏seo试用软件
  • 金华市建设局官方网站如何制作网页广告
  • 做黄网站用什么域名软文有哪些推广渠道
  • 做网站手机版西安疫情最新消息
  • 卡通动画网页界面设计seo公司服务
  • 企业门户网站怎么做怎么在百度推广
  • 怎么搭建个人网站电脑做服务器seo推广岗位职责
  • 湖南城乡建设部网站济南网络推广公司
  • 做网站怎么接业务免费建站免费网站
  • 网站建设大概费用软文接单平台
  • 很多搜索词网站怎样做怎样制作网页
  • 广州宣传片制作公司谷歌优化教程
  • 二次元主题wordpressseo免费优化网站
  • 人防工程做资料的网站网站安全检测工具