热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.zookeeper.server.ServerConfig.parse()方法的使用及代码示例

本文整理了Java中org.apache.zookeeper.server.ServerConfig.parse()方法的一些代码示例,展示了ServerConfig.parse()的具体用法。这些代

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

ServerConfig.parse介绍

[英]Parse a ZooKeeper configuration file
[中]解析ZooKeeper配置文件

代码示例

代码示例来源:origin: apache/incubator-pinot

public void parse(String path)
throws QuorumPeerConfig.ConfigException {
config.parse(path);
}

代码示例来源:origin: apache/incubator-pinot

public void parse(String[] args) {
config.parse(args);
}

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

protected void initializeAndRun(String[] args)
throws ConfigException, IOException, AdminServerException
{
try {
ManagedUtil.registerLog4jMBeans();
} catch (JMException e) {
LOG.warn("Unable to register log4j JMX control", e);
}
ServerConfig cOnfig= new ServerConfig();
if (args.length == 1) {
config.parse(args[0]);
} else {
config.parse(args);
}
runFromConfig(config);
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

protected void initializeAndRun(String[] args)
throws ConfigException, IOException
{
try {
ManagedUtil.registerLog4jMBeans();
} catch (JMException e) {
LOG.warn("Unable to register log4j JMX control", e);
}
ServerConfig cOnfig= new ServerConfig();
if (args.length == 1) {
config.parse(args[0]);
} else {
config.parse(args);
}
runFromConfig(config);
}

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

@Test(expected=IllegalArgumentException.class)
public void testFewArguments() {
String[] args = {"2181"};
serverConfig.parse(args);
}

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

@Test(expected=IllegalArgumentException.class)
public void testTooManyArguments() {
String[] args = {"2181", "/data/dir", "60000", "10000", "9999"};
serverConfig.parse(args);
}

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

@Test
public void testValidArguments() {
String[] args = {"2181", "/data/dir", "60000", "10000"};
serverConfig.parse(args);
assertEquals(2181, serverConfig.getClientPortAddress().getPort());
assertTrue(checkEquality("/data/dir", serverConfig.getDataDir()));
assertEquals(60000, serverConfig.getTickTime());
assertEquals(10000, serverConfig.getMaxClientCnxns());
}

代码示例来源:origin: jackyhung/consumer-dispatcher

protected void loadDistributionServerConfig(final String configPath) {
sc = new ServerConfig();
try {
sc.parse(configPath);
} catch (ConfigException e) {
_logger.error("[Distribution] error while loading distribution config: " + configPath + e, e);
}
}

代码示例来源:origin: org.apache.hadoop/zookeeper

protected void initializeAndRun(String[] args)
throws ConfigException, IOException
{
try {
ManagedUtil.registerLog4jMBeans();
} catch (JMException e) {
LOG.warn("Unable to register log4j JMX control", e);
}
ServerConfig cOnfig= new ServerConfig();
if (args.length == 1) {
config.parse(args[0]);
} else {
config.parse(args);
}
runFromConfig(config);
}

代码示例来源:origin: org.apache.solr/solr-test-framework

protected void initializeAndRun(String[] args) throws ConfigException,
IOException {
try {
ManagedUtil.registerLog4jMBeans();
} catch (JMException e) {
log.warn("Unable to register log4j JMX control", e);
}
ServerConfig cOnfig= new ServerConfig();
if (args.length == 1) {
config.parse(args[0]);
} else {
config.parse(args);
}
runFromConfig(config);
}

代码示例来源:origin: org.apache.airavata/airavata-common-utils

public static void startEmbeddedZK(ServerCnxnFactory cnxnFactory) {
if (ServerSettings.isEmbeddedZK()) {
ServerConfig serverCOnfig= new ServerConfig();
URL resource = AiravataZKUtils.class.getClassLoader().getResource("zoo.cfg");
if (resource == null) {
logger.error("There is no zoo.cfg file in the classpath... Failed to start Zookeeper Server");
System.exit(1);
}
try {
serverConfig.parse(resource.getPath());
} catch (QuorumPeerConfig.ConfigException e) {
logger.error("Error while starting embedded Zookeeper", e);
System.exit(2);
}
final ServerConfig fServerCOnfig= serverConfig;
final ServerCnxnFactory fserverCnxnFactory = cnxnFactory;
(new Thread() {
public void run() {
try {
AiravataZKUtils.runZKFromConfig(fServerConfig,fserverCnxnFactory);
} catch (IOException e) {
logger.error("Error while starting embedded Zookeeper", e);
System.exit(3);
}
}
}).start();
}else{
logger.info("Skipping Zookeeper embedded startup ...");
}
}

代码示例来源:origin: stackoverflow.com

ServerConfig cOnfig= new ServerConfig();
config.parse(new String[] {port, dir});
ZooKeeperServerMain zk = new ZooKeeperServerMain();
zk.runFromConfig(config);

代码示例来源:origin: org.seaborne.rdf-delta/rdf-delta-server-local

private static ZooServer runZookeeperServer(String[] args) {
zkSystemProps();
ServerConfig cOnfig= new ServerConfig();
config.parse(args);
ZooServer zksm = new ZooServer(config);
zksm.setupFromConfig();
return zksm;
}
}

代码示例来源:origin: org.seaborne.rdf-delta/rdf-delta-server-local

public static ZooServer runZookeeperServer(String zooConfFile) {
zkSystemProps();
ServerConfig cOnfig= new ServerConfig();
try {
config.parse(zooConfFile);
} catch (ConfigException e) {
FmtLog.error(LOG, "Error in Zookeeper configuration file '%s': %s", zooConfFile, e.getMessage());
throw new IllegalArgumentException(e);
}
ZooServer zksm = new ZooServer(config);
zksm.setupFromConfig();
return zksm;
}

代码示例来源:origin: co.paralleluniverse/galaxy

public static ServerCnxnFactory startZookeeper(final String configResource, final String dataDirName) throws IOException, QuorumPeerConfig.ConfigException {
ServerConfig sc = new ServerConfig();
sc.parse(pathToResource(configResource));
deleteDir(dataDirName);
new File(dataDirName).mkdirs();
FileTxnSnapLog txnLog = null;
try {
ZooKeeperServer zkServer = new ZooKeeperServer();
txnLog = new FileTxnSnapLog(new File(sc.getDataDir()), new File(
sc.getDataDir()));
zkServer.setTxnLogFactory(txnLog);
zkServer.setTickTime(sc.getTickTime());
zkServer.setMinSessionTimeout(sc.getMinSessionTimeout());
zkServer.setMaxSessionTimeout(sc.getMaxSessionTimeout());
ServerCnxnFactory cnxnFactory = ServerCnxnFactory.createFactory();
cnxnFactory.configure(sc.getClientPortAddress(),
sc.getMaxClientCnxns());
cnxnFactory.startup(zkServer);
return cnxnFactory;
} catch (InterruptedException e) {
throw new RuntimeException(e);
} finally {
if (txnLog != null) {
txnLog.close();
}
}
}

推荐阅读
  • ZooKeeper 学习
    前言相信大家对ZooKeeper应该不算陌生。但是你真的了解ZooKeeper是个什么东西吗?如果别人面试官让你给他讲讲ZooKeeper是个什么东西, ... [详细]
  • Hbase 的伪分布部署、shell基本操作及hbase相关理念
    1,HBase的的的的伪分布式配置-对zookeeper的配置,这个前面配置过,修改zoo.cfg文件,指定zookeeper的主入口-配置的HBase的的:进入optmo ... [详细]
  • 基本信息|根源_SpringBoot 监控统计:SQL监控慢SQL记录Spring监控去广告
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了SpringBoot监控统计:SQL监控慢SQL记录Spring监控去广告相关的知识,希望对你有一定的参考价值。 ... [详细]
  • C#使用System.Net.Mail类实现邮件发送【.Net开发】
    这篇文章介绍了C#使用System.Net.Mail类实现邮件发送的方法,文中通过示例代码介绍的非常详细。对大家的学习或工作具有一定的参考借鉴价值, ... [详细]
  • 微服务应用性能如何?APM监控工具来告诉你
    当微服务系统越来越庞大,各个服务间的调用关系也变得越来越复杂,需要一个工具来帮忙理清请求调用的服务链路。之前使用的是Sleuth+Zipkin的解决方案,最近发现应 ... [详细]
  • 本文介绍了如何清除Eclipse中SVN用户的设置。首先需要查看使用的SVN接口,然后根据接口类型找到相应的目录并删除相关文件。最后使用SVN更新或提交来应用更改。 ... [详细]
  • 本文介绍了Windows Vista操作系统中的用户账户保护功能,该功能是为了增强系统的安全性而设计的。通过对Vista测试版的体验,可以看到系统在安全性方面的进步。该功能的引入,为用户的账户安全提供了更好的保障。 ... [详细]
  • Zookeeper 总结与面试题汇总
    Zookeeper总结与面试题汇总,Go语言社区,Golang程序员人脉社 ... [详细]
  • camel_使用Camel在来自不同来源的Solr中索引数据
    camelApacheSolr是建立在Lucene之上的“流行的,快速的开源企业搜索平台”。为了进行搜索(并查找结果),通常需要从不同的源(例如内容管理 ... [详细]
  • solr导入mysql_Solr导入MySQL中的数据
    一、目标将MySQL数据库中的数据导入至Solr中,并且由Solr生成中文索引,使用Solr查询信息。二、数据导入1、将solr-8.2.0dist下的 ... [详细]
  • 技能速成|一文带你学会MybatisPlus
    一.MP简介我们知道,Mybatis属于一个半自动的ORM框架。之所以说Mybatis是一个半自动的ORM框架,原因是它还需要我们自己在注解或是映射文 ... [详细]
  • 开发笔记:MyBatis03:ResultMap及分页
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了MyBatis03:ResultMap及分页相关的知识,希望对你有一定的参考价值。 ... [详细]
  • Windows Phone 8 文件操作
    在WindowsPhone8中,操作文件的方式限制很大,对独立存储中的文件访问,可以采取两种形式:1、IsolatedSto ... [详细]
  • 部署solr建立nutch索引
    2019独角兽企业重金招聘Python工程师标准接着上篇nutch1.4的部署应用,我们来部署一下solr,solr是对lucene进行了封装的企 ... [详细]
  • java日志框架详解
    Java日志框架详解1.常用日志框架1.1Java常用日志框架类别1.2Java常用日志框架历史1.3两大日志接口阵营1.3.1基于CommonsLogging接口实现的常用日志框 ... [详细]
author-avatar
懷捻過呿_649
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有