Search in sources :

Example 1 with DynamicConfigurationFactory

use of com.twitter.distributedlog.config.DynamicConfigurationFactory in project distributedlog by twitter.

the class DistributedLogServer method getServiceDynConf.

private DynamicDistributedLogConfiguration getServiceDynConf(DistributedLogConfiguration dlConf) throws ConfigurationException {
    Optional<DynamicDistributedLogConfiguration> dynConf = Optional.absent();
    if (conf.isPresent()) {
        DynamicConfigurationFactory configFactory = new DynamicConfigurationFactory(configExecutorService, dlConf.getDynamicConfigReloadIntervalSec(), TimeUnit.SECONDS);
        dynConf = configFactory.getDynamicConfiguration(conf.get());
    }
    if (dynConf.isPresent()) {
        return dynConf.get();
    } else {
        return ConfUtils.getConstDynConf(dlConf);
    }
}
Also used : DynamicConfigurationFactory(com.twitter.distributedlog.config.DynamicConfigurationFactory) DynamicDistributedLogConfiguration(com.twitter.distributedlog.config.DynamicDistributedLogConfiguration)

Aggregations

DynamicConfigurationFactory (com.twitter.distributedlog.config.DynamicConfigurationFactory)1 DynamicDistributedLogConfiguration (com.twitter.distributedlog.config.DynamicDistributedLogConfiguration)1