Java Code Examples for org.apache.hadoop.hbase.HColumnDescriptor.getNameAsString()

The following are Jave code examples for showing how to use getNameAsString() of the org.apache.hadoop.hbase.HColumnDescriptor class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: ditb   File: MasterFileSystem.java   Source Code and License Vote up 5 votes
/**
 * Add column to a table
 * @param tableName
 * @param hcd
 * @return Modified HTableDescriptor with new column added.
 * @throws IOException
 */
public HTableDescriptor addColumn(TableName tableName, HColumnDescriptor hcd)
    throws IOException {
  LOG.info("AddColumn. Table = " + tableName + " HCD = " +
    hcd.toString());
  HTableDescriptor htd = this.services.getTableDescriptors().get(tableName);
  if (htd == null) {
    throw new InvalidFamilyOperationException("Family '" +
      hcd.getNameAsString() + "' cannot be modified as HTD is null");
  }
  htd.addFamily(hcd);
  this.services.getTableDescriptors().add(htd);
  return htd;
}