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

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


  public RootResource() throws IOException {
    super();
  }

  private final TableListModel getTableList() throws IOException {
    TableListModel tableList = new TableListModel();
    String[] tableNames = servlet.getAdmin().getTableNames();
    for (String name: tableNames) {
      tableList.add(new TableModel(name));
    }
    return tableList;
  }
View Full Code Here


      Response response = client.get(path.toString(),
          Constants.MIMETYPE_PROTOBUF);
      code = response.getCode();
      switch (code) {
      case 200:
        TableListModel t = new TableListModel();
        return (TableListModel) t.getObjectFromMessage(response.getBody());
      case 404:
        throw new IOException("Table list not found");
      case 509:
        try {
          Thread.sleep(sleepTime);
View Full Code Here

  @Test
  public void testTableListXML() throws IOException, JAXBException {
    Response response = client.get("/", Constants.MIMETYPE_XML);
    assertEquals(response.getCode(), 200);
    assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
    TableListModel model = (TableListModel)
      context.createUnmarshaller()
        .unmarshal(new ByteArrayInputStream(response.getBody()));
    checkTableList(model);
  }
View Full Code Here

  @Test
  public void testTableListPB() throws IOException, JAXBException {
    Response response = client.get("/", Constants.MIMETYPE_PROTOBUF);
    assertEquals(response.getCode(), 200);
    assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
    TableListModel model = new TableListModel();
    model.getObjectFromMessage(response.getBody());
    checkTableList(model);
    response = client.get("/", Constants.MIMETYPE_PROTOBUF_IETF);
    assertEquals(response.getCode(), 200);
    assertEquals(Constants.MIMETYPE_PROTOBUF_IETF, response.getHeader("content-type"));
    model = new TableListModel();
    model.getObjectFromMessage(response.getBody());
    checkTableList(model);
  }
View Full Code Here

  public RootResource() throws IOException {
    super();
  }

  private final TableListModel getTableList() throws IOException {
    TableListModel tableList = new TableListModel();
    HTableDescriptor[] list = servlet.getAdmin().listTables();
    for (HTableDescriptor htd: list) {
      tableList.add(new TableModel(htd.getNameAsString()));
    }
    return tableList;
  }
View Full Code Here

  public RootResource() throws IOException {
    super();
  }

  private final TableListModel getTableList() throws IOException {
    TableListModel tableList = new TableListModel();
    HTableDescriptor[] list = servlet.getAdmin().listTables();
    for (HTableDescriptor htd: list) {
      tableList.add(new TableModel(htd.getNameAsString()));
    }
    return tableList;
  }
View Full Code Here

  @Test
  public void testTableListXML() throws IOException, JAXBException {
    Response response = client.get("/", Constants.MIMETYPE_XML);
    assertEquals(response.getCode(), 200);
    TableListModel model = (TableListModel)
      context.createUnmarshaller()
        .unmarshal(new ByteArrayInputStream(response.getBody()));
    checkTableList(model);
  }
View Full Code Here

  @Test
  public void testTableListPB() throws IOException, JAXBException {
    Response response = client.get("/", Constants.MIMETYPE_PROTOBUF);
    assertEquals(response.getCode(), 200);
    TableListModel model = new TableListModel();
    model.getObjectFromMessage(response.getBody());
    checkTableList(model);
  }
View Full Code Here

  public RootResource() throws IOException {
    super();
  }

  private final TableListModel getTableList() throws IOException {
    TableListModel tableList = new TableListModel();
    HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
    HTableDescriptor[] list = admin.listTables();
    for (HTableDescriptor htd: list) {
      tableList.add(new TableModel(htd.getNameAsString()));
    }
    return tableList;
  }
View Full Code Here

  public RootResource() throws IOException {
    super();
  }

  private final TableListModel getTableList() throws IOException {
    TableListModel tableList = new TableListModel();
    HTableDescriptor[] list = servlet.getAdmin().listTables();
    for (HTableDescriptor htd: list) {
      tableList.add(new TableModel(htd.getTableName().getNameAsString()));
    }
    return tableList;
  }
View Full Code Here

TOP

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

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.