Examples of tableExists()


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

  @Override
  public boolean createResource(JobConf jobConf) throws IOException {
    HBaseAdmin hBaseAdmin = getHBaseAdmin(jobConf);

    if (hBaseAdmin.tableExists(tableName)) {
      return true;
    }

    LOG.info("creating hbase table: {}", tableName);
View Full Code Here

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

      HBaseAdmin admin = new HBaseAdmin(config);
      String tablenameshard = this.getDataTableNme(tablename);
     
     
      if (!admin.tableExists(tablenameshard)) {
        HTableDescriptor tableDescripter = new HTableDescriptor(tablenameshard.getBytes());
        tableDescripter.setValue("group",String.valueOf(params.get("realtime.hbase.group")));

        HColumnDescriptor columnDescripter2 = new HColumnDescriptor(DATA_FAMILY);
        columnDescripter2.setBlockCacheEnabled(false);
View Full Code Here

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

        admin.createTable(tableDescripter);
      }
     
     
      String tablenamequeue = this.getQueueTableNme(tablename);
      if (!admin.tableExists(tablenamequeue)) {
        HTableDescriptor tableDescripter = new HTableDescriptor(tablenamequeue.getBytes());
        tableDescripter.setValue("group",String.valueOf(params.get("realtime.hbase.group")));

        HColumnDescriptor columnDescripter2 = new HColumnDescriptor(MdrillQueue.FAMILY);
        columnDescripter2.setBlockCacheEnabled(false);
View Full Code Here

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

      final UriInfo uriInfo) {
    try {
      servlet.invalidateMaxAge(tableName);
      byte[] tableName = Bytes.toBytes(actualTableName);
      HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
      if (replace || !admin.tableExists(tableName)) {
        return replace(tableName, model, uriInfo, admin);
      } else {
        return update(tableName, model, uriInfo, admin);
      }
    } catch (IOException e) {
View Full Code Here

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

    if (!servlet.userRequestLimit(user, 1)) {
      Response.status(509).build();
    }
    try {
      HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
      if (!admin.tableExists(actualTableName)) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
      }
    } catch (IOException e) {
      throw new WebApplicationException(Response.Status.SERVICE_UNAVAILABLE);
    }
View Full Code Here

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

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    HBaseAdmin admin = new HBaseAdmin(conf);
    if (!admin.tableExists(TABLE)) {
      HTableDescriptor htd = new HTableDescriptor(TABLE);
      htd.addFamily(new HColumnDescriptor(USER));
      admin.createTable(htd);
      HTable table = new HTable(conf, TABLE);
      Put put = new Put(Bytes.toBytes(ADMIN_TOKEN));
View Full Code Here

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

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    HBaseAdmin admin = new HBaseAdmin(conf);
    if (!admin.tableExists(TABLE)) {
      HTableDescriptor htd = new HTableDescriptor(TABLE);
      htd.addFamily(new HColumnDescriptor(USER));
      admin.createTable(htd);
      HTable table = new HTable(TABLE);
      Put put = new Put(Bytes.toBytes(USER_TOKEN));
View Full Code Here

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

     
      log.info("Connecting to hbase...");
      HBaseAdmin hba = new HBaseAdmin(hc);
      log.info("Creating Table {}", output);
     
      if (hba.tableExists(output)) {
        hba.disableTable(output);
        hba.deleteTable(output);
        hba.majorCompact(".META.");
      }
      hba.createTable(ht);
View Full Code Here

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

    marshaller = context.createMarshaller();
    unmarshaller = context.createUnmarshaller();
    client = new Client(new Cluster().add("localhost",
      REST_TEST_UTIL.getServletPort()));
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    if (admin.tableExists(TABLE)) {
      return;
    }
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    htd.addFamily(new HColumnDescriptor(CFA));
    htd.addFamily(new HColumnDescriptor(CFB));
View Full Code Here

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

    TEST_UTIL.startMiniCluster();
    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
    client = new Client(new Cluster().add("localhost",
      REST_TEST_UTIL.getServletPort()));
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    if (admin.tableExists(TABLE)) {
      return;
    }
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    htd.addFamily(new HColumnDescriptor(CFA));
    admin.createTable(htd);
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.