You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "WangYuan (JIRA)" <ji...@apache.org> on 2017/09/28 01:09:00 UTC

[jira] [Created] (RANGER-1812) Object HTableDescriptor can be used directly at getTableList() method for HBaseClient class

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)