org.apache.hadoop.hbase
Class HTableDescriptor

java.lang.Object
  extended by org.apache.hadoop.hbase.HTableDescriptor
All Implemented Interfaces:
Comparable<HTableDescriptor>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<HTableDescriptor>
Direct Known Subclasses:
UnmodifyableHTableDescriptor

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class HTableDescriptor
extends Object
implements org.apache.hadoop.io.WritableComparable<HTableDescriptor>

HTableDescriptor contains the details about an HBase table such as the descriptors of all the column families, is the table a catalog table, -ROOT- or hbase:meta , if the table is read only, the maximum size of the memstore, when the region split should occur, coprocessors associated with it etc...


Field Summary
static String COMPACTION_ENABLED
          INTERNAL Used by HBase Shell interface to access this metadata attribute which denotes if the table is compaction enabled
static boolean DEFAULT_COMPACTION_ENABLED
          Constant that denotes whether the table is compaction enabled by default
static long DEFAULT_MEMSTORE_FLUSH_SIZE
          Constant that denotes the maximum default size of the memstore after which the contents are flushed to the store files
static boolean DEFAULT_READONLY
          Constant that denotes whether the table is READONLY by default and is false
static String DEFERRED_LOG_FLUSH
          Deprecated. Use DURABILITY instead.
static String DURABILITY
          INTERNAL Durability setting for the table.
static String IS_META
          INTERNAL Used by rest interface to access this metadata attribute which denotes if it is a catalog table, either hbase:meta or -ROOT-
static String IS_ROOT
          INTERNAL Used by rest interface to access this metadata attribute which denotes if the table is a -ROOT- region or not
static String MAX_FILESIZE
          INTERNAL Used by HBase Shell interface to access this metadata attribute which denotes the maximum size of the store file after which a region split occurs
static String MEMSTORE_FLUSHSIZE
          INTERNAL Used by HBase Shell interface to access this metadata attribute which represents the maximum size of the memstore after which its contents are flushed onto the disk
static HTableDescriptor META_TABLEDESC
          Deprecated. Use TableDescriptors#get(TableName.META_TABLE_NAME) or HBaseAdmin#getTableDescriptor(TableName.META_TABLE_NAME) instead.
static byte[] NAMESPACE_COL_DESC_BYTES
           
static String NAMESPACE_FAMILY_INFO
           
static byte[] NAMESPACE_FAMILY_INFO_BYTES
           
static HTableDescriptor NAMESPACE_TABLEDESC
          Table descriptor for namespace table
static String OWNER
           
static ImmutableBytesWritable OWNER_KEY
           
static String PRIORITY
           
static String READONLY
          INTERNAL Used by rest interface to access this metadata attribute which denotes if the table is Read Only
static String SPLIT_POLICY
           
 
Constructor Summary
  HTableDescriptor()
          Deprecated. Used by Writables and Writables are going away.
  HTableDescriptor(byte[] name)
          Deprecated. 
  HTableDescriptor(HTableDescriptor desc)
          Construct a table descriptor by cloning the descriptor passed as a parameter.
  HTableDescriptor(String name)
          Deprecated. 
  HTableDescriptor(TableName name)
          Construct a table descriptor specifying a TableName object
protected HTableDescriptor(TableName name, HColumnDescriptor[] families)
           INTERNAL Private constructor used internally creating table descriptors for catalog tables, hbase:meta and -ROOT-.
protected HTableDescriptor(TableName name, HColumnDescriptor[] families, Map<ImmutableBytesWritable,ImmutableBytesWritable> values)
           INTERNAL Private constructor used internally creating table descriptors for catalog tables, hbase:meta and -ROOT-.
 
Method Summary
 void addCoprocessor(String className)
          Add a table coprocessor to this table.
 void addCoprocessor(String className, org.apache.hadoop.fs.Path jarFilePath, int priority, Map<String,String> kvs)
          Add a table coprocessor to this table.
 HTableDescriptor addCoprocessorWithSpec(String specStr)
          Add a table coprocessor to this table.
 void addFamily(HColumnDescriptor family)
          Adds a column family.
 int compareTo(HTableDescriptor other)
          Compares the descriptor with another descriptor which is passed as a parameter.
 org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema convert()
           
static HTableDescriptor convert(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema ts)
           
 boolean equals(Object obj)
          Compare the contents of the descriptor with another one passed as a parameter.
 HColumnDescriptor[] getColumnFamilies()
          Returns an array all the HColumnDescriptor of the column families of the table.
 Map<String,String> getConfiguration()
          Getter for fetching an unmodifiable configuration map.
 String getConfigurationValue(String key)
          Getter for accessing the configuration value by key
 List<String> getCoprocessors()
          Return the list of attached co-processor represented by their name className
 Durability getDurability()
          Returns the durability setting for the table.
 Collection<HColumnDescriptor> getFamilies()
          Returns an unmodifiable collection of all the HColumnDescriptor of all the column families of the table.
 Set<byte[]> getFamiliesKeys()
          Returns all the column family names of the current table.
 HColumnDescriptor getFamily(byte[] column)
          Returns the HColumnDescriptor for a specific column family with name as specified by the parameter column.
 long getMaxFileSize()
          Returns the maximum size upto which a region can grow to after which a region split is triggered.
 long getMemStoreFlushSize()
          Returns the size of the memstore after which a flush to filesystem is triggered.
 byte[] getName()
          Get the name of the table as a byte array.
 String getNameAsString()
          Get the name of the table as a String
 String getOwnerString()
          Deprecated. 
 int getPriority()
           
 String getRegionSplitPolicyClassName()
          This gets the class associated with the region split policy which determines when a region split should occur.
static org.apache.hadoop.fs.Path getTableDir(org.apache.hadoop.fs.Path rootdir, byte[] tableName)
          Deprecated. 
 TableName getTableName()
          Get the name of the table
 byte[] getValue(byte[] key)
          Getter for accessing the metadata associated with the key
 String getValue(String key)
          Getter for accessing the metadata associated with the key
 Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues()
          Getter for fetching an unmodifiable values map.
 boolean hasCoprocessor(String classNameToMatch)
          Check if the table has an attached co-processor represented by the name className
 boolean hasFamily(byte[] familyName)
          Checks to see if this table contains the given column family
 int hashCode()
           
 boolean isCompactionEnabled()
          Check if the compaction enable flag of the table is true.
 boolean isDeferredLogFlush()
          Deprecated. 
 boolean isMetaRegion()
          Checks if this table is hbase:meta region.
 boolean isMetaTable()
          Checks if the table is a hbase:meta table
 boolean isReadOnly()
          Check if the readOnly flag of the table is set.
 boolean isRootRegion()
          Check if the descriptor represents a -ROOT- region.
static HTableDescriptor metaTableDescriptor(org.apache.hadoop.conf.Configuration conf)
           
static HTableDescriptor parseFrom(byte[] bytes)
           
 void readFields(DataInput in)
          Deprecated. Writables are going away. Use pb parseFrom(byte[]) instead.
 void remove(byte[] key)
          Remove metadata represented by the key from the values map
 void remove(ImmutableBytesWritable key)
          Remove metadata represented by the key from the values map
 void remove(String key)
          Remove metadata represented by the key from the values map
 void removeConfiguration(String key)
          Remove a config setting represented by the key from the configuration map
 void removeCoprocessor(String className)
          Remove a coprocessor from those set on the table
 HColumnDescriptor removeFamily(byte[] column)
          Removes the HColumnDescriptor with name specified by the parameter column from the table descriptor
 void setCompactionEnabled(boolean isEnable)
          Setting the table compaction enable flag.
 void setConfiguration(String key, String value)
          Setter for storing a configuration setting in configuration map.
 void setDeferredLogFlush(boolean isAsyncLogFlush)
          Deprecated. 
 void setDurability(Durability durability)
          Sets the Durability setting for the table.
 void setMaxFileSize(long maxFileSize)
          Sets the maximum size upto which a region can grow to after which a region split is triggered.
 void setMemStoreFlushSize(long memstoreFlushSize)
          Represents the maximum size of the memstore after which the contents of the memstore are flushed to the filesystem.
protected  void setMetaRegion(boolean isMeta)
           INTERNAL Used to denote if the current table represents -ROOT- or hbase:meta region.
 void setName(byte[] name)
          Deprecated. 
 void setName(TableName name)
          Deprecated. 
 void setOwner(User owner)
          Deprecated. 
 void setOwnerString(String ownerString)
          Deprecated. 
 HTableDescriptor setPriority(int priority)
           
 void setReadOnly(boolean readOnly)
          Setting the table as read only sets all the columns in the table as read only.
 void setRegionSplitPolicyClassName(String clazz)
          This sets the class associated with the region split policy which determines when a region split should occur.
protected  void setRootRegion(boolean isRoot)
           INTERNAL Used to denote if the current table represents -ROOT- region.
 void setValue(byte[] key, byte[] value)
          Setter for storing metadata as a (key, value) pair in values map
 void setValue(ImmutableBytesWritable key, ImmutableBytesWritable value)
           
 void setValue(String key, String value)
          Setter for storing metadata as a (key, value) pair in values map
 byte[] toByteArray()
           
 String toString()
           
 String toStringCustomizedValues()
           
 String toStringTableAttributes()
           
 void write(DataOutput out)
          Deprecated. Writables are going away. Use MessageLite.toByteArray() instead.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SPLIT_POLICY

public static final String SPLIT_POLICY
See Also:
Constant Field Values

MAX_FILESIZE

public static final String MAX_FILESIZE
INTERNAL Used by HBase Shell interface to access this metadata attribute which denotes the maximum size of the store file after which a region split occurs

See Also:
getMaxFileSize(), Constant Field Values

OWNER

public static final String OWNER
See Also:
Constant Field Values

OWNER_KEY

public static final ImmutableBytesWritable OWNER_KEY

READONLY

public static final String READONLY
INTERNAL Used by rest interface to access this metadata attribute which denotes if the table is Read Only

See Also:
isReadOnly(), Constant Field Values

COMPACTION_ENABLED

public static final String COMPACTION_ENABLED
INTERNAL Used by HBase Shell interface to access this metadata attribute which denotes if the table is compaction enabled

See Also:
isCompactionEnabled(), Constant Field Values

MEMSTORE_FLUSHSIZE

public static final String MEMSTORE_FLUSHSIZE
INTERNAL Used by HBase Shell interface to access this metadata attribute which represents the maximum size of the memstore after which its contents are flushed onto the disk

See Also:
getMemStoreFlushSize(), Constant Field Values

IS_ROOT

public static final String IS_ROOT
INTERNAL Used by rest interface to access this metadata attribute which denotes if the table is a -ROOT- region or not

See Also:
isRootRegion(), Constant Field Values

IS_META

public static final String IS_META
INTERNAL Used by rest interface to access this metadata attribute which denotes if it is a catalog table, either hbase:meta or -ROOT-

See Also:
isMetaRegion(), Constant Field Values

DEFERRED_LOG_FLUSH

@Deprecated
public static final String DEFERRED_LOG_FLUSH
Deprecated. Use DURABILITY instead.
INTERNAL Used by HBase Shell interface to access this metadata attribute which denotes if the deferred log flush option is enabled.

See Also:
Constant Field Values

DURABILITY

public static final String DURABILITY
INTERNAL Durability setting for the table.

See Also:
Constant Field Values

PRIORITY

public static final String PRIORITY
See Also:
Constant Field Values

DEFAULT_READONLY

public static final boolean DEFAULT_READONLY
Constant that denotes whether the table is READONLY by default and is false

See Also:
Constant Field Values

DEFAULT_COMPACTION_ENABLED

public static final boolean DEFAULT_COMPACTION_ENABLED
Constant that denotes whether the table is compaction enabled by default

See Also:
Constant Field Values

DEFAULT_MEMSTORE_FLUSH_SIZE

public static final long DEFAULT_MEMSTORE_FLUSH_SIZE
Constant that denotes the maximum default size of the memstore after which the contents are flushed to the store files

See Also:
Constant Field Values

META_TABLEDESC

@Deprecated
public static final HTableDescriptor META_TABLEDESC
Deprecated. Use TableDescriptors#get(TableName.META_TABLE_NAME) or HBaseAdmin#getTableDescriptor(TableName.META_TABLE_NAME) instead.
Table descriptor for hbase:meta catalog table


NAMESPACE_FAMILY_INFO

public static final String NAMESPACE_FAMILY_INFO
See Also:
Constant Field Values

NAMESPACE_FAMILY_INFO_BYTES

public static final byte[] NAMESPACE_FAMILY_INFO_BYTES

NAMESPACE_COL_DESC_BYTES

public static final byte[] NAMESPACE_COL_DESC_BYTES

NAMESPACE_TABLEDESC

public static final HTableDescriptor NAMESPACE_TABLEDESC
Table descriptor for namespace table

Constructor Detail

HTableDescriptor

protected HTableDescriptor(TableName name,
                           HColumnDescriptor[] families)
INTERNAL Private constructor used internally creating table descriptors for catalog tables, hbase:meta and -ROOT-.


HTableDescriptor

protected HTableDescriptor(TableName name,
                           HColumnDescriptor[] families,
                           Map<ImmutableBytesWritable,ImmutableBytesWritable> values)
INTERNAL Private constructor used internally creating table descriptors for catalog tables, hbase:meta and -ROOT-.


HTableDescriptor

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

Default constructor which constructs an empty object. For deserializing an HTableDescriptor instance only.


HTableDescriptor

public HTableDescriptor(TableName name)
Construct a table descriptor specifying a TableName object

Parameters:
name - Table name.
See Also:
HADOOP-1581 HBASE: Un-openable tablename bug

HTableDescriptor

@Deprecated
public HTableDescriptor(byte[] name)
Deprecated. 

Construct a table descriptor specifying a byte array table name

Parameters:
name - Table name.
See Also:
HADOOP-1581 HBASE: Un-openable tablename bug

HTableDescriptor

@Deprecated
public HTableDescriptor(String name)
Deprecated. 

Construct a table descriptor specifying a String table name

Parameters:
name - Table name.
See Also:
HADOOP-1581 HBASE: Un-openable tablename bug

HTableDescriptor

public HTableDescriptor(HTableDescriptor desc)
Construct a table descriptor by cloning the descriptor passed as a parameter.

Makes a deep copy of the supplied descriptor. Can make a modifiable descriptor from an UnmodifyableHTableDescriptor.

Parameters:
desc - The descriptor.
Method Detail

isRootRegion

public boolean isRootRegion()
Check if the descriptor represents a -ROOT- region.

Returns:
true if this is a -ROOT- region

setRootRegion

protected void setRootRegion(boolean isRoot)
INTERNAL Used to denote if the current table represents -ROOT- region. This is used internally by the HTableDescriptor constructors

Parameters:
isRoot - true if this is the -ROOT- region

isMetaRegion

public boolean isMetaRegion()
Checks if this table is hbase:meta region.

Returns:
true if this table is hbase:meta region

setMetaRegion

protected void setMetaRegion(boolean isMeta)
INTERNAL Used to denote if the current table represents -ROOT- or hbase:meta region. This is used internally by the HTableDescriptor constructors

Parameters:
isMeta - true if its either -ROOT- or hbase:meta region

isMetaTable

public boolean isMetaTable()
Checks if the table is a hbase:meta table

Returns:
true if table is hbase:meta region.

getValue

public byte[] getValue(byte[] key)
Getter for accessing the metadata associated with the key

Parameters:
key - The key.
Returns:
The value.
See Also:
values

getValue

public String getValue(String key)
Getter for accessing the metadata associated with the key

Parameters:
key - The key.
Returns:
The value.
See Also:
values

getValues

public Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues()
Getter for fetching an unmodifiable values map.

Returns:
unmodifiable map values.
See Also:
values

setValue

public void setValue(byte[] key,
                     byte[] value)
Setter for storing metadata as a (key, value) pair in values map

Parameters:
key - The key.
value - The value.
See Also:
values

setValue

public void setValue(ImmutableBytesWritable key,
                     ImmutableBytesWritable value)

setValue

public void setValue(String key,
                     String value)
Setter for storing metadata as a (key, value) pair in values map

Parameters:
key - The key.
value - The value.
See Also:
values

remove

public void remove(String key)
Remove metadata represented by the key from the values map

Parameters:
key - Key whose key and value we're to remove from HTableDescriptor parameters.

remove

public void remove(ImmutableBytesWritable key)
Remove metadata represented by the key from the values map

Parameters:
key - Key whose key and value we're to remove from HTableDescriptor parameters.

remove

public void remove(byte[] key)
Remove metadata represented by the key from the values map

Parameters:
key - Key whose key and value we're to remove from HTableDescriptor parameters.

isReadOnly

public boolean isReadOnly()
Check if the readOnly flag of the table is set. If the readOnly flag is set then the contents of the table can only be read from but not modified.

Returns:
true if all columns in the table should be read only

setReadOnly

public void setReadOnly(boolean readOnly)
Setting the table as read only sets all the columns in the table as read only. By default all tables are modifiable, but if the readOnly flag is set to true then the contents of the table can only be read but not modified.

Parameters:
readOnly - True if all of the columns in the table should be read only.

isCompactionEnabled

public boolean isCompactionEnabled()
Check if the compaction enable flag of the table is true. If flag is false then no minor/major compactions will be done in real.

Returns:
true if table compaction enabled

setCompactionEnabled

public void setCompactionEnabled(boolean isEnable)
Setting the table compaction enable flag.

Parameters:
isEnable - True if enable compaction.

isDeferredLogFlush

@Deprecated
public boolean isDeferredLogFlush()
Deprecated. 

Check if async log edits are enabled on the table.

Returns:
true if that async log flush is enabled on the table
See Also:
#setAsyncLogFlush(boolean)

setDeferredLogFlush

@Deprecated
public void setDeferredLogFlush(boolean isAsyncLogFlush)
Deprecated. 

This is used to allowing the log edits syncing to the file system. Everytime an edit is sent to the server it is first sync'd to the file system by the log writer. This sync is an expensive operation and thus can be deferred so that the edits are kept in memory until the background async writer-sync-notifier threads do the sync and not explicitly flushed for every edit.

NOTE:- This option might result in data loss if the region server crashes before these pending edits in memory are flushed onto the filesystem.

Parameters:
isAsyncLogFlush -

setDurability

public void setDurability(Durability durability)
Sets the Durability setting for the table. This defaults to Durability.USE_DEFAULT.

Parameters:
durability - enum value

getDurability

public Durability getDurability()
Returns the durability setting for the table.

Returns:
durability setting for the table.

getTableName

public TableName getTableName()
Get the name of the table

Returns:
TableName

getName

public byte[] getName()
Get the name of the table as a byte array.

Returns:
name of table

getNameAsString

public String getNameAsString()
Get the name of the table as a String

Returns:
name of table as a String

setRegionSplitPolicyClassName

public void setRegionSplitPolicyClassName(String clazz)
This sets the class associated with the region split policy which determines when a region split should occur. The class used by default is defined in regionserver.RegionSplitPolicy

Parameters:
clazz - the class name

getRegionSplitPolicyClassName

public String getRegionSplitPolicyClassName()
This gets the class associated with the region split policy which determines when a region split should occur. The class used by default is defined in regionserver.RegionSplitPolicy

Returns:
the class name of the region split policy for this table. If this returns null, the default split policy is used.

setName

@Deprecated
public void setName(byte[] name)
Deprecated. 

Set the name of the table.

Parameters:
name - name of table

setName

@Deprecated
public void setName(TableName name)
Deprecated. 


getMaxFileSize

public long getMaxFileSize()
Returns the maximum size upto which a region can grow to after which a region split is triggered. The region size is represented by the size of the biggest store file in that region.

Returns:
max hregion size for table, -1 if not set.
See Also:
setMaxFileSize(long)

setMaxFileSize

public void setMaxFileSize(long maxFileSize)
Sets the maximum size upto which a region can grow to after which a region split is triggered. The region size is represented by the size of the biggest store file in that region, i.e. If the biggest store file grows beyond the maxFileSize, then the region split is triggered. This defaults to a value of 256 MB.

This is not an absolute value and might vary. Assume that a single row exceeds the maxFileSize then the storeFileSize will be greater than maxFileSize since a single row cannot be split across multiple regions

Parameters:
maxFileSize - The maximum file size that a store file can grow to before a split is triggered.

getMemStoreFlushSize

public long getMemStoreFlushSize()
Returns the size of the memstore after which a flush to filesystem is triggered.

Returns:
memory cache flush size for each hregion, -1 if not set.
See Also:
setMemStoreFlushSize(long)

setMemStoreFlushSize

public void setMemStoreFlushSize(long memstoreFlushSize)
Represents the maximum size of the memstore after which the contents of the memstore are flushed to the filesystem. This defaults to a size of 64 MB.

Parameters:
memstoreFlushSize - memory cache flush size for each hregion

addFamily

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

Parameters:
family - HColumnDescriptor of family to add.

hasFamily

public boolean hasFamily(byte[] familyName)
Checks to see if this table contains the given column family

Parameters:
familyName - Family name or column name.
Returns:
true if the table contains the specified family name

toString

public String toString()
Overrides:
toString in class Object
Returns:
Name of this table and then a map of all of the column family descriptors.
See Also:
getNameAsString()

toStringCustomizedValues

public String toStringCustomizedValues()
Returns:
Name of this table and then a map of all of the column family descriptors (with only the non-default column family attributes)

toStringTableAttributes

public String toStringTableAttributes()
Returns:
map of all table attributes formatted into string.

equals

public boolean equals(Object obj)
Compare the contents of the descriptor with another one passed as a parameter. Checks if the obj passed is an instance of HTableDescriptor, if yes then the contents of the descriptors are compared.

Overrides:
equals in class Object
Returns:
true if the contents of the the two descriptors exactly match
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.

INTERNAL This method is a part of WritableComparable interface and is used for de-serialization of the HTableDescriptor over RPC

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 MessageLite.toByteArray() instead.

INTERNAL This method is a part of WritableComparable interface and is used for serialization of the HTableDescriptor over RPC

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

compareTo

public int compareTo(HTableDescriptor other)
Compares the descriptor with another descriptor which is passed as a parameter. This compares the content of the two descriptors and not the reference.

Specified by:
compareTo in interface Comparable<HTableDescriptor>
Returns:
0 if the contents of the descriptors are exactly matching, 1 if there is a mismatch in the contents

getFamilies

public Collection<HColumnDescriptor> getFamilies()
Returns an unmodifiable collection of all the HColumnDescriptor of all the column families of the table.

Returns:
Immutable collection of HColumnDescriptor of all the column families.

setPriority

public HTableDescriptor setPriority(int priority)

getPriority

public int getPriority()

getFamiliesKeys

public Set<byte[]> getFamiliesKeys()
Returns all the column family names of the current table. The map of HTableDescriptor contains mapping of family name to HColumnDescriptors. This returns all the keys of the family map which represents the column family names of the table.

Returns:
Immutable sorted set of the keys of the families.

getColumnFamilies

public HColumnDescriptor[] getColumnFamilies()
Returns an array all the HColumnDescriptor of the column families of the table.

Returns:
Array of all the HColumnDescriptors of the current table
See Also:
getFamilies()

getFamily

public HColumnDescriptor getFamily(byte[] column)
Returns the HColumnDescriptor for a specific column family with name as specified by the parameter column.

Parameters:
column - Column family name
Returns:
Column descriptor for the passed family name or the family on passed in column.

removeFamily

public HColumnDescriptor removeFamily(byte[] column)
Removes the HColumnDescriptor with name specified by the parameter column from the table descriptor

Parameters:
column - Name of the column family to be removed.
Returns:
Column descriptor for the passed family name or the family on passed in column.

addCoprocessor

public void addCoprocessor(String className)
                    throws IOException
Add a table coprocessor to this table. The coprocessor type must be coprocessor.RegionObserver or Endpoint. It won't check if the class can be loaded or not. Whether a coprocessor is loadable or not will be determined when a region is opened.

Parameters:
className - Full class name.
Throws:
IOException

addCoprocessor

public void addCoprocessor(String className,
                           org.apache.hadoop.fs.Path jarFilePath,
                           int priority,
                           Map<String,String> kvs)
                    throws IOException
Add a table coprocessor to this table. The coprocessor type must be coprocessor.RegionObserver or Endpoint. It won't check if the class can be loaded or not. Whether a coprocessor is loadable or not will be determined when a region is opened.

Parameters:
jarFilePath - Path of the jar file. If it's null, the class will be loaded from default classloader.
className - Full class name.
priority - Priority
kvs - Arbitrary key-value parameter pairs passed into the coprocessor.
Throws:
IOException

addCoprocessorWithSpec

public HTableDescriptor addCoprocessorWithSpec(String specStr)
                                        throws IOException
Add a table coprocessor to this table. The coprocessor type must be coprocessor.RegionObserver or Endpoint. It won't check if the class can be loaded or not. Whether a coprocessor is loadable or not will be determined when a region is opened.

Parameters:
specStr - The Coprocessor specification all in in one String formatted so matches HConstants.CP_HTD_ATTR_VALUE_PATTERN
Throws:
IOException

hasCoprocessor

public boolean hasCoprocessor(String classNameToMatch)
Check if the table has an attached co-processor represented by the name className

Parameters:
classNameToMatch - - Class name of the co-processor
Returns:
true of the table has a co-processor className

getCoprocessors

public List<String> getCoprocessors()
Return the list of attached co-processor represented by their name className

Returns:
The list of co-processors classNames

removeCoprocessor

public void removeCoprocessor(String className)
Remove a coprocessor from those set on the table

Parameters:
className - Class name of the co-processor

getTableDir

@Deprecated
public static org.apache.hadoop.fs.Path getTableDir(org.apache.hadoop.fs.Path rootdir,
                                                               byte[] tableName)
Deprecated. 

Returns the Path object representing the table directory under path rootdir Deprecated use FSUtils.getTableDir() instead.

Parameters:
rootdir - qualified path of HBase root directory
tableName - name of table
Returns:
Path for table

setOwner

@Deprecated
public void setOwner(User owner)
Deprecated. 


setOwnerString

@Deprecated
public void setOwnerString(String ownerString)
Deprecated. 


getOwnerString

@Deprecated
public String getOwnerString()
Deprecated. 


toByteArray

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

parseFrom

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

convert

public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema convert()
Returns:
Convert the current HTableDescriptor into a pb TableSchema instance.

convert

public static HTableDescriptor convert(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema ts)
Parameters:
ts - A pb TableSchema instance.
Returns:
An HTableDescriptor made from the passed in pb ts.

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 setting.

removeConfiguration

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


metaTableDescriptor

public static HTableDescriptor metaTableDescriptor(org.apache.hadoop.conf.Configuration conf)
                                            throws IOException
Throws:
IOException


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.