blob: c1e8727278cd18ce367126be1f70502d8f9a7b78 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.zookeeper;
import com.yahoo.cloud.config.ZookeeperServerConfig;
import com.yahoo.net.HostName;
import java.time.Duration;
/**
* Interface for administering a zookeeper cluster. Currently only supports reconfiguring a zookeeper cluster.
*
* @author hmusum
*/
public interface VespaZooKeeperAdmin {
void reconfigure(String connectionSpec, String servers) throws ReconfigException;
/* Timeout for connecting to ZooKeeper */
default Duration sessionTimeout() { return Duration.ofSeconds(30); }
default String localConnectionSpec(ZookeeperServerConfig config) { return HostName.getLocalhost() + ":" + config.clientPort(); }
}
|