public class WikipediaEditsSource extends org.apache.flink.streaming.api.functions.source.RichSourceFunction<WikipediaEditEvent>
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CHANNEL
IRC channel to join
|
static String |
DEFAULT_HOST
Hostname of the server to connect to.
|
static int |
DEFAULT_PORT
Port of the server to connect to.
|
| Constructor and Description |
|---|
WikipediaEditsSource()
Creates a source reading
WikipediaEditEvent instances from the
IRC channel #en.wikipedia. |
WikipediaEditsSource(String host,
int port,
String channel)
Creates a source reading
WikipediaEditEvent instances from the
specified IRC channel. |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
close() |
void |
open(org.apache.flink.configuration.Configuration parameters) |
void |
run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext ctx) |
public static final String DEFAULT_HOST
public static final int DEFAULT_PORT
public static final String DEFAULT_CHANNEL
public WikipediaEditsSource()
WikipediaEditEvent instances from the
IRC channel #en.wikipedia.
This creates a separate Thread for the IRC connection.
public WikipediaEditsSource(String host, int port, String channel)
WikipediaEditEvent instances from the
specified IRC channel.
In most cases, you want to use the default WikipediaEditsSource(java.lang.String, int, java.lang.String)
constructor. This constructor is meant to be used only if there is a
problem with the default constructor.
host - The IRC server to connect to.port - The port of the IRC server to connect to.channel - The channel to join. Messages not matching the expected
format will be ignored.public void open(org.apache.flink.configuration.Configuration parameters)
throws Exception
open in interface org.apache.flink.api.common.functions.RichFunctionopen in class org.apache.flink.api.common.functions.AbstractRichFunctionExceptionpublic void close()
throws Exception
close in interface org.apache.flink.api.common.functions.RichFunctionclose in class org.apache.flink.api.common.functions.AbstractRichFunctionExceptionpublic void run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext ctx)
throws Exception
Exceptionpublic void cancel()
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.