@InterfaceAudience.Private public class AggregationClient extends Object implements Closeable
This will serve as the client side handler for invoking the aggregate functions. For all aggregate functions,
HConstants.EMPTY_BYTE_ARRAY
)
Call close()
when done.
Modifier and Type | Field and Description |
---|---|
private Connection |
connection |
private static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
AggregationClient(org.apache.hadoop.conf.Configuration cfg)
Constructor with Conf object
|
Modifier and Type | Method and Description |
---|---|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
avg(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
This is the client side interface/handle for calling the average method for
a given cf-cq combination.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
avg(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
This is the client side interface/handle for calling the average method for
a given cf-cq combination.
|
void |
close() |
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
getAvgArgs(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It computes average while fetching sum and row count from all the
corresponding regions.
|
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
getAvgArgs(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It computes average while fetching sum and row count from all the
corresponding regions.
|
(package private) byte[] |
getBytesFromResponse(com.google.protobuf.ByteString response) |
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
getMedianArgs(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It helps locate the region with median for a given column whose weight
is specified in an optional column.
|
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
getStdArgs(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It computes a global standard deviation for a given column and its value.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
max(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It gives the maximum value of a column for a given column family for the
given range.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
max(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It gives the maximum value of a column for a given column family for the
given range.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
median(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
This is the client side interface/handler for calling the median method for a
given cf-cq combination.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
median(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
This is the client side interface/handler for calling the median method for a
given cf-cq combination.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
min(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It gives the minimum value of a column for a given column family for the
given range.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
min(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It gives the minimum value of a column for a given column family for the
given range.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
rowCount(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It gives the row count, by summing up the individual results obtained from
regions.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
rowCount(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It gives the row count, by summing up the individual results obtained from
regions.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
std(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
This is the client side interface/handle for calling the std method for a
given cf-cq combination.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
std(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
This is the client side interface/handle for calling the std method for a
given cf-cq combination.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
sum(Table table,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It sums up the value returned from various regions.
|
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
sum(TableName tableName,
ColumnInterpreter<R,S,P,Q,T> ci,
Scan scan)
It sums up the value returned from various regions.
|
(package private) <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> |
validateArgAndGetPB(Scan scan,
ColumnInterpreter<R,S,P,Q,T> ci,
boolean canFamilyBeAbsent) |
private void |
validateParameters(Scan scan,
boolean canFamilyBeAbsent) |
private static final org.apache.commons.logging.Log log
private final Connection connection
public AggregationClient(org.apache.hadoop.conf.Configuration cfg)
cfg
- public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> R max(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- ci
- scan
- Throwable
- The caller is supposed to handle the exception as they are thrown
& propagated to it.public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> R max(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
- The caller is supposed to handle the exception as they are thrown
& propagated to it.private void validateParameters(Scan scan, boolean canFamilyBeAbsent) throws IOException
IOException
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> R min(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> R min(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> long rowCount(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> long rowCount(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> S sum(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> S sum(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> Pair<S,Long> getAvgArgs(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- scan
- Throwable
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> Pair<S,Long> getAvgArgs(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> double avg(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> double avg(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> Pair<List<S>,Long> getStdArgs(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> double std(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> double std(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
private <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> Pair<NavigableMap<byte[],List<S>>,List<S>> getMedianArgs(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> R median(TableName tableName, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
tableName
- ci
- scan
- Throwable
public <R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> R median(Table table, ColumnInterpreter<R,S,P,Q,T> ci, Scan scan) throws Throwable
table
- ci
- scan
- Throwable
<R,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,T extends com.google.protobuf.Message> org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest validateArgAndGetPB(Scan scan, ColumnInterpreter<R,S,P,Q,T> ci, boolean canFamilyBeAbsent) throws IOException
IOException
byte[] getBytesFromResponse(com.google.protobuf.ByteString response)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.