Package org.apache.hadoop.hbase.master

Examples of org.apache.hadoop.hbase.master.RegionPlan


        if (LOG.isTraceEnabled()) {
          LOG.trace("Moving Region " + region.getEncodedName() + " from server "
              + initialServer.getHostname() + " to " + newServer.getHostname());
        }
        RegionPlan rp = new RegionPlan(region, initialServer, newServer);
        plans.add(rp);
      }
    }
    return plans;
  }
View Full Code Here


    } else {
      dest = new ServerName(Bytes.toString(destServerName));
    }
   
    // Now we can do the move
    RegionPlan rp = new RegionPlan(p.getFirst(), p.getSecond(), dest);
   
    try {
      if (this.cpHost != null) {
        if (this.cpHost.preMove(p.getFirst(), p.getSecond(), dest)) {
          return;
View Full Code Here

    for (Pair<HRegionInfo, ServerName> regionLocation : regionsInMeta) {
      HRegionInfo hri = regionLocation.getFirst();
      ServerName sn = regionLocation.getSecond();
      if (regionStates.isRegionOffline(hri)) {
        if (this.retainAssignment && sn != null && serverManager.isServerOnline(sn)) {
          this.assignmentManager.addPlan(hri.getEncodedName(), new RegionPlan(hri, null, sn));
        }
        regions.add(hri);
      } else {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Skipping assign for the region " + hri + " during enable table "
View Full Code Here

            destination = serverNameWithoutCodeToServerName.get(favoredNodes.get(2));
          }
        }
       
        if (destination != null) {
          RegionPlan plan = new RegionPlan(region, currentServer, destination);
          plans.add(plan);
        }
      }
    }
    return plans;
View Full Code Here

    Mockito.when(master.getAssignmentManager()).thenReturn(am);
    Mockito.when(master.getZooKeeperWatcher()).thenReturn(zkWatcher);
    Mockito.when(master.getZooKeeper()).thenReturn(zkWatcher);
   
    am.addPlan(REGIONINFO.getEncodedName(), new RegionPlan(REGIONINFO, null, SERVERNAME_A));

    zkWatcher.registerListenerFirst(am);

    addServerToDrainedList(SERVERNAME_A, onlineServers, serverManager);
View Full Code Here

      if (this.skipTableStateCheck) {
        // Region may be available in enablingTableRegions during master startup only.
        if (enablingTableRegions != null && enablingTableRegions.contains(hri)) {
          regions.add(hri);
          if (sn != null && serverManager.isServerOnline(sn)) {
            this.assignmentManager.addPlan(hri.getEncodedName(), new RegionPlan(hri, null, sn));
          }
        }
      } else if (onlineRegions.contains(hri)) {
        continue;
      } else {
        regions.add(hri);
        if (sn != null && serverManager.isServerOnline(sn)) {
          this.assignmentManager.addPlan(hri.getEncodedName(), new RegionPlan(hri, null, sn));
        }
      }
    }
    return regions;
  }
View Full Code Here

      if (this.retainAssignment) {
        // Region may be available in enablingTableRegions during master startup only.
        if (enablingTableRegions != null && enablingTableRegions.contains(hri)) {
          regions.add(hri);
          if (sn != null && serverManager.isServerOnline(sn)) {
            this.assignmentManager.addPlan(hri.getEncodedName(), new RegionPlan(hri, null, sn));
          }
        }
      } else if (onlineRegions.contains(hri)) {
        continue;
      } else {
View Full Code Here

    for (Pair<HRegionInfo, ServerName> regionLocation : regionsInMeta) {
      HRegionInfo hri = regionLocation.getFirst();
      ServerName sn = regionLocation.getSecond();
      if (regionStates.isRegionOffline(hri)) {
        if (sn != null && serverManager.isServerOnline(sn)) {
          this.assignmentManager.addPlan(hri.getEncodedName(), new RegionPlan(hri, null, sn));
        }
        regions.add(hri);
      } else {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Skipping assign for the region " + hri + " during enable table "
View Full Code Here

    for (Map.Entry<ServerName, List<HRegionInfo>> e : rsToRegions
        .entrySet()) {
      final List<HRegionInfo> hris = e.getValue();
      // add a plan for each of the regions that needs to be reopened
      for (HRegionInfo hri : hris) {
        RegionPlan reOpenPlan = new RegionPlan(hri, null,
            assignmentManager.getRegionServerOfRegion(hri));
        assignmentManager.addPlan(hri.getEncodedName(), reOpenPlan);
      }
      pool.execute(new Runnable() {
        public void run() {
View Full Code Here

        if (LOG.isTraceEnabled()) {
          LOG.trace("Moving Region " + region.getEncodedName() + " from server "
              + initialServer.getHostname() + " to " + newServer.getHostname());
        }
        RegionPlan rp = new RegionPlan(region, initialServer, newServer);
        plans.add(rp);
      }
    }
    return plans;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.master.RegionPlan

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.