本文整理了Java中org.apache.zookeeper.server.ZooKeeperServer.setMinSessionTimeout()
方法的一些代码示例,展示了ZooKeeperServer.setMinSessionTimeout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperServer.setMinSessionTimeout()
方法的具体详情如下:
包路径:org.apache.zookeeper.server.ZooKeeperServer
类名称:ZooKeeperServer
方法名:setMinSessionTimeout
暂无
代码示例来源:origin: apache/zookeeper
public void setMinSessionTimeout(int min) {
zks.setMinSessionTimeout(min);
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
public void setMinSessionTimeout(int min) {
zks.setMinSessionTimeout(min);
}
代码示例来源:origin: apache/hbase
server.setMinSessionTimeout(configuration.getInt(
"hbase.zookeeper.property.minSessionTimeout", -1));
server.setMaxSessionTimeout(configuration.getInt(
代码示例来源:origin: apache/nifi
private void startStandalone() throws IOException {
logger.info("Starting Embedded ZooKeeper Server");
final ServerConfig config = new ServerConfig();
config.readFrom(quorumPeerConfig);
try {
transactionLog = new FileTxnSnapLog(new File(config.getDataLogDir()), new File(config.getDataDir()));
embeddedZkServer = new ZooKeeperServer();
embeddedZkServer.setTxnLogFactory(transactionLog);
embeddedZkServer.setTickTime(config.getTickTime());
embeddedZkServer.setMinSessionTimeout(config.getMinSessionTimeout());
embeddedZkServer.setMaxSessionTimeout(config.getMaxSessionTimeout());
connectionFactory = ServerCnxnFactory.createFactory();
connectionFactory.configure(config.getClientPortAddress(), config.getMaxClientCnxns());
connectionFactory.startup(embeddedZkServer);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.warn("Embedded ZooKeeper Server interrupted", e);
} catch (final IOException ioe) {
throw new IOException("Failed to start embedded ZooKeeper Server", ioe);
} catch (final Exception e) {
throw new RuntimeException("Failed to start embedded ZooKeeper Server", e);
}
}
代码示例来源:origin: apache/zookeeper
/**
* Creates a ZooKeeperServer instance. It sets everything up, but doesn't
* actually start listening for clients until run() is invoked.
*
* @param dataDir the directory to put the data
*/
public ZooKeeperServer(FileTxnSnapLog txnLogFactory, int tickTime,
int minSessionTimeout, int maxSessionTimeout, ZKDatabase zkDb) {
serverStats = new ServerStats(this);
this.txnLogFactory = txnLogFactory;
this.txnLogFactory.setServerStats(this.serverStats);
this.zkDb = zkDb;
this.tickTime = tickTime;
setMinSessionTimeout(minSessionTimeout);
setMaxSessionTimeout(maxSessionTimeout);
listener = new ZooKeeperServerListenerImpl(this);
readResponseCache = new ResponseCache();
connThrottle = new BlueThrottle();
LOG.info("Created server with tickTime " + tickTime
+ " minSessionTimeout " + getMinSessionTimeout()
+ " maxSessionTimeout " + getMaxSessionTimeout()
+ " datadir " + txnLogFactory.getDataDir()
+ " snapdir " + txnLogFactory.getSnapDir());
}
代码示例来源:origin: org.apache.zookeeper/zookeeper
zkServer.setTxnLogFactory(txnLog);
zkServer.setTickTime(config.tickTime);
zkServer.setMinSessionTimeout(config.minSessionTimeout);
zkServer.setMaxSessionTimeout(config.maxSessionTimeout);
cnxnFactory = ServerCnxnFactory.createFactory();
代码示例来源:origin: apache/hive
server.setMinSessionTimeout(configuration.getInt("hbase.zookeeper.property.minSessionTimeout", -1));
server.setMaxSessionTimeout(configuration.getInt("hbase.zookeeper.property.maxSessionTimeout", -1));
NIOServerCnxnFactory standaloneServerFactory;
代码示例来源:origin: apache/zookeeper
zs.setMinSessionTimeout(MINSESS);
zs.setMaxSessionTimeout(MAXSESS);
代码示例来源:origin: OryxProject/oryx
zkServer.setMinSessionTimeout(serverConfig.getMinSessionTimeout());
zkServer.setMaxSessionTimeout(serverConfig.getMaxSessionTimeout());
代码示例来源:origin: org.apache.hadoop/zookeeper
public void setMinSessionTimeout(int min) {
zks.setMinSessionTimeout(min);
}
代码示例来源:origin: com.github.sgroschupf/zkclient
private void startSingleZkServer(final int tickTime, final File dataDir, final File dataLogDir, final int port) {
try {
_zk = new ZooKeeperServer(dataDir, dataLogDir, tickTime);
_zk.setMinSessionTimeout(_minSessionTimeout);
_nioFactory = new NIOServerCnxn.Factory(new InetSocketAddress(port));
_nioFactory.startup(_zk);
} catch (IOException e) {
throw new ZkException("Unable to start single ZooKeeper server.", e);
} catch (InterruptedException e) {
throw new ZkInterruptedException(e);
}
}
代码示例来源:origin: Cue/greplin-zookeeper-utils
private void configure(ZooKeeperServer zooKeeperServer, ServerConfig config) throws IOException {
zooKeeperServer.setTxnLogFactory(
new FileTxnSnapLog(new File(config.getDataLogDir()), new File(config.getDataDir())));
zooKeeperServer.setTickTime(config.getTickTime());
zooKeeperServer.setMinSessionTimeout(config.getMinSessionTimeout());
zooKeeperServer.setMaxSessionTimeout(config.getMaxSessionTimeout());
}
代码示例来源:origin: com.101tec/zkclient
private void startSingleZkServer(final int tickTime, final File dataDir, final File dataLogDir, final int port) {
try {
_zk = new ZooKeeperServer(dataDir, dataLogDir, tickTime);
_zk.setMinSessionTimeout(_minSessionTimeout);
_nioFactory = new NIOServerCnxnFactory();
int maxClientConnections = 0; // 0 means unlimited
_nioFactory.configure(new InetSocketAddress(port), maxClientConnections);
_nioFactory.startup(_zk);
} catch (IOException e) {
throw new ZkException("Unable to start single ZooKeeper server.", e);
} catch (InterruptedException e) {
throw new ZkInterruptedException(e);
}
}
代码示例来源:origin: com.github.adyliu/zkclient
private void startSingleZkServer(final int tickTime, final File dataDir, final File dataLogDir, final int port) {
try {
_zk = new ZooKeeperServer(dataDir, dataLogDir, tickTime);
_zk.setMinSessionTimeout(_minSessionTimeout);
_nioFactory = ServerCnxnFactory.createFactory(port, 60);
_nioFactory.startup(_zk);
} catch (IOException e) {
throw new ZkException("Unable to start single ZooKeeper server.", e);
} catch (InterruptedException e) {
throw new ZkInterruptedException(e);
}
}
代码示例来源:origin: adyliu/zkclient
private void startSingleZkServer(final int tickTime, final File dataDir, final File dataLogDir, final int port) {
try {
_zk = new ZooKeeperServer(dataDir, dataLogDir, tickTime);
_zk.setMinSessionTimeout(_minSessionTimeout);
_nioFactory = ServerCnxnFactory.createFactory(port, 60);
_nioFactory.startup(_zk);
} catch (IOException e) {
throw new ZkException("Unable to start single ZooKeeper server.", e);
} catch (InterruptedException e) {
throw new ZkInterruptedException(e);
}
}
代码示例来源:origin: fabric8io/jube
public ZooKeeperServerFactory(QuorumPeerConfig config) throws IOException, InterruptedException {
LOGGER.info("Creating zookeeper server with: {}", config);
ServerConfig serverConfig = getServerConfig(config);
ZooKeeperServer zkServer = new ZooKeeperServer();
FileTxnSnapLog ftxn = new FileTxnSnapLog(new File(serverConfig.getDataLogDir()), new File(serverConfig.getDataDir()));
zkServer.setTxnLogFactory(ftxn);
zkServer.setTickTime(serverConfig.getTickTime());
zkServer.setMinSessionTimeout(serverConfig.getMinSessionTimeout());
zkServer.setMaxSessionTimeout(serverConfig.getMaxSessionTimeout());
NIOServerCnxnFactory cnxnFactory = new NIOServerCnxnFactory() {
protected void configureSaslLogin() throws IOException {
}
};
InetSocketAddress clientPortAddress = serverConfig.getClientPortAddress();
cnxnFactory.configure(clientPortAddress, serverConfig.getMaxClientCnxns());
updateZooKeeperURL(cnxnFactory.getLocalAddress(), cnxnFactory.getLocalPort());
try {
LOGGER.debug("Starting ZooKeeper server on address %s", serverConfig.getClientPortAddress());
cnxnFactory.startup(zkServer);
LOGGER.debug("Started ZooKeeper server");
} catch (Exception e) {
LOGGER.warn(String.format("Failed to start ZooKeeper server, reason : %s", e));
cnxnFactory.shutdown();
throw e;
}
}
代码示例来源:origin: com.intropro.prairie/zookeeper-unit
private void runFromConfig(ServerConfig config) throws IOException {
zkServer = new ZooKeeperServer();
try {
txnLog = new FileTxnSnapLog(new File(config.getDataLogDir()), new File(config.getDataDir()));
zkServer.setTxnLogFactory(txnLog);
zkServer.setTickTime(config.getTickTime());
zkServer.setMinSessionTimeout(config.getMinSessionTimeout());
zkServer.setMaxSessionTimeout(config.getMaxSessionTimeout());
cnxnFactory = ServerCnxnFactory.createFactory();
cnxnFactory.configure(config.getClientPortAddress(),
config.getMaxClientCnxns());
cnxnFactory.startup(zkServer);
} catch (InterruptedException e) {
if (zkServer.isRunning()) {
zkServer.shutdown();
}
}
}
代码示例来源:origin: org.fusesource.fabric/fabric-zookeeper-spring
public void afterPropertiesSet() throws Exception {
if( purge ) {
deleteFilesInDir(getDataLogDir());
deleteFilesInDir(getDataDir());
}
FileTxnSnapLog ftxn = new FileTxnSnapLog(getDataLogDir(), getDataDir());
zooKeeperServer.setTxnLogFactory(ftxn);
zooKeeperServer.setTickTime(getTickTime());
zooKeeperServer.setMinSessionTimeout(getMinSessionTimeout());
zooKeeperServer.setMaxSessionTimeout(getMaxSessionTimeout());
connectionFactory = new NIOServerCnxnFactory();
connectionFactory.configure(getClientPortAddress(), getMaxClientConnections());
connectionFactory.startup(zooKeeperServer);
}
代码示例来源:origin: jboss-fuse/fabric8
public void afterPropertiesSet() throws Exception {
if( purge ) {
deleteFilesInDir(getDataLogDir());
deleteFilesInDir(getDataDir());
}
FileTxnSnapLog ftxn = new FileTxnSnapLog(getDataLogDir(), getDataDir());
zooKeeperServer.setTxnLogFactory(ftxn);
zooKeeperServer.setTickTime(getTickTime());
zooKeeperServer.setMinSessionTimeout(getMinSessionTimeout());
zooKeeperServer.setMaxSessionTimeout(getMaxSessionTimeout());
connectionFactory = new NIOServerCnxnFactory();
connectionFactory.configure(getClientPortAddress(), getMaxClientConnections());
connectionFactory.startup(zooKeeperServer);
}
代码示例来源:origin: io.fabric8/fabric-zookeeper-spring
public void afterPropertiesSet() throws Exception {
if( purge ) {
deleteFilesInDir(getDataLogDir());
deleteFilesInDir(getDataDir());
}
FileTxnSnapLog ftxn = new FileTxnSnapLog(getDataLogDir(), getDataDir());
zooKeeperServer.setTxnLogFactory(ftxn);
zooKeeperServer.setTickTime(getTickTime());
zooKeeperServer.setMinSessionTimeout(getMinSessionTimeout());
zooKeeperServer.setMaxSessionTimeout(getMaxSessionTimeout());
connectionFactory = new NIOServerCnxnFactory();
connectionFactory.configure(getClientPortAddress(), getMaxClientConnections());
connectionFactory.startup(zooKeeperServer);
}
内容来源于网络,如有侵权,请联系作者删除!