Issue #3046 Dupe checker for DD gridded retrievals got broken.
Change-Id: Iaec4c848e0a9ef06610153ce03f7c4d45deb870a Former-commit-id:83e43622fb
[formerlyaa8fdb1e5a
] [formerly83e43622fb
[formerlyaa8fdb1e5a
] [formerlyb5a997054b
[formerly 2c957466d5a4877ab7c20ddf75ea6fa8e6333c76]]] Former-commit-id:b5a997054b
Former-commit-id:b8ee6fb194
[formerlyf6a6467a9d
] Former-commit-id:83f8def438
This commit is contained in:
parent
6e961f7010
commit
1b01d0d06d
2 changed files with 22 additions and 18 deletions
|
@ -32,6 +32,8 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
|||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.util.GridUtil;
|
||||
import com.raytheon.uf.edex.datadelivery.retrieval.util.ResponseProcessingUtilities;
|
||||
|
||||
|
@ -50,6 +52,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.util.ResponseProcessingUtilit
|
|||
* May 12, 2013 753 dhladky Altered to be more flexible with other types
|
||||
* May 31, 2013 2038 djohnson Rename setPdos to allocatePdoArray.
|
||||
* Sept 25, 2013 1797 dhladky separated time from gridded time
|
||||
* Apr 22, 2014 3046 dhladky Got rid of duplicate code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -58,6 +61,9 @@ import com.raytheon.uf.edex.datadelivery.retrieval.util.ResponseProcessingUtilit
|
|||
*/
|
||||
public class GridMetadataAdapter extends AbstractMetadataAdapter<Integer> {
|
||||
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GridMetadataAdapter.class);
|
||||
|
||||
public GridMetadataAdapter() {
|
||||
}
|
||||
|
||||
|
@ -91,12 +97,6 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter<Integer> {
|
|||
GridCoverage gridCoverage = ((GriddedCoverage) attXML.getCoverage())
|
||||
.getRequestGridCoverage();
|
||||
|
||||
try {
|
||||
gridCoverage = getCoverageFromCache(gridCoverage);
|
||||
} catch (Exception e) {
|
||||
throw new InstantiationException(e.getMessage());
|
||||
}
|
||||
|
||||
if (time.getSelectedTimeIndices() != null) {
|
||||
int bin = 0;
|
||||
for (String ensemble : ensembles) {
|
||||
|
@ -128,19 +128,16 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter<Integer> {
|
|||
*/
|
||||
private GridRecord populateGridRecord(String name, Parameter parm,
|
||||
Level level, String ensembleId, GridCoverage gridCoverage) {
|
||||
return ResponseProcessingUtilities.getGridRecord(name, parm, level,
|
||||
ensembleId, gridCoverage);
|
||||
|
||||
GridRecord rec = null;
|
||||
|
||||
try {
|
||||
rec = ResponseProcessingUtilities.getGridRecord(name, parm, level, ensembleId, gridCoverage);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Couldn't create grid record! "+e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to find the coverage in the cache
|
||||
*
|
||||
* @param coverage
|
||||
* @return
|
||||
*/
|
||||
@VisibleForTesting
|
||||
GridCoverage getCoverageFromCache(GridCoverage coverage) {
|
||||
return ResponseProcessingUtilities.getCoverageFromCache(coverage);
|
||||
return rec;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
|
|
@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Sept 25, 2013 1797 dhladky separated time from gridded time
|
||||
* Oct 10, 2013 1797 bgonzale Refactored registry Time objects.
|
||||
* Apr 22, 2014 3046 dhladky Sample URI creation for DD dupe check got broken.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -74,6 +75,7 @@ public class ResponseProcessingUtilities {
|
|||
parameter.setUnitString(parm.getUnits());
|
||||
|
||||
GridRecord record = new GridRecord();
|
||||
gridCoverage = getCoverageFromCache(gridCoverage);
|
||||
record.setLocation(gridCoverage);
|
||||
record.setLevel(level);
|
||||
record.setParameter(parameter);
|
||||
|
@ -82,6 +84,11 @@ public class ResponseProcessingUtilities {
|
|||
return record;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a grid coverage from the DB cache system wide.
|
||||
* @param coverage
|
||||
* @return
|
||||
*/
|
||||
public static GridCoverage getCoverageFromCache(GridCoverage coverage) {
|
||||
return GridCoverageLookup.getInstance().getCoverage(coverage, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue