org.apache.hadoop.hbase
Class HTableDescriptor

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

public class HTableDescriptor
extends Object
implements org.apache.hadoop.io.WritableComparable

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


Field Summary
static HTableDescriptor metaTableDesc
          table descriptor for meta table
static HTableDescriptor rootTableDesc
          table descriptor for root table
 
Constructor Summary
HTableDescriptor()
          Constructs an empty object.
HTableDescriptor(String name)
          Constructor.
 
Method Summary
 void addFamily(HColumnDescriptor family)
          Adds a column family.
 int compareTo(Object o)
          
 boolean equals(Object obj)
          
 TreeMap<org.apache.hadoop.io.Text,HColumnDescriptor> families()
          All the column families in this table.
 SortedMap<org.apache.hadoop.io.Text,HColumnDescriptor> getFamilies()
           
 org.apache.hadoop.io.Text getName()
           
static org.apache.hadoop.fs.Path getTableDir(org.apache.hadoop.fs.Path rootdir, org.apache.hadoop.io.Text tableName)
           
 boolean hasFamily(org.apache.hadoop.io.Text family)
          Checks to see if this table contains the given column family
 int hashCode()
          
 boolean isMetaRegion()
           
 boolean isMetaTable()
           
 boolean isRootRegion()
           
 void readFields(DataInput in)
          
 String toString()
          
 void write(DataOutput out)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

rootTableDesc

public static final HTableDescriptor rootTableDesc
table descriptor for root table


metaTableDesc

public static final HTableDescriptor metaTableDesc
table descriptor for meta table

Constructor Detail

HTableDescriptor

public HTableDescriptor()
Constructs an empty object. For deserializing an HTableDescriptor instance only.

See Also:
HTableDescriptor(String)

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

isRootRegion

public boolean isRootRegion()
Returns:
true if this is the root region

isMetaTable

public boolean isMetaTable()
Returns:
true if table is the meta table

isMetaRegion

public boolean isMetaRegion()
Returns:
true if this is a meta region (part of the root or meta tables)

getName

public org.apache.hadoop.io.Text getName()
Returns:
name of table

addFamily

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

Parameters:
family - HColumnDescriptor of familyto add.

hasFamily

public boolean hasFamily(org.apache.hadoop.io.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<org.apache.hadoop.io.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

Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

compareTo

public int compareTo(Object o)

Specified by:
compareTo in interface Comparable

getFamilies

public SortedMap<org.apache.hadoop.io.Text,HColumnDescriptor> getFamilies()
Returns:
Immutable sorted map of families.

getTableDir

public static org.apache.hadoop.fs.Path getTableDir(org.apache.hadoop.fs.Path rootdir,
                                                    org.apache.hadoop.io.Text tableName)
Parameters:
rootdir - qualified path of HBase root directory
tableName - name of table
Returns:
path for table


Copyright © 2008 The Apache Software Foundation