Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RepositoryCatalogFacadeImpl's query of PublishedInfo.class #476

Merged

Conversation

groldan
Copy link
Member

@groldan groldan commented May 23, 2024

The webui layer preview page, and possibly other code paths, lead to querying the PublishedInfo super interface for LayerInfo and LayerGroupInfo.

These queries must be delegated to the layer and layer group queries. The DefaultCatalogFacade in GeoServer does it and builds an in-memory list of the results.

Our RepositoryCatalogFacadeImpl does it in a streaming fashion, but it wasn't respecting the limits, resulting in wrong results for the layer preview page.

Now it queries LayerRepository and LayerGroupRepository, and returns a merge-sorted stream.

If the query does not specify a sort order, the id property is used to provide predictable order for the merge-sort algorithm.

When the returned stream is closed, it'll close the two underlying streams.

The webui layer preview page, and possibly other code paths, lead to
querying the `PublishedInfo` super interface for `LayerInfo` and
`LayerGroupInfo`.

These queries must be delegated to the layer and layer group queries.
The `DefaultCatalogFacade` in GeoServer does it and builds an in-memory
list of the results.

Our `RepositoryCatalogFacadeImpl` does it in a streaming fashion, but it
wasn't respecting the limits, resulting in wrong results for the layer
preview page.

Now it queries `LayerRepository` and `LayerGroupRepository`, and returns
a merge-sorted  stream.

If the query does not specify a sort order, the `id` property is used to provide
predictable order for the merge-sort algorithm.

When the returned stream is closed, it'll close the two underlying streams.
@groldan groldan added the bug Something isn't working label May 23, 2024
@groldan groldan merged commit 6109c70 into geoserver:main May 23, 2024
2 checks passed
@groldan groldan deleted the fix/repo_catalogfacade_query_publishedinfos branch May 23, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant