public class ProcessBolt extends AbstractBolt
This bolt implementation wraps a process configuration and creates the process including its inner element to provide a bolt that behaves the same as a regular streams process.
TODO: Currently, services are not injected into bolts as there is no service facade implementation for storm, yet.
| Modifier and Type | Class and Description |
|---|---|
class |
ProcessBolt.DataForwarder |
class |
ProcessBolt.OutputRef |
| Modifier and Type | Field and Description |
|---|---|
(package private) BoltContext |
ctx |
(package private) static org.slf4j.Logger |
log |
(package private) List<ProcessBolt.OutputRef> |
outputRefs |
protected String[] |
outputs |
(package private) ProcessorList |
process |
private static long |
serialVersionUID
The unique class ID
|
(package private) Set<Subscription> |
subscriptions
The list of subscribers (e.g. output queues,...) that need to be
connected to this bolt
|
protected Variables |
variables |
output, uuid, xmlConfig| Constructor and Description |
|---|
ProcessBolt(String xmlConfig,
String uuid,
Map<String,String> variables)
The bolt implementation requires an XML configuration (the complete
container XML as string) and the ID that identifies the corresponding
process within that XML.
|
| Modifier and Type | Method and Description |
|---|---|
protected ProcessorList |
createProcess()
This method creates the inner processors of this process bolt.
|
protected Processor |
createProcessor(Element el,
ProcessorFactory pf) |
void |
execute(backtype.storm.tuple.Tuple input) |
List<Processor> |
getAllProcessors() |
protected List<Processor> |
getAllProcessors(ProcessorList list) |
Set<Subscription> |
getSubscriptions()
This method returns the list (set) of queues ('sinks') that are
referenced by any of the processors of this process bolt.
|
void |
prepare(Map stormConf,
backtype.storm.task.TopologyContext context,
backtype.storm.task.OutputCollector collector) |
declareOutputFieldsprivate static final long serialVersionUID
static org.slf4j.Logger log
transient ProcessorList process
transient List<ProcessBolt.OutputRef> outputRefs
protected final Variables variables
protected String[] outputs
final BoltContext ctx
final Set<Subscription> subscriptions
public ProcessBolt(String xmlConfig, String uuid, Map<String,String> variables) throws Exception
xmlConfig - The XML configuration as String.uuid - The ID of the process.Exceptionpublic Set<Subscription> getSubscriptions()
protected ProcessorList createProcess() throws Exception
Exceptionprotected List<Processor> getAllProcessors(ProcessorList list)
protected Processor createProcessor(Element el, ProcessorFactory pf) throws Exception
Exceptionpublic void prepare(Map stormConf, backtype.storm.task.TopologyContext context, backtype.storm.task.OutputCollector collector)
IBolt.prepare(java.util.Map,
backtype.storm.task.TopologyContext,
backtype.storm.task.OutputCollector)public void execute(backtype.storm.tuple.Tuple input)
IBolt.execute(backtype.storm.tuple.Tuple)Copyright © 2013. All Rights Reserved.