org.apache.hadoop.hbase.rest.model
Class TableInfoModel

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.model.TableInfoModel
All Implemented Interfaces:
Serializable, ProtobufMessageHandler

public class TableInfoModel
extends Object
implements Serializable, ProtobufMessageHandler

Representation of a list of table regions.

 <complexType name="TableInfo">
   <sequence>
     <element name="region" type="tns:TableRegion" 
       maxOccurs="unbounded" minOccurs="1"></element>
   </sequence>
   <attribute name="name" type="string"></attribute>
 </complexType>
 

See Also:
Serialized Form

Constructor Summary
TableInfoModel()
          Default constructor
TableInfoModel(String name)
          Constructor
 
Method Summary
 void add(TableRegionModel region)
          Add a region model to the list
 byte[] createProtobufOutput()
           
 TableRegionModel get(int index)
           
 String getName()
           
 ProtobufMessageHandler getObjectFromMessage(byte[] message)
          Initialize the model from a protobuf representation.
 List<TableRegionModel> getRegions()
           
 void setName(String name)
           
 void setRegions(List<TableRegionModel> regions)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableInfoModel

public TableInfoModel()
Default constructor


TableInfoModel

public TableInfoModel(String name)
Constructor

Parameters:
name -
Method Detail

add

public void add(TableRegionModel region)
Add a region model to the list

Parameters:
region - the region

get

public TableRegionModel get(int index)
Parameters:
index - the index
Returns:
the region model

getName

public String getName()
Returns:
the table name

getRegions

public List<TableRegionModel> getRegions()
Returns:
the regions

setName

public void setName(String name)
Parameters:
name - the table name

setRegions

public void setRegions(List<TableRegionModel> regions)
Parameters:
regions - the regions to set

toString

public String toString()
Overrides:
toString in class Object

createProtobufOutput

public byte[] createProtobufOutput()
Specified by:
createProtobufOutput in interface ProtobufMessageHandler
Returns:
the protobuf represention of the model

getObjectFromMessage

public ProtobufMessageHandler getObjectFromMessage(byte[] message)
                                            throws IOException
Description copied from interface: ProtobufMessageHandler
Initialize the model from a protobuf representation.

Specified by:
getObjectFromMessage in interface ProtobufMessageHandler
Parameters:
message - the raw bytes of the protobuf message
Returns:
reference to self for convenience
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.