use of org.apache.storm.hooks.ITaskHookDelegate in project heron by twitter.
the class TopologyContext method addTaskHook.
/*
public void setExecutorData(String name, Object data) {
_executorData.put(name, data);
}
public Object getExecutorData(String name) {
return _executorData.get(name);
}
*/
public void addTaskHook(ITaskHook newHook) {
Collection<com.twitter.heron.api.hooks.ITaskHook> hooks = delegate.getHooks();
if (hooks == null) {
ITaskHookDelegate delegateHook = new ITaskHookDelegate();
delegateHook.addHook(newHook);
delegate.addTaskHook(delegateHook);
} else {
for (com.twitter.heron.api.hooks.ITaskHook hook : hooks) {
if (hook instanceof ITaskHookDelegate) {
ITaskHookDelegate delegateHook = (ITaskHookDelegate) hook;
delegateHook.addHook(newHook);
return;
}
}
throw new RuntimeException("StormCompat taskHooks not setup properly");
}
}
Aggregations