Package org.apache.hadoop.hbase.client

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


  private void setupReplication() throws Exception {
    ReplicationAdmin admin1 = new ReplicationAdmin(conf1);
    ReplicationAdmin admin2 = new ReplicationAdmin(conf2);

    HBaseAdmin ha = new HBaseAdmin(conf1);
    ha.createTable(t1_syncupSource);
    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
View Full Code Here


    ReplicationAdmin admin1 = new ReplicationAdmin(conf1);
    ReplicationAdmin admin2 = new ReplicationAdmin(conf2);

    HBaseAdmin ha = new HBaseAdmin(conf1);
    ha.createTable(t1_syncupSource);
    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
    ha.createTable(t2_syncupTarget);
View Full Code Here

    ha.createTable(t1_syncupSource);
    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
    ha.createTable(t2_syncupTarget);
    ha.close();

    // Get HTable from Master
    ht1Source = new HTable(conf1, t1_su);
View Full Code Here

    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
    ha.createTable(t2_syncupTarget);
    ha.close();

    // Get HTable from Master
    ht1Source = new HTable(conf1, t1_su);
    ht1Source.setWriteBufferSize(1024);
View Full Code Here

    for (String familyName : familyNames) {
      tableDescriptor.addFamily(new HColumnDescriptor(familyName));
    }

    hBaseAdmin.createTable(tableDescriptor);

    return true;
  }

  @Override
View Full Code Here

        hbase.disableTable(TABLE_NAME);
       hbase.deleteTable(TABLE_NAME);
     }
    
     HTableDescriptor wordcount = new HTableDescriptor(TABLE_NAME);
     hbase.createTable(wordcount);
     // Cannot edit a stucture on an active table.
     hbase.disableTable(TABLE_NAME);
     HColumnDescriptor columnFamily = new HColumnDescriptor(COLUMN_FAMILY);
     hbase.addColumn(TABLE_NAME, columnFamily);
     hbase.enableTable(TABLE_NAME);
View Full Code Here

      String tableName = info.tableName;
     
      if(!tables.contains(tableName)) {
        // create table
        HTableDescriptor descriptor = createTable(tableName);
        admin.createTable(descriptor);
      }
      tables.remove(tableName);
    }
   
    for (String table : tables) {
View Full Code Here

        columnDescripter2.setMaxVersions(10);
        columnDescripter2.setInMemory(false);
        columnDescripter2.setTimeToLive(Integer.MAX_VALUE);
        tableDescripter.addFamily(columnDescripter2);

        admin.createTable(tableDescripter);
      }
     
     
      String tablenamequeue = this.getQueueTableNme(tablename);
      if (!admin.tableExists(tablenamequeue)) {
View Full Code Here

        columnDescripter2.setCompressionType(Algorithm.NONE);
        columnDescripter2.setMaxVersions(10);
        columnDescripter2.setInMemory(false);
        columnDescripter2.setTimeToLive(2 * 24 * 60 * 60);
        tableDescripter.addFamily(columnDescripter2);
        admin.createTable(tableDescripter);
      }
       
   
    }
  }
 
View Full Code Here

    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));
      put.add(USER, NAME, Bytes.toBytes(ADMIN_USERNAME));
      put.add(USER, ADMIN, Bytes.toBytes(true));
      table.put(put);
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.