Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.MiniZooKeeperCluster


  /**
   * Actually start the MiniHBase instance.
   */
  protected static void hBaseClusterSetup() throws Exception {
    zooKeeperCluster = new MiniZooKeeperCluster();
    int clientPort = zooKeeperCluster.startup(new File("build/test"));
    conf.set("hbase.zookeeper.property.clientPort", clientPort + "");
    // start the mini cluster
    hbaseCluster = new MiniHBaseCluster(conf, NUM_REGIONSERVERS);
    // opening the META table ensures that cluster is running
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

  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

   
    /**
     * Actually start the MiniHBase instance.
     */
    protected void hBaseClusterSetup() throws Exception {
        zooKeeperCluster = new MiniZooKeeperCluster();
        int clientPort = this.zooKeeperCluster.startup(new File("build/test"));
        conf.set("hbase.zookeeper.property.clientPort",clientPort+"");
      // start the mini cluster
      hbaseCluster = new MiniHBaseCluster(conf, NUM_REGIONSERVERS);
      // opening the META table ensures that cluster is running
View Full Code Here

  private static void startZooKeeper() throws Exception {
    if (zooKeeperCluster != null) {
      LOG.error("ZooKeeper already running");
      return;
    }
    zooKeeperCluster = new MiniZooKeeperCluster();
    zooKeeperCluster.startup(testDir);
    LOG.info("started " + zooKeeperCluster.getClass().getName());
  }
View Full Code Here

            LOG.info("vmInputArguments=" + runtime.getInputArguments());
          }
          // If 'local', defer to LocalHBaseCluster instance.  Starts master
          // and regionserver both in the one JVM.
          if (LocalHBaseCluster.isLocal(conf)) {
            final MiniZooKeeperCluster zooKeeperCluster =
              new MiniZooKeeperCluster();
            File zkDataPath = new File(conf.get("hbase.zookeeper.property.dataDir"));
            int zkClientPort = conf.getInt("hbase.zookeeper.property.clientPort", 0);
            if (zkClientPort == 0) {
              throw new IOException("No config value for hbase.zookeeper.property.clientPort");
            }
            zooKeeperCluster.setTickTime(conf.getInt("hbase.zookeeper.property.tickTime", 3000));
            zooKeeperCluster.setClientPort(zkClientPort);
            int clientPort = zooKeeperCluster.startup(zkDataPath);
            if (clientPort != zkClientPort) {
              String errorMsg = "Couldnt start ZK at requested address of " +
                  zkClientPort + ", instead got: " + clientPort + ". Aborting. Why? " +
                  "Because clients (eg shell) wont be able to find this ZK quorum";
              System.err.println(errorMsg);
View Full Code Here

  private static void startZooKeeper() throws Exception {
    if (zooKeeperCluster != null) {
      LOG.error("ZooKeeper already running");
      return;
    }
    zooKeeperCluster = new MiniZooKeeperCluster();
    zooKeeperCluster.startup(testDir);
    LOG.info("started " + zooKeeperCluster.getClass().getName());
  }
View Full Code Here

            LOG.info("vmInputArguments=" + runtime.getInputArguments());
          }
          // If 'local', defer to LocalHBaseCluster instance.  Starts master
          // and regionserver both in the one JVM.
          if (LocalHBaseCluster.isLocal(conf)) {
            final MiniZooKeeperCluster zooKeeperCluster =
              new MiniZooKeeperCluster();
            File zkDataPath = new File(conf.get("hbase.zookeeper.property.dataDir"));
            int zkClientPort = conf.getInt("hbase.zookeeper.property.clientPort", 0);
            if (zkClientPort == 0) {
              throw new IOException("No config value for hbase.zookeeper.property.clientPort");
            }
            zooKeeperCluster.setTickTime(conf.getInt("hbase.zookeeper.property.tickTime", 3000));
            zooKeeperCluster.setClientPort(zkClientPort);
            int clientPort = zooKeeperCluster.startup(zkDataPath);
            if (clientPort != zkClientPort) {
              String errorMsg = "Couldnt start ZK at requested address of " +
                  zkClientPort + ", instead got: " + clientPort + ". Aborting. Why? " +
                  "Because clients (eg shell) wont be able to find this ZK quorum";
              System.err.println(errorMsg);
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 = ZooKeeperWrapper.createInstance(conf1, "cluster1");
    zkw1.writeZNode("/1", "replication", "");
    zkw1.writeZNode("/1/replication", "master",
        conf1.get(HConstants.ZOOKEEPER_QUORUM)+":" +
            conf1.get("hbase.zookeeper.property.clientPort")+":/1");
View Full Code Here

  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

TOP

Related Classes of org.apache.hadoop.hbase.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.