Examples of tableExists()


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

    String schemaPath = "/" + TABLE1 + "/schema";
    TableSchemaModel model;
    Response response;

    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    assertFalse(admin.tableExists(TABLE1));

    // create the table
    model = testTableSchemaModel.buildTestModel(TABLE1);
    testTableSchemaModel.checkModel(model, TABLE1);
    response = client.put(schemaPath, Constants.MIMETYPE_XML, toXML(model));
View Full Code Here

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

    // delete the table
    client.delete(schemaPath);

    // make sure HBase concurs
    assertFalse(admin.tableExists(TABLE1));

    // return read-only setting back to default
    conf.set("hbase.rest.readonly", "false");
  }
View Full Code Here

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

    String schemaPath = "/" + TABLE2 + "/schema";
    TableSchemaModel model;
    Response response;

    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    assertFalse(admin.tableExists(TABLE2));

    // create the table
    model = testTableSchemaModel.buildTestModel(TABLE2);
    testTableSchemaModel.checkModel(model, TABLE2);
    response = client.put(schemaPath, Constants.MIMETYPE_PROTOBUF,
View Full Code Here

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

    // delete the table
    client.delete(schemaPath);

    // make sure HBase concurs
    assertFalse(admin.tableExists(TABLE2));

    // return read-only setting back to default
    conf.set("hbase.rest.readonly", "false");
  }
View Full Code Here

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

   */
  @Test
  public void testCompactionOverride() throws Exception {
    byte[] compactTable = Bytes.toBytes("TestCompactionOverride");
    HBaseAdmin admin = util.getHBaseAdmin();
    if (admin.tableExists(compactTable)) {
      admin.disableTable(compactTable);
      admin.deleteTable(compactTable);
    }

    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(compactTable));
View Full Code Here

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

    job.setMapperClass(mapperClass);

    String hfileOutPath = conf.get(BULK_OUTPUT_CONF_KEY);
    String columns[] = conf.getStrings(COLUMNS_CONF_KEY);
    if (hfileOutPath != null) {
      if (!admin.tableExists(tableName)) {
        LOG.warn(format("Table '%s' does not exist.", tableName));
        // TODO: this is backwards. Instead of depending on the existence of a table,
        // create a sane splits file for HFileOutputFormat based on data sampling.
        createTable(admin, tableName, columns);
      }
View Full Code Here

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

    }

    protected void createSchema() throws IOException {
      HBaseAdmin admin = new HBaseAdmin(getConf());
      TableName tableName = getTableName(getConf());
      if (!admin.tableExists(tableName)) {
        HTableDescriptor htd = new HTableDescriptor(getTableName(getConf()));
        htd.addFamily(new HColumnDescriptor(FAMILY_NAME));
        admin.createTable(htd);
      }
      admin.close();
View Full Code Here

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

  private Response update(final TableSchemaModel model, final boolean replace,
      final UriInfo uriInfo) {
    try {
      byte[] name = Bytes.toBytes(tableResource.getName());
      HBaseAdmin admin = servlet.getAdmin();
      if (replace || !admin.tableExists(name)) {
        return replace(name, model, uriInfo, admin);
      } else {
        return update(name, model, uriInfo, admin);
      }
    } catch (IOException e) {
View Full Code Here

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

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    TEST_UTIL.startMiniCluster();
    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    if (admin.tableExists(TABLE)) {
      if (admin.isTableEnabled(TABLE)) admin.disableTable(TABLE);
      admin.deleteTable(TABLE);
    }
    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
    htd.addFamily(new HColumnDescriptor(COLUMN_1).setMaxVersions(3));
View Full Code Here

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

   * @throws IOException
   */
  private void deleteTable(String tableName) throws IOException {
    // delete the table
    HBaseAdmin admin = new HBaseAdmin(conf);
    if (admin.tableExists(tableName)) {
      admin.disableTable(tableName);
      while (admin.isTableEnabled(tableName)) {
        try {
          Thread.sleep(3000);
        } catch (InterruptedException e) {
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.