本文整理了Java中org.apache.zookeeper.server.ZooKeeperServerConf
类的一些代码示例,展示了ZooKeeperServerConf
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperServerConf
类的具体详情如下:
包路径:org.apache.zookeeper.server.ZooKeeperServerConf
类名称:ZooKeeperServerConf
[英]Configuration data for a ZooKeeperServer. This class is immutable.
[中]ZookePerserver的配置数据。这个类是不变的。
代码示例来源:origin: apache/zookeeper
@Before public void setUp() {
c = new ZooKeeperServerConf(1, "a", "b", 2, 3, 4, 5, 6L);
}
@Test public void testGetters() {
代码示例来源:origin: apache/zookeeper
@Override
public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs) {
CommandResponse response = initializeResponse();
response.putAll(zkServer.getConf().toMap());
return response;
}
}
代码示例来源:origin: apache/zookeeper
@Test public void testGetters() {
assertEquals(1, c.getClientPort());
assertEquals("a", c.getDataDir());
assertEquals("b", c.getDataLogDir());
assertEquals(2, c.getTickTime());
assertEquals(3, c.getMaxClientCnxnsPerHost());
assertEquals(4, c.getMinSessionTimeout());
assertEquals(5, c.getMaxSessionTimeout());
assertEquals(6L, c.getServerId());
}
@Test public void testToMap() {
代码示例来源:origin: apache/zookeeper
public ZooKeeperServerConf getConf() {
return new ZooKeeperServerConf
(getClientPort(),
zkDb.snapLog.getSnapDir().getAbsolutePath(),
zkDb.snapLog.getDataDir().getAbsolutePath(),
getTickTime(),
serverCnxnFactory.getMaxClientCnxnsPerHost(),
getMinSessionTimeout(),
getMaxSessionTimeout(),
getServerId());
}
代码示例来源:origin: apache/zookeeper
@Test public void testToMap() {
Map<String, Object> m = c.toMap();
assertEquals(8, m.size());
assertEquals(Integer.valueOf(1), m.get(ZooKeeperServerConf.KEY_CLIENT_PORT));
assertEquals("a", m.get(ZooKeeperServerConf.KEY_DATA_DIR));
assertEquals("b", m.get(ZooKeeperServerConf.KEY_DATA_LOG_DIR));
assertEquals(Integer.valueOf(2), m.get(ZooKeeperServerConf.KEY_TICK_TIME));
assertEquals(Integer.valueOf(3), m.get(ZooKeeperServerConf.KEY_MAX_CLIENT_CNXNS));
assertEquals(Integer.valueOf(4), m.get(ZooKeeperServerConf.KEY_MIN_SESSION_TIMEOUT));
assertEquals(Integer.valueOf(5), m.get(ZooKeeperServerConf.KEY_MAX_SESSION_TIMEOUT));
assertEquals(Long.valueOf(6L), m.get(ZooKeeperServerConf.KEY_SERVER_ID));
}
}
内容来源于网络,如有侵权,请联系作者删除!