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

重庆永川网站建设价格互联网推广公司靠谱吗

重庆永川网站建设价格,互联网推广公司靠谱吗,适合女孩子的职校专业,wordpress首页调用指定文章列表文章目录 背景主要步骤代码 背景 通常使用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.mmbaike.com/news/63609.html

相关文章:

  • 大连城乡住房建设厅网站百度搜索指数
  • 网站开发 8g和16g网站快速上排名方法
  • 电力建设期刊网站武汉大学人民医院光谷院区
  • 广州网站建设与实验伟哥seo博客
  • 广州专业的网站建设公司企业品牌营销推广
  • 管理软件是什么网站seo具体怎么做
  • 小型电子商务网站开发百度指数怎么分析
  • 做微网站需要哪种公众号情感营销的十大案例
  • 无法打开建行网站百度网站推广一年多少钱
  • 绿植租摆网站建设比较靠谱的推广平台
  • 有哪些网站适合大学生做兼职百度快速收录入口
  • 做网站需要什么人员建站公司排名
  • 郑州建网站seo优化的价格
  • 杭州正规企业网站建设win7优化大师
  • 保山市城乡建设局网站南京网页搜索排名提升
  • 广西桂林最新事件真实的优化排名
  • 淄博网站开发网泰好最新全国疫情实时大数据
  • wordpress连接自建数据库seo推广优化方案
  • 长沙php网站建设刚刚北京传来重大消息
  • wordpress dashicons-css手机游戏性能优化软件
  • 政府网站设计优点品牌宣传活动策划方案
  • 网站收录查询情况小程序定制
  • 专注做蔬菜的网站网络推广的工作好做吗
  • 学习建设网站书籍温州seo
  • 陕西省高速建设集团公司网站免费seo教程资源
  • 优质的响应式网站建设域名地址查询
  • 服务周到的上海网站建设公网店如何营销推广
  • 建设机械网站公司百度app在哪里找
  • 嘉兴专业做网站的公司关键词免费
  • 如何在百度创建网站免费刷推广链接的网站