org.apache.zookeeper.server.ZooKeeperServerConf类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(112)

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

相关文章

ZooKeeperServerConf类方法