Package org.apache.hadoop.hbase

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


        tableDesc.addFamily(columnDesc);
      }

      println("Creating table... Please wait.");

      admin.createTable(tableDesc);
      return new ReturnMsg(0, "Table created successfully.");
    } catch (Exception e) {
      return new ReturnMsg(0, extractErrMsg(e));
    }
  }
View Full Code Here


      admin.deleteTable(tableName); // delete the table
      HTableDescriptor tableDesc = new HTableDescriptor(tableName.toString());
      for (int i = 0; i < columns.length; i++) {
        tableDesc.addFamily(columns[i]);
      }
      admin.createTable(tableDesc); // re-create the table
    } catch (IOException e) {
      return new ReturnMsg(0, "error msg : " + e.toString());
    }
    return new ReturnMsg(0, "'" + tableName + "' is successfully truncated.");
  }
View Full Code Here

    desc.addFamily(new HColumnDescriptor(INPUT_COLUMN));
    desc.addFamily(new HColumnDescriptor(OUTPUT_COLUMN));
   
    // Create a table.
    HBaseAdmin admin = new HBaseAdmin(this.conf);
    admin.createTable(desc);

    // insert some data into the test table
    HTable table = new HTable(conf, new Text(SINGLE_REGION_TABLE_NAME));

    try {
View Full Code Here

    desc.addFamily(new HColumnDescriptor(INPUT_COLUMN));
    desc.addFamily(new HColumnDescriptor(OUTPUT_COLUMN));
   
    // Create a table.
    HBaseAdmin admin = new HBaseAdmin(this.conf);
    admin.createTable(desc);

    // Populate a table into multiple regions
    makeMultiRegionTable(conf, hCluster, fs, MULTI_REGION_TABLE_NAME,
        INPUT_COLUMN);
   
View Full Code Here

      // Start up HBase cluster
      hCluster = new MiniHBaseCluster(conf, 1, dfsCluster, true);

      // Create a table.
      HBaseAdmin admin = new HBaseAdmin(conf);
      admin.createTable(desc);

      // Populate a table into multiple regions
      makeMultiRegionTable(conf, hCluster, this.fs, TABLE_NAME, INPUT_COLUMN);

      // Verify table indeed has multiple regions
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.