return tableList;
}
private final TableListModel getTableListForUser(final User user)
throws IOException {
TableListModel tableList;
if (user.isAdmin()) {
tableList = getTableList();
} else {
tableList = new TableListModel();
HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
HTableDescriptor[] list = admin.listTables();
String prefix = user.getName() + ".";
for (HTableDescriptor htd: list) {
String name = htd.getNameAsString();
if (!name.startsWith(prefix)) {
continue;
}
tableList.add(new TableModel(name.substring(prefix.length())));
}
}
return tableList;
}