use of com.alibaba.otter.node.common.config.NodeTaskListener in project otter by alibaba.
the class NodeTaskServiceImpl method notifyListener.
private synchronized boolean notifyListener() {
boolean result = true;
List<NodeTask> incNodeTask = new ArrayList<NodeTask>(incTasks);
if (CollectionUtils.isEmpty(listeners) == false) {
for (NodeTaskListener listener : listeners) {
result &= listener.process(incNodeTask);
}
if (result) {
mergeIncNodeTasks();
} else {
// 清除本次的增量数据
incTasks.clear();
if (logger.isInfoEnabled()) {
logger.info("##notify listener error {}", printNodeTasks(incNodeTask));
}
}
}
return result;
}
Aggregations