标签:storm
作者对这个例子的说明:这里。
RollingTopWords实现了每过N分钟更新M分钟内最热门话题,如每1分钟刷新一次过去5分钟的热门话题。
@Override
public Map<String, Object> getComponentConfiguration() {
Map<String, Object> conf = new HashMap<String, Object>();
conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, emitFrequencyInSeconds);
return conf;
}
//判断是否系统自动发送的Tuple
public static boolean isTick(Tuple tuple) {
return tuple != null
&& Constants.SYSTEM_COMPONENT_ID .equals(tuple.getSourceComponent())
&& Constants.SYSTEM_TICK_STREAM_ID.equals(tuple.getSourceStreamId());
}
Storm Starter例子RollingTopWords代码学习
标签:storm
原文地址:http://blog.csdn.net/fytain/article/details/45291911