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

外贸网站推广 雅虎问答有用吗深圳昨天下午出大事

外贸网站推广 雅虎问答有用吗,深圳昨天下午出大事,网站宣传用了最字,wordpress5.0文章编辑器概述 SourceFunction:非并行数据源(并行度只能1) --接口 RichSourceFunction:多功能非并行数据源(并行度只能1) --类 ParallelSourceFunction:并行数据源(并行度能够1) --接口 RichParallelSourceFunction:多功能并行数据源(并行度能够1) --类 【建议使用的】 ——…概述 SourceFunction:非并行数据源(并行度只能1) --接口 RichSourceFunction:多功能非并行数据源(并行度只能1) --类 ParallelSourceFunction:并行数据源(并行度能够1) --接口 RichParallelSourceFunction:多功能并行数据源(并行度能够1) --类 【建议使用的】 ——Rich 字样代表富有在编程中富有代表可以调用的方法很多功能很全的意思。 基础案例 package com.bigdata.day02;//1、SourceFunction // public class ZidingyiSource implements SourceFunctionStudent { //2、RichSourceFunction // public class ZidingyiSource extends RichSourceFunctionStudent { //3、ParallelSourceFunction //public class ZidingyiSource implements ParallelSourceFunctionStudent { //4、RichParallelSourceFunction //public class ZidingyiSource extends RichParallelSourceFunctionStudent { // 推荐的 public class ZidingyiSource extends RichParallelSourceFunctionStudent {// ctrl oprivate final Random random new Random();private boolean flag true;// 现在不用Overridepublic void open(Configuration parameters) throws Exception {System.out.println(实现一些资源的开启);}// 现在不用Overridepublic void close() throws Exception {System.out.println(实现一些资源的关闭);}Overridepublic void run(SourceContextStudent sourceContext) throws Exception {while (flag){String stu_id UUID.randomUUID().toString();String stu_name Student_stu_id;int stu_age random.nextInt(8)10;long stu_timestamp System.currentTimeMillis();Student student new Student(stu_id,stu_name,stu_age,stu_timestamp);sourceContext.collect(student);Thread.sleep(1000);}}// 具体什么时候 会调用还不知道Overridepublic void cancel() {flag false;System.out.println(停止运行);} }//调用 public class ZiDingYi {public static void main(String[] args) throws Exception {StreamExecutionEnvironment env StreamExecutionEnvironment.getExecutionEnvironment();// add new DataStreamSourceStudent studentDataStreamSource env.addSource(new ZidingyiSource());int parallelism studentDataStreamSource.getParallelism();System.out.println(parallelism);// print之前与之后的并行度是不同的studentDataStreamSource.print().setParallelism(1);env.execute();} } cancelopenclose的调用时机 package com.bigdata.day02;import java.util.Objects;/* * 1、这几个方法都会按照并行度调用多次 调度的次数 按照studentDataStreamSource的并行度 * */public class ZiDingYi {public static void main(String[] args) throws Exception {// 在上面案例的基础上实现StreamExecutionEnvironment env StreamExecutionEnvironment.getExecutionEnvironment();DataStreamSourceStudent studentDataStreamSource env.addSource(new ZidingyiSource());// 此时就只会调用一次了studentDataStreamSource.setParallelism(1);// 此时打印也会有多个并行度8个cpustudentDataStreamSource.print();// 异步调用 此时会调用open方法JobExecutionResult execute env.execute();JobClient flink_job env.executeAsync(Flink Job);Thread.sleep(3000);// 此时会调用 cancel 和 close flink_job.cancel();} } kafkaSource package com.bigdata.day02;import java.util.Properties;public class KafkaSource {public static void main(String[] args) throws Exception{//envStreamExecutionEnvironment env StreamExecutionEnvironment.getExecutionEnvironment();// properties Properties properties new Properties();properties.setProperty(bootstrap.servers, bigdata01:9092);properties.setProperty(group.id, g1);// consumerFlinkKafkaConsumerString consumer new FlinkKafkaConsumerString(yhedu,new SimpleStringSchema(),properties);// sourceDataStreamSourceString dataStreamSource env.addSource(consumer);dataStreamSource.filter(new FilterFunctionString() {Overridepublic boolean filter(String s) throws Exception {return s.contains(success);}}).print();env.execute();} }
http://www.hkea.cn/news/14561734/

相关文章:

  • 苍南网站制作wordpress调用热门标签
  • 北京网站设计开发公司网站开发微盘
  • 一个做品牌零食特卖的网站中小微企业名录库
  • 网站建设对信息公开的作用网站建设便宜的公司哪家好
  • 灵宝网站制作工作室网页设计公司济南兴田德润优惠吗
  • 国外推广网站有哪些吉林省城市建设学校网站
  • 梧州网站建设定制怎么样提高网站点击率
  • 企业网站模块wordpress 导出相册
  • 网站上线步骤团队介绍网站模板
  • 建站模板大全辽宁建设工程信息网ca锁激活
  • 防城港网站建设温岭网站建设公司
  • 企业网站网络推广怎么做微信上打开连接的网站怎么做的
  • 珠宝网站形象设计销售平台有哪些
  • 泉州网站设计网站后台打不开的原因
  • 北京网站建设方案飞沐跟黄聪学WordPress主题开发
  • 网站上面的内容里面放照片怎么做的ui设计就业方向
  • 淘宝客15套单页网站程序模板打包网站建设公司相关资质
  • 网站平台开发与应用面试网络拓扑
  • python做电商网站wordpress调用分类图片大小
  • 企业网站备案 淘宝客金山网站建设公司
  • 会计上大额网站费如何做分录wordpress中文英文切换
  • 网站建设宣传图片合肥网站制作哪家有名
  • 网站建设过程中什么最重要红河科技公司 网站建设
  • 做一个商城网站需要什么流程郑州做网站的公司有哪些
  • 帝国网站地图插件空间怎么做网站
  • 郑州网站制作_郑州网页制作_做网站设计_河南网站制作网湖南网站建设价格
  • 门户网站建设原则网站建设珠江摩尔
  • 网站排名如何上升太原seo外包服务
  • 网站流量不够嘉兴高端网站
  • 搭建网站大概多少钱公司网站建站要多少钱