Search in sources :

Example 1 with ZkConfig

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);
}
Also used : ZkClient(org.I0Itec.zkclient.ZkClient) ZkConfig(org.apache.samza.config.ZkConfig)

Aggregations

ZkClient (org.I0Itec.zkclient.ZkClient)1 ZkConfig (org.apache.samza.config.ZkConfig)1