blob: 2125ed12c5e9f53411e4bd4e93a6d8db102b7a21 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.zookeeper;
import com.google.inject.Inject;
import com.yahoo.cloud.config.ZookeeperServerConfig;
import com.yahoo.component.AbstractComponent;
import java.nio.file.Path;
/**
* Main component controlling startup and stop of zookeeper server
*
* @author Ulf Lilleengen
* @author Harald Musum
*/
public class VespaZooKeeperServerImpl extends AbstractComponent implements VespaZooKeeperServer {
private final ZooKeeperRunner zooKeeperRunner;
@Inject
public VespaZooKeeperServerImpl(ZookeeperServerConfig zookeeperServerConfig) {
this.zooKeeperRunner = new ZooKeeperRunner(zookeeperServerConfig, this);
}
@Override
public void deconstruct() {
zooKeeperRunner.shutdown();
super.deconstruct();
}
public void start(Path path) {
new Server().start(path);
}
}
|