@Override
  public GetTableNamesResponse getTableNames(RpcController controller, GetTableNamesRequest req)
    throws ServiceException {
    try {
      server.checkServiceStarted();

      final String regex = req.hasRegex() ? req.getRegex() : null;
      final String namespace = req.hasNamespace() ? req.getNamespace() : null;
      List<TableName> tableNames =
        server.listTableNames(namespace, regex, req.getIncludeSysTables());

      GetTableNamesResponse.Builder builder = GetTableNamesResponse.newBuilder();
      if (tableNames != null && tableNames.size() > 0) {
        // Add the table names to the response
        for (TableName table : tableNames) {
          builder.addTableNames(ProtobufUtil.toProtoTableName(table));
        }
      }
      return builder.build();
    } catch (IOException e) {
      throw new ServiceException(e);
    }
  }
Get list of userspace table names
@param controller Unused (set to null).
@param req        GetTableNamesRequest
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java