Package org.apache.hadoop.hbase.client
Interface TableDescriptor
- All Known Implementing Classes:
HTableDescriptor
,ImmutableHTableDescriptor
,TableDescriptorBuilder.ModifyableTableDescriptor
TableDescriptor contains the details about an HBase table such as the descriptors of all the
column families, is the table a catalog table,
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
Modifier and TypeFieldDescriptionstatic final Comparator<TableDescriptor>
static final Comparator<TableDescriptor>
-
Method Summary
Modifier and TypeMethodDescriptionReturns an unmodifiable collection of all theColumnFamilyDescriptor
of all the column families of the table.getColumnFamily
(byte[] name) Returns the ColumnDescriptor for a specific column family with name as specified by the parameter column.int
Returns the count of the column families of the table.Set<byte[]>
Returns all the column family names of the current table.static Comparator<TableDescriptor>
getComparator
(Comparator<ColumnFamilyDescriptor> cfComparator) Return the list of attached co-processor representeddefault Collection<String>
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Returns the durability setting for the table.default String
The HDFS erasure coding policy for a table.This gets the class associated with the flush policy which determines the stores need to be flushed when flushing a region.long
Returns the maximum size upto which a region can grow to after which a region split is triggered.long
Returns the size of the memstore after which a flush to filesystem is triggered.int
Check if there is the target region count.long
Check if there is the target region size.Deprecated.since 2.0.0 and will be removed in 3.0.0.int
int
Returns Returns the configured replicas per regionGet the region server group this table belongs to.This gets the class associated with the region split policy which determines when a region split should occur.Get the name of the tablebyte[]
getValue
(byte[] key) Getter for accessing the metadata associated with the key.Getter for accessing the metadata associated with the key.Getter for accessing the metadata associated with the key.Returns Getter for fetching an unmodifiable map.boolean
hasColumnFamily
(byte[] name) Checks to see if this table contains the given column familyboolean
hasCoprocessor
(String classNameToMatch) Check if the table has an attached co-processor represented by the name classNamedefault boolean
Check if any of the table's cfs' replication scope are set toHConstants.REPLICATION_SCOPE_GLOBAL
.boolean
Returns true if the read-replicas memstore replication is enabled.boolean
Check if the compaction enable flag of the table is true.boolean
Check if the merge enable flag of the table is true.boolean
Checks if this table ishbase:meta
region.boolean
Checks if the table is ahbase:meta
tableboolean
Check if normalization enable flag of the table is true.boolean
Check if the readOnly flag of the table is set.boolean
Check if the split enable flag of the table is true.default boolean
matchReplicationScope
(boolean enabled) Check if the table's cfs' replication scope matched with the replication stateReturns Name of this table and then a map of all of the column family descriptors (with only the non-default column family attributes)
-
Field Details
-
COMPARATOR
-
COMPARATOR_IGNORE_REPLICATION
-
-
Method Details
-
getComparator
-
getColumnFamilyCount
int getColumnFamilyCount()Returns the count of the column families of the table.- Returns:
- Count of column families of the table
-
getCoprocessorDescriptors
Return the list of attached co-processor represented- Returns:
- The list of CoprocessorDescriptor
-
getCoprocessors
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UsegetCoprocessorDescriptors()
insteadReturn the list of attached co-processor represented by their name className- Returns:
- The list of co-processors classNames
-
getDurability
Returns the durability setting for the table.- Returns:
- durability setting for the table.
-
getColumnFamilies
Returns an unmodifiable collection of all theColumnFamilyDescriptor
of all the column families of the table.- Returns:
- An array of
ColumnFamilyDescriptor
of all the column families.
-
getColumnFamilyNames
Set<byte[]> getColumnFamilyNames()Returns all the column family names of the current table. The map of TableDescriptor contains mapping of family name to ColumnDescriptor. 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.
-
getColumnFamily
Returns the ColumnDescriptor for a specific column family with name as specified by the parameter column.- Parameters:
name
- Column family name- Returns:
- Column descriptor for the passed family name or the family on passed in column.
-
getFlushPolicyClassName
This gets the class associated with the flush policy which determines the stores need to be flushed when flushing a region. The class used by default is defined in org.apache.hadoop.hbase.regionserver.FlushPolicy.- Returns:
- the class name of the flush policy for this table. If this returns null, the default flush policy is used.
-
getMaxFileSize
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.
-
getMemStoreFlushSize
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.
-
getPriority
int getPriority() -
getRegionReplication
int getRegionReplication()Returns Returns the configured replicas per region -
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 org.apache.hadoop.hbase.regionserver.RegionSplitPolicy- Returns:
- the class name of the region split policy for this table. If this returns null, the default split policy is used.
-
getTableName
Get the name of the table -
getOwnerString
Deprecated.since 2.0.0 and will be removed in 3.0.0.Get the owner name as a string.- See Also:
-
getValue
Getter for accessing the metadata associated with the key.- Parameters:
key
- The key.- Returns:
- A clone value. Null if no mapping for the key
-
getValue
Getter for accessing the metadata associated with the key.- Parameters:
key
- The key.- Returns:
- A clone value. Null if no mapping for the key
-
getValue
Getter for accessing the metadata associated with the key.- Parameters:
key
- The key.- Returns:
- Null if no mapping for the key
-
getValues
Returns Getter for fetching an unmodifiable map. -
hasCoprocessor
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
-
hasColumnFamily
Checks to see if this table contains the given column family- Parameters:
name
- Family name or column name.- Returns:
- true if the table contains the specified family name
-
hasRegionMemStoreReplication
boolean hasRegionMemStoreReplication()Returns true if the read-replicas memstore replication is enabled. -
isCompactionEnabled
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
-
isSplitEnabled
boolean isSplitEnabled()Check if the split enable flag of the table is true. If flag is false then no region split will be done.- Returns:
- true if table region split enabled
-
isMergeEnabled
boolean isMergeEnabled()Check if the merge enable flag of the table is true. If flag is false then no region merge will be done.- Returns:
- true if table region merge enabled
-
isMetaRegion
boolean isMetaRegion()Checks if this table ishbase:meta
region.- Returns:
- true if this table is
hbase:meta
region
-
isMetaTable
boolean isMetaTable()Checks if the table is ahbase:meta
table- Returns:
- true if table is
hbase:meta
region.
-
isNormalizationEnabled
boolean isNormalizationEnabled()Check if normalization enable flag of the table is true. If flag is false then region normalizer won't attempt to normalize this table.- Returns:
- true if region normalization is enabled for this table
-
getNormalizerTargetRegionCount
Check if there is the target region count. If so, the normalize plan will be calculated based on the target region count.- Returns:
- target region count after normalize done
-
getNormalizerTargetRegionSize
Check if there is the target region size. If so, the normalize plan will be calculated based on the target region size.- Returns:
- target region size after normalize done
-
isReadOnly
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
-
getErasureCodingPolicy
The HDFS erasure coding policy for a table. This will be set on the data dir of the table, and is an alternative to normal replication which takes less space at the cost of locality.- Returns:
- the current policy, or null if undefined
-
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) -
hasGlobalReplicationScope
Check if any of the table's cfs' replication scope are set toHConstants.REPLICATION_SCOPE_GLOBAL
.- Returns:
true
if we have, otherwisefalse
.
-
matchReplicationScope
Check if the table's cfs' replication scope matched with the replication state- Parameters:
enabled
- replication state- Returns:
- true if matched, otherwise false
-
getRegionServerGroup
Get the region server group this table belongs to. The regions of this table will be placed only on the region servers within this group. If not present, will be placed onRSGroupInfo.DEFAULT_GROUP
.
-