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:
parent
1ad5a08ebb
commit
860d7a746e
|
@ -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()]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue