Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.MiniHBaseCluster


    // filesystem ends up being local
   
    super.setUp();

    // Start up HBase cluster
    hCluster = new MiniHBaseCluster(conf, 1, dfsCluster, true);
    LOG.debug("\n\n\n\n\t\t\tSetup Complete\n\n\n\n");
  }
View Full Code Here


  public void setUp() throws Exception {
    super.setUp();
    // Start up HBase cluster
    // Only one region server.  MultiRegionServer manufacturing code below
    // depends on there being one region server only.
    hCluster = new MiniHBaseCluster(conf, 1, dfsCluster, true);
    LOG.info("Master is at " + this.conf.get(HConstants.MASTER_ADDRESS));
  }
View Full Code Here

    try {
      fs = dfsCluster.getFileSystem();
      dir = new Path("/hbase");
      fs.mkdirs(dir);
      // Start up HBase cluster
      hCluster = new MiniHBaseCluster(conf, 1, dfsCluster);
      LOG.info("Master is at " + this.conf.get(HConstants.MASTER_ADDRESS));
    } catch (Exception e) {
      if (dfsCluster != null) {
        dfsCluster.shutdown();
        dfsCluster = null;
View Full Code Here

      dir = new Path("/hbase");
      fs.mkdirs(dir);

      // Start up HBase cluster
      hCluster = new MiniHBaseCluster(conf, 1, dfsCluster);

      // Create a table.
      HBaseAdmin admin = new HBaseAdmin(conf);
      admin.createTable(desc);
View Full Code Here

    }
  }
 
  @Test
  public void testTransitionToFailedOpenEvenIfCleanupFails() throws Exception {
    MiniHBaseCluster cluster = HTU.getHBaseCluster();
    HRegionServer server =
        cluster.getLiveRegionServerThreads().get(0).getRegionServer();
    // Create it OFFLINE, which is what it expects
    ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName());
    ZKAssign.transitionNodeOpening(server.getZooKeeper(), TEST_HRI, server.getServerName());
    // Create the handler
    OpenRegionHandler handler = new OpenRegionHandler(server, server, TEST_HRI, TEST_HTD) {
View Full Code Here

    // Up number of retries.  Needed while cluster starts up. Its been set to 1
    // above.
    final int retries = 5;
    this.conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER_KEY, retries);
   
    MiniHBaseCluster cluster = new MiniHBaseCluster(this.conf, 1);
    try {
      HBaseAdmin hb = new HBaseAdmin(this.conf);
      assertTrue(hb.isMasterRunning());
      HTableDescriptor [] tables = hb.listTables();
      boolean foundTable = false;
      for (int i = 0; i < tables.length; i++) {
        if (Bytes.equals(Bytes.toBytes(TABLENAME), tables[i].getName())) {
          foundTable = true;
          break;
        }
      }
      assertTrue(foundTable);
      LOG.info(TABLENAME + " exists.  Now waiting till startcode " +
        "changes before opening a scanner");
      waitOnStartCodeChange(retries);
      // Delete again so we go get it all fresh.
      HConnectionManager.deleteConnectionInfo();
      HTable t = new HTable(this.conf, TABLENAME);
      int count = 0;
      LOG.info("OPENING SCANNER");
      Scanner s = t.getScanner(TABLENAME_COLUMNS);
      try {
        for (RowResult r: s) {
          if (r == null || r.size() == 0) {
            break;
          }
          count++;
          if (count % 1000 == 0 && count > 0) {
            LOG.info("Iterated over " + count + " rows.");
          }
        }
        assertEquals(EXPECTED_COUNT, count);
      } finally {
        s.close();
      }
    } finally {
      HConnectionManager.deleteConnectionInfo();
      cluster.shutdown();
    }
  }
View Full Code Here

    utils.deleteColumn(editTable, Bytes.toBytes(oldColumn));
    utils.shutdown();
    // Delete again so we go get it all fresh.
    HConnectionManager.deleteConnectionInfo();
    // Now assert columns were added and deleted.
    this.cluster = new MiniHBaseCluster(this.conf, 1);
    // Now assert columns were added and deleted.
    HTable t = new HTable(conf, editTable);
    HTableDescriptor htd = t.getTableDescriptor();
    HColumnDescriptor hcd = htd.getFamily(newColumn);
    assertTrue(hcd != null);
View Full Code Here

        m = MiniZooKeeperCluster.class.getDeclaredMethod("setClientPort",
                zkParam);
      }
      m.invoke(zookeeperCluster, new Object[]{new Integer(zookeeperPort)});
      zookeeperCluster.startup(new File(zookeeperDir));
      hbaseCluster = new MiniHBaseCluster(hbaseConf, 1);
      HMaster master = hbaseCluster.getMaster();
      Object serverName = master.getServerName();

      String hostAndPort;
      if (serverName instanceof String) {
View Full Code Here

   
    @AfterClass
    public static void oneTimeTearDown() throws Exception {
        // In HBase 0.90.1 and above we can use util.shutdownMiniHBaseCluster()
        // here instead.
        MiniHBaseCluster hbc = util.getHBaseCluster();
        if (hbc != null) {
            hbc.shutdown();
            hbc.join();
        }
        util.shutdownMiniZKCluster();
        cluster.shutDown();
    }
View Full Code Here

  @AfterClass
  public static void oneTimeTearDown() throws Exception {
        // In HBase 0.90.1 and above we can use util.shutdownMiniHBaseCluster()
        // here instead.
        MiniHBaseCluster hbc = util.getHBaseCluster();
        if (hbc != null) {
          hbc.shutdown();
          hbc.join();
        }
        util.shutdownMiniZKCluster();
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.MiniHBaseCluster

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.