Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.MiniHBaseCluster.waitForActiveAndReadyMaster()


    admin.deleteTable("testIndexTableCreationAfterMasterRestart" + Constants.INDEX_TABLE_SUFFIX);
    MiniHBaseCluster cluster = UTIL.getHBaseCluster();
    cluster.abortMaster(0);
    cluster.waitOnMaster(0);
    HMaster master = cluster.startMaster().getMaster();
    cluster.waitForActiveAndReadyMaster();
    String indexTableName =
        "testIndexTableCreationAfterMasterRestart" + Constants.INDEX_TABLE_SUFFIX;

    assertTrue("Index tables is not created.", admin.isTableAvailable(indexTableName));
  }
View Full Code Here


    admin.createTable(htd);
    MiniHBaseCluster cluster = UTIL.getHBaseCluster();
    cluster.abortMaster(0);
    cluster.waitOnMaster(0);
    HMaster master = cluster.startMaster().getMaster();
    cluster.waitForActiveAndReadyMaster();

    boolean tableExist =
        MetaReader.tableExists(master.getCatalogTracker(),
          "testIndexTableCreationAlongWithNormalTablesAfterMasterRestart"
              + Constants.INDEX_TABLE_SUFFIX);
View Full Code Here

    admin.disableTable(indexTableName);
    MiniHBaseCluster cluster = UTIL.getHBaseCluster();
    cluster.abortMaster(0);
    cluster.startMaster();
    cluster.waitOnMaster(0);
    cluster.waitForActiveAndReadyMaster();
    Thread.sleep(1000);
    assertTrue("User table should be enabled.", admin.isTableEnabled(tableName));
    assertTrue("Index table should be enabled.", admin.isTableEnabled(indexTableName));
  }
View Full Code Here

    admin.enableTable(indexTableName);
    MiniHBaseCluster cluster = UTIL.getHBaseCluster();
    cluster.abortMaster(0);
    cluster.startMaster();
    cluster.waitOnMaster(0);
    cluster.waitForActiveAndReadyMaster();
    Thread.sleep(1000);
    assertTrue("User table should be disabled.", admin.isTableDisabled(tableName));
    assertTrue("Index table should be disabled.", admin.isTableDisabled(indexTableName));
  }
View Full Code Here

            throw new IllegalStateException("Hadoop expects default umask " +
                  "to be 022, seems like your system has a different one", e);
         }
         MiniHBaseCluster cluster = testUtil.getHBaseCluster();
         log.info("Waiting for active/ready HBase master");
         cluster.waitForActiveAndReadyMaster();
         // Cache zoo keeper port for cache store configuration
         zooKeeperPort = testUtil.getConfiguration()
               .getInt(HConstants.ZOOKEEPER_CLIENT_PORT, -1);
      } catch (Exception e) {
         throw new RuntimeException("Unable to start HBase cluster", e);
View Full Code Here

    // get all the master threads
    List<MasterThread> masterThreads = cluster.getMasterThreads();
    assertEquals(1, masterThreads.size());

    // only one master thread, let's wait for it to be initialized
    assertTrue(cluster.waitForActiveAndReadyMaster());
    HMaster master = masterThreads.get(0).getMaster();
    assertTrue(master.isActiveMaster());
    assertTrue(master.isInitialized());

    // disable load balancing on this master
View Full Code Here

    // Start up a new master
    log("Starting up a new master");
    master = cluster.startMaster().getMaster();
    log("Waiting for master to be ready");
    cluster.waitForActiveAndReadyMaster();
    log("Master is ready");

    // Get new region states since master restarted
    regionStates = master.getAssignmentManager().getRegionStates();
    // Merging region should remain merging
View Full Code Here

    // get all the master threads
    List<MasterThread> masterThreads = cluster.getMasterThreads();
    assertEquals(1, masterThreads.size());

    // only one master thread, let's wait for it to be initialized
    assertTrue(cluster.waitForActiveAndReadyMaster());
    HMaster master = masterThreads.get(0).getMaster();
    assertTrue(master.isActiveMaster());
    assertTrue(master.isInitialized());

    // disable load balancing on this master
View Full Code Here

      Threads.sleep(10);
    }
    log("Starting up a new master");
    master = cluster.startMaster().getMaster();
    log("Waiting for master to be ready");
    assertTrue(cluster.waitForActiveAndReadyMaster());
    log("Master is ready");
   
    // Wait until SSH processing completed for dead server.
    while (master.getServerManager().areDeadServersInProgress()) {
      Thread.sleep(10);
View Full Code Here

    LOG.debug("\n\nStopping the active master " + active.getServerName() + "\n");
    cluster.stopMaster(activeIndex, false);
    cluster.waitOnMaster(activeIndex);

    // wait for an active master to show up and be ready
    assertTrue(cluster.waitForActiveAndReadyMaster());

    LOG.debug("\n\nVerifying backup master is now active\n");
    // should only have one master now
    assertEquals(1, masterThreads.size());
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.