gpt4 book ai didi

org.apache.zookeeper.ZooKeeperMain.main()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 10:04:49 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.zookeeper.ZooKeeperMain.main()方法的一些代码示例,展示了ZooKeeperMain.main()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperMain.main()方法的具体详情如下:
包路径:org.apache.zookeeper.ZooKeeperMain
类名称:ZooKeeperMain
方法名:main

ZooKeeperMain.main介绍

暂无

代码示例

代码示例来源: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: javahongxi/whatsmars

public static void main(String[] args) throws Exception {
    ZooKeeperMain.main(args);
    // 列出根节点下的所有子节点:ls /
    // 列出某节点下的所有子节点:ls /dubbo
  }
}

代码示例来源:origin: apache/accumulo

@Override
 public void execute(final String[] args) throws Exception {
  Opts opts = new Opts();
  opts.parseArgs(ZooKeeperMain.class.getName(), args);
  try (ServerContext context = new ServerContext(new SiteConfiguration())) {
   FileSystem fs = context.getVolumeManager().getDefaultVolume().getFileSystem();
   String baseDir = ServerConstants.getBaseUris(context)[0];
   System.out.println("Using " + fs.makeQualified(new Path(baseDir + "/instance_id"))
     + " to lookup accumulo instance");
   if (opts.servers == null) {
    opts.servers = context.getZooKeepers();
   }
   System.out.println("The accumulo instance id is " + context.getInstanceID());
   if (!opts.servers.contains("/"))
    opts.servers += "/accumulo/" + context.getInstanceID();
   org.apache.zookeeper.ZooKeeperMain
     .main(new String[] {"-server", opts.servers, "-timeout", "" + (opts.timeout * 1000)});
  }
 }
}

代码示例来源:origin: org.apache.accumulo/accumulo-server

public static void main(String[] args) throws Exception {
  Opts opts = new Opts();
  opts.parseArgs(ZooKeeperMain.class.getName(), args);
  FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
  String baseDir = Constants.getBaseDir(ServerConfiguration.getSiteConfiguration());
  System.out.println("Using " + fs.makeQualified(new Path(baseDir + "/instance_id")) + " to lookup accumulo instance");
  Instance instance = HdfsZooInstance.getInstance();
  if (opts.servers == null) {
   opts.servers = instance.getZooKeepers();
  }
  System.out.println("The accumulo instance id is " + instance.getInstanceID());
  if (!opts.servers.contains("/"))
   opts.servers += "/accumulo/" + instance.getInstanceID();
  org.apache.zookeeper.ZooKeeperMain.main(new String[] {"-server", opts.servers, "-timeout", "" + (opts.timeout * 1000)});
 }
}

代码示例来源:origin: org.apache.accumulo/accumulo-server-base

@Override
 public void execute(final String[] args) throws Exception {
  Opts opts = new Opts();
  opts.parseArgs(ZooKeeperMain.class.getName(), args);
  FileSystem fs = VolumeManagerImpl.get().getDefaultVolume().getFileSystem();
  String baseDir = ServerConstants.getBaseUris()[0];
  System.out.println("Using " + fs.makeQualified(new Path(baseDir + "/instance_id"))
    + " to lookup accumulo instance");
  Instance instance = HdfsZooInstance.getInstance();
  if (opts.servers == null) {
   opts.servers = instance.getZooKeepers();
  }
  System.out.println("The accumulo instance id is " + instance.getInstanceID());
  if (!opts.servers.contains("/"))
   opts.servers += "/accumulo/" + instance.getInstanceID();
  org.apache.zookeeper.ZooKeeperMain
    .main(new String[] {"-server", opts.servers, "-timeout", "" + (opts.timeout * 1000)});
 }
}

代码示例来源:origin: harbby/presto-connectors

/**
  * 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);
  }
 }
}

代码示例来源: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);
  }
 }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com