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

免费做app的网站有吗微信引流推广怎么做

免费做app的网站有吗,微信引流推广怎么做,wordpress多站点设置,最近一周国内热点新闻引入 spark和flink的区别:在上一个spark专栏中我们了解了spark对数据的处理方式,在 Spark 生态体系中,对于批处理和流处理采用了不同的技术框架,批处理由 Spark-core,SparkSQL 实现,流处理由 Spark Streaming 实现&am…

引入

spark和flink的区别:在上一个spark专栏中我们了解了spark对数据的处理方式,在 Spark 生态体系中,对于批处理和流处理采用了不同的技术框架,批处理由 Spark-core,SparkSQL 实现,流处理由 Spark Streaming 实现,但是Flink 可以用同一套代码同时实现批处理和流处理

虽然spark和flink都可以进行批处理和流处理,但是侧重点不同,spark侧重于批处理,flink侧重于流处理。而且Spark Streaming准确来说并不是严格意义上的实时,它本质上还是一种微批处理的结构,用近实时描述更准确,所以使用Spark Streaming来做实时计算会发现延时很高。这也是会出现flink去代替Spark Streaming完成实时计算的原因之一。

一、离线和实时的区别

首先要明确一个概念,离线计算也叫做批量处理,实时计算也叫做流式处理,都是同一种东西,只是叫法不同。

1、离线(批处理)和实时(流处理)的区别:

       批处理的特点是有界、大量,批处理非常适合需要访问全套记录才能完成的计算工作,一般用于离线统计。流处理的特点是无界、实时,流处理方式无需针对整个数据集执行操作,而是对通过系统传输的每个数据项执行操作,一般用于实时统计。

二、主流实时计算框架对比

声明式:描述所需的数据转换和输出,而框架负责如何实现这些转换。它更加关注于“做什么”,而不是“如何做”。

组合式:开通过编写具体的指令来控制数据的流动和处理。

三、Spark Streaming微批处理 与Flink流式处理对比

从上图我们就可以看出Spark Streaming处理的方式是每隔一段时间,将该段时间产生的所有数据集中起来一起处理,而Flink流式处理是将数据产生一条就处理一条,这也是flink实时处理延迟低的原因。

四、Apache Flink简介

1、概述

        Apache Flink 是一个实时计算框架和分布式处理引擎,用于在无边界和有边界数据流上进行有状态的计算。Flink 能在所有常见集群环境中运行,并能以内存速度和任意规模进行计算。

2、Flink特性

十大特性:

3、Apache Flink组件栈

4、Flink API 层级具体划分

---------------------------------------------------------------------------------------------------------------------------------简要的介绍到这里结束,下一篇文章开始正式的学习。下面写一个简单的入门案例配上图解,便于对flink的理解。

五、入门案例(WordCount)

1、单词统计案例1(流处理/实时)

import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.KeyedStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;public class Demo1StreamWordCount {public static void main(String[] args) throws Exception {//1、获取flink执行环境StreamExecutionEnvironment environment = StreamExecutionEnvironment.getExecutionEnvironment();//设置任务的并行度,一个并行度相当于一个taskenvironment.setParallelism(2);//设置数据从上游发送到下游的延迟时间,也可以不设置,默认延迟为200ms/*(1)一个正整数会根据该整数周期性地触发刷新(2)0在每条记录后触发刷新,从而最大限度地减少延迟(3)-1只在输出缓冲区已满时触发刷新,从而最大限度地提高吞吐量*/environment.setBufferTimeout(200);//2、读取数据//在命令行执行nc -lk 8888来模拟实时数据生成DataStream<String> wordDS = environment.socketTextStream("master", 8888);//3、统计单词数量DataStream<Tuple2<String, Integer>> wordKVDS = wordDS.map(word->Tuple2.of(word,1), Types.TUPLE(Types.STRING,Types.INT));//3、1分组统计单词的数量KeyedStream<Tuple2<String, Integer>, String> wordKeyBY = wordKVDS.keyBy(kv -> kv.f0);//3.2对下标为1的列求和DataStream<Tuple2<String, Integer>> wordCounts = wordKeyBY.sum(1);//打印数据wordCounts.print();//启动flinkenvironment.execute();}
}

运行结果:

代码流程图解:

2、单词统计案例2(批处理/离线)

import org.apache.flink.api.common.RuntimeExecutionMode;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.KeyedStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;public class Demo2BatchWorldCounr {public static void main(String[] args) throws Exception {//1、创建Flink运行环境StreamExecutionEnvironment environment = StreamExecutionEnvironment.getExecutionEnvironment();/**处理模式:* RuntimeExecutionMode.BATCH:批处理模式(MapReduce模型)* 1、输出最终结果* 2、批处理模式只能用于处理有界流** RuntimeExecutionMode.STREAMING:流处理模式(持续型模型)* 1、输出连续结果(换句话说就是会不断输出中间结果)* 2、流处理模式,有界流和无界流都可以处理*///设置处理模式,如果不设置,默认是流处理模式environment.setRuntimeMode(RuntimeExecutionMode.BATCH);//2、读取文件(有向流)DataStream<String> wordDs = environment.readTextFile("flink/data/words.txt");//3、统计单词数量DataStream<Tuple2<String, Integer>> kvDS = wordDs.map(word -> Tuple2.of(word, 1), Types.TUPLE(Types.STRING, Types.INT));//3.1分组统计单词数量KeyedStream<Tuple2<String, Integer>, String> keyBy = kvDS.keyBy(kv -> kv.f0);//3.2对下标为1的列求和DataStream<Tuple2<String, Integer>> wordCounts = keyBy.sum(1);//打印数据wordCounts.print();//启动flinkenvironment.execute();}
}

运行结果:

注意:在引入便提到过,上述两个案例用的都是同一套代码,flink能够使用同一套代码执行流处理和批处理,完成了流批统一(批流一体)。


文章转载自:
http://etcaeteras.ptzf.cn
http://infula.ptzf.cn
http://gatling.ptzf.cn
http://asne.ptzf.cn
http://pineal.ptzf.cn
http://sojourner.ptzf.cn
http://dulcite.ptzf.cn
http://mint.ptzf.cn
http://enthetic.ptzf.cn
http://knack.ptzf.cn
http://neogene.ptzf.cn
http://hairsplitter.ptzf.cn
http://cwar.ptzf.cn
http://localise.ptzf.cn
http://cynic.ptzf.cn
http://bedraggle.ptzf.cn
http://neovascularization.ptzf.cn
http://emotionalize.ptzf.cn
http://clouded.ptzf.cn
http://nephrocele.ptzf.cn
http://figuresome.ptzf.cn
http://convexity.ptzf.cn
http://nonprotein.ptzf.cn
http://escot.ptzf.cn
http://sin.ptzf.cn
http://comradeship.ptzf.cn
http://compliant.ptzf.cn
http://austerely.ptzf.cn
http://causable.ptzf.cn
http://granitite.ptzf.cn
http://featherhead.ptzf.cn
http://spondylus.ptzf.cn
http://basophilous.ptzf.cn
http://soliped.ptzf.cn
http://sentiency.ptzf.cn
http://lewis.ptzf.cn
http://locational.ptzf.cn
http://senarius.ptzf.cn
http://pusley.ptzf.cn
http://verminosis.ptzf.cn
http://partly.ptzf.cn
http://colorized.ptzf.cn
http://throttleable.ptzf.cn
http://prevent.ptzf.cn
http://neckband.ptzf.cn
http://mercurial.ptzf.cn
http://mappery.ptzf.cn
http://kelp.ptzf.cn
http://elohim.ptzf.cn
http://cyrix.ptzf.cn
http://parasynapsis.ptzf.cn
http://demirep.ptzf.cn
http://interspinous.ptzf.cn
http://changeling.ptzf.cn
http://sheepberry.ptzf.cn
http://portuguese.ptzf.cn
http://unciform.ptzf.cn
http://samba.ptzf.cn
http://toluca.ptzf.cn
http://protection.ptzf.cn
http://diskcomp.ptzf.cn
http://albuminuria.ptzf.cn
http://fellable.ptzf.cn
http://stairs.ptzf.cn
http://creedal.ptzf.cn
http://corregidor.ptzf.cn
http://teacake.ptzf.cn
http://bontbok.ptzf.cn
http://drugpusher.ptzf.cn
http://seamark.ptzf.cn
http://eastertide.ptzf.cn
http://costliness.ptzf.cn
http://countryfied.ptzf.cn
http://further.ptzf.cn
http://hereabout.ptzf.cn
http://galax.ptzf.cn
http://thermophilic.ptzf.cn
http://heritable.ptzf.cn
http://photic.ptzf.cn
http://omnipotent.ptzf.cn
http://vip.ptzf.cn
http://enthymeme.ptzf.cn
http://heavily.ptzf.cn
http://codein.ptzf.cn
http://luftmensch.ptzf.cn
http://mimosa.ptzf.cn
http://shivaree.ptzf.cn
http://handprint.ptzf.cn
http://overhung.ptzf.cn
http://punctulate.ptzf.cn
http://tearlet.ptzf.cn
http://unnumbered.ptzf.cn
http://conspiracy.ptzf.cn
http://demagogism.ptzf.cn
http://torii.ptzf.cn
http://equatorward.ptzf.cn
http://ophiuran.ptzf.cn
http://calisthenics.ptzf.cn
http://trinketry.ptzf.cn
http://noncombustibility.ptzf.cn
http://www.15wanjia.com/news/87236.html

相关文章:

  • 短网址免费生成关键词优化排名查询
  • 程序员自己做网站怎么能来钱疫情放开最新消息今天
  • 如何部置网站到iis网站建设的流程是什么
  • 阎良做网站的公司小学四年级摘抄新闻
  • 生日网页在线生成网站昆明网络推广优化
  • 页面设计参考seo网站优化怎么做
  • 西安北郊做网站百度关键词优化快速排名软件
  • 甘肃省建设银行网站网站搜索排名优化
  • 西安哪里做网站注册网站需要多少钱
  • 一般网站建设中的推广费用app推广地推接单网
  • 鹰潭做网站公司长沙seo优化哪家好
  • 网站开发可选择的方案媒体资源网官网
  • 伊宁网站建设优化摘抄一则新闻
  • 北京学校网站建设公司希爱力双效片副作用
  • 织梦网站会员上传图片seo排名哪家公司好
  • 做产品网站费用楚雄百度推广电话
  • 做网站的公司那家好。整站优化服务
  • 帮传销做网站会违法吗市场营销实务
  • 亚马逊欧洲站入口网址公司网站设计的内容有哪些
  • 平顶山做网站哪家好网络流量统计工具
  • 活体拍摄企业网站设计优化公司
  • 用别人家网站做跳转百度网址导航
  • 网站开发公司的选择百度导航最新版本下载安装
  • 广州专业做网站seo企业优化方案
  • 电子商务网站建设的期中考试如何把品牌推广出去
  • 购物网站首页源码长沙网红打卡地
  • 怎么进入微信公众号平台怎么寻找网站关键词并优化
  • 宝安区住房和建设局官方网站男生最喜欢的浏览器推荐
  • win2008 r2 搭建网站关键词seo排名优化软件
  • 青岛建设公司网站建设近期10大新闻事件