Skip to content

[GEOS-11595] CoverageRATs check for PAM Resource is failing when checking CoverageViews #8025

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

Conversation

turingtestfail
Copy link
Contributor

@turingtestfail turingtestfail commented Nov 14, 2024

GEOS-11595 Powered by Pull Request Badge

pieces in place

fixed indexing issue

cleanup

added test

Checklist

For core and extension modules:

  • New unit tests have been added covering the changes.
  • Documentation has been updated (if change is visible to end users).
  • The REST API docs have been updated (when changing configuration objects or the REST controllers).
  • There is an issue in the GeoServer Jira (except for changes that do not affect administrators or end users in any way).
  • Commit message(s) must be in the form [GEOS-XYZWV] Title of the Jira ticket.
  • Bug fixes and small new features are presented as a single commit.
  • Each commit has a single objective (if there are multiple commits, each has a separate JIRA ticket describing its goal).

@turingtestfail turingtestfail requested a review from aaime November 15, 2024 16:54
@turingtestfail turingtestfail force-pushed the GEOS-11595-CoverageRats-PAM-CoverageViews branch 4 times, most recently from 3d8470b to 7f7b328 Compare November 27, 2024 17:20
Copy link
Member

@aaime aaime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks overall good, see comments below

return null;
}

private ResourceInfo createResourceInfoFromView() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically a one liner, can be in-lined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return resourceInfo;
}

private ResourceInfo createPAMResourceInfoFromView(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/** A ResourceInfo wrapper for CoverageViews */
public class CoverageViewResourceInfo extends DefaultResourceInfo {

public CoverageViewResourceInfo(CoverageView coverageView) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this subclass, just return DefaultResourceInfo, it can be instantiated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return inputAlphaNonNull;
}

public static class InputAlphaNonNullCoverages {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a better name... maybe ViewInputs? Also, does not seem like it needs to be public, package private should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed and made package private.

for (CoverageView.CoverageBand band : info.getBands()) {
for (CoverageView.InputCoverageBand inputCoverageBand : band.getInputCoverageBands()) {
// get the reader for the coverage associated with this input coverage band
GridCoverageReader reader1 = readers.get(inputCoverageBand.getCoverageName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see the need for the "1" suffix.

Suggested change
GridCoverageReader reader1 = readers.get(inputCoverageBand.getCoverageName());
GridCoverageReader reader = readers.get(inputCoverageBand.getCoverageName());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

*
* @param inputAlphaNonNullCoverages input alpha non-null coverages
*/
public CoverageViewPamResourceInfo(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not need like you need the coverages to build the "info" object, so I'd avoid collecting them, reading the raster can allocate actual memory for nothing, depending on the data source (e.g., GeoTIFF does delayed loading, but NetCDF does not).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coverages instantiation made optional

@@ -0,0 +1,126 @@
package org.geoserver.rat;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright header missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

…king CoverageViews

pieces in place

fixed indexing issue

cleanup

added test

transitioning to creating ResourceInfo

more cleanup

cleanup

cleanup pmd

missing copyright

cleanup style

PR Changes
@turingtestfail turingtestfail force-pushed the GEOS-11595-CoverageRats-PAM-CoverageViews branch from 7f7b328 to 6a66bbf Compare December 3, 2024 18:14
@aaime aaime merged commit e9b06e1 into geoserver:main Dec 5, 2024
16 checks passed
@aaime aaime added backport 2.25.x Instructs the bot to create a 2.25.x backport PR on merge backport 2.26.x Instructs the bot to create a 2.26.x backport PR on merge labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.25.x Instructs the bot to create a 2.25.x backport PR on merge backport 2.26.x Instructs the bot to create a 2.26.x backport PR on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants