public final class AnyGet extends Object implements Comparable<org.apache.hadoop.hbase.client.Row>
Get
in HBase to reduce the manual conversion between bytes and String/Object.Get
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.hbase.client.OperationWithAttributes |
ap
The ap.
|
protected org.apache.hadoop.hbase.client.Operation |
op
The op.
|
protected org.apache.hadoop.hbase.client.Query |
query
The query.
|
Constructor and Description |
---|
AnyGet(ByteBuffer row)
Instantiates a new any get.
|
AnyGet(org.apache.hadoop.hbase.client.Get get)
Instantiates a new any get.
|
AnyGet(Object rowKey)
Instantiates a new any get.
|
AnyGet(Object rowKey,
int rowOffset,
int rowLength)
Instantiates a new any get.
|
Modifier and Type | Method and Description |
---|---|
AnyGet |
addColumn(byte[] family,
byte[] qualifier)
Adds the column.
|
AnyGet |
addColumn(String family,
String qualifier)
Adds the column.
|
AnyGet |
addFamily(byte[] family)
Adds the family.
|
AnyGet |
addFamily(String family)
Adds the family.
|
int |
compareTo(org.apache.hadoop.hbase.client.Row other)
Compare to.
|
boolean |
doLoadColumnFamiliesOnDemand()
Get the logical value indicating whether on-demand CF loading should be allowed.
|
boolean |
equals(Object obj)
Equals.
|
Set<byte[]> |
familySet()
Family set.
|
byte[] |
getACL()
Gets the acl.
|
byte[] |
getAttribute(String name)
Gets the attribute.
|
Map<String,byte[]> |
getAttributesMap()
Gets the attributes map.
|
org.apache.hadoop.hbase.security.visibility.Authorizations |
getAuthorizations()
Gets the authorizations.
|
boolean |
getCacheBlocks()
Gets the cache blocks.
|
Map<byte[],org.apache.hadoop.hbase.io.TimeRange> |
getColumnFamilyTimeRange()
Gets the column family time range.
|
org.apache.hadoop.hbase.client.Consistency |
getConsistency()
Returns the consistency level for this operation.
|
Map<byte[],NavigableSet<byte[]>> |
getFamilyMap()
Gets the family map.
|
org.apache.hadoop.hbase.filter.Filter |
getFilter()
Gets the filter.
|
Map<String,Object> |
getFingerprint()
Gets the fingerprint.
|
String |
getId()
This method allows you to retrieve the identifier for the operation if one
was set.
|
org.apache.hadoop.hbase.client.IsolationLevel |
getIsolationLevel()
Gets the isolation level.
|
Boolean |
getLoadColumnFamiliesOnDemandValue()
Get the raw loadColumnFamiliesOnDemand setting; if it's not set, can be null.
|
int |
getMaxResultsPerColumnFamily()
Gets the max results per column family.
|
int |
getMaxVersions()
Gets the max versions.
|
int |
getPriority()
Gets the priority.
|
int |
getReplicaId()
Returns region replica id where Query will fetch data from.
|
byte[] |
getRow()
To Keep it simple, there should be no methods for the properties if it's not set by this class
The properties not set by this should be get by the methods in
Get . |
int |
getRowOffsetPerColumnFamily()
Gets the row offset per column family.
|
org.apache.hadoop.hbase.io.TimeRange |
getTimeRange()
Gets the time range.
|
boolean |
hasFamilies()
Checks for families.
|
int |
hashCode()
Hash code.
|
boolean |
isCheckExistenceOnly()
Checks if is check existence only.
|
boolean |
isClosestRowBefore()
Deprecated.
since 2.0.0 and will be removed in 3.0.0
|
int |
numFamilies()
Num families.
|
static AnyGet |
of(ByteBuffer row)
Of.
|
static AnyGet |
of(org.apache.hadoop.hbase.client.Get get)
Of.
|
static AnyGet |
of(Object rowKey)
Of.
|
static AnyGet |
of(Object rowKey,
int rowOffset,
int rowLength)
Of.
|
AnyGet |
readAllVersions()
Get all available versions.
|
AnyGet |
readVersions(int versions)
Get up to the specified number of versions of each column.
|
QP |
setACL(Map<String,org.apache.hadoop.hbase.security.access.Permission> perms)
Sets the ACL.
|
QP |
setACL(String user,
org.apache.hadoop.hbase.security.access.Permission perms)
Sets the ACL.
|
AP |
setAttribute(String name,
Object value)
Sets the attribute.
|
QP |
setAuthorizations(org.apache.hadoop.hbase.security.visibility.Authorizations authorizations)
Sets the authorizations to be used by this Query.
|
AnyGet |
setCacheBlocks(boolean cacheBlocks)
Sets the cache blocks.
|
AnyGet |
setCheckExistenceOnly(boolean checkExistenceOnly)
Sets the check existence only.
|
AnyGet |
setClosestRowBefore(boolean closestRowBefore)
Deprecated.
since 2.0.0 and will be removed in 3.0.0
|
QP |
setColumnFamilyTimeRange(byte[] cf,
long minStamp,
long maxStamp)
Get versions of columns only within the specified timestamp range,
[minStamp, maxStamp) on a per CF bases.
|
QP |
setColumnFamilyTimeRange(String cf,
long minStamp,
long maxStamp)
Get versions of columns only within the specified timestamp range,
[minStamp, maxStamp) on a per CF bases.
|
QP |
setConsistency(org.apache.hadoop.hbase.client.Consistency consistency)
Sets the consistency level for this operation.
|
QP |
setFilter(org.apache.hadoop.hbase.filter.Filter filter)
Apply the specified server-side filter when performing the Query.
|
AP |
setId(String id)
This method allows you to set an identifier on an operation.
|
QP |
setIsolationLevel(org.apache.hadoop.hbase.client.IsolationLevel level)
Set the isolation level for this query.
|
QP |
setLoadColumnFamiliesOnDemand(boolean value)
Set the value indicating whether loading CFs on demand should be allowed (cluster
default is false).
|
AnyGet |
setMaxResultsPerColumnFamily(int limit)
Sets the max results per column family.
|
AnyGet |
setMaxVersions()
Deprecated.
It is easy to misunderstand with column family's max versions, so use
readAllVersions() instead. |
AnyGet |
setMaxVersions(int maxVersions)
Deprecated.
It is easy to misunderstand with column family's max versions, so use
readVersions(int) instead. |
AP |
setPriority(int priority)
Sets the priority.
|
QP |
setReplicaId(int id)
Specify region replica id where Query will fetch data from.
|
AnyGet |
setRowOffsetPerColumnFamily(int offset)
Sets the row offset per column family.
|
AnyGet |
setTimeRange(long minStamp,
long maxStamp)
Sets the time range.
|
AnyGet |
setTimestamp(long timestamp)
Sets the timestamp.
|
AnyGet |
setTimeStamp(long timestamp)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
Use
setTimestamp(long) instead |
String |
toJSON()
To JSON.
|
String |
toJSON(int maxCols)
To JSON.
|
Map<String,Object> |
toMap()
To map.
|
Map<String,Object> |
toMap(int maxCols)
To map.
|
String |
toString()
To string.
|
String |
toString(int maxCols)
To string.
|
org.apache.hadoop.hbase.client.Get |
val()
Val.
|
protected final org.apache.hadoop.hbase.client.Query query
protected final org.apache.hadoop.hbase.client.OperationWithAttributes ap
protected final org.apache.hadoop.hbase.client.Operation op
public AnyGet(Object rowKey)
rowKey
- the row keypublic AnyGet(Object rowKey, int rowOffset, int rowLength)
rowKey
- the row keyrowOffset
- the row offsetrowLength
- the row lengthpublic AnyGet(ByteBuffer row)
row
- the rowpublic AnyGet(org.apache.hadoop.hbase.client.Get get)
get
- the getpublic static AnyGet of(Object rowKey, int rowOffset, int rowLength)
rowKey
- the row keyrowOffset
- the row offsetrowLength
- the row lengthpublic static AnyGet of(ByteBuffer row)
row
- the rowpublic static AnyGet of(org.apache.hadoop.hbase.client.Get get)
get
- the getpublic org.apache.hadoop.hbase.client.Get val()
public AnyGet addFamily(String family)
family
- the familypublic AnyGet addFamily(byte[] family)
family
- the familypublic AnyGet addColumn(String family, String qualifier)
family
- the familyqualifier
- the qualifierpublic AnyGet addColumn(byte[] family, byte[] qualifier)
family
- the familyqualifier
- the qualifierpublic Map<byte[],NavigableSet<byte[]>> getFamilyMap()
public boolean isCheckExistenceOnly()
public AnyGet setCheckExistenceOnly(boolean checkExistenceOnly)
checkExistenceOnly
- the check existence only@Deprecated public boolean isClosestRowBefore()
@Deprecated public AnyGet setClosestRowBefore(boolean closestRowBefore)
closestRowBefore
- the closest row beforepublic org.apache.hadoop.hbase.io.TimeRange getTimeRange()
public AnyGet setTimeRange(long minStamp, long maxStamp) throws IOException
minStamp
- the min stampmaxStamp
- the max stampIOException
- Signals that an I/O exception has occurred.public AnyGet setTimestamp(long timestamp) throws IOException
timestamp
- the timestampIOException
- Signals that an I/O exception has occurred.@Deprecated public AnyGet setTimeStamp(long timestamp) throws IOException
setTimestamp(long)
insteadtimestamp
- version timestampIOException
- Signals that an I/O exception has occurred.public int getMaxVersions()
@Deprecated public AnyGet setMaxVersions(int maxVersions) throws IOException
readVersions(int)
instead.maxVersions
- maximum versions for each columnIOException
- if invalid number of versions@Deprecated public AnyGet setMaxVersions()
readAllVersions()
instead.public AnyGet readVersions(int versions) throws IOException
versions
- specified number of versions for each columnIOException
- if invalid number of versionspublic AnyGet readAllVersions()
public int getMaxResultsPerColumnFamily()
public AnyGet setMaxResultsPerColumnFamily(int limit)
limit
- the limitpublic int getRowOffsetPerColumnFamily()
public AnyGet setRowOffsetPerColumnFamily(int offset)
offset
- the offsetpublic boolean getCacheBlocks()
public AnyGet setCacheBlocks(boolean cacheBlocks)
cacheBlocks
- the cache blockspublic byte[] getRow()
Get
.public boolean hasFamilies()
public int numFamilies()
public Set<byte[]> familySet()
public int compareTo(org.apache.hadoop.hbase.client.Row other)
compareTo
in interface Comparable<org.apache.hadoop.hbase.client.Row>
other
- the otherpublic boolean equals(Object obj)
public String toString()
public org.apache.hadoop.hbase.filter.Filter getFilter()
public QP setFilter(org.apache.hadoop.hbase.filter.Filter filter)
Filter.filterCell(org.apache.hadoop.hbase.Cell)
is called AFTER all tests for ttl,
column match, deletes and column family's max versions have been run.filter
- filter to run on the serverpublic org.apache.hadoop.hbase.security.visibility.Authorizations getAuthorizations() throws org.apache.hadoop.hbase.exceptions.DeserializationException
org.apache.hadoop.hbase.exceptions.DeserializationException
- the deserialization exceptionpublic QP setAuthorizations(org.apache.hadoop.hbase.security.visibility.Authorizations authorizations)
authorizations
- the authorizationspublic byte[] getACL()
public QP setACL(String user, org.apache.hadoop.hbase.security.access.Permission perms)
user
- User short nameperms
- Permissions for the userpublic QP setACL(Map<String,org.apache.hadoop.hbase.security.access.Permission> perms)
perms
- A map of permissions for a user or userspublic org.apache.hadoop.hbase.client.Consistency getConsistency()
public QP setConsistency(org.apache.hadoop.hbase.client.Consistency consistency)
consistency
- the consistency levelpublic int getReplicaId()
public QP setReplicaId(int id)
setConsistency(Consistency)
passing Consistency.TIMELINE
to read data from
a specific replicaId.
id
- the idpublic org.apache.hadoop.hbase.client.IsolationLevel getIsolationLevel()
public QP setIsolationLevel(org.apache.hadoop.hbase.client.IsolationLevel level)
level
- IsolationLevel for this querypublic Boolean getLoadColumnFamiliesOnDemandValue()
public QP setLoadColumnFamiliesOnDemand(boolean value)
value
- the valuepublic boolean doLoadColumnFamiliesOnDemand()
public Map<byte[],org.apache.hadoop.hbase.io.TimeRange> getColumnFamilyTimeRange()
public QP setColumnFamilyTimeRange(String cf, long minStamp, long maxStamp)
cf
- the column family for which you want to restrictminStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusivepublic QP setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp)
cf
- the column family for which you want to restrictminStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusivepublic byte[] getAttribute(String name)
name
- the namepublic Map<String,byte[]> getAttributesMap()
public AP setAttribute(String name, Object value)
name
- the namevalue
- the valuepublic String getId()
public AP setId(String id)
id
- id to set for the scanpublic int getPriority()
public AP setPriority(int priority)
priority
- the prioritypublic Map<String,Object> getFingerprint()
public Map<String,Object> toMap(int maxCols)
maxCols
- the max colspublic String toJSON() throws IOException
IOException
- Signals that an I/O exception has occurred.public String toJSON(int maxCols) throws IOException
maxCols
- the max colsIOException
- Signals that an I/O exception has occurred.public String toString(int maxCols)
maxCols
- the max colsCopyright © 2019. All rights reserved.