|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.HColumnDescriptor
public class HColumnDescriptor
An HColumnDescriptor contains information about a column family such as the number of versions, compression settings, etc. It is used as input when creating a table or adding a column. Once set, the parameters that specify a column cannot be changed without deleting the column and recreating it. If there is data stored in the column, it will be deleted when the column is deleted.
Nested Class Summary | |
---|---|
static class |
HColumnDescriptor.CompressionType
Deprecated. Compression now means which compression library rather than 'what' to compress. |
Field Summary | |
---|---|
static String |
BLOCKCACHE
|
static String |
BLOCKSIZE
|
static String |
BLOOMFILTER
|
static String |
COMPRESSION
|
static boolean |
DEFAULT_BLOCKCACHE
Default setting for whether to use a block cache or not. |
static int |
DEFAULT_BLOCKSIZE
Default size of blocks in files store to the filesytem. |
static boolean |
DEFAULT_BLOOMFILTER
Default setting for whether or not to use bloomfilters. |
static String |
DEFAULT_COMPRESSION
Default compression type. |
static boolean |
DEFAULT_IN_MEMORY
Default setting for whether to serve from memory or not. |
static int |
DEFAULT_TTL
Default time to live of cell contents. |
static int |
DEFAULT_VERSIONS
Default number of versions of a record to keep. |
static String |
FOREVER
|
static String |
LENGTH
|
static String |
MAPFILE_INDEX_INTERVAL
|
static String |
TTL
|
protected Map<ImmutableBytesWritable,ImmutableBytesWritable> |
values
|
Constructor Summary | |
---|---|
HColumnDescriptor()
Default constructor. |
|
HColumnDescriptor(byte[] familyName)
Construct a column descriptor specifying only the family name The other attributes are defaulted. |
|
HColumnDescriptor(byte[] familyName,
int maxVersions,
String compression,
boolean inMemory,
boolean blockCacheEnabled,
int timeToLive,
boolean bloomFilter)
Constructor |
|
HColumnDescriptor(byte[] familyName,
int maxVersions,
String compression,
boolean inMemory,
boolean blockCacheEnabled,
int blocksize,
int timeToLive,
boolean bloomFilter)
Constructor |
|
HColumnDescriptor(HColumnDescriptor desc)
Constructor. |
|
HColumnDescriptor(String familyName)
Construct a column descriptor specifying only the family name The other attributes are defaulted. |
Method Summary | |
---|---|
int |
compareTo(HColumnDescriptor o)
|
boolean |
equals(Object obj)
|
int |
getBlocksize()
|
Compression.Algorithm |
getCompression()
|
Compression.Algorithm |
getCompressionType()
|
int |
getMaxVersions()
|
byte[] |
getName()
|
String |
getNameAsString()
|
byte[] |
getNameWithColon()
|
int |
getTimeToLive()
|
byte[] |
getValue(byte[] key)
|
String |
getValue(String key)
|
Map<ImmutableBytesWritable,ImmutableBytesWritable> |
getValues()
|
int |
hashCode()
|
boolean |
isBlockCacheEnabled()
|
boolean |
isBloomfilter()
|
boolean |
isInMemory()
|
static byte[] |
isLegalFamilyName(byte[] b)
|
void |
readFields(DataInput in)
|
void |
remove(byte[] key)
|
void |
restSerialize(IRestSerializer serializer)
visitor pattern method where the object implementing this interface will call back on the IRestSerializer with the correct method to run to serialize the output of the object to the stream. |
void |
setBlockCacheEnabled(boolean blockCacheEnabled)
|
void |
setBlocksize(int s)
|
void |
setBloomfilter(boolean onOff)
|
void |
setCompressionType(Compression.Algorithm type)
Compression types supported in hbase. |
void |
setInMemory(boolean inMemory)
|
void |
setMapFileIndexInterval(int interval)
|
void |
setMaxVersions(int maxVersions)
|
void |
setTimeToLive(int timeToLive)
|
void |
setValue(byte[] key,
byte[] value)
|
void |
setValue(String key,
String value)
|
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String COMPRESSION
public static final String BLOCKCACHE
public static final String BLOCKSIZE
public static final String LENGTH
public static final String TTL
public static final String BLOOMFILTER
public static final String FOREVER
public static final String MAPFILE_INDEX_INTERVAL
public static final String DEFAULT_COMPRESSION
public static final int DEFAULT_VERSIONS
public static final boolean DEFAULT_IN_MEMORY
public static final boolean DEFAULT_BLOCKCACHE
public static final int DEFAULT_BLOCKSIZE
public static final boolean DEFAULT_BLOOMFILTER
public static final int DEFAULT_TTL
protected Map<ImmutableBytesWritable,ImmutableBytesWritable> values
Constructor Detail |
---|
public HColumnDescriptor()
public HColumnDescriptor(String familyName)
familyName
- Column family name. Must be 'printable' -- digit or
letter -- and end in a :
public HColumnDescriptor(byte[] familyName)
familyName
- Column family name. Must be 'printable' -- digit or
letter -- and end in a :
public HColumnDescriptor(HColumnDescriptor desc)
desc
- The descriptor.public HColumnDescriptor(byte[] familyName, int maxVersions, String compression, boolean inMemory, boolean blockCacheEnabled, int timeToLive, boolean bloomFilter)
familyName
- Column family name. Must be 'printable' -- digit or
letter -- and end in a :maxVersions
- Maximum number of versions to keepcompression
- Compression typeinMemory
- If true, column data should be kept in an HRegionServer's
cacheblockCacheEnabled
- If true, MapFile blocks should be cachedtimeToLive
- Time-to-live of cell contents, in seconds
(use HConstants.FOREVER for unlimited TTL)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
public HColumnDescriptor(byte[] familyName, int maxVersions, String compression, boolean inMemory, boolean blockCacheEnabled, int blocksize, int timeToLive, boolean bloomFilter)
familyName
- Column family name. Must be 'printable' -- digit or
letter -- and end in a :maxVersions
- Maximum number of versions to keepcompression
- Compression typeinMemory
- If true, column data should be kept in an HRegionServer's
cacheblockCacheEnabled
- If true, MapFile blocks should be cachedblocksize
- timeToLive
- Time-to-live of cell contents, in seconds
(use HConstants.FOREVER for unlimited TTL)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 |
---|
public static byte[] isLegalFamilyName(byte[] b)
b
- Family name.
b
IllegalArgumentException
- If not null and not a legitimate family
name: i.e. 'printable' and ends in a ':' (Null passes are allowed because
b
can be null when deserializing). Cannot start with a '.'
either.public byte[] getName()
public byte[] getNameWithColon()
public String getNameAsString()
public byte[] getValue(byte[] key)
key
- The key.
public String getValue(String key)
key
- The key.
public Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues()
public void setValue(byte[] key, byte[] value)
key
- The key.value
- The value.public void remove(byte[] key)
key
- Key whose key and value we're to remove from HCD parameters.public void setValue(String key, String value)
key
- The key.value
- The value.public Compression.Algorithm getCompression()
public int getMaxVersions()
public void setMaxVersions(int maxVersions)
maxVersions
- maximum number of versionspublic int getBlocksize()
public void setBlocksize(int s)
s
- public Compression.Algorithm getCompressionType()
public void setCompressionType(Compression.Algorithm type)
type
- Compression type setting.public boolean isInMemory()
public void setInMemory(boolean inMemory)
inMemory
- True if we are to keep all values in the HRegionServer
cachepublic int getTimeToLive()
public void setTimeToLive(int timeToLive)
timeToLive
- Time-to-live of cell contents, in seconds.public boolean isBlockCacheEnabled()
public void setBlockCacheEnabled(boolean blockCacheEnabled)
blockCacheEnabled
- True if MapFile blocks should be cached.public boolean isBloomfilter()
public void setBloomfilter(boolean onOff)
onOff
- Enable/Disable bloom filterpublic void setMapFileIndexInterval(int interval)
interval
- The number of entries that are added to the store MapFile before
an index entry is added.public String toString()
toString
in class Object
Object.toString()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(HColumnDescriptor o)
compareTo
in interface Comparable<HColumnDescriptor>
public void restSerialize(IRestSerializer serializer) throws HBaseRestException
ISerializable
restSerialize
in interface ISerializable
HBaseRestException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |