Examples of ServerConfig


Examples of org.apache.zookeeper.server.ServerConfig

    return zkConf;
  }

  private static ServerConfig getZooKeeperConf() throws Exception {
    if (new File(ZK_CONF_FILE).exists()) {
      ServerConfig zkConf = new ServerConfig();
      zkConf.parse(ZK_CONF_FILE);

      return zkConf;
    } else {
      return createZooKeeperConf();
    }
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

      return createZooKeeperConf();
    }
  }

  public static boolean clearZooKeeperData() throws Exception {
    ServerConfig zkConf = getZooKeeperConf();
    File dataLogDir = new File(zkConf.getDataLogDir());
    File dataDir = new File(zkConf.getDataDir());
    return (FileUtil.fullyDelete(dataLogDir) && FileUtil.fullyDelete(dataDir));
  }
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

    return (FileUtil.fullyDelete(dataLogDir) && FileUtil.fullyDelete(dataDir));
  }
   
  public static void createAndStartZooKeeper()
    throws IOException, ConfigException, InterruptedException {
    ServerConfig zkConf = createZooKeeperConf();

    zooKeeper = new ZooKeeperServer();
    FileTxnSnapLog ftxn = new
      FileTxnSnapLog(new File(zkConf.getDataLogDir()),
                     new File(zkConf.getDataDir()));
    zooKeeper.setTxnLogFactory(ftxn);
    zooKeeper.setTickTime(zkConf.getTickTime());
    zooKeeper.setMinSessionTimeout(zkConf.getMinSessionTimeout());
    zooKeeper.setMaxSessionTimeout(zkConf.getMaxSessionTimeout());

    cnxnFactory =
      new NIOServerCnxn.Factory(zkConf.getClientPortAddress(),
                                zkConf.getMaxClientCnxns());
    cnxnFactory.startup(zooKeeper);

  }
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

  }

  public static void startZooKeeper(final Properties properties, boolean format, String path) {
    String realPath = path + "/zk_test";
    properties.setProperty("dataDir", realPath);
    final ServerConfig serverConfig = new ServerConfig();
    QuorumPeerConfig config = new QuorumPeerConfig();
    try {
      config.parseProperties(properties);
    } catch (IOException e) {
      LOG.error(e);
      throw new RuntimeException(e);
    } catch (ConfigException e) {
      LOG.error(e);
      throw new RuntimeException(e);
    }
    serverConfig.readFrom(config);
    rm(new File(realPath));
    serverThread = new Thread(new Runnable() {

      @Override
      public void run() {
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

    if (zkConfig.isDistributed()) {
      QuorumPeerMain qp = new QuorumPeerMain();
      qp.runFromConfig(zkConfig);
    } else {
      ZooKeeperServerMain zk = new ZooKeeperServerMain();
      ServerConfig serverConfig = new ServerConfig();
      serverConfig.readFrom(zkConfig);
      zk.runFromConfig(serverConfig);
    }
  }
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

                serviceRegistration.setProperties(props);
            }
           
            QuorumPeerConfig config = new QuorumPeerConfig();
            config.parseProperties(props);
            final ServerConfig serverConfig = new ServerConfig();
            serverConfig.readFrom(config);
           
            main = getZooKeeperMain();
            zkMainThread = new Thread(new Runnable() {
                public void run() {
                    try {
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

    Properties zkProperties = makeZKProps(conf);
    writeMyID(zkProperties);
    QuorumPeerConfig zkConfig = new QuorumPeerConfig();
    zkConfig.parseProperties(zkProperties);
    ShutdownableZooKeeperServerMain zk = new ShutdownableZooKeeperServerMain();
    ServerConfig serverConfig = new ServerConfig();
    serverConfig.readFrom(zkConfig);
    return new ZookeeperTuple(zk, serverConfig);
  }
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

    if (zkConfig.isDistributed()) {
      QuorumPeerMain qp = new QuorumPeerMain();
      qp.runFromConfig(zkConfig);
    } else {
      ZooKeeperServerMain zk = new ZooKeeperServerMain();
      ServerConfig serverConfig = new ServerConfig();
      serverConfig.readFrom(zkConfig);
      zk.runFromConfig(serverConfig);
    }
  }
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig

        } catch(Exception e) {
            throw new RuntimeException(e);
        }

        zooKeeperServer = new ZooKeeperServerMain();
        final ServerConfig configuration = new ServerConfig();
        configuration.readFrom(quorumConfiguration);

        new Thread() {
            public void run() {
                try {
                    zooKeeperServer.runFromConfig(configuration);
View Full Code Here

Examples of org.jboss.bootstrap.api.config.ServerConfig

   public void start()
   {
      server.registerEventHandler(this, LifecycleState.STOPPED, LifecycleState.IDLE);

      ServerConfig config = server.getConfiguration();
      String property = config.getProperty("jboss.server.temp.dir");
      if (property != null)
         tmp = new File(property);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.