org.apache.hadoop.hbase
Class HTableDescriptor

java.lang.Object
  extended by org.apache.hadoop.hbase.HTableDescriptor
All Implemented Interfaces:
Comparable, Writable, WritableComparable

public class HTableDescriptor
extends Object
implements WritableComparable

HTableDescriptor contains the name of an HTable, and its column families.


Constructor Summary
HTableDescriptor()
          Constructs an empty object
HTableDescriptor(String name)
          Constructor.
 
Method Summary
 void addFamily(HColumnDescriptor family)
          Add a column family.
 int compareTo(Object o)
           
 boolean equals(Object obj)
           
 TreeMap<Text,HColumnDescriptor> families()
          All the column families in this table.
 Text getName()
           
 boolean hasFamily(Text family)
          Checks to see if this table contains the given column family
 int hashCode()
           
 void readFields(DataInput in)
          Reads the fields of this object from in.
 String toString()
           
 void write(DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTableDescriptor

public HTableDescriptor()
Constructs an empty object


HTableDescriptor

public HTableDescriptor(String name)
Constructor.

Parameters:
name - Table name.
Throws:
IllegalArgumentException - if passed a table name that is made of other than 'word' characters: i.e. [a-zA-Z_0-9]
Method Detail

getName

public Text getName()
Returns:
name of table

addFamily

public void addFamily(HColumnDescriptor family)
Add a column family.

Parameters:
family - HColumnDescriptor of familyto add.

hasFamily

public boolean hasFamily(Text family)
Checks to see if this table contains the given column family

Parameters:
family - - family name
Returns:
true if the table contains the specified family name

families

public TreeMap<Text,HColumnDescriptor> families()
All the column families in this table. TODO: What is this used for? Seems Dangerous to let people play with our private members.

Returns:
map of family members

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Writes the fields of this object to out.

Specified by:
write in interface Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Throws:
IOException

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


Copyright © 2006 The Apache Software Foundation