@InterfaceAudience.Public @InterfaceStability.Stable public class Get extends Query implements Row, Comparable<Row>
To get everything for a row, instantiate a Get object with the row to get. To further narrow the scope of what to Get, use the methods below.
To get all columns from specific families, execute addFamily
for each family to retrieve.
To get specific columns, execute addColumn
for each column to retrieve.
To only retrieve columns within a specific range of version timestamps,
execute setTimeRange
.
To only retrieve columns with a specific timestamp, execute
setTimestamp
.
To limit the number of versions of each column to be returned, execute
setMaxVersions
.
To add a filter, call setFilter
.
ID_ATRIBUTE
Constructor and Description |
---|
Get(byte[] row)
Create a Get operation for the specified row.
|
Get(Get get)
Copy-constructor
|
Modifier and Type | Method and Description |
---|---|
Get |
addColumn(byte[] family,
byte[] qualifier)
Get the column from the specific family with the specified qualifier.
|
Get |
addFamily(byte[] family)
Get all columns from the specified family.
|
int |
compareTo(Row other) |
boolean |
equals(Object obj) |
Set<byte[]> |
familySet()
Method for retrieving the keys in the familyMap
|
boolean |
getCacheBlocks()
Get whether blocks should be cached for this Get.
|
Map<byte[],NavigableSet<byte[]>> |
getFamilyMap()
Method for retrieving the get's familyMap
|
Map<String,Object> |
getFingerprint()
Compile the table and column family (i.e.
|
int |
getMaxResultsPerColumnFamily()
Method for retrieving the get's maximum number of values
to return per Column Family
|
int |
getMaxVersions()
Method for retrieving the get's maximum number of version
|
byte[] |
getRow()
Method for retrieving the get's row
|
int |
getRowOffsetPerColumnFamily()
Method for retrieving the get's offset per row per column
family (#kvs to be skipped)
|
TimeRange |
getTimeRange()
Method for retrieving the get's TimeRange
|
boolean |
hasFamilies()
Method for checking if any families have been inserted into this Get
|
int |
hashCode() |
boolean |
isCheckExistenceOnly() |
boolean |
isClosestRowBefore() |
int |
numFamilies()
Method for retrieving the number of families to get from
|
void |
setCacheBlocks(boolean cacheBlocks)
Set whether blocks should be cached for this Get.
|
void |
setCheckExistenceOnly(boolean checkExistenceOnly) |
void |
setClosestRowBefore(boolean closestRowBefore) |
Get |
setFilter(Filter filter)
Apply the specified server-side filter when performing the Query.
|
Get |
setMaxResultsPerColumnFamily(int limit)
Set the maximum number of values to return per row per Column Family
|
Get |
setMaxVersions()
Get all available versions.
|
Get |
setMaxVersions(int maxVersions)
Get up to the specified number of versions of each column.
|
Get |
setRowOffsetPerColumnFamily(int offset)
Set offset for the row per Column Family.
|
Get |
setTimeRange(long minStamp,
long maxStamp)
Get versions of columns only within the specified timestamp range,
[minStamp, maxStamp).
|
Get |
setTimeStamp(long timestamp)
Get versions of columns with the specified timestamp.
|
Map<String,Object> |
toMap(int maxCols)
Compile the details beyond the scope of getFingerprint (row, columns,
timestamps, etc.) into a Map along with the fingerprinted information.
|
getACL, getACLStrategy, getAuthorizations, getFilter, getIsolationLevel, setACL, setACL, setACLStrategy, setAuthorizations, setIsolationLevel
getAttribute, getAttributeSize, getAttributesMap, getId, setAttribute, setId
public Get(byte[] row)
If no further operations are done, this will get the latest version of all columns in all families of the specified row.
row
- row keypublic Get(Get get)
get
- public boolean isCheckExistenceOnly()
public void setCheckExistenceOnly(boolean checkExistenceOnly)
public boolean isClosestRowBefore()
public void setClosestRowBefore(boolean closestRowBefore)
public Get addFamily(byte[] family)
Overrides previous calls to addColumn for this family.
family
- family namepublic Get addColumn(byte[] family, byte[] qualifier)
Overrides previous calls to addFamily for this family.
family
- family namequalifier
- column qualifierpublic Get setTimeRange(long minStamp, long maxStamp) throws IOException
minStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusiveIOException
- if invalid time rangepublic Get setTimeStamp(long timestamp) throws IOException
timestamp
- version timestampIOException
public Get setMaxVersions()
public Get setMaxVersions(int maxVersions) throws IOException
maxVersions
- maximum versions for each columnIOException
- if invalid number of versionspublic Get setMaxResultsPerColumnFamily(int limit)
limit
- the maximum number of values returned / row / CFpublic Get setRowOffsetPerColumnFamily(int offset)
offset
- is the number of kvs that will be skipped.public Get setFilter(Filter filter)
Query
Filter.filterKeyValue(Cell)
is called AFTER all tests
for ttl, column match, deletes and max versions have been run.public void setCacheBlocks(boolean cacheBlocks)
This is true by default. When true, default settings of the table and family are used (this will never override caching blocks if the block cache is disabled for that family or entirely).
cacheBlocks
- if false, default settings are overridden and blocks
will not be cachedpublic boolean getCacheBlocks()
public byte[] getRow()
public int getMaxVersions()
public int getMaxResultsPerColumnFamily()
public int getRowOffsetPerColumnFamily()
public TimeRange getTimeRange()
public Set<byte[]> familySet()
public int numFamilies()
public boolean hasFamilies()
public Map<byte[],NavigableSet<byte[]>> getFamilyMap()
public Map<String,Object> getFingerprint()
getFingerprint
in class Operation
public Map<String,Object> toMap(int maxCols)
public int compareTo(Row other)
compareTo
in interface Comparable<Row>
Copyright © 2015 The Apache Software Foundation. All Rights Reserved.