本文整理了Java中backtype.storm.utils.Utils.newCurator()
方法的一些代码示例,展示了Utils.newCurator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.newCurator()
方法的具体详情如下:
包路径:backtype.storm.utils.Utils
类名称:Utils
方法名:newCurator
暂无
代码示例来源:origin: alibaba/jstorm
public static CuratorFramework newCurator(Map conf, List<String> servers, Object port, String root) {
return newCurator(conf, servers, port, root, null);
}
代码示例来源:origin: alibaba/jstorm
public static CuratorFramework newCurator(Map conf, List<String> servers, Object port, ZookeeperAuthInfo auth) {
return newCurator(conf, servers, port, "", auth);
}
代码示例来源:origin: alibaba/mdrill
public static CuratorFramework newCurator(Map conf, List<String> servers,
Object port) {
return newCurator(conf, servers, port, "");
}
代码示例来源:origin: alibaba/jstorm
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, String root, ZookeeperAuthInfo auth) {
CuratorFramework ret = newCurator(conf, servers, port, root, auth);
ret.start();
return ret;
}
代码示例来源:origin: alibaba/jstorm
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, ZookeeperAuthInfo auth) {
CuratorFramework ret = newCurator(conf, servers, port, auth);
ret.start();
return ret;
}
代码示例来源:origin: alibaba/jstorm
public static CuratorFramework createZKClient(Map conf) throws Exception {
CuratorFramework zkClient = null;
try {
List<String> zkServers = (List<String>) conf.get(Config.STORM_ZOOKEEPER_SERVERS);
Object port = conf.get(Config.STORM_ZOOKEEPER_PORT);
zkClient = Utils.newCurator(conf, zkServers, port, (String) conf.get(Config.STORM_ZOOKEEPER_ROOT));
zkClient.start();
} catch (Exception e) {
if (zkClient != null) {
zkClient.close();
zkClient = null;
}
throw e;
}
return zkClient;
}
代码示例来源:origin: alibaba/mdrill
public static CuratorFramework newCuratorStarted(Map conf,
List<String> servers, Object port, String root) {
CuratorFramework ret = newCurator(conf, servers, port, root);
ret.start();
return ret;
}
代码示例来源:origin: alibaba/mdrill
public static CuratorFramework newCuratorStarted(Map conf,
List<String> servers, Object port) {
CuratorFramework ret = newCurator(conf, servers, port);
ret.start();
return ret;
}
代码示例来源:origin: alibaba/jstorm
public static String getMasterByZk(Map conf) throws Exception {
CuratorFramework zkobj = null;
String masterHost = null;
try {
String root = String.valueOf(conf.get(Config.STORM_ZOOKEEPER_ROOT));
String zkMasterDir = root + Cluster.MASTER_SUBTREE;
zkobj = Utils.newCurator(conf, (List<String>) conf.get(Config.STORM_ZOOKEEPER_SERVERS), conf.get(Config.STORM_ZOOKEEPER_PORT), zkMasterDir);
zkobj.start();
if (zkobj.checkExists().forPath("/") == null) {
throw new RuntimeException("!!!!!!!!!!! \n\n\n No alive nimbus !!!!!!!!!!! \n\n\n");
}
masterHost = new String(zkobj.getData().forPath("/"));
LOG.info("masterHost:" + masterHost);
return masterHost;
} finally {
if (zkobj != null) {
zkobj.close();
zkobj = null;
}
}
}
代码示例来源:origin: alibaba/jstorm
/**
* connect ZK, register watchers
*/
public CuratorFramework mkClient(Map conf, List<String> servers, Object port,
String root, final WatcherCallBack watcher) {
CuratorFramework fk = Utils.newCurator(conf, servers, port, root);
fk.getCuratorListenable().addListener(new CuratorListener() {
@Override
public void eventReceived(CuratorFramework _fk, CuratorEvent e) throws Exception {
if (e.getType().equals(CuratorEventType.WATCHED)) {
WatchedEvent event = e.getWatchedEvent();
watcher.execute(event.getState(), event.getType(), event.getPath());
}
}
});
fk.getUnhandledErrorListenable().addListener(new UnhandledErrorListener() {
@Override
public void unhandledError(String msg, Throwable error) {
String errmsg = "Unrecoverable zookeeper error, halting process: " + msg;
LOG.error(errmsg, error);
JStormUtils.halt_process(1, "Unrecoverable zookeeper error");
}
});
fk.start();
return fk;
}
代码示例来源:origin: alibaba/mdrill
Object port, String root, final WatcherCallBack watcher) {
CuratorFramework fk = Utils.newCurator(conf, servers, port, root);
代码示例来源:origin: com.n3twork.storm/storm-core
public static CuratorFramework newCurator(Map conf, List<String> servers, Object port, String root) {
return newCurator(conf, servers, port, root, null);
}
代码示例来源:origin: com.n3twork.storm/storm-core
public static CuratorFramework newCurator(Map conf, List<String> servers, Object port) {
return newCurator(conf, servers, port, "");
}
代码示例来源:origin: com.alibaba.jstorm/jstorm-core
public static CuratorFramework newCurator(Map conf, List<String> servers, Object port, String root) {
return newCurator(conf, servers, port, root, null);
}
代码示例来源:origin: com.alibaba.jstorm/jstorm-core
public static CuratorFramework newCurator(Map conf, List<String> servers, Object port, ZookeeperAuthInfo auth) {
return newCurator(conf, servers, port, "", auth);
}
代码示例来源:origin: com.n3twork.storm/storm-core
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, String root) {
CuratorFramework ret = newCurator(conf, servers, port, root);
ret.start();
return ret;
}
代码示例来源:origin: com.n3twork.storm/storm-core
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port) {
CuratorFramework ret = newCurator(conf, servers, port);
ret.start();
return ret;
}
代码示例来源:origin: com.alibaba.jstorm/jstorm-core
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, ZookeeperAuthInfo auth) {
CuratorFramework ret = newCurator(conf, servers, port, auth);
ret.start();
return ret;
}
代码示例来源:origin: com.alibaba.jstorm/jstorm-core
public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, String root, ZookeeperAuthInfo auth) {
CuratorFramework ret = newCurator(conf, servers, port, root, auth);
ret.start();
return ret;
}
代码示例来源:origin: com.alibaba.jstorm/jstorm-core
public static CuratorFramework createZKClient(Map conf) throws Exception {
CuratorFramework zkClient = null;
try {
List<String> zkServers = (List<String>) conf.get(Config.STORM_ZOOKEEPER_SERVERS);
Object port = conf.get(Config.STORM_ZOOKEEPER_PORT);
zkClient = Utils.newCurator(conf, zkServers, port, (String) conf.get(Config.STORM_ZOOKEEPER_ROOT));
zkClient.start();
}catch (Exception e){
if (zkClient != null) {
zkClient.close();
zkClient = null;
}
throw e;
}
return zkClient;
}
内容来源于网络,如有侵权,请联系作者删除!