@InterfaceAudience.Private public static class TableDescriptorBuilder.ModifyableTableDescriptor extends Object implements TableDescriptor, Comparable<TableDescriptorBuilder.ModifyableTableDescriptor>
Modifier and Type | Field and Description |
---|---|
private Map<byte[],ColumnFamilyDescriptor> |
families
Maps column family name to the respective FamilyDescriptors
|
private TableName |
name |
private Map<Bytes,Bytes> |
values
A map which holds the metadata information of the table.
|
COMPARATOR, COMPARATOR_IGNORE_REPLICATION
Modifier | Constructor and Description |
---|---|
private |
ModifyableTableDescriptor(TableDescriptor desc) |
|
ModifyableTableDescriptor(TableName name)
Construct a table descriptor specifying a TableName object
|
private |
ModifyableTableDescriptor(TableName name,
Collection<ColumnFamilyDescriptor> families,
Map<Bytes,Bytes> values) |
|
ModifyableTableDescriptor(TableName name,
TableDescriptor desc)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
private void |
checkHasCoprocessor(String className) |
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.
|
ColumnFamilyDescriptor[] |
getColumnFamilies()
Returns an unmodifiable collection of all the
ColumnFamilyDescriptor of
all the column families of the table. |
ColumnFamilyDescriptor |
getColumnFamily(byte[] column)
Returns the ColumnFamilyDescriptor for a specific column family with name as
specified by the parameter column.
|
int |
getColumnFamilyCount()
Returns the count of the column families of the table.
|
Set<byte[]> |
getColumnFamilyNames()
Returns all the column family names of the current table.
|
List<CoprocessorDescriptor> |
getCoprocessorDescriptors()
Return the list of attached co-processor represented by their name
className
|
Durability |
getDurability()
Returns the durability setting for the table.
|
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.
|
private <T> T |
getOrDefault(Bytes key,
Function<String,T> function,
T defaultValue) |
String |
getOwnerString()
Deprecated.
since 2.0.0 and will be removed in 3.0.0.
|
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.
|
Bytes |
getValue(Bytes 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. |
private StringBuilder |
getValues(boolean printDefaults) |
boolean |
hasColumnFamily(byte[] familyName)
Checks to see if this table contains the given column family
|
boolean |
hasCoprocessor(String classNameToMatch)
Check if the table has an attached co-processor represented by the name
className
|
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.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
modifyColumnFamily(ColumnFamilyDescriptor family)
Modifies the existing column family.
|
private static TableDescriptor |
parseFrom(byte[] bytes) |
private TableDescriptorBuilder.ModifyableTableDescriptor |
putColumnFamily(ColumnFamilyDescriptor family) |
ColumnFamilyDescriptor |
removeColumnFamily(byte[] column)
Removes the ColumnFamilyDescriptor with name specified by the parameter column
from the table descriptor
|
void |
removeCoprocessor(String className)
Remove a coprocessor from those set on the table
|
TableDescriptorBuilder.ModifyableTableDescriptor |
removeValue(byte[] key)
Remove metadata represented by the key from the
values map |
TableDescriptorBuilder.ModifyableTableDescriptor |
removeValue(Bytes key)
Remove metadata represented by the key from the
values map |
TableDescriptorBuilder.ModifyableTableDescriptor |
setColumnFamily(ColumnFamilyDescriptor family)
Adds a column family.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setCompactionEnabled(boolean isEnable)
Setting the table compaction enable flag.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setCoprocessor(CoprocessorDescriptor cp)
Add a table coprocessor to this table.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setCoprocessor(String className)
Add a table coprocessor to this table.
|
private TableDescriptorBuilder.ModifyableTableDescriptor |
setCoprocessorToMap(String specStr)
Add coprocessor to values Map
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setCoprocessorWithSpec(String specStr)
Deprecated.
used by HTableDescriptor and admin.rb.
As of release 2.0.0, this will be removed in HBase 3.0.0.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setDurability(Durability durability)
Sets the
Durability setting for the table. |
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.
since 2.0.0 and will be removed in 3.0.0.
|
TableDescriptorBuilder.ModifyableTableDescriptor |
setOwnerString(String ownerString)
Deprecated.
since 2.0.0 and will be removed in 3.0.0.
|
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) |
private TableDescriptorBuilder.ModifyableTableDescriptor |
setValue(Bytes key,
String value) |
TableDescriptorBuilder.ModifyableTableDescriptor |
setValue(String key,
String value) |
private byte[] |
toByteArray() |
private static <T> Bytes |
toBytesOrNull(T t,
Function<T,byte[]> f) |
String |
toString() |
String |
toStringCustomizedValues() |
String |
toStringTableAttributes() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComparator, getCoprocessors, matchReplicationScope
private final Map<Bytes,Bytes> values
private final Map<byte[],ColumnFamilyDescriptor> families
@InterfaceAudience.Private public ModifyableTableDescriptor(TableName name)
name
- Table name.
TODO: make this private after removing the HTableDescriptorprivate ModifyableTableDescriptor(TableDescriptor desc)
@InterfaceAudience.Private @Deprecated public ModifyableTableDescriptor(TableName name, TableDescriptor desc)
Makes a deep copy of the supplied descriptor.
name
- The new namedesc
- The descriptor.
TODO: make this private after removing the HTableDescriptorprivate ModifyableTableDescriptor(TableName name, Collection<ColumnFamilyDescriptor> families, Map<Bytes,Bytes> values)
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 Bytes getValue(Bytes key)
TableDescriptor
getValue
in interface TableDescriptor
key
- The key.public String getValue(String key)
TableDescriptor
getValue
in interface TableDescriptor
key
- The key.public byte[] getValue(byte[] key)
TableDescriptor
getValue
in interface TableDescriptor
key
- The key.private <T> T getOrDefault(Bytes key, Function<String,T> function, T defaultValue)
public Map<Bytes,Bytes> getValues()
values
map.getValues
in interface TableDescriptor
values
.values
public TableDescriptorBuilder.ModifyableTableDescriptor setValue(byte[] key, byte[] value)
values
mapkey
- The key.value
- The value. If null, removes the setting.values
public TableDescriptorBuilder.ModifyableTableDescriptor setValue(String key, String value)
private TableDescriptorBuilder.ModifyableTableDescriptor setValue(Bytes key, String value)
public TableDescriptorBuilder.ModifyableTableDescriptor setValue(Bytes key, Bytes value)
private static <T> Bytes toBytesOrNull(T t, Function<T,byte[]> f)
public TableDescriptorBuilder.ModifyableTableDescriptor removeValue(Bytes key)
values
mapkey
- Key whose key and value we're to remove from TableDescriptor
parameters.public TableDescriptorBuilder.ModifyableTableDescriptor removeValue(byte[] key)
values
mapkey
- Key whose key and value we're to remove from TableDescriptor
parameters.public boolean isReadOnly()
isReadOnly
in interface TableDescriptor
public 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 TableDescriptor
public TableDescriptorBuilder.ModifyableTableDescriptor setCompactionEnabled(boolean isEnable)
isEnable
- True if enable compaction.public boolean isNormalizationEnabled()
isNormalizationEnabled
in interface TableDescriptor
public 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 TableDescriptor
public TableName getTableName()
getTableName
in interface TableDescriptor
public TableDescriptorBuilder.ModifyableTableDescriptor setRegionSplitPolicyClassName(String clazz)
clazz
- the class namepublic String getRegionSplitPolicyClassName()
getRegionSplitPolicyClassName
in interface TableDescriptor
public long getMaxFileSize()
getMaxFileSize
in interface TableDescriptor
setMaxFileSize(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 TableDescriptor
setMemStoreFlushSize(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 TableDescriptor
public TableDescriptorBuilder.ModifyableTableDescriptor setColumnFamily(ColumnFamilyDescriptor family)
modifyColumnFamily(ColumnFamilyDescriptor)
instead.family
- to add.public TableDescriptorBuilder.ModifyableTableDescriptor modifyColumnFamily(ColumnFamilyDescriptor family)
family
- to updateprivate TableDescriptorBuilder.ModifyableTableDescriptor putColumnFamily(ColumnFamilyDescriptor family)
public boolean hasColumnFamily(byte[] familyName)
hasColumnFamily
in interface TableDescriptor
familyName
- Family name or column name.public String toStringCustomizedValues()
public String toStringTableAttributes()
private StringBuilder getValues(boolean printDefaults)
public boolean equals(Object obj)
equals
in class Object
obj
- The object to compareObject.equals(java.lang.Object)
public int compareTo(TableDescriptorBuilder.ModifyableTableDescriptor other)
compareTo
in interface Comparable<TableDescriptorBuilder.ModifyableTableDescriptor>
other
- The MTD to comparepublic ColumnFamilyDescriptor[] getColumnFamilies()
TableDescriptor
ColumnFamilyDescriptor
of
all the column families of the table.getColumnFamilies
in interface TableDescriptor
ColumnFamilyDescriptor
of all the column
families.public int getRegionReplication()
getRegionReplication
in interface TableDescriptor
public TableDescriptorBuilder.ModifyableTableDescriptor setRegionReplication(int regionReplication)
regionReplication
- the replication factor per regionpublic boolean hasRegionMemStoreReplication()
hasRegionMemStoreReplication
in interface TableDescriptor
public 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 TableDescriptor
public Set<byte[]> getColumnFamilyNames()
getColumnFamilyNames
in interface TableDescriptor
public ColumnFamilyDescriptor getColumnFamily(byte[] column)
getColumnFamily
in interface TableDescriptor
column
- Column family namepublic ColumnFamilyDescriptor removeColumnFamily(byte[] column)
column
- Name of the column family to be removed.public TableDescriptorBuilder.ModifyableTableDescriptor setCoprocessor(String className) throws IOException
className
- Full class name.IOException
public TableDescriptorBuilder.ModifyableTableDescriptor setCoprocessor(CoprocessorDescriptor cp) throws IOException
IOException
- any illegal parameter key/value@Deprecated public TableDescriptorBuilder.ModifyableTableDescriptor setCoprocessorWithSpec(String specStr) throws IOException
specStr
- The Coprocessor specification all in in one StringIOException
private void checkHasCoprocessor(String className) throws IOException
IOException
private TableDescriptorBuilder.ModifyableTableDescriptor setCoprocessorToMap(String specStr)
specStr
- The Coprocessor specification all in in one Stringthis
public boolean hasCoprocessor(String classNameToMatch)
hasCoprocessor
in interface TableDescriptor
classNameToMatch
- - Class name of the co-processorpublic List<CoprocessorDescriptor> getCoprocessorDescriptors()
getCoprocessorDescriptors
in interface TableDescriptor
public 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 TableDescriptor
private byte[] toByteArray()
private static TableDescriptor parseFrom(byte[] bytes) throws DeserializationException
bytes
- A pb serialized TableDescriptorBuilder.ModifyableTableDescriptor
instance
with pb magic prefixTableDescriptorBuilder.ModifyableTableDescriptor
made from
bytes
DeserializationException
toByteArray()
public int getColumnFamilyCount()
TableDescriptor
getColumnFamilyCount
in interface TableDescriptor
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.