org.apache.hadoop.hbase.stargate.model
Class ScannerModel

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

public class ScannerModel
extends Object
implements ProtobufMessageHandler, Serializable

A representation of Scanner parameters.

 <complexType name="Scanner">
   <sequence>
     <element name="column" type="base64Binary" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="startRow" type="base64Binary"></attribute>
   <attribute name="endRow" type="base64Binary"></attribute>
   <attribute name="batch" type="int"></attribute>
   <attribute name="startTime" type="int"></attribute>
   <attribute name="endTime" type="int"></attribute>
 </complexType>
 

See Also:
Serialized Form

Constructor Summary
ScannerModel()
          Default constructor
ScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, long endTime)
          Constructor
ScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, long startTime, long endTime)
          Constructor
 
Method Summary
 void addColumn(byte[] column)
          Add a column to the column set
 byte[] createProtobufOutput()
           
 int getBatch()
           
 List<byte[]> getColumns()
           
 byte[] getEndRow()
           
 long getEndTime()
           
 ProtobufMessageHandler getObjectFromMessage(byte[] message)
          Initialize the model from a protobuf representation.
 byte[] getStartRow()
           
 long getStartTime()
           
 boolean hasEndRow()
           
 boolean hasStartRow()
           
 void setBatch(int batch)
           
 void setColumns(List<byte[]> columns)
           
 void setEndRow(byte[] endRow)
           
 void setEndTime(long endTime)
           
 void setStartRow(byte[] startRow)
           
 void setStartTime(long startTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScannerModel

public ScannerModel()
Default constructor


ScannerModel

public ScannerModel(byte[] startRow,
                    byte[] endRow,
                    List<byte[]> columns,
                    int batch,
                    long endTime)
Constructor

Parameters:
startRow - the start key of the row-range
endRow - the end key of the row-range
columns - the columns to scan
batch - the number of values to return in batch
endTime - the upper bound on timestamps of values of interest (values with timestamps later than this are excluded)

ScannerModel

public ScannerModel(byte[] startRow,
                    byte[] endRow,
                    List<byte[]> columns,
                    int batch,
                    long startTime,
                    long endTime)
Constructor

Parameters:
startRow - the start key of the row-range
endRow - the end key of the row-range
columns - the columns to scan
batch - the number of values to return in batch
startTime - the lower bound on timestamps of values of interest (values with timestamps earlier than this are excluded)
endTime - the upper bound on timestamps of values of interest (values with timestamps later than this are excluded)
Method Detail

addColumn

public void addColumn(byte[] column)
Add a column to the column set

Parameters:
column - the column name, as <column>(:<qualifier>)?

hasStartRow

public boolean hasStartRow()
Returns:
true if a start row was specified

getStartRow

public byte[] getStartRow()
Returns:
start row

hasEndRow

public boolean hasEndRow()
Returns:
true if an end row was specified

getEndRow

public byte[] getEndRow()
Returns:
end row

getColumns

public List<byte[]> getColumns()
Returns:
list of columns of interest in column:qualifier format, or empty for all

getBatch

public int getBatch()
Returns:
the number of cells to return in batch

getStartTime

public long getStartTime()
Returns:
the lower bound on timestamps of items of interest

getEndTime

public long getEndTime()
Returns:
the upper bound on timestamps of items of interest

setStartRow

public void setStartRow(byte[] startRow)
Parameters:
startRow - start row

setEndRow

public void setEndRow(byte[] endRow)
Parameters:
endRow - end row

setColumns

public void setColumns(List<byte[]> columns)
Parameters:
columns - list of columns of interest in column:qualifier format, or empty for all

setBatch

public void setBatch(int batch)
Parameters:
batch - the number of cells to return in batch

setStartTime

public void setStartTime(long startTime)
Parameters:
startTime - the lower bound on timestamps of values of interest

setEndTime

public void setEndTime(long endTime)
Parameters:
endTime - the upper bound on timestamps of values of interest

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 © 2009 The Apache Software Foundation