Class TableSchemaModel
java.lang.Object
org.apache.hadoop.hbase.rest.model.TableSchemaModel
- All Implemented Interfaces:
Serializable,ProtobufMessageHandler
@Private
public class TableSchemaModel
extends Object
implements Serializable, ProtobufMessageHandler
A representation of HBase table descriptors.
<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>
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if IS_META attribute exists and is truelbooleanReturns true if IS_ROOT attribute exists and is truelbooleanReturns true if READONLY attribute exists and is truelvoid__setIsMeta(boolean value) void__setIsRoot(boolean value) void__setReadOnly(boolean value) voidaddAttribute(String name, Object value) Add an attribute to the table descriptorvoidaddColumnFamily(ColumnSchemaModel family) Add a column family to the table descriptorbyte[]Returns the protobuf represention of the modelgetAny()Returns the map for holding unspecified (user) attributesgetAttribute(String name) Return a table descriptor value as a string.getColumnFamily(int index) Retrieve the column family at the given index from the table descriptorReturns the columnsgetName()Returns the table namegetObjectFromMessage(byte[] message) Initialize the model from a protobuf representation.Returns a table descriptorvoidsetColumns(List<ColumnSchemaModel> columns) voidtoString()
-
Field Details
-
serialVersionUID
- See Also:
-
IS_META
-
IS_ROOT
-
READONLY
-
TTL
-
VERSIONS
-
COMPRESSION
-
name
-
attrs
-
columns
-
-
Constructor Details
-
TableSchemaModel
public TableSchemaModel()Default constructor. -
TableSchemaModel
Constructor- Parameters:
htd- the table descriptor
-
-
Method Details
-
addAttribute
Add an attribute to the table descriptor- Parameters:
name- attribute namevalue- attribute value
-
getAttribute
Return a table descriptor value as a string. Calls toString() on the object stored in the descriptor value map.- Parameters:
name- the attribute name- Returns:
- the attribute value
-
addColumnFamily
Add a column family to the table descriptor- Parameters:
family- the column family model
-
getColumnFamily
Retrieve the column family at the given index from the table descriptor- Parameters:
index- the index- Returns:
- the column family model
-
getName
Returns the table name -
getAny
Returns the map for holding unspecified (user) attributes -
getColumns
Returns the columns -
setName
- Parameters:
name- the table name
-
setColumns
- Parameters:
columns- the columns to set
-
toString
-
__getIsMeta
Returns true if IS_META attribute exists and is truel -
__getIsRoot
Returns true if IS_ROOT attribute exists and is truel -
__getReadOnly
Returns true if READONLY attribute exists and is truel -
__setIsMeta
- Parameters:
value- desired value of IS_META attribute
-
__setIsRoot
- Parameters:
value- desired value of IS_ROOT attribute
-
__setReadOnly
- Parameters:
value- desired value of READONLY attribute
-
createProtobufOutput
Description copied from interface:ProtobufMessageHandlerReturns the protobuf represention of the model- Specified by:
createProtobufOutputin interfaceProtobufMessageHandler
-
getObjectFromMessage
Description copied from interface:ProtobufMessageHandlerInitialize the model from a protobuf representation.- Specified by:
getObjectFromMessagein interfaceProtobufMessageHandler- Parameters:
message- the raw bytes of the protobuf message- Returns:
- reference to self for convenience
- Throws:
IOException
-
getTableDescriptor
Returns a table descriptor
-