Package org.apache.storm.starter.spout
Class RandomNumberGeneratorSpout
- java.lang.Object
-
- org.apache.storm.starter.spout.RandomNumberGeneratorSpout
-
- All Implemented Interfaces:
Serializable,IBatchSpout,ITridentDataSource
public class RandomNumberGeneratorSpout extends Object implements IBatchSpout
This spout generates random whole numbers with givenmaxNumbervalue as maximum with the givenfields.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RandomNumberGeneratorSpout(Fields fields, int batchSize, int maxNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidack(long batchId)voidclose()voidemitBatch(long batchId, TridentCollector collector)Map<String,Object>getComponentConfiguration()FieldsgetOutputFields()voidopen(Map<String,Object> conf, TopologyContext context)
-
-
-
Constructor Detail
-
RandomNumberGeneratorSpout
public RandomNumberGeneratorSpout(Fields fields, int batchSize, int maxNumber)
-
-
Method Detail
-
open
public void open(Map<String,Object> conf, TopologyContext context)
- Specified by:
openin interfaceIBatchSpout
-
emitBatch
public void emitBatch(long batchId, TridentCollector collector)- Specified by:
emitBatchin interfaceIBatchSpout
-
ack
public void ack(long batchId)
- Specified by:
ackin interfaceIBatchSpout
-
close
public void close()
- Specified by:
closein interfaceIBatchSpout
-
getComponentConfiguration
public Map<String,Object> getComponentConfiguration()
- Specified by:
getComponentConfigurationin interfaceIBatchSpout
-
getOutputFields
public Fields getOutputFields()
- Specified by:
getOutputFieldsin interfaceIBatchSpout
-
-