@InterfaceAudience.Private public static class TableDescriptorBuilder.ModifyableTableDescriptor extends Object implements TableDescriptor, Comparable<TableDescriptorBuilder.ModifyableTableDescriptor>
| Modifier | Constructor and Description |
|---|---|
protected |
ModifyableTableDescriptor(TableDescriptor desc)
Construct a table descriptor by cloning the descriptor passed as a
parameter.
|
|
ModifyableTableDescriptor(TableName name,
Collection<HColumnDescriptor> families,
Map<Bytes,Bytes> values,
Map<String,String> configuration) |
| Modifier and Type | Method and Description |
|---|---|
TableDescriptorBuilder.ModifyableTableDescriptor |
addCoprocessor(String className)
Add a table coprocessor to this table.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
addCoprocessor(String className,
org.apache.hadoop.fs.Path jarFilePath,
int priority,
Map<String,String> kvs)
Add a table coprocessor to this table.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
addCoprocessorWithSpec(String specStr)
Add a table coprocessor to this table.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
addFamily(HColumnDescriptor family)
Adds a column family.
|
int |
compareTo(TableDescriptorBuilder.ModifyableTableDescriptor other)
Compares the descriptor with another descriptor which is passed as a
parameter.
|
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. |
int |
getColumnFamilyCount()
Returns the count 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.
|
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.
|
String |
getOwnerString()
Deprecated.
|
int |
getPriority() |
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.
|
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<Bytes,Bytes> |
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 |
hasRegionMemstoreReplication() |
boolean |
hasSerialReplicationScope()
Return true if there are at least one cf whose replication scope is
serial.
|
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.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
modifyFamily(HColumnDescriptor family)
Modifies the existing column family.
|
static TableDescriptor |
parseFrom(byte[] bytes) |
void |
remove(byte[] key)
Remove metadata represented by the key from the
values map |
void |
remove(Bytes 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
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setCompactionEnabled(boolean isEnable)
Setting the table compaction enable flag.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setConfiguration(String key,
String value)
Setter for storing a configuration setting in
configuration map. |
TableDescriptorBuilder.ModifyableTableDescriptor |
setDurability(Durability durability)
Sets the
Durability setting for the table. |
protected TableDescriptorBuilder.ModifyableTableDescriptor |
setFamily(HColumnDescriptor family) |
TableDescriptorBuilder.ModifyableTableDescriptor |
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.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setMaxFileSize(long maxFileSize)
Sets the maximum size upto which a region can grow to after which a
region split is triggered.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setMemStoreFlushSize(long memstoreFlushSize)
Represents the maximum size of the memstore after which the contents of
the memstore are flushed to the filesystem.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setNormalizationEnabled(boolean isEnable)
Setting the table normalization enable flag.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setOwner(User owner)
Deprecated.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setOwnerString(String ownerString)
Deprecated.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setPriority(int priority) |
TableDescriptorBuilder.ModifyableTableDescriptor |
setReadOnly(boolean readOnly)
Setting the table as read only sets all the columns in the table as read
only.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setRegionMemstoreReplication(boolean memstoreReplication)
Enable or Disable the memstore replication from the primary region to the
replicas.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setRegionReplication(int regionReplication)
Sets the number of replicas per region.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setRegionSplitPolicyClassName(String clazz)
This sets the class associated with the region split policy which
determines when a region split should occur.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setValue(byte[] key,
byte[] value)
Setter for storing metadata as a (key, value) pair in
values map |
TableDescriptorBuilder.ModifyableTableDescriptor |
setValue(Bytes key,
Bytes value) |
TableDescriptorBuilder.ModifyableTableDescriptor |
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() |
@InterfaceAudience.Private protected ModifyableTableDescriptor(TableDescriptor desc)
Makes a deep copy of the supplied descriptor. TODO: make this private after removing the HTableDescriptor
desc - The descriptor.@InterfaceAudience.Private public ModifyableTableDescriptor(TableName name, Collection<HColumnDescriptor> families, Map<Bytes,Bytes> values, Map<String,String> configuration)
public boolean isMetaRegion()
hbase:meta region.isMetaRegion in interface TableDescriptor hbase:meta regionpublic boolean isMetaTable()
hbase:meta tableisMetaTable in interface TableDescriptor hbase:meta region.public byte[] getValue(byte[] key)
getValue in interface TableDescriptorkey - The key.valuespublic String getValue(String key)
key - The key.valuespublic Map<Bytes,Bytes> getValues()
values map.getValues in interface TableDescriptorvalues.valuespublic TableDescriptorBuilder.ModifyableTableDescriptor setValue(byte[] key, byte[] value)
values mapkey - The key.value - The value. If null, removes the setting.valuespublic TableDescriptorBuilder.ModifyableTableDescriptor setValue(Bytes key, Bytes value)
public TableDescriptorBuilder.ModifyableTableDescriptor setValue(String key, String value)
values mapkey - The key.value - The value. If null, removes the setting.valuespublic void remove(String key)
values mapkey - Key whose key and value we're to remove from TableDescriptor
parameters.public void remove(Bytes key)
values mapkey - Key whose key and value we're to remove from TableDescriptor
parameters.public void remove(byte[] key)
values mapkey - Key whose key and value we're to remove from TableDescriptor
parameters.public boolean isReadOnly()
isReadOnly in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor setReadOnly(boolean readOnly)
readOnly - True if all of the columns in the table should be read
only.public boolean isCompactionEnabled()
isCompactionEnabled in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor setCompactionEnabled(boolean isEnable)
isEnable - True if enable compaction.public boolean isNormalizationEnabled()
isNormalizationEnabled in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor setNormalizationEnabled(boolean isEnable)
isEnable - True if enable normalization.public TableDescriptorBuilder.ModifyableTableDescriptor setDurability(Durability durability)
Durability setting for the table. This defaults to
Durability.USE_DEFAULT.durability - enum valuepublic Durability getDurability()
getDurability in interface TableDescriptorpublic TableName getTableName()
getTableName in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor setRegionSplitPolicyClassName(String clazz)
clazz - the class namepublic String getRegionSplitPolicyClassName()
getRegionSplitPolicyClassName in interface TableDescriptorpublic long getMaxFileSize()
getMaxFileSize in interface TableDescriptorsetMaxFileSize(long)public TableDescriptorBuilder.ModifyableTableDescriptor 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()
getMemStoreFlushSize in interface TableDescriptorsetMemStoreFlushSize(long)public TableDescriptorBuilder.ModifyableTableDescriptor setMemStoreFlushSize(long memstoreFlushSize)
memstoreFlushSize - memory cache flush size for each hregionpublic TableDescriptorBuilder.ModifyableTableDescriptor setFlushPolicyClassName(String clazz)
clazz - the class namepublic String getFlushPolicyClassName()
getFlushPolicyClassName in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor addFamily(HColumnDescriptor family)
modifyFamily(HColumnDescriptor) instead.family - HColumnDescriptor of family to add.public TableDescriptorBuilder.ModifyableTableDescriptor modifyFamily(HColumnDescriptor family)
family - HColumnDescriptor of family to updateprotected TableDescriptorBuilder.ModifyableTableDescriptor setFamily(HColumnDescriptor family)
public boolean hasFamily(byte[] familyName)
hasFamily in interface TableDescriptorfamilyName - Family name or column name.public String toString()
public String toStringCustomizedValues()
public String toStringTableAttributes()
public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public int compareTo(TableDescriptorBuilder.ModifyableTableDescriptor other)
compareTo in interface Comparable<TableDescriptorBuilder.ModifyableTableDescriptor>other - The MTD to comparepublic Collection<HColumnDescriptor> getFamilies()
HColumnDescriptor
of all the column families of the table.getFamilies in interface TableDescriptorHColumnDescriptor of all the
column families.public boolean hasSerialReplicationScope()
hasSerialReplicationScope in interface TableDescriptorpublic int getRegionReplication()
getRegionReplication in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor setRegionReplication(int regionReplication)
regionReplication - the replication factor per regionpublic boolean hasRegionMemstoreReplication()
hasRegionMemstoreReplication in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor 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 TableDescriptorBuilder.ModifyableTableDescriptor setPriority(int priority)
public int getPriority()
getPriority in interface TableDescriptorpublic Set<byte[]> getFamiliesKeys()
getFamiliesKeys in interface TableDescriptorpublic int getColumnFamilyCount()
getColumnFamilyCount in interface TableDescriptorpublic HColumnDescriptor[] getColumnFamilies()
HColumnDescriptor of the column families
of the table.getColumnFamilies in interface TableDescriptorgetFamilies()public HColumnDescriptor getFamily(byte[] column)
getFamily in interface TableDescriptorcolumn - Column family namepublic HColumnDescriptor removeFamily(byte[] column)
column - Name of the column family to be removed.public TableDescriptorBuilder.ModifyableTableDescriptor addCoprocessor(String className) throws IOException
className - Full class name.IOExceptionpublic TableDescriptorBuilder.ModifyableTableDescriptor addCoprocessor(String className, org.apache.hadoop.fs.Path jarFilePath, int priority, Map<String,String> kvs) throws IOException
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.IOExceptionpublic TableDescriptorBuilder.ModifyableTableDescriptor addCoprocessorWithSpec(String specStr) throws IOException
specStr - The Coprocessor specification all in in one String
formatted so matches HConstants.CP_HTD_ATTR_VALUE_PATTERNIOExceptionpublic boolean hasCoprocessor(String classNameToMatch)
hasCoprocessor in interface TableDescriptorclassNameToMatch - - Class name of the co-processorpublic List<String> getCoprocessors()
getCoprocessors in interface TableDescriptorpublic void removeCoprocessor(String className)
className - Class name of the co-processor@Deprecated public TableDescriptorBuilder.ModifyableTableDescriptor setOwner(User owner)
@Deprecated public TableDescriptorBuilder.ModifyableTableDescriptor setOwnerString(String ownerString)
@Deprecated public String getOwnerString()
getOwnerString in interface TableDescriptorpublic byte[] toByteArray()
public static TableDescriptor parseFrom(byte[] bytes) throws DeserializationException
bytes - A pb serialized TableDescriptorBuilder.ModifyableTableDescriptor instance
with pb magic prefixTableDescriptorBuilder.ModifyableTableDescriptor made from
bytesDeserializationExceptiontoByteArray()public String getConfigurationValue(String key)
getConfigurationValue in interface TableDescriptorkey - the key whose associated value is to be returnednull if
this map contains no mapping for the keypublic Map<String,String> getConfiguration()
configuration map.getConfiguration in interface TableDescriptorpublic TableDescriptorBuilder.ModifyableTableDescriptor 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 mapkey - Config key.Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.