org.apache.zookeeper.server.ZooKeeperServerListenerImpl类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.apache.zookeeper.server.ZooKeeperServerListenerImpl类的一些代码示例,展示了ZooKeeperServerListenerImpl类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperServerListenerImpl类的具体详情如下:
包路径:org.apache.zookeeper.server.ZooKeeperServerListenerImpl
类名称:ZooKeeperServerListenerImpl

ZooKeeperServerListenerImpl介绍

[英]Default listener implementation, which will be used to notify internal errors. For example, if some critical thread has stopped due to fatal errors, then it will get notifications and will change the state of ZooKeeper server to ERROR representing an error status.
[中]默认侦听器实现,用于通知内部错误。例如,如果某个关键线程由于致命错误而停止,那么它将收到通知,并将ZooKeeper服务器的状态更改为表示错误状态的错误。

代码示例

代码示例来源:origin: apache/zookeeper

/**
 * Creates a ZooKeeperServer instance. Nothing is setup, use the setX
 * methods to prepare the instance (eg datadir, datalogdir, ticktime,
 * builder, etc...)
 *
 * @throws IOException
 */
public ZooKeeperServer() {
  serverStats = new ServerStats(this);
  listener = new ZooKeeperServerListenerImpl(this);
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

/**
 * Creates a ZooKeeperServer instance. Nothing is setup, use the setX
 * methods to prepare the instance (eg datadir, datalogdir, ticktime, 
 * builder, etc...)
 * 
 * @throws IOException
 */
public ZooKeeperServer() {
  serverStats = new ServerStats(this);
  listener = new ZooKeeperServerListenerImpl(this);
}

代码示例来源:origin: org.apache.zookeeper/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,
    DataTreeBuilder treeBuilder, ZKDatabase zkDb) {
  serverStats = new ServerStats(this);
  this.txnLogFactory = txnLogFactory;
  this.txnLogFactory.setServerStats(this.serverStats);
  this.zkDb = zkDb;
  this.tickTime = tickTime;
  this.minSessionTimeout = minSessionTimeout;
  this.maxSessionTimeout = maxSessionTimeout;
  listener = new ZooKeeperServerListenerImpl(this);
  LOG.info("Created server with tickTime " + tickTime
      + " minSessionTimeout " + getMinSessionTimeout()
      + " maxSessionTimeout " + getMaxSessionTimeout()
      + " datadir " + txnLogFactory.getDataDir()
      + " snapdir " + txnLogFactory.getSnapDir());
}

代码示例来源: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());
}

相关文章