|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.client.Get
public class Get
Used to perform Get operations on a single row.
To get everything for a row, instantiate a Get object with the row to get. To further define the scope of what to get, perform additional methods as outlined 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, execute setFilter
.
Constructor Summary | |
---|---|
Get()
Constructor for Writable. |
|
Get(byte[] row)
Create a Get operation for the specified row. |
|
Get(byte[] row,
RowLock rowLock)
Create a Get operation for the specified row, using an existing row lock. |
Method Summary | |
---|---|
Get |
addColumn(byte[] column)
Deprecated. use addColumn(byte[], byte[]) instead |
Get |
addColumn(byte[] family,
byte[] qualifier)
Get the column from the specific family with the specified qualifier. |
Get |
addColumns(byte[][] columns)
Deprecated. issue multiple addColumn(byte[], byte[]) instead |
Get |
addFamily(byte[] family)
Get all columns from the specified family. |
int |
compareTo(Row other)
|
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 |
Filter |
getFilter()
|
long |
getLockId()
Method for retrieving the get's lockId |
int |
getMaxVersions()
Method for retrieving the get's maximum number of version |
byte[] |
getRow()
Method for retrieving the get's row |
RowLock |
getRowLock()
Method for retrieving the get's RowLock |
TimeRange |
getTimeRange()
Method for retrieving the get's TimeRange |
boolean |
hasFamilies()
Method for checking if any families have been inserted into this Get |
int |
numFamilies()
Method for retrieving the number of families to get from |
void |
readFields(DataInput in)
|
void |
setCacheBlocks(boolean cacheBlocks)
Set whether blocks should be cached for this Get. |
Get |
setFilter(Filter filter)
Apply the specified server-side filter when performing the Get. |
Get |
setMaxVersions()
Get all available versions. |
Get |
setMaxVersions(int maxVersions)
Get up to the specified number of versions of each column. |
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. |
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Get()
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(byte[] row, RowLock rowLock)
If no further operations are done, this will get the latest version of all columns in all families of the specified row.
row
- row keyrowLock
- previously acquired row lock, or nullMethod Detail |
---|
public Get addFamily(byte[] family)
Overrides previous calls to addColumn for this family.
family
- family name
public Get addColumn(byte[] family, byte[] qualifier)
Overrides previous calls to addFamily for this family.
family
- family namequalifier
- column qualifier
public Get setTimeRange(long minStamp, long maxStamp) throws IOException
minStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusive
IOException
- if invalid time rangepublic Get setTimeStamp(long timestamp)
timestamp
- version timestamp
public Get setMaxVersions()
public Get setMaxVersions(int maxVersions) throws IOException
maxVersions
- maximum versions for each column
IOException
- if invalid number of versionspublic Get setFilter(Filter filter)
Filter.filterKeyValue(KeyValue)
is called AFTER all tests
for ttl, column match, deletes and max versions have been run.
filter
- filter to run on the server
public Filter getFilter()
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()
getRow
in interface Row
public RowLock getRowLock()
public long getLockId()
public int getMaxVersions()
public TimeRange getTimeRange()
public Set<byte[]> familySet()
public int numFamilies()
public boolean hasFamilies()
public Map<byte[],NavigableSet<byte[]>> getFamilyMap()
public String toString()
toString
in class Object
public int compareTo(Row other)
compareTo
in interface Comparable<Row>
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public Get addColumns(byte[][] columns)
addColumn(byte[], byte[])
instead
Overrides previous calls to addFamily for any families in the input.
columns
- array of columns, formatted as family:qualifier
public Get addColumn(byte[] column)
addColumn(byte[], byte[])
instead
column
- Old format column.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |