Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.AdminProtocol


   * (default 120s) to close the region.  This bypasses the active hmaster.
   */
  public static void closeRegionSilentlyAndWait(HBaseAdmin admin,
      ServerName server, HRegionInfo region) throws IOException, InterruptedException {
    HConnection connection = admin.getConnection();
    AdminProtocol rs = connection.getAdmin(server);
    ProtobufUtil.closeRegion(rs, region.getRegionName(), false);
    long timeout = admin.getConfiguration()
      .getLong("hbase.hbck.close.timeout", 120000);
    long expiration = timeout + System.currentTimeMillis();
    while (System.currentTimeMillis() < expiration) {
View Full Code Here


    // connection needed for poll-wait
    HConnection conn = HConnectionManager.getConnection(TEST_UTIL
        .getConfiguration());
    HRegionLocation loc = table.getRegionLocation(row, true);
    AdminProtocol server = conn.getAdmin(loc.getServerName());
    byte[] regName = loc.getRegionInfo().getRegionName();

    for (int i = 0; i < nFlushes; i++) {
      randomCFPuts(table, row, family, nPuts);
      List<String> sf = ProtobufUtil.getStoreFiles(server, regName, FAMILY);
View Full Code Here

    performMultiplePutAndFlush(admin, hTable, row, FAMILY, 3, 100);

    // Verify we have multiple store files.
    HRegionLocation loc = hTable.getRegionLocation(row, true);
    byte[] regionName = loc.getRegionInfo().getRegionName();
    AdminProtocol server = connection.getAdmin(loc.getServerName());
    assertTrue(ProtobufUtil.getStoreFiles(
      server, regionName, FAMILY).size() > 1);

    // Issue a compaction request
    admin.compact(TABLE);
View Full Code Here

      // Set hbase.rootdir into test dir.
      FileSystem fs = FileSystem.get(this.c);
      Path rootdir = FSUtils.getRootDir(this.c);
      FSUtils.setRootDir(this.c, rootdir);
      this.ct = Mockito.mock(CatalogTracker.class);
      AdminProtocol hri = Mockito.mock(AdminProtocol.class);
      Mockito.when(this.ct.getConnection()).thenReturn(this.connection);
      Mockito.when(ct.waitForMetaServerConnection(Mockito.anyLong())).thenReturn(hri);
    }
View Full Code Here

            Bytes.toBytes("aaa")) {
          @Override
          public Void call() throws Exception {
            LOG.debug("compacting " + location + " for row "
                + Bytes.toStringBinary(row));
            AdminProtocol server = connection.getAdmin(location.getServerName());
            CompactRegionRequest request =
              RequestConverter.buildCompactRegionRequest(
                location.getRegionInfo().getRegionName(), true, null);
            server.compactRegion(null, request);
            numCompactions.incrementAndGet();
            return null;
          }
        }.withRetries();
      }
View Full Code Here

  public void testVerifyMetaRegionLocationFails()
  throws IOException, InterruptedException, KeeperException, ServiceException {
    HConnection connection = Mockito.mock(HConnection.class);
    ServiceException connectException =
      new ServiceException(new ConnectException("Connection refused"));
    final AdminProtocol implementation =
      Mockito.mock(AdminProtocol.class);
    Mockito.when(implementation.getRegionInfo((RpcController)Mockito.any(),
      (GetRegionInfoRequest)Mockito.any())).thenThrow(connectException);
    Mockito.when(connection.getAdmin(Mockito.any(ServerName.class), Mockito.anyBoolean())).
      thenReturn(implementation);
    final CatalogTracker ct = constructAndStartCatalogTracker(connection);
    try {
View Full Code Here

    Collection<ServerName> regionServers = status.getServers();
    Map<ServerName, List<String>> mm =
        new HashMap<ServerName, List<String>>();
    HConnection connection = admin.getConnection();
    for (ServerName hsi : regionServers) {
      AdminProtocol server =
        connection.getAdmin(hsi);

      // list all online regions from this region server
      List<HRegionInfo> regions = ProtobufUtil.getOnlineRegions(server);
      List<String> regionNames = new ArrayList<String>();
View Full Code Here

    @Override
    public synchronized Void call() throws IOException {
      errors.progress();
      try {
        AdminProtocol server =
          connection.getAdmin(rsinfo);

        // list all online regions from this region server
        List<HRegionInfo> regions = ProtobufUtil.getOnlineRegions(server);
        regions = filterRegions(regions);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.AdminProtocol

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.