use of io.crate.udc.ping.PingTask in project crate by crate.
the class UDCService method doStart.
@Override
protected void doStart() throws ElasticsearchException {
String url = settings.get(UDCPlugin.URL_SETTING_NAME, UDCPlugin.URL_DEFAULT_SETTING);
TimeValue initialDelay = settings.getAsTime(UDCPlugin.INITIAL_DELAY_SETTING_NAME, UDCPlugin.INITIAL_DELAY_DEFAULT_SETTING);
TimeValue interval = settings.getAsTime(UDCPlugin.INTERVAL_SETTING_NAME, UDCPlugin.INTERVAL_DEFAULT_SETTING);
if (logger.isDebugEnabled()) {
logger.debug("Starting with delay {} and period {}.", initialDelay.getSeconds(), interval.getSeconds());
}
PingTask pingTask = new PingTask(clusterService, clusterIdServiceProvider.get(), extendedNodeInfo, url, settings);
timer.scheduleAtFixedRate(pingTask, initialDelay.millis(), interval.millis());
}