Search in sources :

Example 1 with ZookeeperServerConfig

use of com.yahoo.cloud.config.ZookeeperServerConfig in project vespa by vespa-engine.

the class ClusterControllerTestCase method assertZookeeperServerConfig.

private void assertZookeeperServerConfig(TestRoot root, int id) {
    ZookeeperServerConfig.Builder builder = new ZookeeperServerConfig.Builder();
    root.getConfig(builder, "admin/standalone/cluster-controllers/" + id);
    ZookeeperServerConfig config = new ZookeeperServerConfig(builder);
    assertThat(config.server().size(), is(3));
    assertThat(config.myid(), is(id));
    Collection<Integer> serverIds = Collections2.transform(config.server(), new Function<ZookeeperServerConfig.Server, Integer>() {

        @Override
        public Integer apply(ZookeeperServerConfig.Server server) {
            return server.id();
        }
    });
    assertTrue(serverIds.contains(id));
}
Also used : ZookeeperServerConfig(com.yahoo.cloud.config.ZookeeperServerConfig)

Example 2 with ZookeeperServerConfig

use of com.yahoo.cloud.config.ZookeeperServerConfig in project vespa by vespa-engine.

the class ZooKeeperServerTest method juteMaxBufferCanBeSet.

@Test
public void juteMaxBufferCanBeSet() throws IOException {
    ZookeeperServerConfig.Builder builder = new ZookeeperServerConfig.Builder();
    builder.myid(1);
    File idFile = folder.newFile();
    File cfgFile = folder.newFile();
    builder.server(new ZookeeperServerConfig.Server.Builder().id(0).hostname("testhost"));
    builder.zooKeeperConfigFile(cfgFile.getAbsolutePath());
    builder.myidFile(idFile.getAbsolutePath());
    createServer(builder);
    assertThat(System.getProperty(ZooKeeperServer.ZOOKEEPER_JUTE_MAX_BUFFER), is("" + new ZookeeperServerConfig(builder).juteMaxBuffer()));
    final int max_buffer = 1;
    builder.juteMaxBuffer(max_buffer);
    createServer(builder);
    assertThat(System.getProperty(ZooKeeperServer.ZOOKEEPER_JUTE_MAX_BUFFER), is("" + max_buffer));
}
Also used : ZookeeperServerConfig(com.yahoo.cloud.config.ZookeeperServerConfig) File(java.io.File) Test(org.junit.Test)

Aggregations

ZookeeperServerConfig (com.yahoo.cloud.config.ZookeeperServerConfig)2 File (java.io.File)1 Test (org.junit.Test)1