Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.move()


    for (HRegionInfo regionInfo:regions) {
      try {
        String destServerName =
          servers[RandomUtils.nextInt(servers.length)].getServerName();
        LOG.debug("Moving " + regionInfo.getRegionNameAsString() + " to " + destServerName);
        admin.move(regionInfo.getRegionName(), Bytes.toBytes(destServerName));
      } catch (Exception e) {
        LOG.debug("Error moving region", e);
      }
    }
    if (sleepTime > 0) {
View Full Code Here


    LOG.info("Moving " + victimRegions.size() + " regions from " + fromServers.size()
        + " servers to " + toServers.size() + " different servers");
    HBaseAdmin admin = this.context.getHaseIntegrationTestingUtility().getHBaseAdmin();
    for (byte[] victimRegion : victimRegions) {
      int targetIx = RandomUtils.nextInt(toServers.size());
      admin.move(victimRegion, Bytes.toBytes(toServers.get(targetIx).getServerName()));
    }
  }

  protected void forceBalancer() throws Exception {
    HBaseAdmin admin = this.context.getHaseIntegrationTestingUtility().getHBaseAdmin();
View Full Code Here

          .iterator().next();

      PrivilegedExceptionAction moveAction = new PrivilegedExceptionAction() {
        public Object run() throws Exception {
          HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
          admin.move(firstRegion.getKey().getEncodedNameAsBytes(),
              Bytes.toBytes(newRs.getServerName().getServerName()));
          return null;
        }
      };
      SUPERUSER.runAs(moveAction);
View Full Code Here

      LOG.info("Moving " + victimRegions.size() + " regions from " + fromServers.size()
          + " servers to " + toServers.size() + " different servers");
      HBaseAdmin admin = this.context.getHaseIntegrationTestingUtility().getHBaseAdmin();
      for (byte[] victimRegion : victimRegions) {
        int targetIx = random.nextInt(toServers.size());
        admin.move(victimRegion, Bytes.toBytes(toServers.get(targetIx).getServerName()));
      }
    }

    protected void forceBalancer() throws Exception {
      HBaseAdmin admin = this.context.getHaseIntegrationTestingUtility().getHBaseAdmin();
View Full Code Here

          .iterator().next();

      AccessTestAction moveAction = new AccessTestAction() {
        @Override
        public Object run() throws Exception {
          admin.move(firstRegion.getKey().getEncodedNameAsBytes(),
              Bytes.toBytes(newRs.getServerName().getServerName()));
          return null;
        }
      };
      SUPERUSER.runAs(moveAction);
View Full Code Here

      LOG.info("Moving " + victimRegions.size() + " regions from " + victimServers.size()
          + " servers to " + targetServers.size() + " different servers");
      HBaseAdmin admin = this.context.getHaseIntegrationTestingUtility().getHBaseAdmin();
      for (byte[] victimRegion : victimRegions) {
        int targetIx = random.nextInt(targetServers.size());
        admin.move(victimRegion, targetServers.get(targetIx));
      }
    }
  }

  public static class ForceBalancerAction extends Action {
View Full Code Here

      final Map.Entry<HRegionInfo, ServerName> firstRegion = regions.entrySet()
          .iterator().next();

      PrivilegedExceptionAction moveAction = new PrivilegedExceptionAction() {
        public Object run() throws Exception {
          admin.move(firstRegion.getKey().getEncodedNameAsBytes(),
              Bytes.toBytes(newRs.getServerName().getServerName()));
          return null;
        }
      };
      SUPERUSER.runAs(moveAction);
View Full Code Here

        Random random = new Random();
        for (HRegionInfo regionInfo:regions) {
          try {
            byte[] destServerName =
              Bytes.toBytes(servers[random.nextInt(servers.length)].getServerName());
            admin.move(regionInfo.getRegionName(), destServerName);
          } catch (Exception e) {
            LOG.debug("Error moving region", e);
          }
        }
        Thread.sleep(sleepTime);
View Full Code Here

      LOG.info("Moving " + victimRegions.size() + " regions from " + victimServers.size()
          + " servers to " + targetServers.size() + " different servers");
      HBaseAdmin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin();
      for (byte[] victimRegion : victimRegions) {
        int targetIx = random.nextInt(targetServers.size());
        admin.move(victimRegion, targetServers.get(targetIx));
      }
    }
  }

  public static class ForceBalancerAction extends Action {
View Full Code Here

      final Map.Entry<HRegionInfo, ServerName> firstRegion = regions.entrySet()
          .iterator().next();

      PrivilegedExceptionAction moveAction = new PrivilegedExceptionAction() {
        public Object run() throws Exception {
          admin.move(firstRegion.getKey().getEncodedNameAsBytes(),
              Bytes.toBytes(newRs.getServerName().getServerName()));
          return null;
        }
      };
      SUPERUSER.runAs(moveAction);
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.