use of org.apache.samza.config.ZkConfig in project samza by apache.
the class ZkCoordinationServiceFactory method getCoordinationService.
// TODO - Why should this method be synchronized?
public synchronized CoordinationUtils getCoordinationService(String groupId, String participantId, Config config) {
ZkConfig zkConfig = new ZkConfig(config);
ZkClient zkClient = createZkClient(zkConfig.getZkConnect(), zkConfig.getZkSessionTimeoutMs(), zkConfig.getZkConnectionTimeoutMs());
// make sure the 'path' exists
createZkPath(zkConfig.getZkConnect(), zkClient);
ZkUtils zkUtils = new ZkUtils(new ZkKeyBuilder(groupId), zkClient, zkConfig.getZkConnectionTimeoutMs());
return new ZkCoordinationUtils(participantId, zkConfig, zkUtils);
}