Merge "Omaha #3071 Fix several errors identified by the log tool" into omaha_14.4.1

Former-commit-id: d301a71c9a [formerly 8c710088b9d9539c240de61b7d58963d3b83326e]
Former-commit-id: f5a89ce811
This commit is contained in:
Ron Anderson 2014-06-02 13:37:41 -05:00 committed by Gerrit Code Review
commit 0d44ffc6dc
3 changed files with 322 additions and 306 deletions

View file

@ -119,6 +119,8 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger;
* the same parm simultaneously.
* Added code to check the purge times when publishing and not publish
* data that is eligible to be purged.
* 05/22/14 #3071 randerso Expand publish time to time constraint quantum after truncating it
* to the purge time
*
* </pre>
*
@ -519,6 +521,11 @@ public class GridParmManager {
publishTime.setStart(startTime);
}
// expand publishTime to TimeContraints so full grids are
// published
publishTime = sourceInfo.getTimeConstraints()
.expandTRToQuantum(publishTime);
inventoryTimer.start();
ServerResponse<List<TimeRange>> invSr = sourceGP
.getGridInventory(publishTime);

View file

@ -114,6 +114,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* Added function to create a D2DGridDatabase object only if there is
* data in postgres for the desired model/reftime
* 04/17/2014 #2934 dgilling Change getGridParmInfo to use D2DParm's GridParmInfo.
* 05/22/2014 #3071 randerso Improved error logging
*
* </pre>
*
@ -808,10 +809,10 @@ public class D2DGridDatabase extends VGridDatabase {
long t0 = System.currentTimeMillis();
Integer fcstHr = null;
try {
// Gets the metadata from the grib metadata database
D2DParm parm = this.gfeParms.get(parmId);
Integer fcstHr = null;
if (!GridPathProvider.STATIC_PARAMETERS.contains(parmId
.getParmName())) {
fcstHr = parm.getTimeRangeToFcstHr().get(timeRange);
@ -822,9 +823,10 @@ public class D2DGridDatabase extends VGridDatabase {
}
d2dRecord = d2dDao.getGrid(d2dModelName, refTime,
parm.getComponents()[0], parm.getLevel(), fcstHr, gpi);
} catch (DataAccessLayerException e) {
} catch (Exception e) {
throw new GfeException(
"Error retrieving D2D Grid record from database", e);
"Error retrieving D2D Grid record from database for "
+ parmId + " fcstHr: " + fcstHr, e);
}
long t1 = System.currentTimeMillis();
@ -964,9 +966,10 @@ public class D2DGridDatabase extends VGridDatabase {
throw new GfeException("Unable to remap UV wind grids", e);
}
return;
} catch (DataAccessLayerException e) {
} catch (Exception e) {
throw new GfeException(
"Unable to retrieve wind grids from D2D database", e);
"Unable to retrieve wind grids from D2D database for "
+ parmId + " fcstHr: " + fcstHr, e);
}
} else {
@ -999,9 +1002,10 @@ public class D2DGridDatabase extends VGridDatabase {
throw new GfeException("Unable to remap wind grids", e);
}
return;
} catch (DataAccessLayerException e) {
} catch (Exception e) {
throw new GfeException(
"Unable to retrieve wind grids from D2D database", e);
"Unable to retrieve wind grids from D2D database for "
+ parmId + " fcstHr: " + fcstHr, e);
}
}
}

View file

@ -114,6 +114,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* 08/05/13 #1571 randerso Refactored to store GridParmInfo and ParmStorageinfo in postgres database
* 10/31/2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
* 12/10/13 #2611 randerso Change saveGridData to set update time when saving grids
* 05/29/2014 #3071 randerso Fix NPE in getCachedParmID
*
* </pre>
*
@ -2168,8 +2169,12 @@ public class IFPGridDatabase extends GridDatabase {
@Override
public ParmID getCachedParmID(ParmID parmId) throws UnknownParmIdException {
ParmID rval = this.parmStorageInfo.get(parmId.getCompositeName())
.getParmID();
ParmID rval = null;
ParmStorageInfo psi = this.parmStorageInfo.get(parmId
.getCompositeName());
if (psi != null) {
psi.getParmID();
}
if (rval == null) {
throw new UnknownParmIdException("ParmId: " + parmId.toString()