public class MessageHandlingApp extends SparkStreamingApp
Modifier and Type | Class and Description |
---|---|
static class |
MessageHandlingApp.CommandType
This class stores possible commands and the String expressions of them.
|
static class |
MessageHandlingApp.Parameter
The class Parameter contains a numeration of parameter types
the MessageHandlingApp may use, as well as their keys.
|
static class |
MessageHandlingApp.UnsupportedCommandException |
Modifier and Type | Field and Description |
---|---|
static String |
APP_NAME
The name of this application.
|
private Singleton<HDFSReader> |
hdfsReaderSingleton
|
private Singleton<ByteArrayProducer> |
producerSingleton
|
private static long |
serialVersionUID
|
loggerSingleton
Constructor and Description |
---|
MessageHandlingApp(SystemPropertyCenter propCenter)
The constructor method.
|
Modifier and Type | Method and Description |
---|---|
void |
addToContext()
Add streaming actions directly to the global streaming context.
|
private void |
handle(String cmd,
Map<String,Serializable> param)
|
static void |
main(String[] args)
|
awaitTermination,
buildDirectStream,
buildDirectStream,
finalize, initialize, registerStreams,
start, stop
public static final String APP_NAME
private static final long serialVersionUID
private Singleton<ByteArrayProducer> producerSingleton
private Singleton<HDFSReader> hdfsReaderSingleton
public MessageHandlingApp(SystemPropertyCenter propCenter) throws Exception
propCenter
- The propCenter stores all the available configurations.Exception
- Any exception that might occur during
execution.
public void addToContext() throws org.apache.spark.SparkException
SparkStreamingApp
TaskData
.
Actions that take TaskData
as input should
be implemented in the
Stream.addToGlobalStream(Map)
,
in order to save time of deserialization.
Note that existence of Kafka topics used in this method is not automatically checked.
addToContext
in
class SparkStreamingApp
org.apache.spark.SparkException