klion26.com
实时计算 | klion26
http://www.klion26.com/category/实时计算
8216;实时计算’ 分类的存档. Spark Streaming 从 Kafka 读取 binlog 转换成 Json. 在开发 Spark Streaming 的公共组件过程中,需要将 binlog 的数据(Array[Byte])转换为 Json 格式,供用户使用,本文提供一种转换的思路。 对于 binlog 数据,每一次操作(INSERT/UPDATE/DELETE 等 都会作为一条记录写入 binlog 文件,但是同一条记录可能包含数据库中的几行数据 这里比较绕,可以看一个具体的例子. 在数据库中,有 id, name,age 三个字段,其中 id 为主键,name 随意, age 随意。 Update table set age = 50 where name = "john". 将 Array[Byte] 数据转换成 com.meituan.data.binlog.BinlogEntry 类,相关类定义参考附录. 获取主键,这里的 asScala 将 Java 的 List 转换为 Scala 的 List. 返回转换后的 beforeColumns 和 afterColumns.
klion26.com
Redis 中快排算法详解(pqsort.c) | klion26
http://www.klion26.com/redis-pqsort-c.html
中的思想是一篇叫做 Engineering a Sort Function. Define SWAPINIT(a, es) swaptype = ( char *)a - (char *)0) % sizeof(long) es % sizeof(long)? 2 : es = sizeof(long)? Define SWAPINIT(a, es) swaptype = ( char *)a - (char *)0) % sizeof(long). 数组首地址不对齐 或者首地址对齐,但是数组元素所占的字节数不能整除 sizeof(long) 的。 对于第一种和第二种,直接按照 long 类型来交换,其他的则按照 char 类型来交换。 If (swaptype = 1) swapcode(long, a, b, n) else swapcode(char, a, b, n). 对于交换,本方法由于把数据分为了小于 pivot 的,大于 pivot 的和等于 pivot 的。 然后我们需要把小于 pivot 的所有元素换到数组的最左边,把原来数组最右边的等于 pivot 的所有元素B换到数组的中间。
klion26.com
Books | klion26
http://www.klion26.com/books
算法 C语言实现 第 1-4 部分. Structure and Interpretation of Computer Programs. The Linux Programming Interface. Computer Systems: A Programmer's Perspective. Asking the Right Questions/学会提问. USACO 5.1.2 Starry Night. XP安装office 2010 Error 1406. Learn algorithm from scratch. 提供, 通过 XHTML 1.1.
klion26.com
apache-storm | klion26
http://www.klion26.com/tag/apache-storm
文章标签 ‘apache-storm’. Tuples are randomly distributed across the bolt's tasks in a way such that each bolt is guaranteed to get an equal number of tuples. The stream is partitioned by the fields specified in the grouping. For example, if the stream is grouped by the "user-id" field, tuples with the same "user-id" will always go to the same task, but tuples with different "user-id"'s may go to different tasks. Provides a good explanation of how it works and the advantages it provides. 其中 Shuffle 和 None 都是随...
klion26.com
Storm 初探 | klion26
http://www.klion26.com/a-brief-view-of-storm.html
因为底层使用 Thrift 来定义和提交 Topology Storm 中的一种结构 ,Storm 可以使用任何语言来进行编程。 每秒可以每个节点可以处理百万级别的 Tuple Storm 中的一种结构。 首先介绍 Storm 中几个结构的定义,分别是 Tuples, Stream, Spout, Bolt, Topology, Task. Stream 是无边界的 Tuple 组成的数据流,可以理解为 Tuple 的流动. Spout 是程序的数据来源,由用户指定,指定之后,所有的数据都从 spout 发出. Topology 是包括 spout,stream,bolt 的一个完整流程,表示数据从开始到结束的整个过程,每一个 Topology 定义了数据的来源,中间需要怎么转换,以及最后输出到哪. Task Spout 或者 Bolt 中实际处理数据的单元,每一个 Spout 或 Bolt 可以包含多个 Task. 如果是直接通信的话,那么需要 Nimbus 和 Supervisor 同时有空才可以,这样是不太现实的。 由于每个 Bolt 有多个 Task 存在,那么对于 Tuple 传给哪一个对应的...
klion26.com
github | klion26
http://www.klion26.com/tag/github
文章标签 ‘github’. 让 Github Blog 支持数学公式. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Show me the code. 1 在图片的右上角加...
klion26.com
grouping | klion26
http://www.klion26.com/tag/grouping
文章标签 ‘grouping’. Tuples are randomly distributed across the bolt's tasks in a way such that each bolt is guaranteed to get an equal number of tuples. The stream is partitioned by the fields specified in the grouping. For example, if the stream is grouped by the "user-id" field, tuples with the same "user-id" will always go to the same task, but tuples with different "user-id"'s may go to different tasks. Provides a good explanation of how it works and the advantages it provides. 其中 Shuffle 和 None 都是随机模式,...
klion26.com
我的生活 | klion26
http://www.klion26.com/category/my_life
8216;我的生活’ 分类的存档. 长大后,如果有人对你说,你不会吃饭,你一定觉得 TA 是傻子,但是别人质疑你做不成某件事的时候,你可能就会相信 TA 的说法,因为你已经成功的吃饭几十年了。 刘江老师现在已经以千人计划回国内发展,他的研究团队正在招人,相关职位信息见 http:/ hr.nimte.ac.cn/jobview.asp? 幸亏买了一个kindle,无聊和心情不好的时候可以看书,看书非常方便,也让自己能顺利看完一些大部头书,看完了CSAPP, 邓小平时代 和 盗墓笔记 ,据说现在 盗墓笔记 拍电视剧了,这又会毁了一部小说,虽然小说的最后还有好多坑没有填上。 以前一直活在一个很小很小的世界中,有一次和同学聊天,我说 以前以为读好书就行了,现在才发现这远远不够 ,同学说 你才发现读书不够啊,不过现在发现也不晚。 至于最终自己能做到啥样子,就像 Dota 中问 猴子,你能起来不 一样,兵需要一个个去补,装备需要一件件去出,事情需要一件件去做,最终结果只有时间能证明。 会一点 Linux 系统编程 网络编程. 可是,人们广泛使用 不得不 , 你让我 等短语。 没拿过奖,你怎么说.说算法很N...
klion26.com
mathjax | klion26
http://www.klion26.com/tag/mathjax
文章标签 ‘mathjax’. 让 Github Blog 支持数学公式. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Fsockopen() has been disabled for security reasons in /home/fengshux/public html/wp-includes/class-snoopy.php. Learn algorithm from scratch.
klion26.com
storm 分组方式实验结果 | klion26
http://www.klion26.com/experiment-of-storm-grouping.html
Tuples are randomly distributed across the bolt's tasks in a way such that each bolt is guaranteed to get an equal number of tuples. The stream is partitioned by the fields specified in the grouping. For example, if the stream is grouped by the "user-id" field, tuples with the same "user-id" will always go to the same task, but tuples with different "user-id"'s may go to different tasks. Provides a good explanation of how it works and the advantages it provides. Or by keeping track of the output of the.