本文整理汇总了Java中org.apache.zookeeper.ZooKeeperMain.main方法的典型用法代码示例。如果您正苦于以下问题:Java ZooKeeperMain.main方法的具体用法?Java ZooKeeperMain.main怎么用?Java ZooKeeperMain.main使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.zookeeper.ZooKeeperMain
的用法示例。
在下文中一共展示了ZooKeeperMain.main方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.apache.zookeeper.ZooKeeperMain; //导入方法依赖的package包/类
/**
* 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 ZooKeeperMainServer().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.
if (hasCommandLineArguments(args)) {
HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain zkm =
new HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(newArgs);
zkm.runCmdLine();
} else {
ZooKeeperMain.main(newArgs);
}
}
示例2: main
import org.apache.zookeeper.ZooKeeperMain; //导入方法依赖的package包/类
/**
* 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);
}
}
示例3: main
import org.apache.zookeeper.ZooKeeperMain; //导入方法依赖的package包/类
/**
* Run the tool.
* @param args Command line arguments. First arg is path to zookeepers file.
*/
public static void main(String args[]) throws Exception {
Configuration conf = HBaseConfiguration.create();
String hostport = new ZooKeeperMainServer().parse(conf);
String[] newArgs = args;
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;
}
ZooKeeperMain.main(newArgs);
}