State Management
- windowed aggregation 比如:每个用户每小时的点击量
- 这种windowed processing通常用于ranking和relevance , 发现"trending topics ", 以及简单的实时reporting和monitoring。
- 困难在于:当一个window处理的消息很多时,如果这个window 失败了,当重启时应该如何避免需要把全部消息重新处理一遍。
- table-table join
- stream-table join
- stream-stream join
- 在一个task重启时,重新读取曾经的所有输入以重建它的state。但是通常这个state会比input stream小得多,或者input stream是不可重放的。所以重新处理原有输入是一种浪费
- 使用一个changelog流。task把它的每次状态的改变记在这个流里。changelog就是一个普通的流,可以被其它人订阅。当然changelog是不断增长的,为了避免它占用太多空间,可以使用Kafka 0.8.1提供的log compaction功能,来去掉重复的条目。
stores.my-store.factory=org.apache.samza.storage.kv.KeyValueStorageEngineFactory
# Log changes to the store to an output stream for restore
# If no changelog is specified the store will not be logged (but you can still rebuild off your input streams)
stores.my-store.changelog=kafka.my-stream-name
# The serialization format to use
stores.my-store.key.serde=string
stores.my-store.msg.serde=string
private KeyValueStore<String, String> store;
public void init(Config config, TaskContext context) {
this.store = (KeyValueStore<String, String>) context.getStore("store");
}
public void process(IncomingMessageEnvelope envelope, MessageCollector collector, TaskCoordinator coordinator) {
System.out.println("Adding " + envelope.getKey() + " => " + envelope.getMessage() + " to the store.");
store.put((String) envelope.getKey(), (String) envelope.getMessage());
}
}
State Management的更多相关文章
- angular2 学习笔记 ( 状态管理 state management )
更新 : 2017-12-29 ng5 移除 zone.js https://zhuanlan.zhihu.com/p/29577461 zone 的用途就是拦截游览器事件, 比如 click, a ...
- State management(状态管理)
State management https://en.wikipedia.org/wiki/State_management UI控件的状态管理, 例如按钮的灰化.只读.显示隐藏等. 特殊地一个控件 ...
- .NET:CLR via C# Exceptions and State Management
重点学习的个概念 unhandled exceptions constrained execution regions code contracts runtime wrapped exception ...
- Web前端的状态管理(State Management)
背景 我相信很多朋友跟我一样,初次听到什么Flux, Redux, Vuex,状态管理的时候是一脸懵逼的.因为在外面之前前端大部分开发的时候,根本没有那么多的概念.自从ReactJS火爆后,什么Flu ...
- Recoil & React official state management
Recoil & React official state management Redux Recoil.js https://recoiljs.org/ A state managemen ...
- ASP.NET MVC- JSON ,Jquery, State management and Asynch controllers
一.JSON MVC And JQuery In case you are new to JSON please read this before moving ahead with this la ...
- PatentTips - Virtual machine management using processor state information
BACKGROUND OF THE INVENTION The invention generally relates to virtual machine management, and more ...
- [Hapi.js] Managing State with Cookies
hapi has built-in support for parsing cookies from a request headers, and writing cookies to a respo ...
- 原生 JavaScript 实现 state 状态管理系统
原生 JavaScript 实现 state 状态管理系统 Build a state management system with vanilla JavaScript | CSS-Tricks 在 ...
随机推荐
- VR开发中性能问题—OculusWaitForGPU
http://blog.csdn.net/cartzhang/article/details/50788894 VR开发中性能问题-OculusWaitForGPU 本文章由cartzhang编写,转 ...
- get方法与post方法的使用
使用get方法获取页面的form内容 新建一个getform.html <html> <head> <title>Using Http Get Method< ...
- Office升级到2013版后无法登录微软账号问题
自打office从2010版升级到2013版,就再也无法登录微软账号了.每次点击登录,弹出来的框就显示:this feature has been disabled by your administr ...
- 译:Spring框架参考文档之IoC容器(未完成)
6. IoC容器 6.1 Spring IoC容器和bean介绍 这一章节介绍了Spring框架的控制反转(IoC)实现的原理.IoC也被称作依赖注入(DI).It is a process wher ...
- Bootstrap学习笔记(三) 网格系统
4-1实现原理 网格系统的实现原理非常简单,仅仅是通过定义容器大小,平分12份(也有平分成24份或32份,但12份是最常见的),再调整内外边距,最后结合媒体查询,就制作出了强大的响应式网格系统.Boo ...
- Linux C 程序 指针和字符串函数(11)
指向字符串的指针 C语言访问字符串很多方法:1.用字符数组存放一个字符串 char string[] = "Linux C"; printf("%s\n".st ...
- Chrome插件:网页截图
截图(Webpage Screenshot)是一款Chrome浏览器中的截图插件,使用它可以快速地截取网页中的全部内容. 这是介绍地址:http://chromecj.com/blogging/201 ...
- C# CRC32
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- Linux下面对于VIM编辑器的代码折叠使用与screen
VIM设置代码折叠 1. 折叠方式 可用选项 'foldmethod' 来设定折叠方式:set fdm=*****.有 6 种方法来选定折叠: manual 手工 ...
- linux 正则表达式深度解析
正则表达式的文法分为3种标准:BRE.ERE 和 ARE.其中 BER 和 ERE 属于 POSIX 标准,ARE 则是由各家定义的扩展 简介 大体来讲,正则表达式的文法分为3种标准:BRE.ER ...