code: public AbstractDatastoreType createPojoDatastore(final Datastore datastore, final Set<Column> columns,
              final int maxRowsToQuery) {
          final PojoDatastoreType datastoreType = new PojoDatastoreType();
          datastoreType.setName(datastore.getName());
          datastoreType.setDescription(datastore.getDescription());
  
          try (final DatastoreConnection con = datastore.openConnection()) {
              final DataContext dataContext = con.getDataContext();
  
              final Schema schema;
              final Table[] tables;
              if (columns == null || columns.isEmpty()) {
                  schema = dataContext.getDefaultSchema();
                  tables = schema.getTables();
              } else {
                  tables = MetaModelHelper.getTables(columns);
                  // TODO: There's a possibility that tables span multiple
                  // schemas, but we cannot currently support that in a
                  // PojoDatastore, so we just pick the first and cross our
                  // fingers.
                  schema = tables[0].getSchema();
              }
  
              datastoreType.setSchemaName(schema.getName());
  
              for (final Table table : tables) {
                  final Column[] usedColumns;
                  if (columns == null || columns.isEmpty()) {
                      usedColumns = table.getColumns();
                  } else {
                      usedColumns = MetaModelHelper.getTableColumns(table, columns);
                  }
  
                  final PojoTableType tableType = createPojoTable(dataContext, table, usedColumns, maxRowsToQuery);
                  datastoreType.getTable().add(tableType);
              }
          }
  
          return datastoreType;
      }
docs: Creates a serialized POJO copy of a datastore.
  
  @param datastore
  the datastore to copy
  @param columns
  the columns to include, or null if all tables/columns should
  be included.
  @param maxRowsToQuery
  the maximum number of records to query and include in the
  datastore copy. Keep this number reasonably low, or else the
  copy might cause out-of-memory issues (Both while reading and
  writing).
  @return