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
Modifier and TypeFieldDescriptionprivate List<ColumnSchemaModel>
private static final QName
private static final QName
private static final QName
private String
private static final QName
private static final long
private static final QName
private static final QName
Fields inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
BUFFER_SIZE
-
Constructor Summary
ConstructorDescriptionDefault constructor.TableSchemaModel
(TableDescriptor tableDescriptor) 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 descriptorgetAny()
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
(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) Returns a table descriptororg.apache.hbase.thirdparty.com.google.protobuf.Message
Convert to model to a protobuf Message objectvoid
setColumns
(List<ColumnSchemaModel> columns) void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
createProtobufOutput, getObjectFromMessage, getObjectFromMessage, writeProtobufOutput
-
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:
tableDescriptor
- 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
-
messageFromObject
Description copied from interface:ProtobufMessageHandler
Convert to model to a protobuf Message object- Specified by:
messageFromObject
in interfaceProtobufMessageHandler
- Returns:
- the protobuf Message object
-
getObjectFromMessage
public ProtobufMessageHandler getObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) throws IOException - Specified by:
getObjectFromMessage
in interfaceProtobufMessageHandler
- Throws:
IOException
-
getTableDescriptor
Returns a table descriptor
-