org.apache.hadoop.hbase.rest.serializer
Class JSONSerializer

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.serializer.AbstractRestSerializer
      extended by org.apache.hadoop.hbase.rest.serializer.JSONSerializer
All Implemented Interfaces:
IRestSerializer

public class JSONSerializer
extends AbstractRestSerializer

Serializes objects into JSON strings and prints them back out on the output stream. It should be noted that this JSON implementation uses annotations on the objects to be serialized. Since these annotations are used to describe the serialization of the objects the only method that is implemented is writeOutput(Object o). The other methods in the interface do not need to be implemented.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.rest.serializer.AbstractRestSerializer
prettyPrint, response
 
Constructor Summary
JSONSerializer(javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 void serializeCell(Cell cell)
          serialize a cell object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeCellArray(Cell[] cells)
          serialize a Cell array to the output stream
 void serializeColumnDescriptor(HColumnDescriptor column)
          serialize an HColumnDescriptor to the output stream.
 void serializeDatabaseMetadata(DatabaseModel.DatabaseMetadata databaseMetadata)
          serialize the database metadata Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeRegionData(TableModel.Regions regions)
          serialize the region data for a table to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeRowResult(RowResult rowResult)
          serialize a RowResult object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeRowResultArray(RowResult[] rows)
          serialize a RowResult array to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeScannerIdentifier(ScannerIdentifier scannerIdentifier)
          serialize the ScannerIdentifier object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeStatusMessage(Status.StatusMessage message)
          serialize the status message object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeTableDescriptor(HTableDescriptor tableDescriptor)
          serialize the HTableDescriptor object Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method
 void serializeTimestamps(TimestampsDescriptor timestampsDescriptor)
          serialize a description of the timestamps available for a row to the output stream.
 void writeOutput(Object o)
          Serializes an object into the appropriate format and writes it to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONSerializer

public JSONSerializer(javax.servlet.http.HttpServletResponse response)
Parameters:
response -
Method Detail

writeOutput

public void writeOutput(Object o)
                 throws HBaseRestException
Description copied from interface: IRestSerializer
Serializes an object into the appropriate format and writes it to the output stream. This is the main point of entry when for an object to be serialized to the output stream.

Throws:
HBaseRestException

serializeColumnDescriptor

public void serializeColumnDescriptor(HColumnDescriptor column)
                               throws HBaseRestException
Description copied from interface: IRestSerializer
serialize an HColumnDescriptor to the output stream. Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeDatabaseMetadata

public void serializeDatabaseMetadata(DatabaseModel.DatabaseMetadata databaseMetadata)
                               throws HBaseRestException
Description copied from interface: IRestSerializer
serialize the database metadata Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeRegionData

public void serializeRegionData(TableModel.Regions regions)
                         throws HBaseRestException
Description copied from interface: IRestSerializer
serialize the region data for a table to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeTableDescriptor

public void serializeTableDescriptor(HTableDescriptor tableDescriptor)
                              throws HBaseRestException
Description copied from interface: IRestSerializer
serialize the HTableDescriptor object Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeStatusMessage

public void serializeStatusMessage(Status.StatusMessage message)
                            throws HBaseRestException
Description copied from interface: IRestSerializer
serialize the status message object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeScannerIdentifier

public void serializeScannerIdentifier(ScannerIdentifier scannerIdentifier)
                                throws HBaseRestException
Description copied from interface: IRestSerializer
serialize the ScannerIdentifier object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeRowResult

public void serializeRowResult(RowResult rowResult)
                        throws HBaseRestException
Description copied from interface: IRestSerializer
serialize a RowResult object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeRowResultArray

public void serializeRowResultArray(RowResult[] rows)
                             throws HBaseRestException
Description copied from interface: IRestSerializer
serialize a RowResult array to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeCell

public void serializeCell(Cell cell)
                   throws HBaseRestException
Description copied from interface: IRestSerializer
serialize a cell object to the output stream Implementation of this method is optional, IF all the work is done in the writeOutput(Object o) method

Throws:
HBaseRestException

serializeCellArray

public void serializeCellArray(Cell[] cells)
                        throws HBaseRestException
Description copied from interface: IRestSerializer
serialize a Cell array to the output stream

Throws:
HBaseRestException

serializeTimestamps

public void serializeTimestamps(TimestampsDescriptor timestampsDescriptor)
                         throws HBaseRestException
Description copied from interface: IRestSerializer
serialize a description of the timestamps available for a row to the output stream.

Throws:
HBaseRestException


Copyright © 2009 The Apache Software Foundation