|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.jini.start.config.ServiceConfiguration
com.bigdata.jini.start.config.JavaServiceConfiguration
com.bigdata.jini.start.config.ZookeeperServerConfiguration
public class ZookeeperServerConfiguration
zookeeper server configuration.
| Nested Class Summary | |
|---|---|
static interface |
ZookeeperServerConfiguration.Options
Zookeeper server configuration options. |
static class |
ZookeeperServerConfiguration.ZookeeperRunningException
Exception throw if there is already a zookeeper server instance running on the localhost. |
class |
ZookeeperServerConfiguration.ZookeeperServiceStarter<V extends ZookeeperProcessHelper>
|
| Nested classes/interfaces inherited from class com.bigdata.jini.start.config.JavaServiceConfiguration |
|---|
JavaServiceConfiguration.JavaServiceStarter<V extends ProcessHelper> |
| Nested classes/interfaces inherited from class com.bigdata.jini.start.config.ServiceConfiguration |
|---|
ServiceConfiguration.AbstractServiceStarter<V extends ProcessHelper> |
| Field Summary | |
|---|---|
int |
clientPort
The zookeeper client port. |
String |
configFile
The basename of the generated zookeeper configuration file. |
File |
dataDir
The data directory as specified by ZookeeperServerConfiguration.Options.DATA_DIR. |
File |
dataLogDir
The data log directory as specified by ZookeeperServerConfiguration.Options.DATA_LOG_DIR. |
Map<String,String> |
other
Zookeeper properties that we don't need to know about explictly (just passed through). |
String |
servers
|
| Fields inherited from class com.bigdata.jini.start.config.JavaServiceConfiguration |
|---|
classpath, defaultJavaArgs, javaHome, log4j |
| Fields inherited from class com.bigdata.jini.start.config.ServiceConfiguration |
|---|
args, className, constraints, log, options, replicationCount, serviceCount, serviceDir, timeout |
| Constructor Summary | |
|---|---|
ZookeeperServerConfiguration(net.jini.config.Configuration config)
|
|
| Method Summary | |
|---|---|
protected long |
getDefaultTimeout()
The default used for ServiceConfiguration.Options.TIMEOUT (4000 milliseconds). |
ZookeeperServerEntry[] |
getZookeeperServerEntries()
Parses out the zookeeper server descriptions. |
static ZookeeperServerEntry[] |
getZookeeperServerEntries(String servers)
Parses out the zookeeper server descriptions. |
JavaServiceConfiguration.JavaServiceStarter |
newServiceStarter(IServiceListener listener)
Not supported. |
ZookeeperServerConfiguration.ZookeeperServiceStarter |
newServiceStarter(IServiceListener listener,
ZookeeperServerEntry entry)
(Re-)starts the zookeeper server instance identified in the ZookeeperServerEntry unless it is already running using the
properties defined in the Configuration. |
| Methods inherited from class com.bigdata.jini.start.config.JavaServiceConfiguration |
|---|
getClassName, getClasspath, getDefaultJavaArgs, getJavaHome, getLog4j, toString |
| Methods inherited from class com.bigdata.jini.start.config.ServiceConfiguration |
|---|
canStartService, canStartService, concat, getArgs, getClassPath, getConstraints, getOptions, getReplicationCount, getServiceCount, getServiceDir, getStringArray, getTimeout, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final String servers
public final int clientPort
public final File dataDir
ZookeeperServerConfiguration.Options.DATA_DIR.
public final File dataLogDir
ZookeeperServerConfiguration.Options.DATA_LOG_DIR.
public final String configFile
ZookeeperServerConfiguration.Options.CONFIG_FILEpublic final Map<String,String> other
| Constructor Detail |
|---|
public ZookeeperServerConfiguration(net.jini.config.Configuration config)
throws net.jini.config.ConfigurationException
className - config -
net.jini.config.ConfigurationException| Method Detail |
|---|
protected long getDefaultTimeout()
ServiceConfiguration.Options.TIMEOUT (4000 milliseconds).
getDefaultTimeout in class ServiceConfiguration
public ZookeeperServerEntry[] getZookeeperServerEntries()
throws net.jini.config.ConfigurationException
net.jini.config.ConfigurationException
public static ZookeeperServerEntry[] getZookeeperServerEntries(String servers)
throws net.jini.config.ConfigurationException
The - servers per ZookeeperServerConfiguration.Options.SERVERS
net.jini.config.ConfigurationException
public ZookeeperServerConfiguration.ZookeeperServiceStarter newServiceStarter(IServiceListener listener,
ZookeeperServerEntry entry)
ZookeeperServerEntry unless it is already running using the
properties defined in the Configuration.
The difference between a "start" and a "restart" is whether the zookeeper "myid" file exists in the data directory for the service. If it does, then we "restart" zookeeper using the existing configuration. If it does not, then we generate the zookeeper configuration file and the myid file and then start zookeeper. Of course, how a server restart for zookeeper fairs depends on whether you took down the service or if it crashed, etc.
listener - entry - Identifies the specific server instance to start.
A tighter zookeeper integration could probably fix this issue. In
order to tell whether or not zookeeper is already running we test
"ruok" for the client port (it we don't test then we might see a
BindException in the process output, but we don't get an
error when we execute the JVM to run zookeeper). Since all
instances use the same ZookeeperServerConfiguration.Options.CLIENT_PORT, all we know is
whether or not there are any instances running which were
configured for that client port, but not how many and not which
ones.
Also see ZookeeperProcessHelper.kill(boolean), which has
difficulties knowing which instance should be killed - it will kill
which one is currently answering at the clientPost on the
localhost!
public JavaServiceConfiguration.JavaServiceStarter newServiceStarter(IServiceListener listener)
newServiceStarter in class JavaServiceConfigurationnewServiceStarter(IServiceListener, ZookeeperServerEntry)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||