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
FieldsModifier and TypeFieldDescriptionprivate List<ColumnSchemaModel>private static final QNameprivate static final QNameprivate static final QNameprivate Stringprivate static final QNameprivate static final longprivate static final QNameprivate static final QNameFields inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.TableSchemaModel(TableDescriptor tableDescriptor) 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 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.MessageConvert to model to a protobuf Message objectvoidsetColumns(List<ColumnSchemaModel> columns) voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:ProtobufMessageHandlerConvert to model to a protobuf Message object- Specified by:
messageFromObjectin interfaceProtobufMessageHandler- Returns:
- the protobuf Message object
-
getObjectFromMessage
public ProtobufMessageHandler getObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) throws IOException - Specified by:
getObjectFromMessagein interfaceProtobufMessageHandler- Throws:
IOException
-
getTableDescriptor
Returns a table descriptor
-