Package org.apache.hadoop.hbase.zookeeper

Examples of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster


  private void setUpFixtures(HiveConf conf) throws Exception {
    conf.set("hbase.master", "local");
    String tmpdir =  System.getProperty("user.dir")+"/../build/ql/tmp";
    hbaseRoot = "file://" + tmpdir + "/hbase";
    conf.set("hbase.rootdir", hbaseRoot);
    zooKeeperCluster = new MiniZooKeeperCluster();
    zooKeeperPort = zooKeeperCluster.startup(
      new File(tmpdir, "zookeeper"));
    conf.set("hbase.zookeeper.property.clientPort",
      Integer.toString(zooKeeperPort));
    HBaseConfiguration hbaseConf = new HBaseConfiguration(conf);
View Full Code Here


    Configuration conf = getConf();
    try {
      // If 'local', defer to LocalHBaseCluster instance.  Starts master
      // and regionserver both in the one JVM.
      if (LocalHBaseCluster.isLocal(conf)) {
        final MiniZooKeeperCluster zooKeeperCluster = new MiniZooKeeperCluster(conf);
        File zkDataPath = new File(conf.get(HConstants.ZOOKEEPER_DATA_DIR));
        int zkClientPort = conf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT, 0);
        if (zkClientPort == 0) {
          throw new IOException("No config value for "
              + HConstants.ZOOKEEPER_CLIENT_PORT);
        }
        zooKeeperCluster.setDefaultClientPort(zkClientPort);

        // login the zookeeper server principal (if using security)
        ZKUtil.loginServer(conf, "hbase.zookeeper.server.keytab.file",
          "hbase.zookeeper.server.kerberos.principal", null);

        int clientPort = zooKeeperCluster.startup(zkDataPath);
        if (clientPort != zkClientPort) {
          String errorMsg = "Could not start ZK at requested port of " +
            zkClientPort + ".  ZK was started at port: " + clientPort +
            ".  Aborting as clients (e.g. shell) will not be able to find " +
            "this ZK quorum.";
View Full Code Here

    conf1.setBoolean("dfs.support.append", true);
    conf1.setLong(HConstants.THREAD_WAKE_FREQUENCY, 100);

    utility1 = new HBaseTestingUtility(conf1);
    utility1.startMiniZKCluster();
    MiniZooKeeperCluster miniZK = utility1.getZkCluster();
    zkw1 = new ZooKeeperWatcher(conf1, "cluster1", null);
    admin = new ReplicationAdmin(conf1);
    LOG.info("Setup first Zk");

    conf2 = HBaseConfiguration.create();
View Full Code Here

  throws Exception {
    this.passedZkCluster = false;
    if (this.zkCluster != null) {
      throw new IOException("Cluster already running at " + dir);
    }
    this.zkCluster = new MiniZooKeeperCluster();
    int clientPort = this.zkCluster.startup(dir);
    this.conf.set("hbase.zookeeper.property.clientPort",
      Integer.toString(clientPort));
    return this.zkCluster;
  }
View Full Code Here

  protected void setUp() throws Exception {
    File zkDataDir = new File(System.getProperty("java.io.tmpdir"));
    if (this.zkCluster != null) {
      throw new IOException("Cluster already running");
    }
    this.zkCluster = new MiniZooKeeperCluster();
    this.zkPort = this.zkCluster.startup(zkDataDir);
   
    this.zkClient = ZooKeeperTokenStore.createConnectedClient("localhost:" + zkPort, 3000,
        connectTimeoutMillis);
  }
View Full Code Here

    public void preTest(HiveConf conf) throws Exception {

      if (zooKeeperCluster == null) {
        String tmpdir =  System.getProperty("user.dir")+"/../build/ql/tmp";
        zooKeeperCluster = new MiniZooKeeperCluster();
        zkPort = zooKeeperCluster.startup(new File(tmpdir, "zookeeper"));
      }

      if (zooKeeper != null) {
        zooKeeper.close();
View Full Code Here

    conf1.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY,
        "org.apache.hadoop.hbase.replication.TestMasterReplication$CoprocessorCounter");

    utility1 = new HBaseTestingUtility(conf1);
    utility1.startMiniZKCluster();
    MiniZooKeeperCluster miniZK = utility1.getZkCluster();
    new ZooKeeperWatcher(conf1, "cluster1", null, true);

    conf2 = new Configuration(conf1);
    conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2");
View Full Code Here

    conf1.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY,
        TestCoprocessorForTagsAtSource.class.getName());

    utility1 = new HBaseTestingUtility(conf1);
    utility1.startMiniZKCluster();
    MiniZooKeeperCluster miniZK = utility1.getZkCluster();
    // Have to reget conf1 in case zk cluster location different
    // than default
    conf1 = utility1.getConfiguration();
    replicationAdmin = new ReplicationAdmin(conf1);
    LOG.info("Setup first Zk");
View Full Code Here

    hbaseConf.set(HConstants.ZOOKEEPER_QUORUM, "0.0.0.0");
    hbaseConf.setInt("hbase.master.info.port", -1);
    hbaseConf.setInt("hbase.zookeeper.property.maxClientCnxns",500);
    String zookeeperDir = new File(workDir,"zk").getAbsolutePath();
    int zookeeperPort = 2181;
    zookeeperCluster = new MiniZooKeeperCluster();
    Method m;
    Class<?> zkParam[] = {Integer.TYPE};
    try{
      m = MiniZooKeeperCluster.class.getDeclaredMethod("setDefaultClientPort",
          zkParam);
View Full Code Here

    private void setupZookeeper() {
        try {
            zookeeperDir = new File(workDir,"zk").getAbsolutePath();
            zookeeperPort = findFreePort();
            zookeeperCluster = new MiniZooKeeperCluster();
            zookeeperCluster.setDefaultClientPort(zookeeperPort);
            zookeeperCluster.startup(new File(zookeeperDir));
        } catch(Exception e) {
            throw new IllegalStateException("Failed to Setup Zookeeper Cluster",e);
        }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster

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.