Window滑动方式:

没有数据不滑动
windowLength:窗口的时间长度/tuple个数
slidingInterval:滑动的时间间隔/tuple个数

withWindow(Duration windowLength)
1.表示每个tuple滑动一次,滑动的窗口的时间长度是windowLength。

withWindow(Duration windowLength, Duration slidingInterval)
2.表示每隔slidingInterval时间,滑动窗口,滑动的窗口的时间长度是windowLength ,没有数据不滑动。

withWindow(Count windowLength, Count slidingInterval)
3.表示每隔slidingInterval的tuple数,滑动窗口,滑动的窗口的tuple个数是windowLength ,没有数据不滑动。

withWindow(Count windowLength)
4.表示每个tuple滑动一次,滑动的窗口的tuple个数是windowLength。

withWindow(Count windowLength, Duration slidingInterval)

5.表示每隔slidingInterval时间,滑动窗口,滑动的窗口的tuple个数是windowLength ,没有数据不滑动。

withWindow(Duration windowLength, Count slidingInterval)
6.表示每隔slidingInterval的tuple数,滑动窗口,滑动的窗口的时间长度是windowLength ,没有数据不滑动。

表示图:例如每5秒滑动一次,滑动窗口大小是10秒

........| e1 e2 | e3 e4 e5 e6 | e7 e8 e9 |...
-5 0 5 10 15 -> time
|<------- w1 -->|
|<---------- w2 ----->|
|<-------------- w3 ---->|

TumblingWindow滑动方式:
withTumblingWindow(BaseWindowedBolt.Count count)
1.表示间隔count个tuple数之后滑动一次窗口

withTumblingWindow(BaseWindowedBolt.Duration duration)

2.表示间隔时长duration之后滑动一次窗口

表示图:每5秒滑动一次窗口

| e1 e2 | e3 e4 e5 e6 | e7 e8 e9 |...
0 5 10 15 -> time
w1 w2 w3

storm滑动窗口的更多相关文章

  1. Storm Windowing storm滑动窗口简介

    Storm Windowing 简介 Storm可同时处理窗口内的所有tuple.窗口可以从时间或数量上来划分,由如下两个因素决定: 窗口的长度,可以是时间间隔或Tuple数量: 滑动间隔(slidi ...

  2. storm 1.0版本滑动窗口的实现及原理

    滑动窗口在监控和统计应用的场景比较广泛,比如每隔一段时间(10s)统计最近30s的请求量或者异常次数,根据请求或者异常次数采取相应措施.在storm1.0版本之前,没有提供关于滑动窗口的实现,需要开发 ...

  3. Storm 实现滑动窗口计数和TopN排序

    计算top N words的topology, 用于比如trending topics or trending images on Twitter. 实现了滑动窗口计数和TopN排序, 比较有意思,  ...

  4. Spark-Streaming之window滑动窗口应用

    Spark-Streaming之window滑动窗口应用,Spark Streaming提供了滑动窗口操作的支持,从而让我们可以对一个滑动窗口内的数据执行计算操作.每次掉落在窗口内的RDD的数据,会被 ...

  5. 57、Spark Streaming: window滑动窗口以及热点搜索词滑动统计案例

    一.window滑动窗口 1.概述 Spark Streaming提供了滑动窗口操作的支持,从而让我们可以对一个滑动窗口内的数据执行计算操作.每次掉落在窗口内的RDD的数据, 会被聚合起来执行计算操作 ...

  6. [LeetCode] Sliding Window Maximum 滑动窗口最大值

    Given an array nums, there is a sliding window of size k which is moving from the very left of the a ...

  7. TCP/IP 协议中的滑动窗口

    一个例子明白发送缓冲区.接受缓冲区.滑动窗口协议之间的关系. 在上面的几篇文章中简单介绍了上述几个概念在TCP网络编程中的关系,也对应了几个基本socket系统调用的几个行为,这里再列举一个例子,由于 ...

  8. lintcode 滑动窗口的最大值(双端队列)

    题目链接:http://www.lintcode.com/zh-cn/problem/sliding-window-maximum/# 滑动窗口的最大值 给出一个可能包含重复的整数数组,和一个大小为  ...

  9. TCP 三次握手四次挥手, ack 报文的大小.tcp和udp的不同之处、tcp如何保证可靠的、tcp滑动窗口解释

    一.TCP三次握手和四次挥手,ACK报文的大小 首先连接需要三次握手,释放连接需要四次挥手 然后看一下连接的具体请求: [注意]中断连接端可以是Client端,也可以是Server端. [注意] 在T ...

随机推荐

  1. js基本对象

    1.介绍js的基本数据类型 Undefined.Null.Boolean.Number.String 2.js有哪些内置对象? 数据封装类对象:Object.Array.Boolean.Number ...

  2. Android中BroadcastReceiver的使用

    1.Android中广播分为静态注册和动态注册 2.下面是一个简单静态注册的例子 创建一个继承BroadcastReceiver的子类 public class DeviceBootReceiver ...

  3. wamp新建虚拟目录无法运行的解决方法

    操作步骤: 打开 D:\wamp\bin\apache\apache2.4.9\conf\httpd.conf  文件,大概在第242行 把 <Directory /> AllowOver ...

  4. Flutter自定义绘制(1)- 绘制基础

    CustomPainter Flutter 中实现绘制的主要是CustomPainter类. 我们一般继承这个类,来使用它: class MyPainter extends CustomPainter ...

  5. JS 百度地图 换地图主题颜色(自定义)

    JS 百度地图 换地图主题颜色(自定义) 可通过这个在线编辑得到自己想要的主题:https://developer.baidu.com/map/custom/ <div id="all ...

  6. LINUX安装Tree软件包

     1.将镜像光盘放入光驱中 查看当前LINUX版本号:cat  /etc/redhat-release 2.挂载镜像文件 mount  /dev/cdrom /mnt mount :挂载设备命令 /d ...

  7. js 四 windows对象

    1 window 对象 1 window对象的属性 window对象的属性,又都是对象类型的 1 screen 对象 访问screen 对象 et: console.log(window.screen ...

  8. 【leetcode】302.Smallest Rectangle Enclosing Black Pixels

    原题 An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The bl ...

  9. 关于在window8上使用ssh命令的记录

    1.开启虚拟机以及git bash窗口,准备连接 2.在虚拟机中输入ifconfig -a查看虚拟机ip 从图中找到ip为 : inet 地址:192.168.78.133 3.输入命令: ssh r ...

  10. i p _ i n s e r t o p t i o n s函数

    i p _ o u t p u t函数接收一个分组和选项.当 i p _ f o r w a r d调用该函数时,选项已经是分组的一部分,所以 i p _ f o r w a r d总是把一个空选项指 ...