Package org.apache.zookeeper.server

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


        MyZooKeeperServerMain(QuorumPeerConfig config) {
            this.config = config;
        }

        public void startup() throws IOException {
             ServerConfig serverConfig = new ServerConfig();
             serverConfig.readFrom(config);
             runFromConfig(serverConfig);
        }
View Full Code Here

    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

    }

    @Override
    public void runFromConfig(QuorumPeerConfig config) throws Exception
    {
        ServerConfig        serverConfig = new ServerConfig();
        serverConfig.readFrom(config);
        latch.countDown();
        super.runFromConfig(serverConfig);
    }
View Full Code Here

    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

      p.setProperty("tickTime", _tickTime);
      p.setProperty("clientPort", String.valueOf(_clientPort));
      p.setProperty("dataDir", _dataDir);
      qpc.parseProperties(p);

      ServerConfig serverConfig = new ServerConfig();
      serverConfig.readFrom(qpc);

      runFromConfig(serverConfig);

      _mainThread = new Thread(new Runnable()
      {
View Full Code Here

    ZooKeeperServerMain zksm;
    ServerConfig serverConfig;

    public void init(String port, String data) {
        zksm = new ZooKeeperServerMain();
        serverConfig = new ServerConfig();
        serverConfig.parse(new String[]{port, data});

    }
View Full Code Here

      LOGGER.debug("starting zookeeper server on {}:{}",
          p.get("clientPortAddress"), p.get("clientPort"));
    }
    QuorumPeerConfig qpc = new QuorumPeerConfig();
    qpc.parseProperties(p);
    config = new ServerConfig();
    config.readFrom(qpc);
    zkThread = new Thread(this);
    zkThread.start();
  }
View Full Code Here

    }

    @Override
    public void runFromConfig(QuorumPeerConfig config) throws Exception
    {
        ServerConfig serverConfig = new ServerConfig();
        serverConfig.readFrom(config);
        latch.countDown();
        try
        {
            super.runFromConfig(serverConfig);
        }
View Full Code Here

          // Configure a local zookeeper instance
          Properties zkProperties = generateLocalZkProperties();
          QuorumPeerConfig qpConfig = new QuorumPeerConfig();
          qpConfig.parseProperties(zkProperties);
          // run the zookeeper instance
          final ServerConfig zkConfig = new ServerConfig();
          zkConfig.readFrom(qpConfig);
          zookeeper.runFromConfig(zkConfig);
        } catch (QuorumPeerConfig.ConfigException qpcce) {
          throw new RuntimeException("parse of generated ZK config file " +
                                       "has failed.", qpcce);
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.server.ServerConfig

Copyright © 2018 www.massapicom. 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.