Documentation ¶
Index ¶
Constants ¶
const GUESS_MYID = 0
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ZkConfig ¶
func MakeZkConfigFromString ¶
Create a config for this instance.
<server_id>@<hostname>:<leader_port>:<election_port>:<client_port>
If server_id > 1000, then we assume this is a global quorum. server_id's must be 1-255, global id's are 1001-1255 mod 1000.
func NewZkConfig ¶
func NewZkConfig() *ZkConfig
ServerId is a unique id for a server - must be 1-255
func (*ZkConfig) ConfigFile ¶
func (*ZkConfig) DirectoryList ¶
type Zkd ¶
type Zkd struct {
// contains filtered or unexported fields
}
Zkd manages the running of ZooKeeper servers.
func StartLocalZk ¶
StartLocalZk is a helper method to create a local ZK process. Used in tests, mostly. It will log.Fatal out if there is an error. Each call should use different serverID / ports, so tests don't interfere with eachother. Use the testfiles package to achieve this.
func (*Zkd) Done ¶
func (zkd *Zkd) Done() <-chan struct{}
Done returns a channel that is closed when the underlying process started by this Zkd has terminated. If the process was started by someone else, this channel will never be closed.