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

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

public class CellSetModel
extends Object
implements Serializable, ProtobufMessageHandler

Representation of a grouping of cells. May contain cells from more than one row. Encapsulates RowModel and CellModel models.

 <complexType name="CellSet">
   <sequence>
     <element name="row" type="tns:Row" maxOccurs="unbounded" 
       minOccurs="1"></element>
   </sequence>
 </complexType>
 
 <complexType name="Row">
   <sequence>
     <element name="key" type="base64Binary"></element>
     <element name="cell" type="tns:Cell" 
       maxOccurs="unbounded" minOccurs="1"></element>
   </sequence>
 </complexType>

 <complexType name="Cell">
   <sequence>
     <element name="value" maxOccurs="1" minOccurs="1">
       <simpleType>
         <restriction base="base64Binary"/>
       </simpleType>
     </element>
   </sequence>
   <attribute name="column" type="base64Binary" />
   <attribute name="timestamp" type="int" />
 </complexType>
 

See Also:
Serialized Form

Constructor Summary
CellSetModel()
          Constructor
CellSetModel(List<RowModel> rows)
           
 
Method Summary
 void addRow(RowModel row)
          Add a row to this cell set
 byte[] createProtobufOutput()
           
 ProtobufMessageHandler getObjectFromMessage(byte[] message)
          Initialize the model from a protobuf representation.
 List<RowModel> getRows()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellSetModel

public CellSetModel()
Constructor


CellSetModel

public CellSetModel(List<RowModel> rows)
Parameters:
rows - the rows
Method Detail

addRow

public void addRow(RowModel row)
Add a row to this cell set

Parameters:
row - the row

getRows

public List<RowModel> getRows()
Returns:
the rows

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.