@InterfaceAudience.Private public class TableSchemaModel extends Object implements Serializable, ProtobufMessageHandler
<complexType name="TableSchema">
<sequence>
<element name="column" type="tns:ColumnSchema"
maxOccurs="unbounded" minOccurs="1"></element>
</sequence>
<attribute name="name" type="string"></attribute>
<anyAttribute></anyAttribute>
</complexType>
| Modifier and Type | Field and Description |
|---|---|
private Map<QName,Object> |
attrs |
private List<ColumnSchemaModel> |
columns |
private static QName |
COMPRESSION |
private static QName |
IS_META |
private static QName |
IS_ROOT |
private String |
name |
private static QName |
READONLY |
private static long |
serialVersionUID |
private static QName |
TTL |
private static QName |
VERSIONS |
| Constructor and Description |
|---|
TableSchemaModel()
Default constructor.
|
TableSchemaModel(HTableDescriptor htd)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
__getIsMeta()
Returns true if IS_META attribute exists and is truel
|
boolean |
__getIsRoot()
Returns true if IS_ROOT attribute exists and is truel
|
boolean |
__getReadOnly()
Returns true if READONLY attribute exists and is truel
|
void |
__setIsMeta(boolean value) |
void |
__setIsRoot(boolean value) |
void |
__setReadOnly(boolean value) |
void |
addAttribute(String name,
Object value)
Add an attribute to the table descriptor
|
void |
addColumnFamily(ColumnSchemaModel family)
Add a column family to the table descriptor
|
byte[] |
createProtobufOutput()
Returns the protobuf represention of the model
|
Map<QName,Object> |
getAny()
Returns the map for holding unspecified (user) attributes
|
String |
getAttribute(String name)
Return a table descriptor value as a string.
|
ColumnSchemaModel |
getColumnFamily(int index)
Retrieve the column family at the given index from the table descriptor
|
List<ColumnSchemaModel> |
getColumns()
Returns the columns
|
String |
getName()
Returns the table name
|
ProtobufMessageHandler |
getObjectFromMessage(byte[] message)
Initialize the model from a protobuf representation.
|
HTableDescriptor |
getTableDescriptor()
Returns a table descriptor
|
void |
setColumns(List<ColumnSchemaModel> columns) |
void |
setName(String name) |
String |
toString() |
private static final long serialVersionUID
private static final QName COMPRESSION
private List<ColumnSchemaModel> columns
public TableSchemaModel()
public TableSchemaModel(HTableDescriptor htd)
htd - the table descriptorpublic void addAttribute(String name, Object value)
name - attribute namevalue - attribute valuepublic String getAttribute(String name)
name - the attribute namepublic void addColumnFamily(ColumnSchemaModel family)
family - the column family modelpublic ColumnSchemaModel getColumnFamily(int index)
index - the indexpublic List<ColumnSchemaModel> getColumns()
public void setColumns(List<ColumnSchemaModel> columns)
columns - the columns to setpublic boolean __getIsMeta()
public boolean __getIsRoot()
public boolean __getReadOnly()
public void __setIsMeta(boolean value)
value - desired value of IS_META attributepublic void __setIsRoot(boolean value)
value - desired value of IS_ROOT attributepublic void __setReadOnly(boolean value)
value - desired value of READONLY attributepublic byte[] createProtobufOutput()
ProtobufMessageHandlercreateProtobufOutput in interface ProtobufMessageHandlerpublic ProtobufMessageHandler getObjectFromMessage(byte[] message) throws IOException
ProtobufMessageHandlergetObjectFromMessage in interface ProtobufMessageHandlermessage - the raw bytes of the protobuf messageIOExceptionpublic HTableDescriptor getTableDescriptor()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.