- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKMainServer.<init>()
方法的一些代码示例,展示了ZKMainServer.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKMainServer.<init>()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKMainServer
类名称:ZKMainServer
方法名:<init>
暂无
代码示例来源:origin: apache/hbase
/**
* Run the tool.
* @param args Command line arguments. First arg is path to zookeepers file.
*/
public static void main(String[] args) throws Exception {
String [] newArgs = args;
if (!hasServer(args)) {
// Add the zk ensemble from configuration if none passed on command-line.
Configuration conf = HBaseConfiguration.create();
String hostport = new ZKMainServer().parse(conf);
if (hostport != null && hostport.length() > 0) {
newArgs = new String[args.length + 2];
System.arraycopy(args, 0, newArgs, 2, args.length);
newArgs[0] = "-server";
newArgs[1] = hostport;
}
}
// If command-line arguments, run our hack so they are executed.
// ZOOKEEPER-1897 was committed to zookeeper-3.4.6 but elsewhere in this class we say
// 3.4.6 breaks command-processing; TODO.
if (hasCommandLineArguments(args)) {
HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain zkm =
new HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(newArgs);
zkm.runCmdLine();
} else {
ZooKeeperMain.main(newArgs);
}
}
}
代码示例来源:origin: apache/hbase
@Test
public void testHostPortParse() {
ZKMainServer parser = new ZKMainServer();
Configuration c = HBaseConfiguration.create();
assertEquals("localhost:" + c.get(HConstants.ZOOKEEPER_CLIENT_PORT), parser.parse(c));
代码示例来源:origin: org.apache.hbase/hbase-zookeeper
/**
* Run the tool.
* @param args Command line arguments. First arg is path to zookeepers file.
*/
public static void main(String[] args) throws Exception {
String [] newArgs = args;
if (!hasServer(args)) {
// Add the zk ensemble from configuration if none passed on command-line.
Configuration conf = HBaseConfiguration.create();
String hostport = new ZKMainServer().parse(conf);
if (hostport != null && hostport.length() > 0) {
newArgs = new String[args.length + 2];
System.arraycopy(args, 0, newArgs, 2, args.length);
newArgs[0] = "-server";
newArgs[1] = hostport;
}
}
// If command-line arguments, run our hack so they are executed.
// ZOOKEEPER-1897 was committed to zookeeper-3.4.6 but elsewhere in this class we say
// 3.4.6 breaks command-processing; TODO.
if (hasCommandLineArguments(args)) {
HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain zkm =
new HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(newArgs);
zkm.runCmdLine();
} else {
ZooKeeperMain.main(newArgs);
}
}
}
代码示例来源:origin: org.apache.hbase/hbase-zookeeper
@Test
public void testHostPortParse() {
ZKMainServer parser = new ZKMainServer();
Configuration c = HBaseConfiguration.create();
assertEquals("localhost:" + c.get(HConstants.ZOOKEEPER_CLIENT_PORT), parser.parse(c));
final String port = "1234";
c.set(HConstants.ZOOKEEPER_CLIENT_PORT, port);
c.set("hbase.zookeeper.quorum", "example.com");
assertEquals("example.com:" + port, parser.parse(c));
c.set("hbase.zookeeper.quorum", "example1.com,example2.com,example3.com");
String ensemble = parser.parse(c);
assertTrue(port, ensemble.matches("(example[1-3]\\.com:1234,){2}example[1-3]\\.com:" + port));
// multiple servers with its own port
c.set("hbase.zookeeper.quorum", "example1.com:5678,example2.com:9012,example3.com:3456");
ensemble = parser.parse(c);
assertEquals(ensemble, "example1.com:5678,example2.com:9012,example3.com:3456");
// some servers without its own port, which will be assigned the default client port
c.set("hbase.zookeeper.quorum", "example1.com:5678,example2.com:9012,example3.com");
ensemble = parser.parse(c);
assertEquals(ensemble, "example1.com:5678,example2.com:9012,example3.com:" + port);
}
}
代码示例来源:origin: com.aliyun.hbase/alihbase-zookeeper
@Test
public void testHostPortParse() {
ZKMainServer parser = new ZKMainServer();
Configuration c = HBaseConfiguration.create();
assertEquals("localhost:" + c.get(HConstants.ZOOKEEPER_CLIENT_PORT), parser.parse(c));
final String port = "1234";
c.set(HConstants.ZOOKEEPER_CLIENT_PORT, port);
c.set("hbase.zookeeper.quorum", "example.com");
assertEquals("example.com:" + port, parser.parse(c));
c.set("hbase.zookeeper.quorum", "example1.com,example2.com,example3.com");
String ensemble = parser.parse(c);
assertTrue(port, ensemble.matches("(example[1-3]\\.com:1234,){2}example[1-3]\\.com:" + port));
// multiple servers with its own port
c.set("hbase.zookeeper.quorum", "example1.com:5678,example2.com:9012,example3.com:3456");
ensemble = parser.parse(c);
assertEquals(ensemble, "example1.com:5678,example2.com:9012,example3.com:3456");
// some servers without its own port, which will be assigned the default client port
c.set("hbase.zookeeper.quorum", "example1.com:5678,example2.com:9012,example3.com");
ensemble = parser.parse(c);
assertEquals(ensemble, "example1.com:5678,example2.com:9012,example3.com:" + port);
}
}
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKMainServer.main()方法的一些代码示例,展示了ZKMainServer.main()的具体用法
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKMainServer.()方法的一些代码示例,展示了ZKMainServer.()的具体用法。这些代码示例主
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKMainServer.parse()方法的一些代码示例,展示了ZKMainServer.parse()的具体
我是一名优秀的程序员,十分优秀!