WangYuan created RANGER-1812:
--------------------------------
Summary: Object HTableDescriptor can be used directly at
getTableList() method for HBaseClient class
Key: RANGER-1812
URL: https://issues.apache.org/jira/browse/RANGER-1812
Project: Ranger
Issue Type: Bug
Components: plugins, Ranger
Affects Versions: master
Reporter: WangYuan
Assignee: WangYuan
Priority: Minor
Object HTableDescriptor can be used directly at getTableList() method for
HBaseClient class
{code:title=HBaseClient.java}
public List<String> getTableList(final String tableNameMatching, final
List<String> existingTableList ) throws HadoopException {
... ...
HTableDescriptor [] htds = admin.listTables(tableNameMatching);
if (htds != null) {
for (HTableDescriptor htd : admin.listTables(tableNameMatching)) {
// The object htds can be used directly inestead of listTables once
again
// for (HTableDescriptor htd : htds )
String tableName = htd.getNameAsString();
if (existingTableList != null &&
existingTableList.contains(tableName)) {
continue;
} else {
tableList.add(htd.getNameAsString());
}
}
}
... ...
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)