use of com.netflix.curator.framework.CuratorFramework in project storm by nathanmarz.
the class Utils method newCuratorStarted.
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port) {
CuratorFramework ret = newCurator(conf, servers, port);
ret.start();
return ret;
}
use of com.netflix.curator.framework.CuratorFramework in project elasticsearch-river-kafka by endgameinc.
the class KafkaClientTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mockCurator = createMock(CuratorFramework.class);
mockConsumer = createMock(SimpleConsumer.class);
final CuratorFramework cur = mockCurator;
final SimpleConsumer con = mockConsumer;
client = new KafkaClient("zookeeper", "broker", 9092) {
void connect(String zk, String broker, int port) {
this.curator = cur;
this.consumer = con;
}
};
}
use of com.netflix.curator.framework.CuratorFramework in project platformlayer by platformlayer.
the class ZookeeperContext method buildZk.
public CuratorFramework buildZk(List<String> dnsNames) throws OpsException {
String connectionString = Joiner.on(",").join(dnsNames);
Builder builder = CuratorFrameworkFactory.builder();
builder.connectString(connectionString);
TimeSpan retryInterval = TimeSpan.FIVE_SECONDS;
RetryPolicy retryPolicy = new RetryOneTime((int) retryInterval.getTotalMilliseconds());
builder.retryPolicy(retryPolicy);
CuratorFramework curatorFramework;
try {
curatorFramework = builder.build();
} catch (IOException e) {
throw new OpsException("Error building zookeeper connection", e);
}
return curatorFramework;
// TimeSpan sessionTimeout = TimeSpan.TEN_SECONDS;
//
// ZooKeeper zk = new ZooKeeper(connectionString, (int) sessionTimeout.getTotalMilliseconds(), this);
// return zk;
}
use of com.netflix.curator.framework.CuratorFramework in project storm by nathanmarz.
the class Utils method newCuratorStarted.
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, String root) {
CuratorFramework ret = newCurator(conf, servers, port, root);
ret.start();
return ret;
}
Aggregations