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
Modifier and TypeFieldDescriptionprivate int
private boolean
private int
private static final byte[]
private List<byte[]>
private byte[]
private long
private String
private int
private int
private static final long
private byte[]
private long
Fields inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
BUFFER_SIZE
-
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
static 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
getLimit()
Returns the limit specificationint
Returns maximum number of versions to returngetObjectFromMessage
(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) 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 specifiedorg.apache.hbase.thirdparty.com.google.protobuf.Message
Convert to model to a protobuf Message objectvoid
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
setLimit
(int limit) void
setMaxVersions
(int maxVersions) void
setStartRow
(byte[] startRow) void
setStartTime
(long startTime) static String
stringifyFilter
(Filter filter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.rest.ProtobufMessageHandler
createProtobufOutput, getObjectFromMessage, getObjectFromMessage, writeProtobufOutput
-
Field Details
-
serialVersionUID
- See Also:
-
startRow
-
endRow
-
columns
-
batch
-
startTime
-
endTime
-
filter
-
maxVersions
-
caching
-
labels
-
cacheBlocks
-
limit
-
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 -
getLimit
Returns the limit specification -
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
-
setLimit
- Parameters:
limit
- the number of rows can fetch of each scanner at lifetime
-
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
-
messageFromObject
Description copied from interface:ProtobufMessageHandler
Convert to model to a protobuf Message object- Specified by:
messageFromObject
in interfaceProtobufMessageHandler
- Returns:
- the protobuf Message object
-
getObjectFromMessage
public ProtobufMessageHandler getObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) throws IOException - Specified by:
getObjectFromMessage
in interfaceProtobufMessageHandler
- Throws:
IOException
-