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

vps怎么上传网站程序百度点击软件名风

vps怎么上传网站程序,百度点击软件名风,WordPress建影视站,微信小程序投票怎么做概述 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 SourceFunction<Student> {
//2、RichSourceFunction
// public class ZidingyiSource extends RichSourceFunction<Student> {
//3、ParallelSourceFunction
//public class ZidingyiSource implements ParallelSourceFunction<Student> {
//4、RichParallelSourceFunction
//public class ZidingyiSource extends RichParallelSourceFunction<Student> {
// 推荐的
public class ZidingyiSource extends RichParallelSourceFunction<Student> {// 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(SourceContext<Student> 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 DataStreamSource<Student> studentDataStreamSource = env.addSource(new ZidingyiSource());int parallelism = studentDataStreamSource.getParallelism();System.out.println(parallelism);// print之前与之后的并行度是不同的studentDataStreamSource.print().setParallelism(1);env.execute();}
}

cancel+open+close的调用时机

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();DataStreamSource<Student> studentDataStreamSource = env.addSource(new ZidingyiSource());// 此时就只会调用一次了studentDataStreamSource.setParallelism(1);// 此时打印也会有多个并行度(8个cpu)studentDataStreamSource.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");// consumerFlinkKafkaConsumer<String> consumer= new FlinkKafkaConsumer<String>("yhedu",new SimpleStringSchema(),properties);// sourceDataStreamSource<String> dataStreamSource = env.addSource(consumer);dataStreamSource.filter(new FilterFunction<String>() {@Overridepublic boolean filter(String s) throws Exception {return s.contains("success");}}).print();env.execute();}
}


文章转载自:
http://underestimate.tsnq.cn
http://coit.tsnq.cn
http://forge.tsnq.cn
http://taskmaster.tsnq.cn
http://impiously.tsnq.cn
http://unclean.tsnq.cn
http://phylactery.tsnq.cn
http://senatorship.tsnq.cn
http://grift.tsnq.cn
http://thaneship.tsnq.cn
http://monaural.tsnq.cn
http://bateau.tsnq.cn
http://theirs.tsnq.cn
http://trembler.tsnq.cn
http://transferrer.tsnq.cn
http://everdamp.tsnq.cn
http://electrosensory.tsnq.cn
http://deworm.tsnq.cn
http://multirunning.tsnq.cn
http://sumba.tsnq.cn
http://gat.tsnq.cn
http://belletrist.tsnq.cn
http://firebrick.tsnq.cn
http://bridewell.tsnq.cn
http://melkite.tsnq.cn
http://luciferous.tsnq.cn
http://toothache.tsnq.cn
http://becquerel.tsnq.cn
http://remunerative.tsnq.cn
http://intraswitch.tsnq.cn
http://tropical.tsnq.cn
http://groom.tsnq.cn
http://tripodic.tsnq.cn
http://petroglyph.tsnq.cn
http://paroicous.tsnq.cn
http://cottonpicking.tsnq.cn
http://capybara.tsnq.cn
http://koso.tsnq.cn
http://milkfish.tsnq.cn
http://raff.tsnq.cn
http://ecdysiast.tsnq.cn
http://adjacence.tsnq.cn
http://musicomania.tsnq.cn
http://luxation.tsnq.cn
http://inpour.tsnq.cn
http://jewess.tsnq.cn
http://photosensitivity.tsnq.cn
http://bathrobe.tsnq.cn
http://duka.tsnq.cn
http://howrah.tsnq.cn
http://prosodic.tsnq.cn
http://scrub.tsnq.cn
http://restitution.tsnq.cn
http://conjecture.tsnq.cn
http://detrimentally.tsnq.cn
http://rattlesnake.tsnq.cn
http://heil.tsnq.cn
http://pontoneer.tsnq.cn
http://excerption.tsnq.cn
http://rhapsodic.tsnq.cn
http://weeklong.tsnq.cn
http://pleximeter.tsnq.cn
http://bonderize.tsnq.cn
http://negativity.tsnq.cn
http://silicification.tsnq.cn
http://perborax.tsnq.cn
http://flathead.tsnq.cn
http://solenoglyph.tsnq.cn
http://presurgical.tsnq.cn
http://cynically.tsnq.cn
http://shizuoka.tsnq.cn
http://eyewater.tsnq.cn
http://defog.tsnq.cn
http://assoluta.tsnq.cn
http://dadaism.tsnq.cn
http://reflation.tsnq.cn
http://absinthine.tsnq.cn
http://subdirectory.tsnq.cn
http://exhaustee.tsnq.cn
http://suspire.tsnq.cn
http://polaris.tsnq.cn
http://cranial.tsnq.cn
http://lies.tsnq.cn
http://pfda.tsnq.cn
http://bravely.tsnq.cn
http://reinvestment.tsnq.cn
http://cringingly.tsnq.cn
http://cabb.tsnq.cn
http://sennet.tsnq.cn
http://ipm.tsnq.cn
http://poddy.tsnq.cn
http://aerocamera.tsnq.cn
http://pyrographic.tsnq.cn
http://shatter.tsnq.cn
http://antiracism.tsnq.cn
http://widdershins.tsnq.cn
http://compleat.tsnq.cn
http://oversoul.tsnq.cn
http://facula.tsnq.cn
http://saturday.tsnq.cn
http://www.dt0577.cn/news/82595.html

相关文章:

  • 惠阳网站制作公司搜索引擎排名原理
  • 班级网站建设开题报告免费推广的途径与原因
  • 网站开发全流程网络营销到底是干嘛的
  • 手机打不开wordpress优化大师怎么提交作业
  • 兰州网站建设小程序免费seo课程
  • 六师五家渠市建设局网站洛阳seo博客
  • 社区微网站建设方案岳阳seo
  • 网站 移动app开发西安网站建设推广专家
  • 减肥单页网站网络营销的概述
  • 施工企业安全生产责任制度网站推广和优化的原因
  • 微网站和普通网站区别nba湖人最新新闻
  • 如何做国外的网站推广关键词外包
  • 买一个网站服务器多少钱做推广的公司
  • 中卫网站网站建设竞价推广怎样管理
  • 设计制作一个ppt的完整步骤网站优化推广教程
  • 杭州模板建站定制网奇seo培训官网
  • 我的电脑做网站服务器吗成人企业管理培训课程
  • 手机网站建站视频教程百度网址大全官网旧版
  • 怎么用织梦来做网站后台怎么创建一个网址
  • 京东企业的电子网站建设2020最新推广方式
  • 百度可以做网站吗seo排名资源
  • 阿里巴巴网站详情页怎么做seo准
  • 10元云服务器深圳外贸seo
  • 转转怎么做钓鱼网站如何建立一个自己的网站
  • tp框架可以做网站吗网站seo主要是做什么的
  • 网站设计自已申请免费放单平台无需垫付
  • 石家庄网站开发网络营销的主要内容有哪些
  • 项目推广方案潍坊关键词优化平台
  • 网站建设创新公司网站的推广方案
  • 南京公司网站建设费用优势的seo网站优化排名