@Override
  public ListTableDescriptorsByStateResponse listTableDescriptorsByState(RpcController controller,
    ListTableDescriptorsByStateRequest request) throws ServiceException {
    try {
      server.checkInitialized();
      List<TableDescriptor> descriptors = server.listTableDescriptors(null, null, null, false);

      ListTableDescriptorsByStateResponse.Builder builder =
        ListTableDescriptorsByStateResponse.newBuilder();
      if (descriptors != null && descriptors.size() > 0) {
        // Add the table descriptors to the response
        TableState.State state =
          request.getIsEnabled() ? TableState.State.ENABLED : TableState.State.DISABLED;
        for (TableDescriptor htd : descriptors) {
          if (server.getTableStateManager().isTableState(htd.getTableName(), state)) {
            builder.addTableSchema(ProtobufUtil.toTableSchema(htd));
          }
        }
      }
      return builder.build();
    } catch (IOException ioe) {
      throw new ServiceException(ioe);
    }
  }
Get list of TableDescriptors for requested tables.
@param c   Unused (set to null).
@param req GetTableDescriptorsRequest that contains: - tableNames: requested tables, or if
           empty, all are requested.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java