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 performance issue that aggregation cache not used for coverages #1317

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,21 @@ public static Optional<FeatureDatasetCoverage> openGrib(String endpoint) {

}

/**
* @deprecated Use openNcmlString(String, String)
*/
@Deprecated
public static Optional<FeatureDatasetCoverage> openNcmlString(String ncml) throws IOException {
NetcdfDataset ncd = NetcdfDatasets.openNcmlDataset(new StringReader(ncml), null, null);
return openNcmlString(ncml, null);
}

/**
* @param ncml the NcML as a String
* @param location the URL location string of the NcML document,
* or may be just a unique name for caching purposes (if null, aggregation cache will not be used).
*/
public static Optional<FeatureDatasetCoverage> openNcmlString(String ncml, String location) throws IOException {
NetcdfDataset ncd = NetcdfDatasets.openNcmlDataset(new StringReader(ncml), location, null);

DtCoverageDataset gds = new DtCoverageDataset(ncd);
if (!gds.getGrids().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void testAggNewOpenAsCoverage() throws IOException, InvalidRangeException
ncml = ncmlStream.collect(Collectors.joining());
}
assertThat(ncml).isNotNull();
Optional<FeatureDatasetCoverage> fdc = CoverageDatasetFactory.openNcmlString(ncml);
Optional<FeatureDatasetCoverage> fdc = CoverageDatasetFactory.openNcmlString(ncml, null);
assertThat(fdc.isPresent()).isTrue();
List<CoverageCollection> cc = fdc.get().getCoverageCollections();
checkCoverages(cc);
Expand Down
Loading