org.apache.hadoop.hbase
Class HColumnDescriptor

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

public class HColumnDescriptor
extends Object
implements WritableComparable

A HColumnDescriptor contains information about a column family such as the number of versions, compression settings, etc.


Nested Class Summary
static class HColumnDescriptor.CompressionType
          The type of compression.
 
Constructor Summary
HColumnDescriptor()
          Default constructor.
HColumnDescriptor(String columnName)
          Construct a column descriptor specifying only the family name The other attributes are defaulted.
HColumnDescriptor(Text name, int maxVersions, HColumnDescriptor.CompressionType compression, boolean inMemory, int maxValueLength, BloomFilterDescriptor bloomFilter)
          Constructor - specify all parameters.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object obj)
           
 HColumnDescriptor.CompressionType getCompression()
           
 int getMaxVersions()
           
 Text getName()
           
 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

HColumnDescriptor

public HColumnDescriptor()
Default constructor. Must be present for Writable.


HColumnDescriptor

public HColumnDescriptor(String columnName)
Construct a column descriptor specifying only the family name The other attributes are defaulted.

Parameters:
columnName - - column family name

HColumnDescriptor

public HColumnDescriptor(Text name,
                         int maxVersions,
                         HColumnDescriptor.CompressionType compression,
                         boolean inMemory,
                         int maxValueLength,
                         BloomFilterDescriptor bloomFilter)
Constructor - specify all parameters.

Parameters:
name - - Column family name
maxVersions - - Maximum number of versions to keep
compression - - Compression type
inMemory - - If true, column data should be kept in a HRegionServer's cache
maxValueLength - - Restrict values to <= this value
bloomFilter - - Enable the specified bloom filter for this column
Throws:
IllegalArgumentException - if passed a family name that is made of other than 'word' characters: i.e. [a-zA-Z_0-9] and does not end in a :
IllegalArgumentException - if the number of versions is <= 0
Method Detail

getName

public Text getName()
Returns:
- name of column family

getCompression

public HColumnDescriptor.CompressionType getCompression()
Returns:
- compression type being used for the column family

getMaxVersions

public int getMaxVersions()
Returns:
- maximum number of versions

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

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

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

compareTo

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


Copyright © 2006 The Apache Software Foundation