Examples of waitForAssignment()


Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    MasterServices services = TEST_UTIL.getMiniHBaseCluster().getMaster();
    AssignmentManager am = services.getAssignmentManager();
    Map<HRegionInfo,HServerAddress> regions = ht.getRegionsInfo();
    for (HRegionInfo regionInfo : regions.keySet()) {
      try {
        am.waitForAssignment(regionInfo);
      } catch (InterruptedException e) {
        LOG.info("Interrupted waiting for region to be assigned during " +
            "create table call", e);
        Thread.currentThread().interrupt();
        return;
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    MasterServices services = TEST_UTIL.getMiniHBaseCluster().getMaster();
    AssignmentManager am = services.getAssignmentManager();
    Map<HRegionInfo,HServerAddress> regions = ht.getRegionsInfo();
    for (HRegionInfo regionInfo : regions.keySet()) {
      try {
        am.waitForAssignment(regionInfo);
      } catch (InterruptedException e) {
        LOG.info("Interrupted waiting for region to be assigned during " +
            "create table call", e);
        Thread.currentThread().interrupt();
        return;
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    HBaseAdmin localAdmin = createTable(tableName);
    List<HRegionInfo> tableRegions = localAdmin.getTableRegions(tableName);
    HRegionInfo hri = tableRegions.get(0);
    AssignmentManager am = master.getAssignmentManager();
    assertTrue("Region " + hri.getRegionNameAsString()
      + " should be assigned properly", am.waitForAssignment(hri));
    ServerName server = am.getRegionStates().getRegionServerOfRegion(hri);
    localAdmin.move(hri.getEncodedNameAsBytes(), Bytes.toBytes(server.getServerName()));
    assertEquals("Current region server and region server before move should be same.", server,
      am.getRegionStates().getRegionServerOfRegion(hri));
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    HBaseAdmin localAdmin = createTable(tableName);
    List<HRegionInfo> tableRegions = localAdmin.getTableRegions(tableName);
    HRegionInfo hri = tableRegions.get(0);
    AssignmentManager am = master.getAssignmentManager();
    assertTrue("Region " + hri.getRegionNameAsString()
      + " should be assigned properly", am.waitForAssignment(hri));
    ServerName server = am.getRegionStates().getRegionServerOfRegion(hri);
    localAdmin.move(hri.getEncodedNameAsBytes(), Bytes.toBytes(server.getServerName()));
    assertEquals("Current region server and region server before move should be same.", server,
      am.getRegionStates().getRegionServerOfRegion(hri));
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    HBaseAdmin localAdmin = createTable(tableName);
    List<HRegionInfo> tableRegions = localAdmin.getTableRegions(tableName);
    HRegionInfo hri = tableRegions.get(0);
    AssignmentManager am = master.getAssignmentManager();
    assertTrue("Region " + hri.getRegionNameAsString()
      + " should be assigned properly", am.waitForAssignment(hri));
    ServerName server = am.getRegionStates().getRegionServerOfRegion(hri);
    localAdmin.move(hri.getEncodedNameAsBytes(), Bytes.toBytes(server.getServerName()));
    assertEquals("Current region server and region server before move should be same.", server,
      am.getRegionStates().getRegionServerOfRegion(hri));
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

              .getLong("hbase.bulk.assignment.waiton.empty.rit", 5 * 60 * 1000);
      Set<HRegionInfo> regionSet = new HashSet<HRegionInfo>(1);
      regionSet.add(regionInfo);
      try {
        am.waitUntilNoRegionsInTransition(timeout, regionSet);
        am.waitForAssignment(regionInfo, timeout);
      } catch (InterruptedException e) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Interrupted while region in assignment.");
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

              .getLong("hbase.bulk.assignment.waiton.empty.rit", 5 * 60 * 1000);
      Set<HRegionInfo> regionSet = new HashSet<HRegionInfo>(1);
      regionSet.add(regionInfo);
      try {
        am.waitUntilNoRegionsInTransition(timeout, regionSet);
        am.waitForAssignment(regionInfo, timeout);
        destServer = am.getRegionServerOfRegion(regionInfo);
        am.putRegionPlan(regionInfo, destServer);
      } catch (InterruptedException e) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Interrupted while region in assignment.");
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    HBaseAdmin localAdmin = createTable(tableName);
    List<HRegionInfo> tableRegions = localAdmin.getTableRegions(tableName);
    HRegionInfo hri = tableRegions.get(0);
    AssignmentManager am = master.getAssignmentManager();
    assertTrue("Region " + hri.getRegionNameAsString()
      + " should be assigned properly", am.waitForAssignment(hri));
    ServerName server = am.getRegionStates().getRegionServerOfRegion(hri);
    localAdmin.move(hri.getEncodedNameAsBytes(), Bytes.toBytes(server.getServerName()));
    assertEquals("Current region server and region server before move should be same.", server,
      am.getRegionStates().getRegionServerOfRegion(hri));
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    am.assign(REGIONINFO, true);

    setRegionOpenedOnZK(zkWatcher, SERVERNAME_A, REGIONINFO);
    setRegionOpenedOnZK(zkWatcher, SERVERNAME_B, REGIONINFO);

    am.waitForAssignment(REGIONINFO);

    assertTrue(am.getRegionStates().isRegionOnline(REGIONINFO));
    assertNotEquals(am.getRegionStates().getRegionServerOfRegion(REGIONINFO), SERVERNAME_A);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.AssignmentManager.waitForAssignment()

    for (Entry<String, RegionState> entry : regionsInTransition.entrySet()) {
      setRegionOpenedOnZK(zkWatcher, entry.getValue().getServerName(),
        entry.getValue().getRegion());
    }
   
    am.waitForAssignment(REGIONINFO_A);
    am.waitForAssignment(REGIONINFO_B);
    am.waitForAssignment(REGIONINFO_C);
    am.waitForAssignment(REGIONINFO_D);
    am.waitForAssignment(REGIONINFO_E);
   
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.