public abstract class AbstractDpsBolt
extends org.apache.storm.topology.base.BaseRichBolt
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.storm.tuple.Tuple |
inputTuple |
protected eu.europeana.cloud.service.dps.TaskExecutionKillService |
killService |
static String |
NOTIFICATION_STREAM_NAME |
protected org.apache.storm.task.OutputCollector |
outputCollector |
protected Map |
stormConfig |
protected org.apache.storm.task.TopologyContext |
topologyContext |
protected String |
topologyName |
| Constructor and Description |
|---|
AbstractDpsBolt() |
| Modifier and Type | Method and Description |
|---|---|
void |
declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer declarer) |
protected void |
emitDropNotification(long taskId,
String resource,
String message,
String additionalInformations)
Emit
NotificationTuple with error notification to NOTIFICATION_STREAM_NAME. |
protected void |
emitErrorNotification(long taskId,
String resource,
String message,
String additionalInformations)
Emit
NotificationTuple with error notification to NOTIFICATION_STREAM_NAME. |
protected void |
emitKillNotification(long taskId,
String resource,
String message,
String additionalInformations)
Emit
NotificationTuple with kill notification to NOTIFICATION_STREAM_NAME. |
protected void |
emitSuccess(StormTaskTuple t) |
protected void |
endTask(long taskId,
String info,
eu.europeana.cloud.common.model.dps.TaskState state,
Date finishTime) |
abstract void |
execute(StormTaskTuple t) |
void |
execute(org.apache.storm.tuple.Tuple tuple) |
protected void |
logAndEmitError(StormTaskTuple t,
String message) |
protected void |
logAndEmitError(StormTaskTuple t,
String message,
Exception e) |
abstract void |
prepare() |
void |
prepare(Map stormConfig,
org.apache.storm.task.TopologyContext tc,
org.apache.storm.task.OutputCollector oc) |
protected void |
updateTask(long taskId,
String info,
eu.europeana.cloud.common.model.dps.TaskState state,
Date startTime) |
public static final String NOTIFICATION_STREAM_NAME
protected org.apache.storm.tuple.Tuple inputTuple
protected Map stormConfig
protected org.apache.storm.task.TopologyContext topologyContext
protected org.apache.storm.task.OutputCollector outputCollector
protected eu.europeana.cloud.service.dps.TaskExecutionKillService killService
protected String topologyName
public abstract void execute(StormTaskTuple t)
public abstract void prepare()
public void execute(org.apache.storm.tuple.Tuple tuple)
public void prepare(Map stormConfig, org.apache.storm.task.TopologyContext tc, org.apache.storm.task.OutputCollector oc)
public void declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer declarer)
protected void emitDropNotification(long taskId,
String resource,
String message,
String additionalInformations)
NotificationTuple with error notification to NOTIFICATION_STREAM_NAME.
Only one notification call per resource per task.taskId - task IDresource - affected resource (e.g. file URL)message - short textadditionalInformations - the rest of informations (e.g. stack trace)protected void emitErrorNotification(long taskId,
String resource,
String message,
String additionalInformations)
NotificationTuple with error notification to NOTIFICATION_STREAM_NAME.
Only one notification call per resource per task.taskId - task IDresource - affected resource (e.g. file URL)message - short textadditionalInformations - the rest of informations (e.g. stack trace)protected void emitKillNotification(long taskId,
String resource,
String message,
String additionalInformations)
NotificationTuple with kill notification to NOTIFICATION_STREAM_NAME.
Only one notification call per resource per task.taskId - task IDresource - affected resource (e.g. file URL)message - short textadditionalInformations - the rest of informationsprotected void endTask(long taskId,
String info,
eu.europeana.cloud.common.model.dps.TaskState state,
Date finishTime)
protected void updateTask(long taskId,
String info,
eu.europeana.cloud.common.model.dps.TaskState state,
Date startTime)
protected void logAndEmitError(StormTaskTuple t, String message)
protected void logAndEmitError(StormTaskTuple t, String message, Exception e)
protected void emitSuccess(StormTaskTuple t)
Copyright © 2013–2017 Europeana Cloud Development Team. All rights reserved.