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
-
Constructor Summary
ConstructorDescriptionDefault constructor.Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if IS_META attribute exists and is truelboolean
Returns true if IS_ROOT attribute exists and is truelboolean
Returns true if READONLY attribute exists and is truelvoid
__setIsMeta
(boolean value) void
__setIsRoot
(boolean value) void
__setReadOnly
(boolean value) void
addAttribute
(String name, Object value) Add an attribute to the table descriptorvoid
addColumnFamily
(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 descriptorvoid
setColumns
(List<ColumnSchemaModel> columns) void
toString()
-
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:ProtobufMessageHandler
Returns the protobuf represention of the model- Specified by:
createProtobufOutput
in interfaceProtobufMessageHandler
-
getObjectFromMessage
Description copied from interface:ProtobufMessageHandler
Initialize the model from a protobuf representation.- Specified by:
getObjectFromMessage
in interfaceProtobufMessageHandler
- Parameters:
message
- the raw bytes of the protobuf message- Returns:
- reference to self for convenience
- Throws:
IOException
-
getTableDescriptor
Returns a table descriptor
-