public class PunchDispatcherNode
extends org.thales.punch.libraries.storm.api.BaseProcessingNode
PunchDispatcherNode
simply dispatches incoming tuples to different punchlet(s),
based on one of the received fields.
This is handy to run small parser topologies assuming that an upfront punchlet or component already enriched the data with the type of log.
Why not deploy several bolts in a single topology instead, and use streams to do the required wiring ? There are two potential reasons that may be important to you.
First the order of message processing will not be guaranteed anymore. Simply because each PunchNode
will handle its message in a dedicated thread.
Next, this requires (as just highlighted) more threads. If you are on a very constraint server, you may want to limit yoru topology to the smallest number of threads.
Here is an example configuration :
{
"type": "punch_bolt_dispatcher",
"bolt_settings": {
"dispatcher_field" : "type",
"dispatcher_map" : {
"sourcefire" : {
"punchlet" : [
"standard/common/input.punch",
"standard/common/parsing_syslog_header.punch",
"standard/sourcefire/parsing.punch",
"standard/common/geoip.punch"
]
},
"apache_httpd" : {
"punchlet_json_resources" : [
"standard/apache_httpd/http_codes.json"
,"standard/apache_httpd/taxonomy.json"
],
"punchlet" : [
"standard/common/input.punch",
"standard/common/parsing_syslog_header.punch",
"standard/apache_httpd/parsing.punch",
"standard/apache_httpd/enrichment.punch",
"standard/apache_httpd/normalization.punch",
"standard/common/geoip.punch"
]
}
}
},
Constructor and Description |
---|
PunchDispatcherNode(org.thales.punch.libraries.storm.api.NodeSettings config,
Map<String,PunchNode> dispatcher)
Ctor
|
Modifier and Type | Method and Description |
---|---|
void |
prepare(Map stormConf,
org.apache.storm.task.TopologyContext context,
org.apache.storm.task.OutputCollector collector) |
void |
process(org.apache.storm.tuple.Tuple input) |
public void process(org.apache.storm.tuple.Tuple input)
process
in class org.thales.punch.libraries.storm.api.BaseProcessingNode
public void prepare(Map stormConf, org.apache.storm.task.TopologyContext context, org.apache.storm.task.OutputCollector collector)
prepare
in interface org.apache.storm.task.IBolt
prepare
in class org.thales.punch.libraries.storm.api.BaseProcessingNode
Copyright © 2022. All rights reserved.