Class ScannerModel
java.lang.Object
org.apache.hadoop.hbase.rest.model.ScannerModel
- All Implemented Interfaces:
Serializable,ProtobufMessageHandler
A representation of Scanner parameters.
<complexType name="Scanner">
<sequence>
<element name="column" type="base64Binary" minOccurs="0" maxOccurs="unbounded"/>
<element name="filter" type="string" minOccurs="0" maxOccurs="1"></element>
</sequence>
<attribute name="startRow" type="base64Binary"></attribute>
<attribute name="endRow" type="base64Binary"></attribute>
<attribute name="batch" type="int"></attribute>
<attribute name="caching" type="int"></attribute>
<attribute name="startTime" type="int"></attribute>
<attribute name="endTime" type="int"></attribute>
<attribute name="maxVersions" type="int"></attribute>
</complexType>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classprivate static classImplement lazily-instantiated singleton as per recipe here: http://literatejava.com/jvm/fastest-threadsafe-singleton-jvm/ -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, int caching, long endTime, int maxVersions, String filter) ConstructorScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, int caching, long startTime, long endTime, String filter) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(byte[] column) Add a column to the column setvoidAdd a visibility label to the scanstatic Filterbyte[]Returns the protobuf represention of the modelstatic ScannerModelintgetBatch()Returns the number of cells to return in batchbooleanReturns true if HFile blocks should be cached on the servers for this scan, false otherwiseintReturns the number of rows that the scanner to fetch at onceList<byte[]>Returns list of columns of interest in column:qualifier format, or empty for allbyte[]Returns end rowlongReturns the upper bound on timestamps of items of interestReturns the filter specificationprivate static org.apache.hbase.thirdparty.com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProviderGet theJacksonJaxbJsonProviderinstance;intReturns maximum number of versions to returngetObjectFromMessage(byte[] message) Initialize the model from a protobuf representation.byte[]Returns start rowlongReturns the lower bound on timestamps of items of interestbooleanReturns true if an end row was specifiedbooleanReturns true if a start row was specifiedvoidsetBatch(int batch) voidsetCacheBlocks(boolean value) voidsetCaching(int caching) voidsetColumns(List<byte[]> columns) voidsetEndRow(byte[] endRow) voidsetEndTime(long endTime) voidvoidsetMaxVersions(int maxVersions) voidsetStartRow(byte[] startRow) voidsetStartTime(long startTime) static StringstringifyFilter(Filter filter)
-
Field Details
-
serialVersionUID
- See Also:
-
startRow
-
endRow
-
columns
-
batch
-
startTime
-
endTime
-
filter
-
maxVersions
-
caching
-
labels
-
cacheBlocks
-
COLUMN_DIVIDER
-
-
Constructor Details
-
ScannerModel
public ScannerModel()Default constructor -
ScannerModel
public ScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, int caching, long endTime, int maxVersions, String filter) Constructor- Parameters:
startRow- the start key of the row-rangeendRow- the end key of the row-rangecolumns- the columns to scanbatch- the number of values to return in batchcaching- the number of rows that the scanner will fetch at onceendTime- the upper bound on timestamps of values of interestmaxVersions- the maximum number of versions to returnfilter- a filter specification (values with timestamps later than this are excluded)
-
ScannerModel
public ScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, int caching, long startTime, long endTime, String filter) Constructor- Parameters:
startRow- the start key of the row-rangeendRow- the end key of the row-rangecolumns- the columns to scanbatch- the number of values to return in batchcaching- the number of rows that the scanner will fetch at oncestartTime- 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)filter- a filter specification
-
-
Method Details
-
getJasonProvider
private static org.apache.hbase.thirdparty.com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider getJasonProvider()Get theJacksonJaxbJsonProviderinstance;- Returns:
- A
JacksonJaxbJsonProvider.
-
buildFilter
- Parameters:
s- the JSON representation of the filter- Returns:
- the filter
- Throws:
Exception
-
stringifyFilter
- Parameters:
filter- the filter- Returns:
- the JSON representation of the filter
- Throws:
Exception
-
fromScan
- Parameters:
scan- the scan specification- Throws:
Exception
-
addColumn
Add a column to the column set- Parameters:
column- the column name, as <column>(:<qualifier>)?
-
addLabel
Add a visibility label to the scan -
hasStartRow
Returns true if a start row was specified -
getStartRow
Returns start row -
hasEndRow
Returns true if an end row was specified -
getEndRow
Returns end row -
getColumns
Returns list of columns of interest in column:qualifier format, or empty for all -
getLabels
-
getBatch
Returns the number of cells to return in batch -
getCaching
Returns the number of rows that the scanner to fetch at once -
getCacheBlocks
Returns true if HFile blocks should be cached on the servers for this scan, false otherwise -
getStartTime
Returns the lower bound on timestamps of items of interest -
getEndTime
Returns the upper bound on timestamps of items of interest -
getMaxVersions
Returns maximum number of versions to return -
getFilter
Returns the filter specification -
setStartRow
- Parameters:
startRow- start row
-
setEndRow
- Parameters:
endRow- end row
-
setColumns
- Parameters:
columns- list of columns of interest in column:qualifier format, or empty for all
-
setBatch
- Parameters:
batch- the number of cells to return in batch
-
setCaching
- Parameters:
caching- the number of rows to fetch at once
-
setCacheBlocks
- Parameters:
value- true if HFile blocks should be cached on the servers for this scan, false otherwise
-
setMaxVersions
- Parameters:
maxVersions- maximum number of versions to return
-
setStartTime
- Parameters:
startTime- the lower bound on timestamps of values of interest
-
setEndTime
- Parameters:
endTime- the upper bound on timestamps of values of interest
-
setFilter
- Parameters:
filter- the filter specification
-
createProtobufOutput
Description copied from interface:ProtobufMessageHandlerReturns the protobuf represention of the model- Specified by:
createProtobufOutputin interfaceProtobufMessageHandler
-
getObjectFromMessage
Description copied from interface:ProtobufMessageHandlerInitialize the model from a protobuf representation.- Specified by:
getObjectFromMessagein interfaceProtobufMessageHandler- Parameters:
message- the raw bytes of the protobuf message- Returns:
- reference to self for convenience
- Throws:
IOException
-