摘要: SimpleTopology.javaView Code import backtype.storm.Config;import backtype.storm.LocalCluster;import backtype.storm.StormSubmitter;import backtype.storm.topology.TopologyBuilder;import backtype.storm.tuple.Fields;/** * Hello world! * */public class SimpleTopology{ public static void main( String[]... 阅读全文
posted @ 2013-03-04 18:17 涛光 阅读(1307) 评论(0) 推荐(0) 编辑
摘要: 机器:192.168.180.101192.168.187.16需要准备的软件有:zookeeper(zookeeper-3.4.4.tar.gz),storm(storm-0.8.1.zip) ,jdk1、配置zookeeper解压zookeeper,将conf目录下的zoo_sample.cfg 重命名为:zoo.cfg修改后内容为:# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitL 阅读全文
posted @ 2013-03-04 18:17 涛光 阅读(7704) 评论(0) 推荐(0) 编辑
摘要: 在php中可以很方便的通过array_chunk 进行大数组的切割操作,但是在python中目前貌似没有可以直接使用的方法,下面是在网上搜索了一番,找到一个不错的解决办法,是利用python的生成器(yield)方法实现。具体的代码如下:def iterator_chunk(iterator, size, strict=False): rt = [] for it in iterator: rt.append(it) if len(rt) == size: yield tuple(rt) rt = [] ... 阅读全文
posted @ 2013-03-04 11:42 涛光 阅读(641) 评论(0) 推荐(0) 编辑