本文整理匯總了Java中org.apache.zookeeper.server.ServerConfig.getTickTime方法的典型用法代碼示例。如果您正苦於以下問題:Java ServerConfig.getTickTime方法的具體用法?Java ServerConfig.getTickTime怎麽用?Java ServerConfig.getTickTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.zookeeper.server.ServerConfig
的用法示例。
在下文中一共展示了ServerConfig.getTickTime方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: TestZooKeeperServer
import org.apache.zookeeper.server.ServerConfig; //導入方法依賴的package包/類
public TestZooKeeperServer(FileTxnSnapLog txnLog, ServerConfig config)
{
super(txnLog, config.getTickTime(), config.getMinSessionTimeout(), config.getMaxSessionTimeout(), null);
}
示例2: runFromConfig
import org.apache.zookeeper.server.ServerConfig; //導入方法依賴的package包/類
@Override
public void runFromConfig(final ServerConfig config) throws IOException {
ServerConfig newServerConfig = new ServerConfig() {
public void parse(String[] args) {
config.parse(args);
}
public void parse(String path)
throws QuorumPeerConfig.ConfigException {
config.parse(path);
}
public void readFrom(QuorumPeerConfig otherConfig) {
config.readFrom(otherConfig);
}
public InetSocketAddress getClientPortAddress() {
return config.getClientPortAddress();
}
public String getDataDir() {
return config.getDataDir();
}
public String getDataLogDir() {
return config.getDataLogDir();
}
public int getTickTime() {
return config.getTickTime();
}
public int getMaxClientCnxns() {
dataDir = getDataDir();
dataLogDir = getDataLogDir();
tickTime = getTickTime();
minSessionTimeout = getMinSessionTimeout();
maxSessionTimeout = getMaxSessionTimeout();
maxClientCnxns = 0;
return 0;
}
public int getMinSessionTimeout() {
return config.getMinSessionTimeout();
}
public int getMaxSessionTimeout() {
return config.getMaxSessionTimeout();
}
};
newServerConfig.getMaxClientCnxns();
super.runFromConfig(newServerConfig);
}