public class IrcFirehoseFactory extends Object implements io.druid.data.input.FirehoseFactory<IrcParser>
Example Usage
Decoder definition: wikipedia-decoder.json
{
"type": "wikipedia",
"namespaces": {
"#en.wikipedia": {
"": "main",
"Category": "category",
"Template talk": "template talk",
"Help talk": "help talk",
"Media": "media",
"MediaWiki talk": "mediawiki talk",
"File talk": "file talk",
"MediaWiki": "mediawiki",
"User": "user",
"File": "file",
"User talk": "user talk",
"Template": "template",
"Help": "help",
"Special": "special",
"Talk": "talk",
"Category talk": "category talk"
}
},
"geoIpDatabase": "path/to/GeoLite2-City.mmdb"
}
Example code:
IrcDecoder wikipediaDecoder = new ObjectMapper().readValue(
new File("wikipedia-decoder.json"),
IrcDecoder.class
);
IrcFirehoseFactory factory = new IrcFirehoseFactory(
"wiki123",
"irc.wikimedia.org",
Lists.newArrayList(
"#en.wikipedia",
"#fr.wikipedia",
"#de.wikipedia",
"#ja.wikipedia"
),
wikipediaDecoder
);
Constructor and Description |
---|
IrcFirehoseFactory(String nick,
String host,
List<String> channels,
IrcDecoder decoder) |
Modifier and Type | Method and Description |
---|---|
io.druid.data.input.Firehose |
connect(IrcParser firehoseParser) |
List<String> |
getChannels() |
IrcDecoder |
getDecoder() |
String |
getHost() |
String |
getNick() |
IrcParser |
getParser() |
public IrcFirehoseFactory(String nick, String host, List<String> channels, IrcDecoder decoder)
public String getNick()
public String getHost()
public IrcDecoder getDecoder()
public io.druid.data.input.Firehose connect(IrcParser firehoseParser) throws IOException
connect
in interface io.druid.data.input.FirehoseFactory<IrcParser>
IOException
Copyright © 2015. All rights reserved.