org.apache.zookeeper.server
Class ServerConfig

java.lang.Object
  extended by org.apache.zookeeper.server.ServerConfig

public class ServerConfig
extends Object

Server configuration storage. We use this instead of Properties as it's typed.


Field Summary
protected  InetSocketAddress clientPortAddress
           
protected  File dataDir
           
protected  File dataLogDir
           
protected  int maxClientCnxns
           
protected  int maxSessionTimeout
          defaults to -1 if not set explicitly
protected  int minSessionTimeout
          defaults to -1 if not set explicitly
protected  int tickTime
           
 
Constructor Summary
ServerConfig()
           
 
Method Summary
 InetSocketAddress getClientPortAddress()
           
 File getDataDir()
           
 File getDataLogDir()
           
 int getMaxClientCnxns()
           
 int getMaxSessionTimeout()
          maximum session timeout in milliseconds, -1 if unset
 int getMinSessionTimeout()
          minimum session timeout in milliseconds, -1 if unset
 int getTickTime()
           
 void parse(String path)
          Parse a ZooKeeper configuration file
 void parse(String[] args)
          Parse arguments for server configuration
 void readFrom(QuorumPeerConfig config)
          Read attributes from a QuorumPeerConfig.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clientPortAddress

protected InetSocketAddress clientPortAddress

dataDir

protected File dataDir

dataLogDir

protected File dataLogDir

tickTime

protected int tickTime

maxClientCnxns

protected int maxClientCnxns

minSessionTimeout

protected int minSessionTimeout
defaults to -1 if not set explicitly


maxSessionTimeout

protected int maxSessionTimeout
defaults to -1 if not set explicitly

Constructor Detail

ServerConfig

public ServerConfig()
Method Detail

parse

public void parse(String[] args)
Parse arguments for server configuration

Parameters:
args - clientPort dataDir and optional tickTime
Throws:
IllegalArgumentException - on invalid usage

parse

public void parse(String path)
           throws QuorumPeerConfig.ConfigException
Parse a ZooKeeper configuration file

Parameters:
path - the patch of the configuration file
Throws:
QuorumPeerConfig.ConfigException - error processing configuration

readFrom

public void readFrom(QuorumPeerConfig config)
Read attributes from a QuorumPeerConfig.

Parameters:
config -

getClientPortAddress

public InetSocketAddress getClientPortAddress()

getDataDir

public File getDataDir()

getDataLogDir

public File getDataLogDir()

getTickTime

public int getTickTime()

getMaxClientCnxns

public int getMaxClientCnxns()

getMinSessionTimeout

public int getMinSessionTimeout()
minimum session timeout in milliseconds, -1 if unset


getMaxSessionTimeout

public int getMaxSessionTimeout()
maximum session timeout in milliseconds, -1 if unset



Copyright © 2011 The Apache Software Foundation