Package org.apache.hadoop.hbase.client

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


  public void testAddColumn() throws IOException {
    Admin admin = TEST_UTIL.getHBaseAdmin();
    // Create a table with two families
    HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
    baseHtd.addFamily(new HColumnDescriptor(FAMILY_0));
    admin.createTable(baseHtd);
    admin.disableTable(TABLE_NAME);
    try {
      // Verify the table descriptor
      verifyTableDescriptor(TABLE_NAME, FAMILY_0);
View Full Code Here


    Admin admin = TEST_UTIL.getHBaseAdmin();
    // Create a table with two families
    HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
    baseHtd.addFamily(new HColumnDescriptor(FAMILY_0));
    baseHtd.addFamily(new HColumnDescriptor(FAMILY_1));
    admin.createTable(baseHtd);
    admin.disableTable(TABLE_NAME);
    try {
      // Verify the table descriptor
      verifyTableDescriptor(TABLE_NAME, FAMILY_0, FAMILY_1);
View Full Code Here

    final TableName tableName = TableName.valueOf("testTableReadLock");
    final Admin admin = TEST_UTIL.getHBaseAdmin();
    final HTableDescriptor desc = new HTableDescriptor(tableName);
    final byte[] family = Bytes.toBytes("test_cf");
    desc.addFamily(new HColumnDescriptor(family));
    admin.createTable(desc); // create with one region

    // write some data, not much
    int ret = loadTool.run(new String[] { "-tn", tableName.getNameAsString(), "-write",
        String.format("%d:%d:%d", 1, 10, 10), "-num_keys", String.valueOf(numKeys), "-skip_init" });
    if (0 != ret) {
View Full Code Here

    }

    HTableDescriptor htd = new HTableDescriptor(compactTable);
    htd.addFamily(new HColumnDescriptor(A));
    htd.addCoprocessor(EvenOnlyCompactor.class.getName());
    admin.createTable(htd);

    Table table = new HTable(util.getConfiguration(), compactTable);
    for (long i=1; i<=10; i++) {
      byte[] iBytes = Bytes.toBytes(i);
      Put put = new Put(iBytes);
View Full Code Here

      HColumnDescriptor colDesc = new HColumnDescriptor(fam);
      HTableDescriptor desc = new HTableDescriptor(tableName);
      colDesc.setDataBlockEncoding(DataBlockEncoding.PREFIX_TREE);
      colDesc.setTimeToLive(15552000);
      desc.addFamily(colDesc);
      hBaseAdmin.createTable(desc);
      table = new HTable(conf, tableName);
      Put put = new Put(Bytes.toBytes("a-b-0-0"));
      put.add(fam, qual1, Bytes.toBytes("c1-value"));
      table.put(put);
      table.flushCommits();
View Full Code Here

      public Object run() throws Exception {
        HTableDescriptor desc = new HTableDescriptor(TEST_TABLE.getTableName());
        desc.addFamily(new HColumnDescriptor(TEST_FAMILY));
        Admin admin = new HBaseAdmin(conf);
        try {
          admin.createTable(desc);
        } finally {
          admin.close();
        }
        return null;
      }
View Full Code Here

    // Enable backwards compatible early termination behavior in the HTD. We
    // want to confirm that the per-table configuration is properly picked up.
    htd.setConfiguration(AccessControlConstants.CF_ATTRIBUTE_EARLY_OUT, "true");

    admin.createTable(htd);

    TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName().getName());
  }

  @After
View Full Code Here

      colDesc.setBlockCacheEnabled(true);
      // colDesc.setDataBlockEncoding(DataBlockEncoding.NONE);
      colDesc.setDataBlockEncoding(DataBlockEncoding.PREFIX_TREE);
      desc.addFamily(colDesc);
      Admin admin = TEST_UTIL.getHBaseAdmin();
      admin.createTable(desc);
      byte[] value = Bytes.toBytes("value");
      table = new HTable(TEST_UTIL.getConfiguration(), tableName);
      Put put = new Put(row);
      put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value);
      put.setAttribute("visibility", Bytes.toBytes("myTag"));
View Full Code Here

      colDesc.setBlockCacheEnabled(true);
      // colDesc.setDataBlockEncoding(DataBlockEncoding.NONE);
      colDesc.setDataBlockEncoding(DataBlockEncoding.PREFIX_TREE);
      desc.addFamily(colDesc);
      Admin admin = TEST_UTIL.getHBaseAdmin();
      admin.createTable(desc);

      table = new HTable(TEST_UTIL.getConfiguration(), tableName);
      Put put = new Put(row);
      byte[] value = Bytes.toBytes("value");
      put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value);
View Full Code Here

      HColumnDescriptor colDesc = new HColumnDescriptor(fam);
      colDesc.setBlockCacheEnabled(true);
      colDesc.setDataBlockEncoding(encoding);
      desc.addFamily(colDesc);
      Admin admin = TEST_UTIL.getHBaseAdmin();
      admin.createTable(desc);
      try {
        table = new HTable(TEST_UTIL.getConfiguration(), tableName);
        Put put = new Put(row);
        byte[] value = Bytes.toBytes("value");
        put.add(fam, qual, HConstants.LATEST_TIMESTAMP, value);
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.