当前位置: 首页>>代码示例>>Java>>正文


Java ZooKeeperMain.main方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:ZooKeeperMainServer.java

示例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);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:29,代码来源:ZKMainServer.java

示例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);
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:17,代码来源:ZooKeeperMainServer.java


注:本文中的org.apache.zookeeper.ZooKeeperMain.main方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。