/**
* 数据源
* @author zhengcy
*
*/
@SuppressWarnings("serial")
public class SentenceSpout extends BaseRichSpout {
private SpoutOutputCollector collector;
private String[] sentences = {
"Apache Storm is a free and open source distributed realtime computation system",
"Storm makes it easy to reliably process unbounded streams of data",
"doing for realtime processing what Hadoop did for batch processing",
"Storm is simple", "can be used with any programming language",
"and is a lot of fun to use" };
private int index = 0;
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
//定义输出字段描述
declarer.declare(new Fields("sentence"));
}