Package org.apache.hadoop.hbase.stargate.model

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


        HRegionInfo hri = e.getKey();
        if (user.isAdmin()) {
          HServerAddress addr = e.getValue();
          InetSocketAddress sa = addr.getInetSocketAddress();
          model.add(
            new TableRegionModel(name, hri.getRegionId(), hri.getStartKey(),
              hri.getEndKey(),
              sa.getHostName() + ":" + Integer.valueOf(sa.getPort())));
        } else {
          model.add(
            new TableRegionModel(name, hri.getRegionId(), hri.getStartKey(),
              hri.getEndKey()));
        }
      }
      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();
        if (hri.getRegionNameAsString().equals(region.getName())) {
          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(table, 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();
        if (hri.getRegionNameAsString().equals(region.getName())) {
          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

TOP

Related Classes of org.apache.hadoop.hbase.stargate.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.