Issue #1504 GFE: Model data not always appearing automatically without CAVE restart
Change-Id: I1e52c111ec50a860a226d85bed6f0ab6dfebed58 Former-commit-id:62671efc2a
[formerly62671efc2a
[formerly 1fe63a2d5e20226f6124a9ca27b9f6272c49226c]] Former-commit-id:20b0761048
Former-commit-id:44807ba0d5
This commit is contained in:
parent
18296e08da
commit
cb23960f0e
11 changed files with 273 additions and 323 deletions
|
@ -73,6 +73,7 @@ import com.raytheon.viz.gfe.core.griddata.IGridData;
|
|||
* to use IFPClient
|
||||
* 02/23/12 #346 dgilling Implement a dispose method.
|
||||
* 03/01/12 #346 dgilling Re-order dispose method.
|
||||
* 01/21/12 #1504 randerso Cleaned up old debug logging to improve performance
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -411,6 +412,7 @@ public class DbParm extends Parm {
|
|||
// normal mode
|
||||
if (normal) {
|
||||
Arrays.sort(grids);
|
||||
|
||||
// Now replace the existing grids with the new ones
|
||||
replaceGrids(affectedTimeRange, grids);
|
||||
|
||||
|
@ -757,10 +759,10 @@ public class DbParm extends Parm {
|
|||
|
||||
List<LockRequest> lreq = new ArrayList<LockRequest>(timesToSave.size());
|
||||
for (int i = 0; i < timesToSave.size(); i++) {
|
||||
String msg = "Reverting " + getParmID() + " tr="
|
||||
+ timesToSave.get(i);
|
||||
statusHandler.handle(Priority.DEBUG, msg, new Exception("Debug: "
|
||||
+ msg));
|
||||
// String msg = "Reverting " + getParmID() + " tr="
|
||||
// + timesToSave.get(i);
|
||||
// statusHandler.handle(Priority.DEBUG, msg, new Exception("Debug: "
|
||||
// + msg));
|
||||
|
||||
boolean success = true;
|
||||
IGridData[] grids = null;
|
||||
|
|
|
@ -97,24 +97,6 @@ class ParmID(JUtil.JavaWrapperClass):
|
|||
def getParmId(self):
|
||||
return self.__pid.getParmId()
|
||||
|
||||
def setParmName(self, parmName):
|
||||
self.__pid.setParmName(parmName)
|
||||
|
||||
def setParmLevel(self, parmLevel):
|
||||
self.__pid.setParmLevel(parmLevel)
|
||||
|
||||
def setDbId(self, dbId):
|
||||
self.__pid.setDbId(dbId.toJavaObj())
|
||||
|
||||
def setCompositeName(self, compositeName):
|
||||
self.__pid.setCompositeName(compositeName)
|
||||
|
||||
def setShortParmId(self, shortParmId):
|
||||
self.__pid.setShortParmId(shortParmId)
|
||||
|
||||
def setParmId(self, parmId):
|
||||
self.__pid.setParmId(parmId)
|
||||
|
||||
@staticmethod
|
||||
def shortSerializer(parmID):
|
||||
return JavaParmID.shortSerializer(parmID.javaParmId())
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
package com.raytheon.edex.plugin.gfe.cache.d2dparms;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -40,15 +41,18 @@ import com.raytheon.edex.plugin.gfe.server.database.D2DGridDatabase;
|
|||
import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabase;
|
||||
import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabaseManager;
|
||||
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
|
||||
import com.raytheon.edex.plugin.gfe.util.SendNotifications;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
|
||||
import com.raytheon.uf.common.parameter.mapping.ParameterMapper;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GridUpdateNotification;
|
||||
import com.raytheon.uf.common.message.WsId;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.util.mapping.MultipleMappingException;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.site.SiteAwareRegistry;
|
||||
|
||||
|
@ -62,6 +66,10 @@ import com.raytheon.uf.edex.site.SiteAwareRegistry;
|
|||
* 01/08/09 1674 bphillip Initial creation
|
||||
* 11/05/12 #1310 dgilling Modify cache to listen to plugin
|
||||
* purged topic.
|
||||
* 01/18/13 #1504 randerso Moved D2D to GFE parameter name translation from
|
||||
* D2DParmIdCache toGfeIngestNotificationFilter.
|
||||
* Added code to match wind components and send
|
||||
* GridUpdateNotifications.
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -77,8 +85,19 @@ public class D2DParmIdCache {
|
|||
private static final Pattern RangeFilter = Pattern
|
||||
.compile("(.*?)\\d{1,2}hr");
|
||||
|
||||
private static final Map<String, String> WIND_COMP_PARMS;
|
||||
static {
|
||||
WIND_COMP_PARMS = new HashMap<String, String>();
|
||||
WIND_COMP_PARMS.put("uw", "vw");
|
||||
WIND_COMP_PARMS.put("vw", "uw");
|
||||
WIND_COMP_PARMS.put("ws", "wd");
|
||||
WIND_COMP_PARMS.put("wd", "ws");
|
||||
}
|
||||
|
||||
/** Map containing the ParmIDs */
|
||||
private Map<String, Set<String>> parmIds;
|
||||
private Map<DatabaseID, Set<ParmID>> parmIds;
|
||||
|
||||
private Map<ParmID, Set<TimeRange>> windComps;
|
||||
|
||||
private static D2DParmIdCache instance;
|
||||
|
||||
|
@ -93,7 +112,8 @@ public class D2DParmIdCache {
|
|||
* Constructs a new D2DParmIdCache
|
||||
*/
|
||||
public D2DParmIdCache() {
|
||||
parmIds = new HashMap<String, Set<String>>();
|
||||
parmIds = new HashMap<DatabaseID, Set<ParmID>>();
|
||||
windComps = new HashMap<ParmID, Set<TimeRange>>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,53 +160,18 @@ public class D2DParmIdCache {
|
|||
}
|
||||
|
||||
private void putParmIDInternal(ParmID parmId) {
|
||||
DatabaseID dbId = parmId.getDbId();
|
||||
synchronized (parmIds) {
|
||||
Set<ParmID> dbParms = parmIds.get(dbId);
|
||||
// Add the database entry to the map if it does not exist
|
||||
if (!parmIds.containsKey(parmId.getDbId().toString())) {
|
||||
parmIds.put(parmId.getDbId().toString(), new HashSet<String>());
|
||||
}
|
||||
// Insert the ParmID into the map
|
||||
String parmStr = parmId.toString();
|
||||
// Ensure that the staticTopo parameter has the correct
|
||||
// capitalization, or the smart init scripts will not be able to
|
||||
// find it
|
||||
String parmName = parmId.getParmName();
|
||||
if (parmName.equalsIgnoreCase("staticTopo")) {
|
||||
parmStr = parmStr.replace("statictopo", "staticTopo");
|
||||
} else if (parmName.equalsIgnoreCase("staticspacing")) {
|
||||
parmStr = parmStr.replace("staticspacing", "staticSpacing");
|
||||
} else if (parmName.equalsIgnoreCase("staticXspacing")) {
|
||||
parmStr = parmStr.replace("staticxspacing", "staticXspacing");
|
||||
} else if (parmName.equalsIgnoreCase("staticYspacing")) {
|
||||
parmStr = parmStr.replace("staticyspacing", "staticYspacing");
|
||||
} else if (parmName.equalsIgnoreCase("staticCoriolis")) {
|
||||
parmStr = parmStr.replace("staticcoriolis", "staticCoriolis");
|
||||
} else {
|
||||
String gfeParamName = null;
|
||||
try {
|
||||
gfeParamName = ParameterMapper.getInstance().lookupAlias(
|
||||
parmId.getParmName(), "gfeParamName");
|
||||
} catch (MultipleMappingException e) {
|
||||
statusHandler.handle(Priority.WARN,
|
||||
e.getLocalizedMessage(), e);
|
||||
gfeParamName = e.getArbitraryMapping();
|
||||
}
|
||||
parmStr = parmStr.replaceFirst(
|
||||
parmId.getParmName(),
|
||||
gfeParamName);
|
||||
}
|
||||
parmIds.get(parmId.getDbId().toString()).add(parmStr);
|
||||
}
|
||||
if (dbParms == null) {
|
||||
dbParms = new HashSet<ParmID>();
|
||||
parmIds.put(dbId, dbParms);
|
||||
}
|
||||
|
||||
/**
|
||||
* Places a parmId into the cache
|
||||
*
|
||||
* @param parmId
|
||||
* String representation of a ParmID
|
||||
*/
|
||||
public void putParmID(String parmId) {
|
||||
putParmID(new ParmID(parmId));
|
||||
// Insert the ParmID into the map
|
||||
dbParms.add(parmId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,18 +194,10 @@ public class D2DParmIdCache {
|
|||
* @return The ParmIDs in the given DatabaseID
|
||||
*/
|
||||
public List<ParmID> getParmIDs(DatabaseID dbId) {
|
||||
Set<String> parmStrings = null;
|
||||
List<ParmID> parms = Collections.emptyList();
|
||||
synchronized (parmIds) {
|
||||
if (parmIds.containsKey(dbId.toString())) {
|
||||
parmStrings = new HashSet<String>(parmIds.get(dbId.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
List<ParmID> parms = Collections.emptyList();
|
||||
if (parmStrings != null) {
|
||||
parms = new ArrayList<ParmID>(parmStrings.size());
|
||||
for (String parmStr : parmStrings) {
|
||||
parms.add(new ParmID(parmStr));
|
||||
parms = new ArrayList<ParmID>(parmIds.get(dbId));
|
||||
}
|
||||
}
|
||||
return parms;
|
||||
|
@ -244,14 +221,9 @@ public class D2DParmIdCache {
|
|||
* @return The list of DatabaseIDs
|
||||
*/
|
||||
public List<DatabaseID> getDatabaseIDs() {
|
||||
Set<String> dbStrs;
|
||||
List<DatabaseID> dbIds = null;
|
||||
synchronized (parmIds) {
|
||||
dbStrs = new HashSet<String>(parmIds.keySet());
|
||||
}
|
||||
|
||||
List<DatabaseID> dbIds = new ArrayList<DatabaseID>(dbStrs.size());
|
||||
for (String dbId : dbStrs) {
|
||||
dbIds.add(new DatabaseID(dbId));
|
||||
dbIds = new ArrayList<DatabaseID>(parmIds.keySet());
|
||||
}
|
||||
return dbIds;
|
||||
}
|
||||
|
@ -382,6 +354,19 @@ public class D2DParmIdCache {
|
|||
for (DatabaseID dbId : dbsToRemove) {
|
||||
GridParmManager.removeDbFromMap(dbId);
|
||||
}
|
||||
// purge the windComps
|
||||
List<ParmID> wcToRemove = new ArrayList<ParmID>();
|
||||
synchronized (windComps) {
|
||||
for (ParmID id : windComps.keySet()) {
|
||||
if (dbsToRemove.contains(id.getDbId())) {
|
||||
wcToRemove.add(id);
|
||||
}
|
||||
}
|
||||
for (ParmID id : wcToRemove) {
|
||||
windComps.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
statusHandler.handle(Priority.EVENTA,
|
||||
"Total time to build D2DParmIdCache for " + siteID
|
||||
+ " took " + (System.currentTimeMillis() - start)
|
||||
|
@ -397,7 +382,7 @@ public class D2DParmIdCache {
|
|||
public long getSize() {
|
||||
long size = 0;
|
||||
synchronized (parmIds) {
|
||||
for (Set<String> parms : parmIds.values()) {
|
||||
for (Set<ParmID> parms : parmIds.values()) {
|
||||
size += parms.size();
|
||||
}
|
||||
}
|
||||
|
@ -410,4 +395,63 @@ public class D2DParmIdCache {
|
|||
buildCache(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void processGridUpdateNotification(GridUpdateNotification gun) {
|
||||
ParmID parmId = gun.getParmId();
|
||||
|
||||
String otherCompName = WIND_COMP_PARMS.get(parmId.getParmName());
|
||||
if (otherCompName == null) {
|
||||
// if it's not a wind component just add it to the cache
|
||||
putParmID(parmId);
|
||||
} else {
|
||||
Set<TimeRange> windTrs = null;
|
||||
synchronized (windComps) {
|
||||
// add this parms times to windComps map
|
||||
Set<TimeRange> trs = windComps.get(parmId);
|
||||
if (trs == null) {
|
||||
trs = new HashSet<TimeRange>();
|
||||
windComps.put(parmId, trs);
|
||||
}
|
||||
trs.addAll(gun.getHistories().keySet());
|
||||
|
||||
// get the other components times
|
||||
ParmID otherCompId = new ParmID(otherCompName,
|
||||
parmId.getDbId(), parmId.getParmLevel());
|
||||
Set<TimeRange> otherTrs = windComps.get(otherCompId);
|
||||
|
||||
// if we have both components
|
||||
if (otherTrs != null) {
|
||||
// find times where we have both components
|
||||
windTrs = new HashSet<TimeRange>(trs);
|
||||
windTrs.retainAll(otherTrs);
|
||||
|
||||
// remove the matching times since we don't need them
|
||||
// anymore
|
||||
trs.removeAll(windTrs);
|
||||
otherTrs.removeAll(windTrs);
|
||||
}
|
||||
}
|
||||
|
||||
// if we found any matching times for both components
|
||||
if (windTrs != null && !windTrs.isEmpty()) {
|
||||
// add the wind parmId to the cache
|
||||
ParmID windId = new ParmID("wind", parmId.getDbId(),
|
||||
parmId.getParmLevel());
|
||||
putParmID(windId);
|
||||
|
||||
// create GridUpdateNotifications for the wind parm
|
||||
Map<TimeRange, List<GridDataHistory>> history = new HashMap<TimeRange, List<GridDataHistory>>();
|
||||
ArrayList<GridUpdateNotification> guns = new ArrayList<GridUpdateNotification>(
|
||||
windTrs.size());
|
||||
for (TimeRange tr : windTrs) {
|
||||
history.put(tr, Arrays.asList(new GridDataHistory(
|
||||
GridDataHistory.OriginType.INITIALIZED, windId, tr,
|
||||
null, (WsId) null)));
|
||||
guns.add(new GridUpdateNotification(windId, tr, history,
|
||||
null, windId.getDbId().getSiteId()));
|
||||
}
|
||||
SendNotifications.send(guns);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ import com.raytheon.uf.common.dataplugin.gfe.server.notify.GridUpdateNotificatio
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 1/10/09 1674 bphillip Initial creation
|
||||
* 10/06/09 3172 njensen Based on grib notification
|
||||
* 01/18/13 #1504 randerso Changed to send full GridUpdateNotification
|
||||
* to D2DParmIdCache
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -53,8 +55,8 @@ public class D2DParmIdFilter {
|
|||
public void updateParmIdCache(List<? extends GfeNotification> notifications) {
|
||||
for (GfeNotification notify : notifications) {
|
||||
if (notify instanceof GridUpdateNotification) {
|
||||
D2DParmIdCache.getInstance().putParmID(
|
||||
((GridUpdateNotification) notify).getParmId());
|
||||
D2DParmIdCache.getInstance().processGridUpdateNotification(
|
||||
(GridUpdateNotification) notify);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,6 +108,8 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
|||
* 10/10/12 #1260 randerso Added check to ensure db can be created before
|
||||
* adding it to the inventory
|
||||
* 12/06/12 #1394 rjpeter Optimized D2D grid access.
|
||||
* 01/21/12 #1504 randerso Back ported change to use ParameterMapper into 13.1.2
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
|
|
@ -21,7 +21,6 @@ package com.raytheon.edex.plugin.gfe.server.notify;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -54,10 +53,13 @@ import com.raytheon.uf.common.dataplugin.gfe.server.notify.GridUpdateNotificatio
|
|||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
||||
import com.raytheon.uf.common.message.WsId;
|
||||
import com.raytheon.uf.common.parameter.mapping.ParameterMapper;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.util.mapping.MultipleMappingException;
|
||||
import com.raytheon.uf.edex.core.EDEXUtil;
|
||||
|
||||
/**
|
||||
|
@ -71,6 +73,8 @@ import com.raytheon.uf.edex.core.EDEXUtil;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 12, 2011 dgilling Initial creation
|
||||
* Sep 19, 2012 jdynina DR 15442 fix
|
||||
* Jan 18, 2013 #1504 randerso Moved D2D to GFE parameter name translation from
|
||||
* D2DParmIdCache to GfeIngestNotificationFilter
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -80,7 +84,7 @@ import com.raytheon.uf.edex.core.EDEXUtil;
|
|||
|
||||
public class GfeIngestNotificationFilter {
|
||||
|
||||
private static final transient IUFStatusHandler handler = UFStatus
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GfeIngestNotificationFilter.class);
|
||||
|
||||
private SmartInitQueue smartInitQueue = null;
|
||||
|
@ -106,8 +110,7 @@ public class GfeIngestNotificationFilter {
|
|||
}
|
||||
}
|
||||
|
||||
public void filterGridRecords(List<GridRecord> gridRecords,
|
||||
Date arrivalTime)
|
||||
public void filterGridRecords(List<GridRecord> gridRecords, Date arrivalTime)
|
||||
throws Exception {
|
||||
StringBuilder initNameBuilder = new StringBuilder(120);
|
||||
|
||||
|
@ -126,7 +129,8 @@ public class GfeIngestNotificationFilter {
|
|||
try {
|
||||
config = IFPServerConfigManager.getServerConfig(site);
|
||||
} catch (GfeConfigurationException e) {
|
||||
handler.error("Unable to retrieve site config for " + site, e);
|
||||
statusHandler.error("Unable to retrieve site config for "
|
||||
+ site, e);
|
||||
continue;
|
||||
}
|
||||
for (GridRecord grid : gridRecords) {
|
||||
|
@ -152,24 +156,30 @@ public class GfeIngestNotificationFilter {
|
|||
}
|
||||
|
||||
String abbrev = grid.getParameter().getAbbreviation();
|
||||
String level = GridTranslator.getShortLevelName(
|
||||
grid
|
||||
.getLevel().getMasterLevel().getName(), grid
|
||||
.getLevel().getLevelonevalue(), grid.getLevel()
|
||||
.getLeveltwovalue());
|
||||
ParmID parmID = new ParmID(abbrev, dbId, level);
|
||||
String gfeParmName = null;
|
||||
try {
|
||||
gfeParmName = ParameterMapper.getInstance()
|
||||
.lookupAlias(abbrev, "gfeParamName");
|
||||
} catch (MultipleMappingException e) {
|
||||
statusHandler.handle(Priority.WARN,
|
||||
e.getLocalizedMessage(), e);
|
||||
gfeParmName = e.getArbitraryMapping();
|
||||
}
|
||||
|
||||
if (!gridInv.containsKey(parmID)) {
|
||||
gridInv.put(parmID, new ArrayList<TimeRange>());
|
||||
String level = GridTranslator.getShortLevelName(grid
|
||||
ParmID parmID = new ParmID(gfeParmName, dbId, level);
|
||||
|
||||
List<TimeRange> trs = gridInv.get(parmID);
|
||||
if (trs == null) {
|
||||
trs = new ArrayList<TimeRange>();
|
||||
gridInv.put(parmID, trs);
|
||||
}
|
||||
TimeRange validPeriod = grid.getDataTime().getValidPeriod();
|
||||
if (validPeriod.getDuration() > 0) {
|
||||
gridInv.get(parmID).add(validPeriod);
|
||||
trs.add(validPeriod);
|
||||
} else {
|
||||
gridInv.get(parmID).add(
|
||||
new TimeRange(grid.getDataTime()
|
||||
.getValidPeriod().getStart(),
|
||||
3600 * 1000));
|
||||
trs.add(new TimeRange(grid.getDataTime()
|
||||
.getValidPeriod().getStart(), 3600 * 1000));
|
||||
}
|
||||
|
||||
List<String> siteInitModules = config.initModels(gfeModel);
|
||||
|
@ -201,23 +211,20 @@ grid
|
|||
|
||||
// DR 15442 - move last for loop out of the for loop at line 110
|
||||
for (ParmID parmId : gridInv.keySet()) {
|
||||
Map<TimeRange, List<GridDataHistory>> hist = new HashMap<TimeRange, List<GridDataHistory>>();
|
||||
try {
|
||||
List<TimeRange> trs = gridInv.get(parmId);
|
||||
Collections.sort(trs);
|
||||
for (TimeRange time : trs) {
|
||||
List<GridDataHistory> histList = new ArrayList<GridDataHistory>();
|
||||
histList.add(new GridDataHistory(
|
||||
GridDataHistory.OriginType.INITIALIZED,
|
||||
parmId, time, null, (WsId) null));
|
||||
GridDataHistory.OriginType.INITIALIZED, parmId,
|
||||
time, null, (WsId) null));
|
||||
Map<TimeRange, List<GridDataHistory>> hist = new HashMap<TimeRange, List<GridDataHistory>>();
|
||||
hist.put(time, histList);
|
||||
guns.add(new GridUpdateNotification(parmId, time, hist,
|
||||
null, parmId.getDbId().getSiteId()));
|
||||
}
|
||||
guns.add(new GridUpdateNotification(parmId,
|
||||
new TimeRange(trs.get(0).getStart(), trs.get(
|
||||
trs.size() - 1).getEnd()), hist, null,
|
||||
parmId.getDbId().getSiteId()));
|
||||
} catch (Exception e) {
|
||||
handler.error("Unable to retrieve grid history for "
|
||||
statusHandler.error("Unable to retrieve grid history for "
|
||||
+ parmId.toString(), e);
|
||||
}
|
||||
}
|
||||
|
@ -225,7 +232,8 @@ grid
|
|||
try {
|
||||
sendNotifications(guns);
|
||||
} catch (Exception e) {
|
||||
handler.error("Unable to send grib ingest notifications", e);
|
||||
statusHandler.error("Unable to send grib ingest notifications",
|
||||
e);
|
||||
}
|
||||
|
||||
smartInitQueue.addInits(inits.values());
|
||||
|
@ -233,8 +241,7 @@ grid
|
|||
}
|
||||
|
||||
public void filterSatelliteRecords(List<SatelliteRecord> records,
|
||||
Date arrivalTime)
|
||||
throws Exception {
|
||||
Date arrivalTime) throws Exception {
|
||||
StringBuilder initNameBuilder = new StringBuilder(120);
|
||||
|
||||
Set<String> activeSites = GFESiteActivation.getInstance()
|
||||
|
@ -249,7 +256,8 @@ grid
|
|||
try {
|
||||
config = IFPServerConfigManager.getServerConfig(site);
|
||||
} catch (GfeConfigurationException e) {
|
||||
handler.error("Error retrieiving site config for " + site, e);
|
||||
statusHandler.error(
|
||||
"Error retrieiving site config for " + site, e);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -298,8 +306,8 @@ grid
|
|||
try {
|
||||
sendNotifications(guns);
|
||||
} catch (Exception e) {
|
||||
handler.error("Unable to send satellite ingest notifications",
|
||||
e);
|
||||
statusHandler.error(
|
||||
"Unable to send satellite ingest notifications", e);
|
||||
}
|
||||
|
||||
smartInitQueue.addInits(inits.values());
|
||||
|
|
|
@ -50,6 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdap
|
|||
* 8/19/09 2899 njensen Rewrote equals() for performance
|
||||
* 5/08/12 #600 dgilling Implement clone().
|
||||
* 6/25/12 #766 dgilling Fix isValid().
|
||||
* 01/18/13 #1504 randerso Removed setters since class should be immutable
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -487,42 +488,6 @@ public class DatabaseID implements Serializable, Comparable<DatabaseID>,
|
|||
return date;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setFormat(DataType format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
public void setFormat(String format) {
|
||||
if (format.equals("GRID")) {
|
||||
this.format = DataType.GRID;
|
||||
} else {
|
||||
this.format = DataType.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public void setModelName(String modelName) {
|
||||
this.modelName = modelName;
|
||||
}
|
||||
|
||||
public void setModelTime(String modelTime) {
|
||||
this.modelTime = modelTime;
|
||||
}
|
||||
|
||||
public void setModelId(String modelId) {
|
||||
this.modelId = modelId.intern();
|
||||
}
|
||||
|
||||
public void setShortModelId(String shortModelId) {
|
||||
this.shortModelId = shortModelId;
|
||||
}
|
||||
|
||||
public Date getModelTimeAsDate() {
|
||||
if (this.modelTime.equals(NO_MODEL_TIME)) {
|
||||
return new Date(0);
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdap
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/6/08 875 bphillip Initial Creation
|
||||
* 5/8/12 #600 dgilling Implement clone().
|
||||
* 01/18/13 #1504 randerso Removed setters since class should be immutable
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -95,12 +96,7 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append(parmName).append("_");
|
||||
buffer.append(parmLevel).append(":");
|
||||
buffer.append(dbId.toString());
|
||||
|
||||
return buffer.toString();
|
||||
return this.parmId;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -140,7 +136,6 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
this.parmName = parmName;
|
||||
this.parmLevel = defaultLevel();
|
||||
this.dbId = new DatabaseID(parmModel);
|
||||
this.compositeName = parmName + "_" + defaultLevel();
|
||||
encodeIdentifier();
|
||||
}
|
||||
|
||||
|
@ -158,7 +153,6 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
this.parmName = parmName;
|
||||
this.parmLevel = level;
|
||||
this.dbId = new DatabaseID(parmModel);
|
||||
this.compositeName = parmName + "_" + level;
|
||||
encodeIdentifier();
|
||||
}
|
||||
|
||||
|
@ -170,7 +164,6 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
*/
|
||||
public ParmID(String parmIdentifier) {
|
||||
decodeIdentifier(parmIdentifier);
|
||||
this.compositeName = this.parmName + "_" + this.parmLevel;
|
||||
encodeIdentifier();
|
||||
}
|
||||
|
||||
|
@ -186,7 +179,6 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
this.parmName = parmName;
|
||||
this.parmLevel = defaultLevel();
|
||||
this.dbId = dbId;
|
||||
this.compositeName = parmName + "_" + defaultLevel();
|
||||
encodeIdentifier();
|
||||
}
|
||||
|
||||
|
@ -204,7 +196,6 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
this.parmName = parmName;
|
||||
this.parmLevel = level;
|
||||
this.dbId = dbId;
|
||||
this.compositeName = parmName + "_" + level;
|
||||
encodeIdentifier();
|
||||
}
|
||||
|
||||
|
@ -333,12 +324,10 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
*/
|
||||
|
||||
private void encodeIdentifier() {
|
||||
this.compositeName = this.parmName + "_" + this.parmLevel;
|
||||
shortParmId = this.compositeName + ":" + dbId.getShortModelId();
|
||||
|
||||
if (parmId == null || parmId.length() == 0) {
|
||||
parmId = this.compositeName + ":" + dbId.getModelId();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the parmName
|
||||
|
@ -442,30 +431,6 @@ public class ParmID implements Comparable<ParmID>, Serializable,
|
|||
return true;
|
||||
}
|
||||
|
||||
public void setParmName(String parmName) {
|
||||
this.parmName = parmName;
|
||||
}
|
||||
|
||||
public void setParmLevel(String parmLevel) {
|
||||
this.parmLevel = parmLevel;
|
||||
}
|
||||
|
||||
public void setDbId(DatabaseID dbId) {
|
||||
this.dbId = dbId;
|
||||
}
|
||||
|
||||
public void setCompositeName(String compositeName) {
|
||||
this.compositeName = compositeName;
|
||||
}
|
||||
|
||||
public void setShortParmId(String shortParmId) {
|
||||
this.shortParmId = shortParmId;
|
||||
}
|
||||
|
||||
public void setParmId(String parmId) {
|
||||
this.parmId = parmId;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -48,50 +48,30 @@ class ParmID(object):
|
|||
else:
|
||||
self.parmLevel = level
|
||||
|
||||
self.compositeName = self.parmName + "_" + self.parmLevel
|
||||
self.__encodeIdentifier()
|
||||
|
||||
elif parmIdentifier is not None:
|
||||
self.__decodeIdentifier(parmIdentifier)
|
||||
self.compositeName = self.parmName + "_" + self.parmLevel
|
||||
self.__encodeIdentifier()
|
||||
|
||||
def getParmName(self):
|
||||
return self.parmName
|
||||
|
||||
def setParmName(self, parmName):
|
||||
self.parmName = parmName
|
||||
|
||||
def getParmLevel(self):
|
||||
return self.parmLevel
|
||||
|
||||
def setParmLevel(self, parmLevel):
|
||||
self.parmLevel = parmLevel
|
||||
|
||||
def getDbId(self):
|
||||
return self.dbId
|
||||
|
||||
def setDbId(self, dbId):
|
||||
self.dbId = dbId
|
||||
|
||||
def getCompositeName(self):
|
||||
return self.compositeName
|
||||
|
||||
def setCompositeName(self, compositeName):
|
||||
self.compositeName = compositeName
|
||||
|
||||
def getShortParmId(self):
|
||||
return self.shortParmId
|
||||
|
||||
def setShortParmId(self, shortParmId):
|
||||
self.shortParmId = shortParmId
|
||||
|
||||
def getParmId(self):
|
||||
return self.parmId
|
||||
|
||||
def setParmId(self, parmId):
|
||||
self.parmId = parmId
|
||||
|
||||
def __decodeIdentifier(self, parmIdentifier):
|
||||
parts = parmIdentifier.split(":")
|
||||
nameLevel = parts[0].split("_")
|
||||
|
@ -104,8 +84,8 @@ class ParmID(object):
|
|||
self.parmLevel = self.defaultLevel()
|
||||
|
||||
def __encodeIdentifier(self):
|
||||
self.compositeName = self.parmName + "_" + self.parmLevel
|
||||
self.shortParmId = self.compositeName + ":" + self.dbId.getShortModelId()
|
||||
if self.parmId is None or len(self.parmId) == 0:
|
||||
self.parmId = self.compositeName + ":" + self.dbId.getModelId()
|
||||
|
||||
def isValid(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue