@InterfaceAudience.Public public abstract class Query extends OperationWithAttributes
Modifier and Type | Field and Description |
---|---|
protected Map<byte[],TimeRange> |
colFamTimeRangeMap |
protected Consistency |
consistency |
protected Filter |
filter |
protected Boolean |
loadColumnFamiliesOnDemand |
protected boolean |
queryMetricsEnabled |
protected int |
targetReplicaId |
ID_ATRIBUTE
Constructor and Description |
---|
Query() |
Modifier and Type | Method and Description |
---|---|
boolean |
doLoadColumnFamiliesOnDemand()
Get the logical value indicating whether on-demand CF loading should be allowed.
|
byte[] |
getACL()
Returns The serialized ACL for this operation, or null if none
|
Authorizations |
getAuthorizations()
Returns The authorizations this Query is associated with.
|
Map<byte[],TimeRange> |
getColumnFamilyTimeRange()
Returns A map of column families to time ranges
|
Consistency |
getConsistency()
Returns the consistency level for this operation
|
Filter |
getFilter() |
IsolationLevel |
getIsolationLevel()
Returns The isolation level of this query.
|
Boolean |
getLoadColumnFamiliesOnDemandValue()
Get the raw loadColumnFamiliesOnDemand setting; if it's not set, can be null.
|
int |
getReplicaId()
Returns region replica id where Query will fetch data from.
|
boolean |
isQueryMetricsEnabled()
Returns whether query metrics are enabled
|
Query |
setACL(Map<String,Permission> perms)
Set the ACL for the operation.
|
Query |
setACL(String user,
Permission perms)
Set the ACL for the operation.
|
Query |
setAuthorizations(Authorizations authorizations)
Sets the authorizations to be used by this Query
|
Query |
setColumnFamilyTimeRange(byte[] cf,
long minStamp,
long maxStamp)
Get versions of columns only within the specified timestamp range, [minStamp, maxStamp) on a
per CF bases.
|
Query |
setConsistency(Consistency consistency)
Sets the consistency level for this operation
|
Query |
setFilter(Filter filter)
Apply the specified server-side filter when performing the Query.
|
Query |
setIsolationLevel(IsolationLevel level)
Set the isolation level for this query.
|
Query |
setLoadColumnFamiliesOnDemand(boolean value)
Set the value indicating whether loading CFs on demand should be allowed (cluster default is
false).
|
Query |
setQueryMetricsEnabled(boolean enabled)
Enables the return of
QueryMetrics alongside the corresponding result(s) for this query |
Query |
setReplicaId(int Id)
Specify region replica id where Query will fetch data from.
|
getAttribute, getAttributeSize, getAttributesMap, getId, getPriority, setAttribute, setId, setPriority
protected Filter filter
protected int targetReplicaId
protected Consistency consistency
protected Boolean loadColumnFamiliesOnDemand
protected boolean queryMetricsEnabled
public Filter getFilter()
public Query setFilter(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 Query setAuthorizations(Authorizations authorizations)
public Authorizations getAuthorizations() throws DeserializationException
DeserializationException
public byte[] getACL()
public Query setACL(String user, Permission perms)
user
- User short nameperms
- Permissions for the userpublic Query setACL(Map<String,Permission> perms)
perms
- A map of permissions for a user or userspublic Consistency getConsistency()
public Query setConsistency(Consistency consistency)
consistency
- the consistency levelpublic Query setReplicaId(int Id)
setConsistency(Consistency)
passing Consistency.TIMELINE
to read data from a
specific replicaId. public int getReplicaId()
public Query setIsolationLevel(IsolationLevel level)
level
- IsolationLevel for this querypublic Query setQueryMetricsEnabled(boolean enabled)
QueryMetrics
alongside the corresponding result(s) for this query
This is intended for advanced users who need result-granular, server-side metrics
Does not work with calls to Table.exists(Get)
and Table.exists(List)
enabled
- true
to enable collection of per-result query metrics false
to
disable metrics collection (resulting in null
metrics)public boolean isQueryMetricsEnabled()
true
if query metrics are enabled, false
otherwisepublic IsolationLevel getIsolationLevel()
public Query setLoadColumnFamiliesOnDemand(boolean value)
public Boolean getLoadColumnFamiliesOnDemandValue()
public boolean doLoadColumnFamiliesOnDemand()
public Query setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp)
cf
- the column family for which you want to restrictminStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusiveCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.