use of org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetConfiguredNamespacesAndTablesInRSGroupResponse in project hbase by apache.
the class MasterRpcServices method getConfiguredNamespacesAndTablesInRSGroup.
@Override
public GetConfiguredNamespacesAndTablesInRSGroupResponse getConfiguredNamespacesAndTablesInRSGroup(RpcController controller, GetConfiguredNamespacesAndTablesInRSGroupRequest request) throws ServiceException {
GetConfiguredNamespacesAndTablesInRSGroupResponse.Builder builder = GetConfiguredNamespacesAndTablesInRSGroupResponse.newBuilder();
String groupName = request.getGroupName();
LOG.info(server.getClientIdAuditPrefix() + " get configured namespaces and tables in rsgroup " + groupName);
try {
if (server.getMasterCoprocessorHost() != null) {
server.getMasterCoprocessorHost().preGetConfiguredNamespacesAndTablesInRSGroup(groupName);
}
for (NamespaceDescriptor nd : server.getClusterSchema().getNamespaces()) {
if (groupName.equals(nd.getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP))) {
builder.addNamespace(nd.getName());
}
}
for (TableDescriptor td : server.getTableDescriptors().getAll().values()) {
if (td.getRegionServerGroup().map(g -> g.equals(groupName)).orElse(false)) {
builder.addTableName(ProtobufUtil.toProtoTableName(td.getTableName()));
}
}
if (server.getMasterCoprocessorHost() != null) {
server.getMasterCoprocessorHost().postGetConfiguredNamespacesAndTablesInRSGroup(groupName);
}
} catch (IOException e) {
throw new ServiceException(e);
}
return builder.build();
}
Aggregations