@InterfaceAudience.Public @InterfaceStability.Evolving public class HTableDescriptor extends Object implements org.apache.hadoop.io.WritableComparable<HTableDescriptor>
-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...Modifier and Type | Field and Description |
---|---|
static String |
COMPACTION_ENABLED
INTERNAL Used by HBase Shell interface to access this metadata
attribute which denotes if the table is compaction enabled
|
private static ImmutableBytesWritable |
COMPACTION_ENABLED_KEY |
private Map<String,String> |
configuration
A map which holds the configuration specific to the table.
|
static boolean |
DEFAULT_COMPACTION_ENABLED
Constant that denotes whether the table is compaction enabled by default
|
private static boolean |
DEFAULT_DEFERRED_LOG_FLUSH |
private static Durability |
DEFAULT_DURABLITY
Default durability for HTD is USE_DEFAULT, which defaults to HBase-global default value
|
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_NORMALIZATION_ENABLED
Constant that denotes whether the table is normalized by default.
|
static boolean |
DEFAULT_READONLY
Constant that denotes whether the table is READONLY by default and is false
|
static boolean |
DEFAULT_REGION_MEMSTORE_REPLICATION |
static int |
DEFAULT_REGION_REPLICATION |
private static Map<String,String> |
DEFAULT_VALUES |
static String |
DEFERRED_LOG_FLUSH
Deprecated.
Use
DURABILITY instead. |
private static ImmutableBytesWritable |
DEFERRED_LOG_FLUSH_KEY
Deprecated.
|
private Durability |
durability
Durability setting for the table
|
static String |
DURABILITY
INTERNAL
Durability setting for the table. |
private static ImmutableBytesWritable |
DURABILITY_KEY |
private static ImmutableBytesWritable |
FALSE |
private Map<byte[],HColumnDescriptor> |
families
Maps column family name to the respective HColumnDescriptors
|
static String |
FLUSH_POLICY |
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- |
private static ImmutableBytesWritable |
IS_META_KEY |
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
|
private static ImmutableBytesWritable |
IS_ROOT_KEY |
private static org.apache.commons.logging.Log |
LOG |
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
|
private static ImmutableBytesWritable |
MAX_FILESIZE_KEY |
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
|
private static ImmutableBytesWritable |
MEMSTORE_FLUSHSIZE_KEY |
private Boolean |
meta
Cache of whether this is a meta table or not.
|
static HTableDescriptor |
META_TABLEDESC
Deprecated.
Use TableDescriptors#get(TableName.META_TABLE_NAME) or
HBaseAdmin#getTableDescriptor(TableName.META_TABLE_NAME) instead.
|
private TableName |
name |
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 |
NORMALIZATION_ENABLED
INTERNAL Used by shell/rest interface to access this metadata
attribute which denotes if the table should be treated by region normalizer.
|
private static ImmutableBytesWritable |
NORMALIZATION_ENABLED_KEY |
static String |
OWNER |
static ImmutableBytesWritable |
OWNER_KEY |
static String |
READONLY
INTERNAL Used by rest interface to access this metadata
attribute which denotes if the table is Read Only
|
private static ImmutableBytesWritable |
READONLY_KEY |
static String |
REGION_MEMSTORE_REPLICATION
INTERNAL flag to indicate whether or not the memstore should be replicated
for read-replicas (CONSISTENCY => TIMELINE).
|
private static ImmutableBytesWritable |
REGION_MEMSTORE_REPLICATION_KEY |
static String |
REGION_REPLICATION
INTERNAL number of region replicas for the table.
|
private static ImmutableBytesWritable |
REGION_REPLICATION_KEY |
private static Set<ImmutableBytesWritable> |
RESERVED_KEYWORDS |
private Boolean |
root
Cache of whether this is root table or not.
|
static String |
SPLIT_POLICY |
private static byte |
TABLE_DESCRIPTOR_VERSION
Changes prior to version 3 were not recorded here.
|
private static ImmutableBytesWritable |
TRUE |
private Map<ImmutableBytesWritable,ImmutableBytesWritable> |
values
A map which holds the metadata information of the table.
|
Modifier | Constructor and Description |
---|---|
|
HTableDescriptor()
Deprecated.
As of release 0.96
(HBASE-5453).
This will be removed in HBase 2.0.0.
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- . |
|
HTableDescriptor(TableName name,
HTableDescriptor desc)
Construct a table descriptor by cloning the descriptor passed as a parameter
but using a different table name.
|
Modifier and Type | Method and Description |
---|---|
HTableDescriptor |
addCoprocessor(String className)
Add a table coprocessor to this table.
|
HTableDescriptor |
addCoprocessor(String className,
org.apache.hadoop.fs.Path jarFilePath,
int priority,
Map<String,String> kvs)
Add a table coprocessor to this table.
|
private HTableDescriptor |
addCoprocessorToMap(String specStr)
Add coprocessor to values Map
|
HTableDescriptor |
addCoprocessorWithSpec(String specStr)
Add a table coprocessor to this table.
|
HTableDescriptor |
addFamily(HColumnDescriptor family)
Adds a column family.
|
private Boolean |
calculateIsMetaRegion() |
private void |
checkHasCoprocessor(String className) |
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
|
private static String |
getCoprocessorClassNameFromSpecStr(String spec) |
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.
|
String |
getFlushPolicyClassName()
This gets the class associated with the flush policy which determines the stores need to be
flushed when flushing a region.
|
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()
Deprecated.
Use
getTableName() instead |
String |
getNameAsString()
Get the name of the table as a String
|
String |
getOwnerString()
Deprecated.
|
int |
getRegionReplication()
Returns the configured replicas per region
|
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
|
private byte[] |
getValue(ImmutableBytesWritable 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. |
private StringBuilder |
getValues(boolean printDefaults) |
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 |
hasRegionMemstoreReplication() |
boolean |
isCompactionEnabled()
Check if the compaction enable flag of the table is true.
|
boolean |
isMetaRegion()
Checks if this table is
hbase:meta
region. |
boolean |
isMetaTable()
Checks if the table is a
hbase:meta table |
boolean |
isNormalizationEnabled()
Check if normalization enable flag of the table is true.
|
boolean |
isReadOnly()
Check if the readOnly flag of the table is set.
|
boolean |
isRootRegion()
Check if the descriptor represents a
-ROOT- region. |
private boolean |
isSomething(ImmutableBytesWritable key,
boolean valueIfNull) |
static HTableDescriptor |
metaTableDescriptor(org.apache.hadoop.conf.Configuration conf) |
HTableDescriptor |
modifyFamily(HColumnDescriptor family)
Modifies the existing column family.
|
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
|
HTableDescriptor |
setCompactionEnabled(boolean isEnable)
Setting the table compaction enable flag.
|
HTableDescriptor |
setConfiguration(String key,
String value)
Setter for storing a configuration setting in
configuration map. |
HTableDescriptor |
setDurability(Durability durability)
Sets the
Durability setting for the table. |
HTableDescriptor |
setFlushPolicyClassName(String clazz)
This sets the class associated with the flush policy which determines determines the stores
need to be flushed when flushing a region.
|
HTableDescriptor |
setMaxFileSize(long maxFileSize)
Sets the maximum size upto which a region can grow to after which a region
split is triggered.
|
HTableDescriptor |
setMemStoreFlushSize(long memstoreFlushSize)
Represents the maximum size of the memstore after which the contents of the
memstore are flushed to the filesystem.
|
private void |
setMetaFlags(TableName name) |
protected void |
setMetaRegion(boolean isMeta)
INTERNAL Used to denote if the current table represents
-ROOT- or hbase:meta region. |
HTableDescriptor |
setName(byte[] name)
Deprecated.
|
HTableDescriptor |
setName(TableName name)
Deprecated.
|
HTableDescriptor |
setNormalizationEnabled(boolean isEnable)
Setting the table normalization enable flag.
|
HTableDescriptor |
setOwner(User owner)
Deprecated.
|
HTableDescriptor |
setOwnerString(String ownerString)
Deprecated.
|
HTableDescriptor |
setReadOnly(boolean readOnly)
Setting the table as read only sets all the columns in the table as read
only.
|
HTableDescriptor |
setRegionMemstoreReplication(boolean memstoreReplication)
Enable or Disable the memstore replication from the primary region to the replicas.
|
HTableDescriptor |
setRegionReplication(int regionReplication)
Sets the number of replicas per region.
|
HTableDescriptor |
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. |
HTableDescriptor |
setValue(byte[] key,
byte[] value)
Setter for storing metadata as a (key, value) pair in
values map |
HTableDescriptor |
setValue(ImmutableBytesWritable key,
ImmutableBytesWritable value) |
private HTableDescriptor |
setValue(ImmutableBytesWritable key,
String value) |
HTableDescriptor |
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. |
private static final org.apache.commons.logging.Log LOG
private static final byte TABLE_DESCRIPTOR_VERSION
private TableName name
private final Map<ImmutableBytesWritable,ImmutableBytesWritable> values
private final Map<String,String> configuration
public static final String SPLIT_POLICY
public static final String MAX_FILESIZE
getMaxFileSize()
,
Constant Field Valuesprivate static final ImmutableBytesWritable MAX_FILESIZE_KEY
public static final String OWNER
public static final ImmutableBytesWritable OWNER_KEY
public static final String READONLY
isReadOnly()
,
Constant Field Valuesprivate static final ImmutableBytesWritable READONLY_KEY
public static final String COMPACTION_ENABLED
isCompactionEnabled()
,
Constant Field Valuesprivate static final ImmutableBytesWritable COMPACTION_ENABLED_KEY
public static final String MEMSTORE_FLUSHSIZE
getMemStoreFlushSize()
,
Constant Field Valuesprivate static final ImmutableBytesWritable MEMSTORE_FLUSHSIZE_KEY
public static final String FLUSH_POLICY
public static final String IS_ROOT
isRootRegion()
,
Constant Field Valuesprivate static final ImmutableBytesWritable IS_ROOT_KEY
public static final String IS_META
hbase:meta
or -ROOT-
isMetaRegion()
,
Constant Field Valuesprivate static final ImmutableBytesWritable IS_META_KEY
@Deprecated public static final String DEFERRED_LOG_FLUSH
DURABILITY
instead.@Deprecated private static final ImmutableBytesWritable DEFERRED_LOG_FLUSH_KEY
public static final String DURABILITY
Durability
setting for the table.private static final ImmutableBytesWritable DURABILITY_KEY
public static final String REGION_REPLICATION
private static final ImmutableBytesWritable REGION_REPLICATION_KEY
public static final String REGION_MEMSTORE_REPLICATION
private static final ImmutableBytesWritable REGION_MEMSTORE_REPLICATION_KEY
public static final String NORMALIZATION_ENABLED
private static final ImmutableBytesWritable NORMALIZATION_ENABLED_KEY
private static final Durability DEFAULT_DURABLITY
private static final ImmutableBytesWritable FALSE
private static final ImmutableBytesWritable TRUE
private static final boolean DEFAULT_DEFERRED_LOG_FLUSH
public static final boolean DEFAULT_READONLY
public static final boolean DEFAULT_COMPACTION_ENABLED
public static final boolean DEFAULT_NORMALIZATION_ENABLED
public static final long DEFAULT_MEMSTORE_FLUSH_SIZE
public static final int DEFAULT_REGION_REPLICATION
public static final boolean DEFAULT_REGION_MEMSTORE_REPLICATION
private static final Set<ImmutableBytesWritable> RESERVED_KEYWORDS
private volatile Boolean meta
private volatile Boolean root
private Durability durability
private final Map<byte[],HColumnDescriptor> families
@Deprecated public static final HTableDescriptor META_TABLEDESC
hbase:meta
catalog tablepublic static final String NAMESPACE_FAMILY_INFO
public static final byte[] NAMESPACE_FAMILY_INFO_BYTES
public static final byte[] NAMESPACE_COL_DESC_BYTES
public static final HTableDescriptor NAMESPACE_TABLEDESC
@InterfaceAudience.Private protected HTableDescriptor(TableName name, HColumnDescriptor[] families)
hbase:meta
and -ROOT-
.protected HTableDescriptor(TableName name, HColumnDescriptor[] families, Map<ImmutableBytesWritable,ImmutableBytesWritable> values)
hbase:meta
and -ROOT-
.@Deprecated public HTableDescriptor()
public HTableDescriptor(TableName name)
name
- Table name.@Deprecated public HTableDescriptor(byte[] name)
name
- Table name.@Deprecated public HTableDescriptor(String name)
name
- Table name.public HTableDescriptor(HTableDescriptor desc)
Makes a deep copy of the supplied descriptor. Can make a modifiable descriptor from an UnmodifyableHTableDescriptor.
desc
- The descriptor.public HTableDescriptor(TableName name, HTableDescriptor desc)
Makes a deep copy of the supplied descriptor. Can make a modifiable descriptor from an UnmodifyableHTableDescriptor.
name
- Table name.desc
- The descriptor.private void setMetaFlags(TableName name)
public boolean isRootRegion()
-ROOT-
region. -ROOT-
regionprotected void setRootRegion(boolean isRoot)
-ROOT-
region. This is used internally by the
HTableDescriptor constructorsisRoot
- true if this is the -ROOT-
regionpublic boolean isMetaRegion()
hbase:meta
region. hbase:meta
regionprivate Boolean calculateIsMetaRegion()
private boolean isSomething(ImmutableBytesWritable key, boolean valueIfNull)
protected void setMetaRegion(boolean isMeta)
-ROOT-
or hbase:meta
region. This is used
internally by the HTableDescriptor constructorsisMeta
- true if its either -ROOT-
or
hbase:meta
regionpublic boolean isMetaTable()
hbase:meta
table hbase:meta
region.public byte[] getValue(byte[] key)
key
- The key.values
private byte[] getValue(ImmutableBytesWritable key)
public String getValue(String key)
key
- The key.values
public Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues()
values
map.public HTableDescriptor setValue(byte[] key, byte[] value)
values
mapkey
- The key.value
- The value.values
private HTableDescriptor setValue(ImmutableBytesWritable key, String value)
public HTableDescriptor setValue(ImmutableBytesWritable key, ImmutableBytesWritable value)
public HTableDescriptor setValue(String key, String value)
values
mapkey
- The key.value
- The value.values
public void remove(String key)
values
mapkey
- Key whose key and value we're to remove from HTableDescriptor
parameters.public void remove(ImmutableBytesWritable key)
values
mapkey
- Key whose key and value we're to remove from HTableDescriptor
parameters.public void remove(byte[] key)
values
mapkey
- Key whose key and value we're to remove from HTableDescriptor
parameters.public boolean isReadOnly()
public HTableDescriptor setReadOnly(boolean readOnly)
readOnly
- True if all of the columns in the table should be read
only.public boolean isCompactionEnabled()
public HTableDescriptor setCompactionEnabled(boolean isEnable)
isEnable
- True if enable compaction.public boolean isNormalizationEnabled()
public HTableDescriptor setNormalizationEnabled(boolean isEnable)
isEnable
- True if enable normalization.public HTableDescriptor setDurability(Durability durability)
Durability
setting for the table. This defaults to Durability.USE_DEFAULT.durability
- enum valuepublic Durability getDurability()
public TableName getTableName()
@Deprecated public byte[] getName()
getTableName()
insteadpublic String getNameAsString()
public HTableDescriptor setRegionSplitPolicyClassName(String clazz)
RegionSplitPolicy
clazz
- the class namepublic String getRegionSplitPolicyClassName()
RegionSplitPolicy
@Deprecated public HTableDescriptor setName(byte[] name)
name
- name of table@Deprecated public HTableDescriptor setName(TableName name)
public long getMaxFileSize()
setMaxFileSize(long)
public HTableDescriptor setMaxFileSize(long maxFileSize)
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
maxFileSize
- The maximum file size that a store file can grow to
before a split is triggered.public long getMemStoreFlushSize()
setMemStoreFlushSize(long)
public HTableDescriptor setMemStoreFlushSize(long memstoreFlushSize)
memstoreFlushSize
- memory cache flush size for each hregionpublic HTableDescriptor setFlushPolicyClassName(String clazz)
FlushPolicy
clazz
- the class namepublic String getFlushPolicyClassName()
FlushPolicy
public HTableDescriptor addFamily(HColumnDescriptor family)
modifyFamily(HColumnDescriptor)
instead.family
- HColumnDescriptor of family to add.public HTableDescriptor modifyFamily(HColumnDescriptor family)
family
- HColumnDescriptor of family to updatepublic boolean hasFamily(byte[] familyName)
familyName
- Family name or column name.public String toString()
toString
in class Object
getNameAsString()
public String toStringCustomizedValues()
public String toStringTableAttributes()
private StringBuilder getValues(boolean printDefaults)
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
@Deprecated public void readFields(DataInput in) throws IOException
parseFrom(byte[])
instead.WritableComparable
interface
and is used for de-serialization of the HTableDescriptor over RPCreadFields
in interface org.apache.hadoop.io.Writable
IOException
@Deprecated public void write(DataOutput out) throws IOException
MessageLite.toByteArray()
instead.WritableComparable
interface
and is used for serialization of the HTableDescriptor over RPCwrite
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(HTableDescriptor other)
compareTo
in interface Comparable<HTableDescriptor>
public Collection<HColumnDescriptor> getFamilies()
HColumnDescriptor
of all the column families of the table.HColumnDescriptor
of all the
column families.public int getRegionReplication()
public HTableDescriptor setRegionReplication(int regionReplication)
regionReplication
- the replication factor per regionpublic boolean hasRegionMemstoreReplication()
public HTableDescriptor setRegionMemstoreReplication(boolean memstoreReplication)
memstoreReplication
- true if the new data written to the primary region
should be replicated.
false if the secondaries can tollerate to have new
data only when the primary flushes the memstore.public Set<byte[]> getFamiliesKeys()
public HColumnDescriptor[] getColumnFamilies()
HColumnDescriptor
of the column families
of the table.getFamilies()
public HColumnDescriptor getFamily(byte[] column)
column
- Column family namepublic HColumnDescriptor removeFamily(byte[] column)
column
- Name of the column family to be removed.public HTableDescriptor addCoprocessor(String className) throws IOException
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.className
- Full class name.IOException
public HTableDescriptor addCoprocessor(String className, org.apache.hadoop.fs.Path jarFilePath, int priority, Map<String,String> kvs) throws IOException
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.jarFilePath
- Path of the jar file. If it's null, the class will be
loaded from default classloader.className
- Full class name.priority
- Prioritykvs
- Arbitrary key-value parameter pairs passed into the coprocessor.IOException
public HTableDescriptor addCoprocessorWithSpec(String specStr) throws IOException
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.specStr
- The Coprocessor specification all in in one String formatted so matches
HConstants.CP_HTD_ATTR_VALUE_PATTERN
IOException
private void checkHasCoprocessor(String className) throws IOException
IOException
private HTableDescriptor addCoprocessorToMap(String specStr)
specStr
- The Coprocessor specification all in in one String formatted so matches
HConstants.CP_HTD_ATTR_VALUE_PATTERN
this
public boolean hasCoprocessor(String classNameToMatch)
classNameToMatch
- - Class name of the co-processorpublic List<String> getCoprocessors()
private static String getCoprocessorClassNameFromSpecStr(String spec)
spec
- String formatted as per HConstants.CP_HTD_ATTR_VALUE_PATTERN
spec
or null if no match or classpath foundpublic void removeCoprocessor(String className)
className
- Class name of the co-processor@Deprecated public static org.apache.hadoop.fs.Path getTableDir(org.apache.hadoop.fs.Path rootdir, byte[] tableName)
Path
object representing the table directory under
path rootdir
Deprecated use FSUtils.getTableDir() instead.rootdir
- qualified path of HBase root directorytableName
- name of tablePath
for table@Deprecated public HTableDescriptor setOwner(User owner)
@Deprecated public HTableDescriptor setOwnerString(String ownerString)
@Deprecated public String getOwnerString()
public byte[] toByteArray()
parseFrom(byte[])
public static HTableDescriptor parseFrom(byte[] bytes) throws DeserializationException, IOException
bytes
- A pb serialized HTableDescriptor
instance with pb magic prefixHTableDescriptor
made from bytes
DeserializationException
IOException
toByteArray()
public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema convert()
HTableDescriptor
into a pb TableSchema instance.public static HTableDescriptor convert(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema ts)
ts
- A pb TableSchema instance.HTableDescriptor
made from the passed in pb ts
.public String getConfigurationValue(String key)
public Map<String,String> getConfiguration()
configuration
map.public HTableDescriptor setConfiguration(String key, String value)
configuration
map.key
- Config key. Same as XML config key e.g. hbase.something.or.other.value
- String value. If null, removes the setting.public void removeConfiguration(String key)
configuration
mappublic static HTableDescriptor metaTableDescriptor(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.