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
Modifier and TypeClassDescription(package private) static class
private static class
Implement lazily-instantiated singleton as per recipe here: http://literatejava.com/jvm/fastest-threadsafe-singleton-jvm/ -
Field Summary
-
Constructor Summary
ConstructorDescriptionDefault 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 TypeMethodDescriptionvoid
addColumn
(byte[] column) Add a column to the column setvoid
Add a visibility label to the scanstatic Filter
byte[]
Returns the protobuf represention of the modelstatic ScannerModel
int
getBatch()
Returns the number of cells to return in batchboolean
Returns true if HFile blocks should be cached on the servers for this scan, false otherwiseint
Returns 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 rowlong
Returns the upper bound on timestamps of items of interestReturns the filter specificationprivate static org.apache.hbase.thirdparty.com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
Get theJacksonJaxbJsonProvider
instance;int
Returns maximum number of versions to returngetObjectFromMessage
(byte[] message) Initialize the model from a protobuf representation.byte[]
Returns start rowlong
Returns the lower bound on timestamps of items of interestboolean
Returns true if an end row was specifiedboolean
Returns true if a start row was specifiedvoid
setBatch
(int batch) void
setCacheBlocks
(boolean value) void
setCaching
(int caching) void
setColumns
(List<byte[]> columns) void
setEndRow
(byte[] endRow) void
setEndTime
(long endTime) void
void
setMaxVersions
(int maxVersions) void
setStartRow
(byte[] startRow) void
setStartTime
(long startTime) static String
stringifyFilter
(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 theJacksonJaxbJsonProvider
instance;- 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:ProtobufMessageHandler
Returns the protobuf represention of the model- Specified by:
createProtobufOutput
in interfaceProtobufMessageHandler
-
getObjectFromMessage
Description copied from interface:ProtobufMessageHandler
Initialize the model from a protobuf representation.- Specified by:
getObjectFromMessage
in interfaceProtobufMessageHandler
- Parameters:
message
- the raw bytes of the protobuf message- Returns:
- reference to self for convenience
- Throws:
IOException
-