Amend HBASE-22377 Provide API to check the existence of a namespace which does not require ADMIN permissions

Bring back late review feedback from branch-2 version: use toArray in listNamespaces
This commit is contained in:
Andrew Purtell 2019-05-14 13:54:51 -07:00
parent 1ad5a08ebb
commit 860d7a746e
No known key found for this signature in database
GPG Key ID: 8597754DD5365CCD
1 changed files with 1 additions and 5 deletions

View File

@ -3148,11 +3148,7 @@ public class HBaseAdmin implements Admin {
controller.setCallTimeout(callTimeout);
List<String> list = master.listNamespaces(controller,
ListNamespacesRequest.newBuilder().build()).getNamespaceNameList();
String[] res = new String[list.size()];
for(int i = 0; i < list.size(); i++) {
res[i] = list.get(i);
}
return res;
return list.toArray(new String[list.size()]);
}
});
}