use of com.alibaba.jstorm.schedule.FollowerRunnable in project jstorm by alibaba.
the class NimbusServer method initFollowerThread.
private void initFollowerThread(Map conf) {
// when this nimbus become leader, we will execute this callback, to init some necessary data/thread
Callback leaderCallback = new Callback() {
public <T> Object execute(T... args) {
try {
init(data.getConf());
} catch (Exception e) {
LOG.error("Nimbus init error after becoming a leader", e);
throw new RuntimeException(e);
}
return null;
}
};
follower = new FollowerRunnable(data, 5000, leaderCallback);
Thread thread = new Thread(follower);
thread.setDaemon(true);
thread.start();
LOG.info("Successfully init Follower thread");
}
Aggregations