@InterfaceAudience.Private public class ScannerModel extends Object implements ProtobufMessageHandler, Serializable
<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>
Constructor and Description |
---|
ScannerModel()
Default constructor
|
ScannerModel(byte[] startRow,
byte[] endRow,
List<byte[]> columns,
int batch,
int caching,
long endTime,
int maxVersions,
String filter)
Constructor
|
ScannerModel(byte[] startRow,
byte[] endRow,
List<byte[]> columns,
int batch,
int caching,
long startTime,
long endTime,
String filter)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addColumn(byte[] column)
Add a column to the column set
|
void |
addLabel(String label)
Add a visibility label to the scan
|
static Filter |
buildFilter(String s) |
byte[] |
createProtobufOutput() |
static ScannerModel |
fromScan(Scan scan) |
int |
getBatch() |
boolean |
getCacheBlocks() |
int |
getCaching() |
List<byte[]> |
getColumns() |
byte[] |
getEndRow() |
long |
getEndTime() |
String |
getFilter() |
List<String> |
getLabels() |
int |
getMaxVersions() |
ProtobufMessageHandler |
getObjectFromMessage(byte[] message)
Initialize the model from a protobuf representation.
|
byte[] |
getStartRow() |
long |
getStartTime() |
boolean |
hasEndRow() |
boolean |
hasStartRow() |
void |
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 |
setFilter(String filter) |
void |
setMaxVersions(int maxVersions) |
void |
setStartRow(byte[] startRow) |
void |
setStartTime(long startTime) |
static String |
stringifyFilter(Filter filter) |
public ScannerModel()
public ScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, int caching, long endTime, int maxVersions, String filter)
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)public ScannerModel(byte[] startRow, byte[] endRow, List<byte[]> columns, int batch, int caching, long startTime, long endTime, String filter)
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 specificationpublic static Filter buildFilter(String s) throws Exception
s
- the JSON representation of the filterException
public static String stringifyFilter(Filter filter) throws Exception
filter
- the filterException
public static ScannerModel fromScan(Scan scan) throws Exception
scan
- the scan specificationException
public void addColumn(byte[] column)
column
- the column name, as <column>(:<qualifier>)?public void addLabel(String label)
public boolean hasStartRow()
public byte[] getStartRow()
public boolean hasEndRow()
public byte[] getEndRow()
public List<byte[]> getColumns()
public int getBatch()
public int getCaching()
public boolean getCacheBlocks()
public long getStartTime()
public long getEndTime()
public int getMaxVersions()
public String getFilter()
public void setStartRow(byte[] startRow)
startRow
- start rowpublic void setEndRow(byte[] endRow)
endRow
- end rowpublic void setColumns(List<byte[]> columns)
columns
- list of columns of interest in column:qualifier format, or empty for allpublic void setBatch(int batch)
batch
- the number of cells to return in batchpublic void setCaching(int caching)
caching
- the number of rows to fetch at oncepublic void setCacheBlocks(boolean value)
value
- true if HFile blocks should be cached on the servers for this scan, false otherwisepublic void setMaxVersions(int maxVersions)
maxVersions
- maximum number of versions to returnpublic void setStartTime(long startTime)
startTime
- the lower bound on timestamps of values of interestpublic void setEndTime(long endTime)
endTime
- the upper bound on timestamps of values of interestpublic void setFilter(String filter)
filter
- the filter specificationpublic byte[] createProtobufOutput()
createProtobufOutput
in interface ProtobufMessageHandler
public ProtobufMessageHandler getObjectFromMessage(byte[] message) throws IOException
ProtobufMessageHandler
getObjectFromMessage
in interface ProtobufMessageHandler
message
- the raw bytes of the protobuf messageIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.