Examples of parseProperties()


Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

      // Configure a local zookeeper instance
      Properties zkProperties = configLocalZooKeeper(zkDir);

      QuorumPeerConfig qpConfig = new QuorumPeerConfig();
      qpConfig.parseProperties(zkProperties);

      // Create and run the zookeeper instance
      final InternalZooKeeper zookeeper = new InternalZooKeeper();
      final ServerConfig zkConfig = new ServerConfig();
      zkConfig.readFrom(qpConfig);
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

      public void run() {
        try {
          // 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) {
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

      Integer.valueOf(properties.getProperty("clientPort")));
    assertEquals("localhost:2888:3888", properties.get("server.0"));

    HQuorumPeer.writeMyID(properties);
    QuorumPeerConfig config = new QuorumPeerConfig();
    config.parseProperties(properties);

    assertEquals(this.dataDir.toString(), config.getDataDir());
    assertEquals(2181, config.getClientPortAddress().getPort());
    Map<Long,QuorumServer> servers = config.getServers();
    assertEquals(3, servers.size());
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

    System.setProperty("hbase.master.hostname", "foo.bar");
    is = new ByteArrayInputStream(s.getBytes());
    properties = ZKConfig.parseZooCfg(conf, is);
    assertEquals("foo.bar:2888:3888", properties.get("server.0"));

    config.parseProperties(properties);

    servers = config.getServers();
    server = servers.get(Long.valueOf(0));
    assertEquals("foo.bar", server.addr.getHostName());
  }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

    Configuration conf = HBaseConfiguration.create();
    try {
      Properties zkProperties = makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);
      runZKServer(zkConfig);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(-1);
    }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

    assertEquals(dataDir.toString(), properties.get("dataDir"));
    assertEquals(Integer.valueOf(2181), Integer.valueOf(properties.getProperty("clientPort")));
    assertEquals("localhost:2888:3888", properties.get("server.0"));

    QuorumPeerConfig config = new QuorumPeerConfig();
    config.parseProperties(properties);

    assertEquals(dataDir.toString(), config.getDataDir());
    assertEquals(2181, config.getClientPortAddress().getPort());
    Map<Long,QuorumServer> servers = config.getServers();
    assertEquals(1, servers.size());
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

    System.setProperty("hbase.master.hostname", "foo.bar");
    is = new ByteArrayInputStream(s.getBytes());
    properties = HQuorumPeer.parseZooCfg(conf, is);
    assertEquals("foo.bar:2888:3888", properties.get("server.0"));

    config.parseProperties(properties);

    servers = config.getServers();
    server = servers.get(Long.valueOf(0));
    assertEquals("foo.bar", server.addr.getHostName());
  }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

                properties.setProperty("server." + thisSpec.getServerId(), String.format("localhost:%d:%d", thisSpec.getQuorumPort(), thisSpec.getElectionPort()));
            }
        }

        QuorumPeerConfig config = new QuorumPeerConfig();
        config.parseProperties(properties);
        return config;
    }
}
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

    Configuration conf = new HamaConfiguration(baseConf);
    try {
      Properties zkProperties = makeZKProps(conf);
      writeMyID(zkProperties);
      QuorumPeerConfig zkConfig = new QuorumPeerConfig();
      zkConfig.parseProperties(zkProperties);
      runZKServer(zkConfig);
    } catch (Exception e) {
      LOG.error("Exception during ZooKeeper startup - exiting...",e);
      System.exit(-1);
    }
View Full Code Here

Examples of org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties()

    assertEquals(dataDir.toString(), properties.get("dataDir"));
    assertEquals(Integer.valueOf(2181), Integer.valueOf(properties.getProperty("clientPort")));
    assertEquals("localhost:2888:3888", properties.get("server.0"));

    QuorumPeerConfig config = new QuorumPeerConfig();
    config.parseProperties(properties);

    int tickTime = config.getTickTime();
    assertEquals(2000, tickTime);
    int initLimit = config.getInitLimit();
    assertEquals(10, initLimit);
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.