/** * @return All tables for all namespaces */ public Tables getHBaseTables() throws Exception { final TableName[] tableNames = executeSecure(() -> hBaseAdmin.listTableNames()); LOG.debug("HBase tables {}", Arrays.toString(tableNames)); return Tables.newInstance(tableNames, securityContext, true, getPrincipals(), getKeytabs()); }
/** * @param namespace Namespace for which to get table names * @return All tables for the namespace given as parameter */ public Tables getHBaseTables(final String namespace) throws IOException, PrivilegedActionException, InterruptedException { final TableName[] tableNames = executeSecure(() -> hBaseAdmin.listTableNamesByNamespace(namespace)); LOG.debug("HBase namespace [{}] has tables {}", namespace, Arrays.toString(tableNames)); return Tables.newInstance(tableNames, securityContext, true, getPrincipals(), getKeytabs()); }
/** * @return All namespaces */ public HBaseNamespaces getHBaseNamespaces() throws IOException, PrivilegedActionException, InterruptedException { final HBaseNamespaces namespaces = HBaseNamespaces.newInstance( executeSecure(() -> hBaseAdmin.listNamespaceDescriptors()), securityContext, true, getPrincipals(), getKeytabs()); LOG.debug("HBase namespaces {}", namespaces); return namespaces; }