org.apache.hadoop.hbase
Class HColumnDescriptor

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

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class HColumnDescriptor
extends Object
implements org.apache.hadoop.io.WritableComparable<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.


Field Summary
static String BLOCKCACHE
           
static String BLOCKSIZE
          Size of storefile/hfile 'blocks'.
static String BLOOMFILTER
           
static String CACHE_BLOOMS_ON_WRITE
           
static String CACHE_DATA_ON_WRITE
           
static String CACHE_INDEX_ON_WRITE
           
static String COMPRESS_TAGS
           
static String COMPRESSION
           
static String COMPRESSION_COMPACT
           
static String DATA_BLOCK_ENCODING
           
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 stored to the filesytem (hfiles).
static String DEFAULT_BLOOMFILTER
          Default setting for whether or not to use bloomfilters.
static boolean DEFAULT_CACHE_BLOOMS_ON_WRITE
          Default setting for whether to cache bloom filter blocks on write if block caching is enabled.
static boolean DEFAULT_CACHE_DATA_ON_WRITE
          Default setting for whether to cache data blocks on write if block caching is enabled.
static boolean DEFAULT_CACHE_INDEX_ON_WRITE
          Default setting for whether to cache index blocks on write if block caching is enabled.
static boolean DEFAULT_COMPRESS_TAGS
          Default compress tags along with any type of DataBlockEncoding.
static String DEFAULT_COMPRESSION
          Default compression type.
static String DEFAULT_DATA_BLOCK_ENCODING
          Default data block encoding algorithm.
static boolean DEFAULT_ENCODE_ON_DISK
          Default value of the flag that enables data block encoding on disk, as opposed to encoding in cache only.
static boolean DEFAULT_EVICT_BLOCKS_ON_CLOSE
          Default setting for whether to evict cached blocks from the blockcache on close.
static boolean DEFAULT_IN_MEMORY
          Default setting for whether to serve from memory or not.
static KeepDeletedCells DEFAULT_KEEP_DELETED
          Default setting for preventing deleted from being collected immediately.
static int DEFAULT_MIN_VERSIONS
          Default is not to keep a minimum of versions.
static boolean DEFAULT_PREFETCH_BLOCKS_ON_OPEN
           
static int DEFAULT_REPLICATION_SCOPE
          Default scope.
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 ENCODE_ON_DISK
           
static String ENCRYPTION
           
static String ENCRYPTION_KEY
           
static String EVICT_BLOCKS_ON_CLOSE
           
static String FOREVER
           
static String KEEP_DELETED_CELLS
           
static String LENGTH
           
static String MIN_VERSIONS
           
static String PREFETCH_BLOCKS_ON_OPEN
          Key for the PREFETCH_BLOCKS_ON_OPEN attribute.
static String REPLICATION_SCOPE
           
static byte[] REPLICATION_SCOPE_BYTES
           
static String TTL
           
 
Constructor Summary
HColumnDescriptor()
          Deprecated. Used by Writables and Writables are going away.
HColumnDescriptor(byte[] familyName)
          Construct a column descriptor specifying only the family name The other attributes are defaulted.
HColumnDescriptor(byte[] familyName, int minVersions, int maxVersions, KeepDeletedCells keepDeletedCells, String compression, boolean encodeOnDisk, String dataBlockEncoding, boolean inMemory, boolean blockCacheEnabled, int blocksize, int timeToLive, String bloomFilter, int scope)
          Deprecated. use HColumnDescriptor(String) and setters
HColumnDescriptor(byte[] familyName, int maxVersions, String compression, boolean inMemory, boolean blockCacheEnabled, int blocksize, int timeToLive, String bloomFilter, int scope)
          Deprecated. use HColumnDescriptor(String) and setters
HColumnDescriptor(byte[] familyName, int maxVersions, String compression, boolean inMemory, boolean blockCacheEnabled, int timeToLive, String bloomFilter)
          Deprecated. use HColumnDescriptor(String) and setters
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)
           
 HBaseProtos.ColumnFamilySchema convert()
           
static HColumnDescriptor convert(HBaseProtos.ColumnFamilySchema cfs)
           
 boolean equals(Object obj)
           
 int getBlocksize()
           
 BloomType getBloomFilterType()
           
 Compression.Algorithm getCompactionCompression()
           
 Compression.Algorithm getCompactionCompressionType()
           
 Compression.Algorithm getCompression()
           
 Compression.Algorithm getCompressionType()
           
 Map<String,String> getConfiguration()
          Getter for fetching an unmodifiable configuration map.
 String getConfigurationValue(String key)
          Getter for accessing the configuration value by key.
 DataBlockEncoding getDataBlockEncoding()
           
 DataBlockEncoding getDataBlockEncodingOnDisk()
          Deprecated. 
static Map<String,String> getDefaultValues()
           
 byte[] getEncryptionKey()
          Return the raw crypto key attribute for the family, or null if not set
 String getEncryptionType()
          Return the encryption algorithm in use by this family
 KeepDeletedCells getKeepDeletedCells()
           
 int getMaxVersions()
           
 int getMinVersions()
           
 byte[] getName()
           
 String getNameAsString()
           
 int getScope()
           
 int getTimeToLive()
           
static PrettyPrinter.Unit getUnit(String key)
           
 byte[] getValue(byte[] key)
           
 String getValue(String key)
           
 Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues()
           
 int hashCode()
           
 boolean isBlockCacheEnabled()
           
 boolean isInMemory()
           
static byte[] isLegalFamilyName(byte[] b)
           
static HColumnDescriptor parseFrom(byte[] bytes)
           
 void readFields(DataInput in)
          Deprecated. Writables are going away. Use pb parseFrom(byte[]) instead.
 void remove(byte[] key)
           
 void removeConfiguration(String key)
          Remove a configuration setting represented by the key from the configuration map.
 HColumnDescriptor setBlockCacheEnabled(boolean blockCacheEnabled)
           
 HColumnDescriptor setBlocksize(int s)
           
 HColumnDescriptor setBloomFilterType(BloomType bt)
           
 HColumnDescriptor setCacheBloomsOnWrite(boolean value)
           
 HColumnDescriptor setCacheDataOnWrite(boolean value)
           
 HColumnDescriptor setCacheIndexesOnWrite(boolean value)
           
 HColumnDescriptor setCompactionCompressionType(Compression.Algorithm type)
          Compression types supported in hbase.
 HColumnDescriptor setCompressionType(Compression.Algorithm type)
          Compression types supported in hbase.
 HColumnDescriptor setCompressTags(boolean compressTags)
          Set whether the tags should be compressed along with DataBlockEncoding.
 void setConfiguration(String key, String value)
          Setter for storing a configuration setting in configuration map.
 HColumnDescriptor setDataBlockEncoding(DataBlockEncoding type)
          Set data block encoding algorithm used in block cache.
 HColumnDescriptor setEncodeOnDisk(boolean encodeOnDisk)
          Deprecated. 
 HColumnDescriptor setEncryptionKey(byte[] keyBytes)
          Set the raw crypto key attribute for the family
 HColumnDescriptor setEncryptionType(String algorithm)
          Set the encryption algorithm for use with this family
 HColumnDescriptor setEvictBlocksOnClose(boolean value)
           
 HColumnDescriptor setInMemory(boolean inMemory)
           
 HColumnDescriptor setKeepDeletedCells(boolean keepDeletedCells)
          Deprecated. use setKeepDeletedCells(KeepDeletedCells)
 HColumnDescriptor setKeepDeletedCells(KeepDeletedCells keepDeletedCells)
           
 HColumnDescriptor setMaxVersions(int maxVersions)
           
 HColumnDescriptor setMinVersions(int minVersions)
           
 HColumnDescriptor setPrefetchBlocksOnOpen(boolean value)
           
 HColumnDescriptor setScope(int scope)
           
 HColumnDescriptor setTimeToLive(int timeToLive)
           
 HColumnDescriptor setValue(byte[] key, byte[] value)
           
 HColumnDescriptor setValue(String key, String value)
           
 HColumnDescriptor setVersions(int minVersions, int maxVersions)
          Set minimum and maximum versions to keep
 boolean shouldCacheBloomsOnWrite()
           
 boolean shouldCacheDataOnWrite()
           
 boolean shouldCacheIndexesOnWrite()
           
 boolean shouldCompressTags()
           
 boolean shouldEvictBlocksOnClose()
           
 boolean shouldPrefetchBlocksOnOpen()
           
 byte[] toByteArray()
           
 String toString()
           
 String toStringCustomizedValues()
           
 void write(DataOutput out)
          Deprecated. Writables are going away. Use toByteArray() instead.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPRESSION

public static final String COMPRESSION
See Also:
Constant Field Values

COMPRESSION_COMPACT

public static final String COMPRESSION_COMPACT
See Also:
Constant Field Values

ENCODE_ON_DISK

public static final String ENCODE_ON_DISK
See Also:
Constant Field Values

DATA_BLOCK_ENCODING

public static final String DATA_BLOCK_ENCODING
See Also:
Constant Field Values

BLOCKCACHE

public static final String BLOCKCACHE
See Also:
Constant Field Values

CACHE_DATA_ON_WRITE

public static final String CACHE_DATA_ON_WRITE
See Also:
Constant Field Values

CACHE_INDEX_ON_WRITE

public static final String CACHE_INDEX_ON_WRITE
See Also:
Constant Field Values

CACHE_BLOOMS_ON_WRITE

public static final String CACHE_BLOOMS_ON_WRITE
See Also:
Constant Field Values

EVICT_BLOCKS_ON_CLOSE

public static final String EVICT_BLOCKS_ON_CLOSE
See Also:
Constant Field Values

PREFETCH_BLOCKS_ON_OPEN

public static final String PREFETCH_BLOCKS_ON_OPEN
Key for the PREFETCH_BLOCKS_ON_OPEN attribute. If set, all INDEX, BLOOM, and DATA blocks of HFiles belonging to this family will be loaded into the cache as soon as the file is opened. These loads will not count as cache misses.

See Also:
Constant Field Values

BLOCKSIZE

public static final String BLOCKSIZE
Size of storefile/hfile 'blocks'. Default is DEFAULT_BLOCKSIZE. Use smaller block sizes for faster random-access at expense of larger indices (more memory consumption).

See Also:
Constant Field Values

LENGTH

public static final String LENGTH
See Also:
Constant Field Values

TTL

public static final String TTL
See Also:
Constant Field Values

BLOOMFILTER

public static final String BLOOMFILTER
See Also:
Constant Field Values

FOREVER

public static final String FOREVER
See Also:
Constant Field Values

REPLICATION_SCOPE

public static final String REPLICATION_SCOPE
See Also:
Constant Field Values

REPLICATION_SCOPE_BYTES

public static final byte[] REPLICATION_SCOPE_BYTES

MIN_VERSIONS

public static final String MIN_VERSIONS
See Also:
Constant Field Values

KEEP_DELETED_CELLS

public static final String KEEP_DELETED_CELLS
See Also:
Constant Field Values

COMPRESS_TAGS

public static final String COMPRESS_TAGS
See Also:
Constant Field Values

ENCRYPTION

@InterfaceStability.Unstable
public static final String ENCRYPTION
See Also:
Constant Field Values

ENCRYPTION_KEY

@InterfaceStability.Unstable
public static final String ENCRYPTION_KEY
See Also:
Constant Field Values

DEFAULT_COMPRESSION

public static final String DEFAULT_COMPRESSION
Default compression type.


DEFAULT_ENCODE_ON_DISK

public static final boolean DEFAULT_ENCODE_ON_DISK
Default value of the flag that enables data block encoding on disk, as opposed to encoding in cache only. We encode blocks everywhere by default, as long as DATA_BLOCK_ENCODING is not NONE.

See Also:
Constant Field Values

DEFAULT_DATA_BLOCK_ENCODING

public static final String DEFAULT_DATA_BLOCK_ENCODING
Default data block encoding algorithm.


DEFAULT_VERSIONS

public static final int DEFAULT_VERSIONS
Default number of versions of a record to keep.


DEFAULT_MIN_VERSIONS

public static final int DEFAULT_MIN_VERSIONS
Default is not to keep a minimum of versions.

See Also:
Constant Field Values

DEFAULT_IN_MEMORY

public static final boolean DEFAULT_IN_MEMORY
Default setting for whether to serve from memory or not.

See Also:
Constant Field Values

DEFAULT_KEEP_DELETED

public static final KeepDeletedCells DEFAULT_KEEP_DELETED
Default setting for preventing deleted from being collected immediately.


DEFAULT_BLOCKCACHE

public static final boolean DEFAULT_BLOCKCACHE
Default setting for whether to use a block cache or not.

See Also:
Constant Field Values

DEFAULT_CACHE_DATA_ON_WRITE

public static final boolean DEFAULT_CACHE_DATA_ON_WRITE
Default setting for whether to cache data blocks on write if block caching is enabled.

See Also:
Constant Field Values

DEFAULT_CACHE_INDEX_ON_WRITE

public static final boolean DEFAULT_CACHE_INDEX_ON_WRITE
Default setting for whether to cache index blocks on write if block caching is enabled.

See Also:
Constant Field Values

DEFAULT_BLOCKSIZE

public static final int DEFAULT_BLOCKSIZE
Default size of blocks in files stored to the filesytem (hfiles).

See Also:
Constant Field Values

DEFAULT_BLOOMFILTER

public static final String DEFAULT_BLOOMFILTER
Default setting for whether or not to use bloomfilters.


DEFAULT_CACHE_BLOOMS_ON_WRITE

public static final boolean DEFAULT_CACHE_BLOOMS_ON_WRITE
Default setting for whether to cache bloom filter blocks on write if block caching is enabled.

See Also:
Constant Field Values

DEFAULT_TTL

public static final int DEFAULT_TTL
Default time to live of cell contents.

See Also:
Constant Field Values

DEFAULT_REPLICATION_SCOPE

public static final int DEFAULT_REPLICATION_SCOPE
Default scope.

See Also:
Constant Field Values

DEFAULT_EVICT_BLOCKS_ON_CLOSE

public static final boolean DEFAULT_EVICT_BLOCKS_ON_CLOSE
Default setting for whether to evict cached blocks from the blockcache on close.

See Also:
Constant Field Values

DEFAULT_COMPRESS_TAGS

public static final boolean DEFAULT_COMPRESS_TAGS
Default compress tags along with any type of DataBlockEncoding.

See Also:
Constant Field Values

DEFAULT_PREFETCH_BLOCKS_ON_OPEN

public static final boolean DEFAULT_PREFETCH_BLOCKS_ON_OPEN
See Also:
Constant Field Values
Constructor Detail

HColumnDescriptor

@Deprecated
public HColumnDescriptor()
Deprecated. Used by Writables and Writables are going away.

Default constructor. Must be present for Writable.


HColumnDescriptor

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

Parameters:
familyName - Column family name. Must be 'printable' -- digit or letter -- and may not contain a :

HColumnDescriptor

public HColumnDescriptor(byte[] familyName)
Construct a column descriptor specifying only the family name The other attributes are defaulted.

Parameters:
familyName - Column family name. Must be 'printable' -- digit or letter -- and may not contain a :

HColumnDescriptor

public HColumnDescriptor(HColumnDescriptor desc)
Constructor. Makes a deep copy of the supplied descriptor. Can make a modifiable descriptor from an UnmodifyableHColumnDescriptor.

Parameters:
desc - The descriptor.

HColumnDescriptor

@Deprecated
public HColumnDescriptor(byte[] familyName,
                                    int maxVersions,
                                    String compression,
                                    boolean inMemory,
                                    boolean blockCacheEnabled,
                                    int timeToLive,
                                    String bloomFilter)
Deprecated. use HColumnDescriptor(String) and setters

Constructor

Parameters:
familyName - Column family name. Must be 'printable' -- digit or letter -- and may not contain a :
maxVersions - Maximum number of versions to keep
compression - Compression type
inMemory - If true, column data should be kept in an HRegionServer's cache
blockCacheEnabled - If true, MapFile blocks should be cached
timeToLive - Time-to-live of cell contents, in seconds (use HConstants.FOREVER for unlimited TTL)
bloomFilter - Bloom filter type 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] or contains a :
IllegalArgumentException - if the number of versions is <= 0

HColumnDescriptor

@Deprecated
public HColumnDescriptor(byte[] familyName,
                                    int maxVersions,
                                    String compression,
                                    boolean inMemory,
                                    boolean blockCacheEnabled,
                                    int blocksize,
                                    int timeToLive,
                                    String bloomFilter,
                                    int scope)
Deprecated. use HColumnDescriptor(String) and setters

Constructor

Parameters:
familyName - Column family name. Must be 'printable' -- digit or letter -- and may not contain a :
maxVersions - Maximum number of versions to keep
compression - Compression type
inMemory - If true, column data should be kept in an HRegionServer's cache
blockCacheEnabled - If true, MapFile blocks should be cached
blocksize - Block size to use when writing out storefiles. Use smaller block sizes for faster random-access at expense of larger indices (more memory consumption). Default is usually 64k.
timeToLive - Time-to-live of cell contents, in seconds (use HConstants.FOREVER for unlimited TTL)
bloomFilter - Bloom filter type for this column
scope - The scope tag 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] or contains a :
IllegalArgumentException - if the number of versions is <= 0

HColumnDescriptor

@Deprecated
public HColumnDescriptor(byte[] familyName,
                                    int minVersions,
                                    int maxVersions,
                                    KeepDeletedCells keepDeletedCells,
                                    String compression,
                                    boolean encodeOnDisk,
                                    String dataBlockEncoding,
                                    boolean inMemory,
                                    boolean blockCacheEnabled,
                                    int blocksize,
                                    int timeToLive,
                                    String bloomFilter,
                                    int scope)
Deprecated. use HColumnDescriptor(String) and setters

Constructor

Parameters:
familyName - Column family name. Must be 'printable' -- digit or letter -- and may not contain a :
minVersions - Minimum number of versions to keep
maxVersions - Maximum number of versions to keep
keepDeletedCells - Whether to retain deleted cells until they expire up to maxVersions versions.
compression - Compression type
encodeOnDisk - whether to use the specified data block encoding on disk. If false, the encoding will be used in cache only.
dataBlockEncoding - data block encoding
inMemory - If true, column data should be kept in an HRegionServer's cache
blockCacheEnabled - If true, MapFile blocks should be cached
blocksize - Block size to use when writing out storefiles. Use smaller blocksizes for faster random-access at expense of larger indices (more memory consumption). Default is usually 64k.
timeToLive - Time-to-live of cell contents, in seconds (use HConstants.FOREVER for unlimited TTL)
bloomFilter - Bloom filter type for this column
scope - The scope tag 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] or contains a :
IllegalArgumentException - if the number of versions is <= 0
Method Detail

isLegalFamilyName

public static byte[] isLegalFamilyName(byte[] b)
Parameters:
b - Family name.
Returns:
b
Throws:
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. Also Family can not be an empty value or equal "recovered.edits".

getName

public byte[] getName()
Returns:
Name of this column family

getNameAsString

public String getNameAsString()
Returns:
Name of this column family

getValue

public byte[] getValue(byte[] key)
Parameters:
key - The key.
Returns:
The value.

getValue

public String getValue(String key)
Parameters:
key - The key.
Returns:
The value as a string.

getValues

public Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues()
Returns:
All values.

setValue

public HColumnDescriptor setValue(byte[] key,
                                  byte[] value)
Parameters:
key - The key.
value - The value.
Returns:
this (for chained invocation)

remove

public void remove(byte[] key)
Parameters:
key - Key whose key and value we're to remove from HCD parameters.

setValue

public HColumnDescriptor setValue(String key,
                                  String value)
Parameters:
key - The key.
value - The value.
Returns:
this (for chained invocation)

getCompression

public Compression.Algorithm getCompression()
Returns:
compression type being used for the column family

getCompactionCompression

public Compression.Algorithm getCompactionCompression()
Returns:
compression type being used for the column family for major compression

getMaxVersions

public int getMaxVersions()
Returns:
maximum number of versions

setMaxVersions

public HColumnDescriptor setMaxVersions(int maxVersions)
Parameters:
maxVersions - maximum number of versions
Returns:
this (for chained invocation)

setVersions

public HColumnDescriptor setVersions(int minVersions,
                                     int maxVersions)
Set minimum and maximum versions to keep

Parameters:
minVersions - minimal number of versions
maxVersions - maximum number of versions
Returns:
this (for chained invocation)

getBlocksize

public int getBlocksize()
Returns:
The storefile/hfile blocksize for this column family.

setBlocksize

public HColumnDescriptor setBlocksize(int s)
Parameters:
s - Blocksize to use when writing out storefiles/hfiles on this column family.
Returns:
this (for chained invocation)

getCompressionType

public Compression.Algorithm getCompressionType()
Returns:
Compression type setting.

setCompressionType

public HColumnDescriptor setCompressionType(Compression.Algorithm type)
Compression types supported in hbase. LZO is not bundled as part of the hbase distribution. See LZO Compression for how to enable it.

Parameters:
type - Compression type setting.
Returns:
this (for chained invocation)

getDataBlockEncodingOnDisk

@Deprecated
public DataBlockEncoding getDataBlockEncodingOnDisk()
Deprecated. 

Returns:
data block encoding algorithm used on disk

setEncodeOnDisk

@Deprecated
public HColumnDescriptor setEncodeOnDisk(boolean encodeOnDisk)
Deprecated. 

This method does nothing now. Flag ENCODE_ON_DISK is not used any more. Data blocks have the same encoding in cache as on disk.

Returns:
this (for chained invocation)

getDataBlockEncoding

public DataBlockEncoding getDataBlockEncoding()
Returns:
the data block encoding algorithm used in block cache and optionally on disk

setDataBlockEncoding

public HColumnDescriptor setDataBlockEncoding(DataBlockEncoding type)
Set data block encoding algorithm used in block cache.

Parameters:
type - What kind of data block encoding will be used.
Returns:
this (for chained invocation)

setCompressTags

public HColumnDescriptor setCompressTags(boolean compressTags)
Set whether the tags should be compressed along with DataBlockEncoding. When no DataBlockEncoding is been used, this is having no effect.

Parameters:
compressTags -
Returns:
this (for chained invocation)

shouldCompressTags

public boolean shouldCompressTags()
Returns:
Whether KV tags should be compressed along with DataBlockEncoding. When no DataBlockEncoding is been used, this is having no effect.

getCompactionCompressionType

public Compression.Algorithm getCompactionCompressionType()
Returns:
Compression type setting.

setCompactionCompressionType

public HColumnDescriptor setCompactionCompressionType(Compression.Algorithm type)
Compression types supported in hbase. LZO is not bundled as part of the hbase distribution. See LZO Compression for how to enable it.

Parameters:
type - Compression type setting.
Returns:
this (for chained invocation)

isInMemory

public boolean isInMemory()
Returns:
True if we are to keep all in use HRegionServer cache.

setInMemory

public HColumnDescriptor setInMemory(boolean inMemory)
Parameters:
inMemory - True if we are to keep all values in the HRegionServer cache
Returns:
this (for chained invocation)

getKeepDeletedCells

public KeepDeletedCells getKeepDeletedCells()

setKeepDeletedCells

@Deprecated
public HColumnDescriptor setKeepDeletedCells(boolean keepDeletedCells)
Deprecated. use setKeepDeletedCells(KeepDeletedCells)

Parameters:
keepDeletedCells - True if deleted rows should not be collected immediately.
Returns:
this (for chained invocation)

setKeepDeletedCells

public HColumnDescriptor setKeepDeletedCells(KeepDeletedCells keepDeletedCells)
Parameters:
keepDeletedCells - True if deleted rows should not be collected immediately.
Returns:
this (for chained invocation)

getTimeToLive

public int getTimeToLive()
Returns:
Time-to-live of cell contents, in seconds.

setTimeToLive

public HColumnDescriptor setTimeToLive(int timeToLive)
Parameters:
timeToLive - Time-to-live of cell contents, in seconds.
Returns:
this (for chained invocation)

getMinVersions

public int getMinVersions()
Returns:
The minimum number of versions to keep.

setMinVersions

public HColumnDescriptor setMinVersions(int minVersions)
Parameters:
minVersions - The minimum number of versions to keep. (used when timeToLive is set)
Returns:
this (for chained invocation)

isBlockCacheEnabled

public boolean isBlockCacheEnabled()
Returns:
True if MapFile blocks should be cached.

setBlockCacheEnabled

public HColumnDescriptor setBlockCacheEnabled(boolean blockCacheEnabled)
Parameters:
blockCacheEnabled - True if MapFile blocks should be cached.
Returns:
this (for chained invocation)

getBloomFilterType

public BloomType getBloomFilterType()
Returns:
bloom filter type used for new StoreFiles in ColumnFamily

setBloomFilterType

public HColumnDescriptor setBloomFilterType(BloomType bt)
Parameters:
bt - bloom filter type
Returns:
this (for chained invocation)

getScope

public int getScope()
Returns:
the scope tag

setScope

public HColumnDescriptor setScope(int scope)
Parameters:
scope - the scope tag
Returns:
this (for chained invocation)

shouldCacheDataOnWrite

public boolean shouldCacheDataOnWrite()
Returns:
true if we should cache data blocks on write

setCacheDataOnWrite

public HColumnDescriptor setCacheDataOnWrite(boolean value)
Parameters:
value - true if we should cache data blocks on write
Returns:
this (for chained invocation)

shouldCacheIndexesOnWrite

public boolean shouldCacheIndexesOnWrite()
Returns:
true if we should cache index blocks on write

setCacheIndexesOnWrite

public HColumnDescriptor setCacheIndexesOnWrite(boolean value)
Parameters:
value - true if we should cache index blocks on write
Returns:
this (for chained invocation)

shouldCacheBloomsOnWrite

public boolean shouldCacheBloomsOnWrite()
Returns:
true if we should cache bloomfilter blocks on write

setCacheBloomsOnWrite

public HColumnDescriptor setCacheBloomsOnWrite(boolean value)
Parameters:
value - true if we should cache bloomfilter blocks on write
Returns:
this (for chained invocation)

shouldEvictBlocksOnClose

public boolean shouldEvictBlocksOnClose()
Returns:
true if we should evict cached blocks from the blockcache on close

setEvictBlocksOnClose

public HColumnDescriptor setEvictBlocksOnClose(boolean value)
Parameters:
value - true if we should evict cached blocks from the blockcache on close
Returns:
this (for chained invocation)

shouldPrefetchBlocksOnOpen

public boolean shouldPrefetchBlocksOnOpen()
Returns:
true if we should prefetch blocks into the blockcache on open

setPrefetchBlocksOnOpen

public HColumnDescriptor setPrefetchBlocksOnOpen(boolean value)
Parameters:
value - true if we should prefetch blocks into the blockcache on open
Returns:
this (for chained invocation)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

toStringCustomizedValues

public String toStringCustomizedValues()
Returns:
Column family descriptor with only the customized attributes.

getUnit

public static PrettyPrinter.Unit getUnit(String key)

getDefaultValues

public static Map<String,String> getDefaultValues()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

readFields

@Deprecated
public void readFields(DataInput in)
                throws IOException
Deprecated. Writables are going away. Use pb parseFrom(byte[]) instead.

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

write

@Deprecated
public void write(DataOutput out)
           throws IOException
Deprecated. Writables are going away. Use toByteArray() instead.

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

compareTo

public int compareTo(HColumnDescriptor o)
Specified by:
compareTo in interface Comparable<HColumnDescriptor>

toByteArray

public byte[] toByteArray()
Returns:
This instance serialized with pb with pb magic prefix
See Also:
parseFrom(byte[])

parseFrom

public static HColumnDescriptor parseFrom(byte[] bytes)
                                   throws DeserializationException
Parameters:
bytes - A pb serialized HColumnDescriptor instance with pb magic prefix
Returns:
An instance of HColumnDescriptor made from bytes
Throws:
DeserializationException
See Also:
toByteArray()

convert

public static HColumnDescriptor convert(HBaseProtos.ColumnFamilySchema cfs)
Parameters:
cfs -
Returns:
An HColumnDescriptor made from the passed in cfs

convert

public HBaseProtos.ColumnFamilySchema convert()
Returns:
Convert this instance to a the pb column family type

getConfigurationValue

public String getConfigurationValue(String key)
Getter for accessing the configuration value by key.


getConfiguration

public Map<String,String> getConfiguration()
Getter for fetching an unmodifiable configuration map.


setConfiguration

public void setConfiguration(String key,
                             String value)
Setter for storing a configuration setting in configuration map.

Parameters:
key - Config key. Same as XML config key e.g. hbase.something.or.other.
value - String value. If null, removes the configuration.

removeConfiguration

public void removeConfiguration(String key)
Remove a configuration setting represented by the key from the configuration map.


getEncryptionType

@InterfaceStability.Unstable
public String getEncryptionType()
Return the encryption algorithm in use by this family


setEncryptionType

@InterfaceStability.Unstable
public HColumnDescriptor setEncryptionType(String algorithm)
Set the encryption algorithm for use with this family

Parameters:
algorithm -

getEncryptionKey

@InterfaceStability.Unstable
public byte[] getEncryptionKey()
Return the raw crypto key attribute for the family, or null if not set


setEncryptionKey

@InterfaceStability.Unstable
public HColumnDescriptor setEncryptionKey(byte[] keyBytes)
Set the raw crypto key attribute for the family



Copyright © 2015 The Apache Software Foundation. All Rights Reserved.