@Override
public long getRowCount(
final String tableName,
final String... additionalAuthorizations ) {
RowIterator rowIterator;
try {
rowIterator = new RowIterator(
connector.createScanner(
getQualifiedTableName(tableName),
(authorization == null) ? new Authorizations(
additionalAuthorizations) : new Authorizations(
(String[]) ArrayUtils.add(
additionalAuthorizations,
authorization))));
while (rowIterator.hasNext()) {
rowIterator.next();
}
return rowIterator.getKVCount();
}
catch (final TableNotFoundException e) {
LOGGER.warn("Table '" + tableName + "' not found during count operation");
return 0;
}