Package org.apache.hadoop.hbase.rest.model

Examples of org.apache.hadoop.hbase.rest.model.TableRegionModel


        servlet.getConfiguration(), null, Bytes.toBytes(tableName), false);
      for (Map.Entry<HRegionInfo,ServerName> e: regions.entrySet()) {
        HRegionInfo hri = e.getKey();
        ServerName addr = e.getValue();
        model.add(
          new TableRegionModel(tableName, hri.getRegionId(),
            hri.getStartKey(), hri.getEndKey(), addr.getHostAndPort()));
      }
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
      servlet.getMetrics().incrementSucessfulGetRequests(1);
View Full Code Here


  void checkTableInfo(TableInfoModel model) {
    assertEquals(model.getName(), TABLE);
    Iterator<TableRegionModel> regions = model.getRegions().iterator();
    assertTrue(regions.hasNext());
    while (regions.hasNext()) {
      TableRegionModel region = regions.next();
      boolean found = false;
      for (Map.Entry<HRegionInfo,HServerAddress> e: regionMap.entrySet()) {
        HRegionInfo hri = e.getKey();
        String hriRegionName = hri.getRegionNameAsString();
        String regionName = region.getName();
        if (hriRegionName.equals(regionName)) {
          found = true;
          byte[] startKey = hri.getStartKey();
          byte[] endKey = hri.getEndKey();
          InetSocketAddress sa = e.getValue().getInetSocketAddress();
          String location = sa.getHostName() + ":" +
            Integer.valueOf(sa.getPort());
          assertEquals(hri.getRegionId(), region.getId());
          assertTrue(Bytes.equals(startKey, region.getStartKey()));
          assertTrue(Bytes.equals(endKey, region.getEndKey()));
          assertEquals(location, region.getLocation());
          break;
        }
      }
      assertTrue(found);
    }
View Full Code Here

        servlet.getConfiguration(), Bytes.toBytes(tableName), false);
      for (Map.Entry<HRegionInfo,ServerName> e: regions.entrySet()) {
        HRegionInfo hri = e.getKey();
        ServerName addr = e.getValue();
        model.add(
          new TableRegionModel(tableName, hri.getRegionId(),
            hri.getStartKey(), hri.getEndKey(), addr.getHostAndPort()));
      }
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
      servlet.getMetrics().incrementSucessfulGetRequests(1);
View Full Code Here

      for (Map.Entry<HRegionInfo,HServerAddress> e: regions.entrySet()) {
        HRegionInfo hri = e.getKey();
        HServerAddress addr = e.getValue();
        InetSocketAddress sa = addr.getInetSocketAddress();
        model.add(
          new TableRegionModel(tableName, hri.getRegionId(),
            hri.getStartKey(), hri.getEndKey(),
            sa.getHostName() + ":" + Integer.valueOf(sa.getPort())));
      }
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
View Full Code Here

  void checkTableInfo(TableInfoModel model) {
    assertEquals(model.getName(), TABLE);
    Iterator<TableRegionModel> regions = model.getRegions().iterator();
    assertTrue(regions.hasNext());
    while (regions.hasNext()) {
      TableRegionModel region = regions.next();
      boolean found = false;
      for (Map.Entry<HRegionInfo,HServerAddress> e: regionMap.entrySet()) {
        HRegionInfo hri = e.getKey();
        String hriRegionName = hri.getRegionNameAsString();
        String regionName = region.getName();
        if (hriRegionName.equals(regionName)) {
          found = true;
          byte[] startKey = hri.getStartKey();
          byte[] endKey = hri.getEndKey();
          InetSocketAddress sa = e.getValue().getInetSocketAddress();
          String location = sa.getHostName() + ":" +
            Integer.valueOf(sa.getPort());
          assertEquals(hri.getRegionId(), region.getId());
          assertTrue(Bytes.equals(startKey, region.getStartKey()));
          assertTrue(Bytes.equals(endKey, region.getEndKey()));
          assertEquals(location, region.getLocation());
          break;
        }
      }
      assertTrue(found);
    }
View Full Code Here

      for (Map.Entry<HRegionInfo,HServerAddress> e: regions.entrySet()) {
        HRegionInfo hri = e.getKey();
        HServerAddress addr = e.getValue();
        InetSocketAddress sa = addr.getInetSocketAddress();
        model.add(
          new TableRegionModel(tableName, hri.getRegionId(),
            hri.getStartKey(), hri.getEndKey(),
            sa.getHostName() + ":" + Integer.valueOf(sa.getPort())));
      }
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
View Full Code Here

      for (Map.Entry<HRegionInfo,HServerAddress> e: regions.entrySet()) {
        HRegionInfo hri = e.getKey();
        HServerAddress addr = e.getValue();
        InetSocketAddress sa = addr.getInetSocketAddress();
        model.add(
          new TableRegionModel(tableName, hri.getRegionId(),
            hri.getStartKey(), hri.getEndKey(),
            sa.getHostName() + ":" + Integer.valueOf(sa.getPort())));
      }
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
View Full Code Here

  public void checkTableInfo(TableInfoModel model) {
    assertEquals(model.getName(), TABLE);
    Iterator<TableRegionModel> regions = model.getRegions().iterator();
    assertTrue(regions.hasNext());
    while (regions.hasNext()) {
      TableRegionModel region = regions.next();
      boolean found = false;
      for (Map.Entry<HRegionInfo,HServerAddress> e: regionMap.entrySet()) {
        HRegionInfo hri = e.getKey();
        String hriRegionName = hri.getRegionNameAsString();
        String regionName = region.getName();
        if (hriRegionName.startsWith(regionName)) {
          found = true;
          byte[] startKey = hri.getStartKey();
          byte[] endKey = hri.getEndKey();
          InetSocketAddress sa = e.getValue().getInetSocketAddress();
          String location = sa.getHostName() + ":" +
            Integer.valueOf(sa.getPort());
          assertEquals(hri.getRegionId(), region.getId());
          assertTrue(Bytes.equals(startKey, region.getStartKey()));
          assertTrue(Bytes.equals(endKey, region.getEndKey()));
          assertEquals(location, region.getLocation());
          break;
        }
      }
      assertTrue(found);
    }
View Full Code Here

        servlet.getConfiguration(), Bytes.toBytes(tableName), false);
      for (Map.Entry<HRegionInfo,ServerName> e: regions.entrySet()) {
        HRegionInfo hri = e.getKey();
        ServerName addr = e.getValue();
        model.add(
          new TableRegionModel(tableName, hri.getRegionId(),
            hri.getStartKey(), hri.getEndKey(), addr.getHostAndPort()));
      }
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
      servlet.getMetrics().incrementSucessfulGetRequests(1);
View Full Code Here

  void checkTableInfo(TableInfoModel model) {
    assertEquals(model.getName(), TABLE.getNameAsString());
    Iterator<TableRegionModel> regions = model.getRegions().iterator();
    assertTrue(regions.hasNext());
    while (regions.hasNext()) {
      TableRegionModel region = regions.next();
      boolean found = false;
      for (Map.Entry<HRegionInfo, ServerName> e: regionMap.entrySet()) {
        HRegionInfo hri = e.getKey();
        String hriRegionName = hri.getRegionNameAsString();
        String regionName = region.getName();
        if (hriRegionName.equals(regionName)) {
          found = true;
          byte[] startKey = hri.getStartKey();
          byte[] endKey = hri.getEndKey();
          InetSocketAddress sa = new InetSocketAddress(e.getValue().getHostname(), e.getValue().getPort());
          String location = sa.getHostName() + ":" +
            Integer.valueOf(sa.getPort());
          assertEquals(hri.getRegionId(), region.getId());
          assertTrue(Bytes.equals(startKey, region.getStartKey()));
          assertTrue(Bytes.equals(endKey, region.getEndKey()));
          assertEquals(location, region.getLocation());
          break;
        }
      }
      assertTrue(found);
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.rest.model.TableRegionModel

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.