Merge tag 'OB_14.3.1-32m' into omaha_14.4.1

Conflicts:
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java
	cave/com.raytheon.viz.volumebrowser/localization/volumebrowser/VbSources.xml
	edexOsgi/build.edex/esb/conf/logback-ingest.xml
	edexOsgi/com.raytheon.uf.edex.core/src/com/raytheon/uf/edex/core/IMessageProducer.java
	edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/MessageProducer.java

Former-commit-id: f2f468fb55 [formerly 79a5171143] [formerly a8a97501ac] [formerly a8a97501ac [formerly a16abe1b8b]] [formerly f2f468fb55 [formerly 79a5171143] [formerly a8a97501ac] [formerly a8a97501ac [formerly a16abe1b8b]] [formerly 9de825c332 [formerly a8a97501ac [formerly a16abe1b8b] [formerly 9de825c332 [formerly 565efec2ebe5a3a1a009d213a77617f4a593aa6b]]]]]
Former-commit-id: 9de825c332
Former-commit-id: 2c93b5896b [formerly 2955b2190c] [formerly 548f32e067] [formerly d4eb1c8ea6b361e80e76a7f995f909b42100e4aa [formerly 29ce0315e9304041fd7bae8c79ce27a5695cbd1b] [formerly 548f32e067 [formerly 5e6aa15038]]]
Former-commit-id: e5e84f410a43cf0e927898af4a02fadb46fa885b [formerly 64fc53589e5e7392560fcbddd6c72901e00e8798] [formerly 399b05ad5e [formerly 2695a061f4]]
Former-commit-id: 399b05ad5e
Former-commit-id: 82204ef840
This commit is contained in:
Steve Harris 2014-11-10 08:42:01 -06:00
commit fa04151399
27 changed files with 412 additions and 292 deletions

View file

@ -102,6 +102,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 12/09/2013 2367 dgilling Instantiate ProcedureJobPool here. * 12/09/2013 2367 dgilling Instantiate ProcedureJobPool here.
* 05/22/2014 3110 randerso Attach router to edex.alerts.gfe earlier * 05/22/2014 3110 randerso Attach router to edex.alerts.gfe earlier
* 09/09/2014 3592 randerso Added call to SampleSetManager.dispose() * 09/09/2014 3592 randerso Added call to SampleSetManager.dispose()
* 10/30/2014 3775 randerso Added parmCacheInit to initStatus
* *
* </pre> * </pre>
* *
@ -223,7 +224,7 @@ public class DataManager {
NotificationManagerJob.addObserver("edex.alerts.gfe", this.router); NotificationManagerJob.addObserver("edex.alerts.gfe", this.router);
this.parmManager = new ParmManager(this); this.parmManager = new ParmManager(this);
GFEParmCacheInitJob cacheJob = new GFEParmCacheInitJob(this.parmManager); GFEParmCacheInitJob cacheJob = new GFEParmCacheInitJob(this);
cacheJob.setSystem(true); cacheJob.setSystem(true);
cacheJob.schedule(); cacheJob.schedule();
this.refManager = new ReferenceSetManager(this); this.refManager = new ReferenceSetManager(this);

View file

@ -29,6 +29,7 @@ package com.raytheon.viz.gfe.core.internal;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 25, 2011 njensen Initial creation * Jan 25, 2011 njensen Initial creation
* Oct 30, 2014 #3775 randerso Added parmCacheInit to initStatus
* *
* </pre> * </pre>
* *
@ -38,12 +39,22 @@ package com.raytheon.viz.gfe.core.internal;
public class DataMgrInitStatus { public class DataMgrInitStatus {
private boolean parmCacheInitDone = false;
private boolean iscInitDone = false; private boolean iscInitDone = false;
private boolean selectTRMgrDone = false; private boolean selectTRMgrDone = false;
private boolean sampleSetMgrDone = false; private boolean sampleSetMgrDone = false;
public boolean isParmCacheInitDone() {
return parmCacheInitDone;
}
public void setParmCacheInitDone(boolean parmCacheInitDone) {
this.parmCacheInitDone = parmCacheInitDone;
}
public boolean isIscInitDone() { public boolean isIscInitDone() {
return iscInitDone; return iscInitDone;
} }
@ -69,7 +80,8 @@ public class DataMgrInitStatus {
} }
public boolean isDone() { public boolean isDone() {
return iscInitDone && sampleSetMgrDone && selectTRMgrDone; return parmCacheInitDone && iscInitDone && sampleSetMgrDone
&& selectTRMgrDone;
} }
} }

View file

@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import com.raytheon.viz.gfe.core.IParmManager; import com.raytheon.viz.gfe.core.DataManager;
/** /**
* Job for initializing a cache in memory of all available parms. * Job for initializing a cache in memory of all available parms.
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.core.IParmManager;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 19, 2011 njensen Initial creation * Jan 19, 2011 njensen Initial creation
* Oct 30, 2014 #3775 randerso Added parmCacheInit to initStatus
* *
* </pre> * </pre>
* *
@ -45,11 +46,11 @@ import com.raytheon.viz.gfe.core.IParmManager;
public class GFEParmCacheInitJob extends Job { public class GFEParmCacheInitJob extends Job {
private IParmManager parmMgr; private DataManager dataMgr;
public GFEParmCacheInitJob(IParmManager pm) { public GFEParmCacheInitJob(DataManager dataMgr) {
super("Parm Cache Initialization"); super("Parm Cache Initialization");
this.parmMgr = pm; this.dataMgr = dataMgr;
} }
/* /*
@ -61,7 +62,8 @@ public class GFEParmCacheInitJob extends Job {
@Override @Override
protected IStatus run(IProgressMonitor monitor) { protected IStatus run(IProgressMonitor monitor) {
long t0 = System.currentTimeMillis(); long t0 = System.currentTimeMillis();
this.parmMgr.getAllAvailableParms(); this.dataMgr.getParmManager().getAllAvailableParms();
this.dataMgr.getInitStatus().setParmCacheInitDone(true);
System.out.println("GFEParmCacheInitJob took: " System.out.println("GFEParmCacheInitJob took: "
+ (System.currentTimeMillis() - t0) + "ms"); + (System.currentTimeMillis() - t0) + "ms");

View file

@ -143,6 +143,8 @@ import com.raytheon.viz.gfe.types.MutableInteger;
* 04/02/2014 #2969 randerso Fix error when Toop parm is unloaded. * 04/02/2014 #2969 randerso Fix error when Toop parm is unloaded.
* 05/28/2014 #3110 randerso Remove #3105 changes * 05/28/2014 #3110 randerso Remove #3105 changes
* 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles() * 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles()
* 10/08/2014 #3684 randerso Minor code optimization
* 10/30/2014 #3775 randerso Changed to createMutableDb before getting initial database inventory
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -359,9 +361,6 @@ public class ParmManager implements IParmManager, IMessageClient {
dbCategories = Arrays.asList(prefs.getStringArray("dbTypes")); dbCategories = Arrays.asList(prefs.getStringArray("dbTypes"));
this.availableDatabases = new HashSet<DatabaseID>(
getDatabaseInventory());
this.dbInvChangeListener = new AbstractGFENotificationObserver<DBInvChangeNotification>( this.dbInvChangeListener = new AbstractGFENotificationObserver<DBInvChangeNotification>(
DBInvChangeNotification.class) { DBInvChangeNotification.class) {
@ -1282,6 +1281,20 @@ public class ParmManager implements IParmManager, IMessageClient {
} }
private void updateDatabaseLists() throws GFEServerException { private void updateDatabaseLists() throws GFEServerException {
boolean containsMutable = false;
DatabaseID mutableDbId = getMutableDatabase();
if (mutableDbId.isValid()) {
// createMutableDb is it doesn't already exist
ServerResponse<?> sr = this.dataManager.getClient().createNewDb(
mutableDbId);
containsMutable = sr.isOkay();
}
if (this.availableDatabases == null) {
this.availableDatabases = new HashSet<DatabaseID>(
getDatabaseInventory());
}
this.availableServerDatabases = new ArrayList<DatabaseID>( this.availableServerDatabases = new ArrayList<DatabaseID>(
availableDatabases); availableDatabases);
this.availableVCParmDatabases = determineVCParmDatabases(vcModules); this.availableVCParmDatabases = determineVCParmDatabases(vcModules);
@ -1307,39 +1320,24 @@ public class ParmManager implements IParmManager, IMessageClient {
} }
Collections.sort(this.availableServerDatabases); Collections.sort(this.availableServerDatabases);
DatabaseID mutableDbId = getMutableDatabase(); if (containsMutable) {
if (mutableDbId.isValid()) { // order of isc databases is important, since ISCDataAccess will
boolean containsMutable = availableServerDatabases // look for the first match. That's why we don't use
.contains(mutableDbId); // availableDbs()
// and simplify the three loops into one.
if (!containsMutable) { for (DatabaseID dbid : availableVCParmDatabases) {
ServerResponse<?> sr = this.dataManager.getClient() if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) {
.createNewDb(mutableDbId); iscDbs.add(dbid);
containsMutable = sr.isOkay(); }
} }
for (DatabaseID dbid : availableVParmDatabases) {
if (containsMutable) { if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) {
// order of isc databases is important, since ISCDataAccess will iscDbs.add(dbid);
// look for the first match. That's why we don't use
// availableDbs()
// and simplify the three loops into one.
for (DatabaseID dbid : availableVCParmDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
} }
for (DatabaseID dbid : availableVParmDatabases) { }
if (dbid.getModelName().equals("ISC") for (DatabaseID dbid : availableServerDatabases) {
&& !iscDbs.contains(dbid)) { if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) {
iscDbs.add(dbid); iscDbs.add(dbid);
}
}
for (DatabaseID dbid : availableServerDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
} }
} }
} }
@ -2920,7 +2918,7 @@ public class ParmManager implements IParmManager, IMessageClient {
List<DatabaseID> newAdditions = new ArrayList<DatabaseID>(additions); List<DatabaseID> newAdditions = new ArrayList<DatabaseID>(additions);
newAdditions.removeAll(availableDatabases); newAdditions.removeAll(availableDatabases);
availableDatabases.addAll(additions); availableDatabases.addAll(newAdditions);
availableDatabases.removeAll(deletions); availableDatabases.removeAll(deletions);
List<ParmID> toDelete = new ArrayList<ParmID>(); List<ParmID> toDelete = new ArrayList<ParmID>();

View file

@ -85,6 +85,8 @@ import com.raytheon.viz.gfe.rsc.GFEFonts;
* 02/19/2008 dfitch Initial creation. * 02/19/2008 dfitch Initial creation.
* Apr 7, 2009 #2212 randerso Reimplemented * Apr 7, 2009 #2212 randerso Reimplemented
* Jun 23, 2011 #9897 ryu Update static variables on new GFE config * Jun 23, 2011 #9897 ryu Update static variables on new GFE config
* Oct 29, 2014 #3776 randerso Cached fill patterns used in history mode
* Renamed static variables to match AWIPS standards
* *
* </pre> * </pre>
* *
@ -108,18 +110,22 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
private static final Date BASE_DATE = new Date(0); private static final Date BASE_DATE = new Date(0);
private static Color DEFAULT_COLOR = new Color(null, private static final Color DEFAULT_COLOR = new Color(null,
RGBColors.getRGBColor("gray75")); RGBColors.getRGBColor("gray75"));
protected static Pattern LockedByMe; protected static Pattern lockedByMe;
public static Pattern LockedByOther; public static Pattern lockedByOther;
protected static Color TimeBlockVisible_color; protected static Map<RGB, Pattern> modifiedByMe = new HashMap<RGB, Pattern>();
protected static Color TimeBlockActive_color; protected static Map<RGB, Pattern> modifiedByOther = new HashMap<RGB, Pattern>();
protected static Color TimeBlockInvisible_color; protected static Color timeBlockVisible_color;
protected static Color timeBlockActive_color;
protected static Color timeBlockInvisible_color;
protected static boolean showEditorTimeLines; protected static boolean showEditorTimeLines;
@ -140,10 +146,10 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
if ((pattern = prefs.getString("LockedByMe_pattern")).isEmpty()) { if ((pattern = prefs.getString("LockedByMe_pattern")).isEmpty()) {
pattern = "WHOLE"; pattern = "WHOLE";
} }
if (LockedByMe != null) { if (lockedByMe != null) {
LockedByMe.dispose(); lockedByMe.dispose();
} }
LockedByMe = FillPatterns.getSWTPattern( lockedByMe = FillPatterns.getSWTPattern(
RGBColors.getRGBColor(color), pattern); RGBColors.getRGBColor(color), pattern);
if ((color = prefs.getString("LockedByOther_color")).isEmpty()) { if ((color = prefs.getString("LockedByOther_color")).isEmpty()) {
@ -153,40 +159,50 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
.isEmpty()) { .isEmpty()) {
pattern = "WHOLE"; pattern = "WHOLE";
} }
if (LockedByOther != null) { if (lockedByOther != null) {
LockedByOther.dispose(); lockedByOther.dispose();
} }
LockedByOther = FillPatterns.getSWTPattern( lockedByOther = FillPatterns.getSWTPattern(
RGBColors.getRGBColor(color), pattern); RGBColors.getRGBColor(color), pattern);
for (RGB key : modifiedByMe.keySet()) {
Pattern pat = modifiedByMe.remove(key);
pat.dispose();
}
for (RGB key : modifiedByOther.keySet()) {
Pattern pat = modifiedByOther.remove(key);
pat.dispose();
}
if ((color = prefs.getString("TimeBlockVisible_color")) if ((color = prefs.getString("TimeBlockVisible_color"))
.isEmpty()) { .isEmpty()) {
color = "White"; color = "White";
} }
if (TimeBlockVisible_color != null) { if (timeBlockVisible_color != null) {
TimeBlockVisible_color.dispose(); timeBlockVisible_color.dispose();
} }
TimeBlockVisible_color = new Color(Display.getDefault(), timeBlockVisible_color = new Color(Display.getDefault(),
RGBColors.getRGBColor(color)); RGBColors.getRGBColor(color));
if ((color = prefs.getString("TimeBlockActive_color")) if ((color = prefs.getString("TimeBlockActive_color"))
.isEmpty()) { .isEmpty()) {
color = "Yellow"; color = "Yellow";
} }
if (TimeBlockActive_color != null) { if (timeBlockActive_color != null) {
TimeBlockActive_color.dispose(); timeBlockActive_color.dispose();
} }
TimeBlockActive_color = new Color(Display.getDefault(), timeBlockActive_color = new Color(Display.getDefault(),
RGBColors.getRGBColor(color)); RGBColors.getRGBColor(color));
if ((color = prefs.getString("TimeBlockInvisible_color")) if ((color = prefs.getString("TimeBlockInvisible_color"))
.isEmpty()) { .isEmpty()) {
color = "Gray50"; color = "Gray50";
} }
if (TimeBlockInvisible_color != null) { if (timeBlockInvisible_color != null) {
TimeBlockInvisible_color.dispose(); timeBlockInvisible_color.dispose();
} }
TimeBlockInvisible_color = new Color(Display.getDefault(), timeBlockInvisible_color = new Color(Display.getDefault(),
RGBColors.getRGBColor(color)); RGBColors.getRGBColor(color));
showEditorTimeLines = true; showEditorTimeLines = true;
@ -496,7 +512,7 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
LockTable lockTable = parm.getLockTable(); LockTable lockTable = parm.getLockTable();
gc.setBackgroundPattern(LockedByMe); gc.setBackgroundPattern(lockedByMe);
for (TimeRange timeRange : lockTable.lockedByMe()) { for (TimeRange timeRange : lockTable.lockedByMe()) {
if (timeRange.overlaps(this.gridManager.getVisibleTimeRange())) { if (timeRange.overlaps(this.gridManager.getVisibleTimeRange())) {
Rectangle rect = computeLockRect(timeRange); Rectangle rect = computeLockRect(timeRange);
@ -505,7 +521,7 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
} }
gc.setBackgroundPattern(LockedByOther); gc.setBackgroundPattern(lockedByOther);
for (TimeRange timeRange : lockTable.lockedByOther()) { for (TimeRange timeRange : lockTable.lockedByOther()) {
if (timeRange.overlaps(this.gridManager.getVisibleTimeRange())) { if (timeRange.overlaps(this.gridManager.getVisibleTimeRange())) {
Rectangle rect = computeLockRect(timeRange); Rectangle rect = computeLockRect(timeRange);
@ -519,7 +535,7 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
TimeRange dataTR[]) { TimeRange dataTR[]) {
GC gc = event.gc; GC gc = event.gc;
TimeRange visibleRange = gridManager.getVisibleTimeRange(); TimeRange visibleRange = gridManager.getVisibleTimeRange();
gc.setForeground(TimeBlockInvisible_color); gc.setForeground(timeBlockInvisible_color);
gc.setLineStyle(DATA_BLOCK_LINE_STYLE); gc.setLineStyle(DATA_BLOCK_LINE_STYLE);
gc.setLineWidth(0); gc.setLineWidth(0);
@ -684,18 +700,18 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
} }
if (!active && !visible) { if (!active && !visible) {
gc.setBackground(TimeBlockInvisible_color); gc.setBackground(timeBlockInvisible_color);
gc.fillRectangle(rect); gc.fillRectangle(rect);
} else if (!active && visible) { } else if (!active && visible) {
gc.setBackground(TimeBlockVisible_color); gc.setBackground(timeBlockVisible_color);
gc.fillRectangle(rect); gc.fillRectangle(rect);
} else if (active && visible) { } else if (active && visible) {
gc.setBackground(TimeBlockActive_color); gc.setBackground(timeBlockActive_color);
gc.fillRectangle(rect); gc.fillRectangle(rect);
} else { } else {
gc.setBackground(TimeBlockInvisible_color); gc.setBackground(timeBlockInvisible_color);
gc.fillRectangle(rect); gc.fillRectangle(rect);
gc.setForeground(TimeBlockActive_color); gc.setForeground(timeBlockActive_color);
gc.drawRectangle(rect); gc.drawRectangle(rect);
} }
} }
@ -760,13 +776,21 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
patt = Activator.getDefault().getPreferenceStore() patt = Activator.getDefault().getPreferenceStore()
.getString("HistoryUserModPattern_Me"); .getString("HistoryUserModPattern_Me");
if (!patt.isEmpty()) { if (!patt.isEmpty()) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt); fp = modifiedByMe.get(color.getRGB());
if (fp == null) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt);
modifiedByMe.put(color.getRGB(), fp);
}
} }
} else { } else {
patt = Activator.getDefault().getPreferenceStore() patt = Activator.getDefault().getPreferenceStore()
.getString("HistoryUserModPattern_Other"); .getString("HistoryUserModPattern_Other");
if (!patt.isEmpty()) { if (!patt.isEmpty()) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt); fp = modifiedByOther.get(color.getRGB());
if (fp == null) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt);
modifiedByOther.put(color.getRGB(), fp);
}
} }
} }
} }

View file

@ -52,9 +52,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.GFEPreference; import com.raytheon.viz.gfe.GFEPreference;
import com.raytheon.viz.gfe.constants.StatusConstants;
import com.raytheon.viz.gfe.core.griddata.IGridData; import com.raytheon.viz.gfe.core.griddata.IGridData;
import com.raytheon.viz.gfe.core.msgs.IParmInventoryChangedListener; import com.raytheon.viz.gfe.core.msgs.IParmInventoryChangedListener;
import com.raytheon.viz.gfe.core.parm.Parm; import com.raytheon.viz.gfe.core.parm.Parm;
@ -78,6 +76,7 @@ import com.raytheon.viz.gfe.temporaleditor.mousehandler.TitleBarMouseHandler;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Apr 30, 2009 2159 rjpeter Initial creation. * Apr 30, 2009 2159 rjpeter Initial creation.
* Oct 29, 2014 #3776 randerso Renamed static variables to match AWIPS standards
* </pre> * </pre>
* *
* @author rjpeter * @author rjpeter
@ -85,7 +84,9 @@ import com.raytheon.viz.gfe.temporaleditor.mousehandler.TitleBarMouseHandler;
*/ */
public abstract class AbstractTemporalEditorBar implements public abstract class AbstractTemporalEditorBar implements
Comparable<AbstractTemporalEditorBar> { Comparable<AbstractTemporalEditorBar> {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(AbstractTemporalEditorBar.class); private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(AbstractTemporalEditorBar.class);
protected static final Color DEFAULT_COLOR = Display.getDefault() protected static final Color DEFAULT_COLOR = Display.getDefault()
.getSystemColor(SWT.COLOR_GRAY); .getSystemColor(SWT.COLOR_GRAY);
@ -552,7 +553,7 @@ public abstract class AbstractTemporalEditorBar implements
for (Parm parm : parmList) { for (Parm parm : parmList) {
LockTable lockTable = parm.getLockTable(); LockTable lockTable = parm.getLockTable();
gc.setBackgroundPattern(GridBar.LockedByOther); gc.setBackgroundPattern(GridBar.lockedByOther);
for (TimeRange timeRange : lockTable.lockedByOther()) { for (TimeRange timeRange : lockTable.lockedByOther()) {
if (timeRange.overlaps(range)) { if (timeRange.overlaps(range)) {
Rectangle rect = teUtil.timeRangeToPixels(timeRange); Rectangle rect = teUtil.timeRangeToPixels(timeRange);
@ -643,7 +644,7 @@ public abstract class AbstractTemporalEditorBar implements
scaleCanvas.redraw(); scaleCanvas.redraw();
editorCanvas.redraw(); editorCanvas.redraw();
bottomLabel.redraw(); bottomLabel.redraw();
} }
} }
/** /**

View file

@ -34,6 +34,28 @@
</encoder> </encoder>
</appender> </appender>
<!-- activeTableChange log -->
<appender name="activeTableLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${edex.home}/logs/edex-${edex.run.mode}-activeTableChange-%d{yyyyMMdd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%-5p %d [%t] %c{0}: %m%n</pattern>
</encoder>
</appender>
<appender name="activeTableChangeLogAsync" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="activeTableChangeLog" />
</appender>
<logger name="ActiveTableChange" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="activeTableChangeLogAsync" />
</logger>
<!-- Purge log --> <!-- Purge log -->
<appender name="purge" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="purge" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

View file

@ -31,25 +31,9 @@
depends-on="commonTimeRegistered, gfeDbRegistered, levelFactoryInitialized"> depends-on="commonTimeRegistered, gfeDbRegistered, levelFactoryInitialized">
</bean> </bean>
<bean id="gfeNotifyFilter" class="com.raytheon.edex.plugin.gfe.server.notify.GfeNotificationFilter"/>
<bean id="ifpServer" class="com.raytheon.edex.plugin.gfe.server.IFPServer.Wrapper"/> <bean id="ifpServer" class="com.raytheon.edex.plugin.gfe.server.IFPServer.Wrapper"/>
<camelContext id="gfe-common-camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler"> <camelContext id="gfe-common-camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
<route id="gfeNotify">
<from uri="vm:edex.gfeNotification?size=5000"/>
<doTry>
<filter>
<method bean="gfeNotifyFilter" method="isGfeNotification"/>
<bean ref="serializationUtil" method="transformToThrift"/>
<to uri="jms-generic:topic:edex.alerts.gfe?timeToLive=60000"/>
</filter>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:gfeNotify?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="notifyIfpServer"> <route id="notifyIfpServer">
<from uri="jms-generic:topic:edex.alerts.gfe?threadName=notifyIfpServer-edex.alerts.gfe" /> <from uri="jms-generic:topic:edex.alerts.gfe?threadName=notifyIfpServer-edex.alerts.gfe" />

View file

@ -79,6 +79,7 @@ import com.raytheon.uf.edex.site.notify.SendSiteActivationNotifications;
* May 15, 2014 #3157 dgilling Mark getActiveSites() as deprecated. * May 15, 2014 #3157 dgilling Mark getActiveSites() as deprecated.
* Jul 09, 2014 #3146 randerso Eliminated redundant evaluation of serverConfig * Jul 09, 2014 #3146 randerso Eliminated redundant evaluation of serverConfig
* Sent activation failure message to alertViz * Sent activation failure message to alertViz
* Oct 07, 2014 #3684 randerso Restructured IFPServer start up
* </pre> * </pre>
* *
* @author njensen * @author njensen

View file

@ -39,6 +39,8 @@ import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabase;
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase; import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase; import com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.NetCDFDatabaseManager; import com.raytheon.edex.plugin.gfe.server.database.NetCDFDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.TopoDatabase;
import com.raytheon.edex.plugin.gfe.server.database.TopoDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.VGridDatabase; import com.raytheon.edex.plugin.gfe.server.database.VGridDatabase;
import com.raytheon.edex.plugin.gfe.server.lock.LockManager; import com.raytheon.edex.plugin.gfe.server.lock.LockManager;
import com.raytheon.edex.plugin.gfe.smartinit.SmartInitQueue; import com.raytheon.edex.plugin.gfe.smartinit.SmartInitQueue;
@ -127,6 +129,14 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger;
* Cleaned up commented code. * Cleaned up commented code.
* 07/21/2014 #3415 randerso Fixed d2dGridDataPurged to not purge NetCDF databases. * 07/21/2014 #3415 randerso Fixed d2dGridDataPurged to not purge NetCDF databases.
* 09/21/2014 #3648 randerso Changed to do version purging when new databases are added * 09/21/2014 #3648 randerso Changed to do version purging when new databases are added
* 10/07/2014 #3684 randerso Restructured IFPServer start up.
* Reordered handling of DbInvChangeNotification
* Don't process GFENotifications sent by this JVM
* Prevent createDB from creating databases that are immediately purged
* Send DBInvChangeNotifications at site activation so new D2D data
* ingested while deactivated gets recognized
* 10/27/2014 #3766 randerso Fixed return type and javadoc for createNewDb
*
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -158,6 +168,8 @@ public class GridParmManager {
private LockManager lockMgr; private LockManager lockMgr;
private TopoDatabaseManager topoMgr;
private Map<DatabaseID, GridDatabase> dbMap = new ConcurrentHashMap<DatabaseID, GridDatabase>(); private Map<DatabaseID, GridDatabase> dbMap = new ConcurrentHashMap<DatabaseID, GridDatabase>();
/** /**
@ -165,18 +177,16 @@ public class GridParmManager {
* *
* @param siteID * @param siteID
* @param config * @param config
* @param lockMgr
* @throws PluginException * @throws PluginException
* @throws DataAccessLayerException * @throws DataAccessLayerException
* @throws GfeException * @throws GfeException
*/ */
public GridParmManager(String siteID, IFPServerConfig config, public GridParmManager(String siteID, IFPServerConfig config)
LockManager lockMgr) throws PluginException, throws PluginException, DataAccessLayerException, GfeException {
DataAccessLayerException, GfeException {
this.siteID = siteID; this.siteID = siteID;
this.config = config; this.config = config;
this.lockMgr = lockMgr; this.lockMgr = new LockManager(siteID, config, this);
this.lockMgr.setGridParmMgr(this); this.topoMgr = new TopoDatabaseManager(siteID, config);
initializeManager(); initializeManager();
} }
@ -188,6 +198,20 @@ public class GridParmManager {
NetCDFDatabaseManager.removeDatabases(siteID); NetCDFDatabaseManager.removeDatabases(siteID);
} }
/**
* @return the lockMgr
*/
public LockManager getLockMgr() {
return lockMgr;
}
/**
* @return the topoMgr
*/
public TopoDatabaseManager getTopoMgr() {
return topoMgr;
}
private GridParm gridParm(ParmID id) { private GridParm gridParm(ParmID id) {
GridDatabase db = getDatabase(id.getDbId()); GridDatabase db = getDatabase(id.getDbId());
if (db != null) { if (db != null) {
@ -879,6 +903,10 @@ public class GridParmManager {
if (notify) { if (notify) {
createDbNotification(Arrays.asList(dbId), purged); createDbNotification(Arrays.asList(dbId), purged);
} }
// always notify on purges
else {
createDbNotification(null, purged);
}
} }
} }
@ -889,11 +917,11 @@ public class GridParmManager {
* Create a new database * Create a new database
* *
* @param dbId * @param dbId
* @return ServerResponse containing the created database * @return ServerResponse containing status only
*/ */
public ServerResponse<GridDatabase> createNewDb(DatabaseID dbId) { public ServerResponse<?> createNewDb(DatabaseID dbId) {
ServerResponse<GridDatabase> sr = new ServerResponse<GridDatabase>(); ServerResponse<?> sr = new ServerResponse<Object>();
if (!dbId.getFormat().equals(DataType.GRID)) { if (!dbId.getFormat().equals(DataType.GRID)) {
sr.addMessage("Invalid database id for createNewDb(): " + dbId); sr.addMessage("Invalid database id for createNewDb(): " + dbId);
@ -903,6 +931,8 @@ public class GridParmManager {
GridDatabase db = this.getDatabase(dbId); GridDatabase db = this.getDatabase(dbId);
if (db != null) { if (db != null) {
return sr; // database already exists return sr; // database already exists
} else {
sr.addMessage("Unable to create database: " + dbId);
} }
// is it a singleton database? // is it a singleton database?
@ -1042,42 +1072,64 @@ public class GridParmManager {
return sr; return sr;
} }
private ServerResponse<GridDatabase> createDB(DatabaseID id) { private ServerResponse<GridDatabase> createDB(DatabaseID dbId) {
// TODO: consider merging this into getDatabase() // TODO: consider merging this into getDatabase()
ServerResponse<GridDatabase> status = new ServerResponse<GridDatabase>(); ServerResponse<GridDatabase> status = new ServerResponse<GridDatabase>();
if (!id.isValid() || !id.getFormat().equals(DataType.GRID)) { if (!dbId.isValid() || !dbId.getFormat().equals(DataType.GRID)) {
status.addMessage("Database id " status.addMessage("Database id "
+ id + dbId
+ " is not valid, or is not a grid-type. Cannot create database."); + " is not valid, or is not a grid-type. Cannot create database.");
return status; return status;
} }
// create the grid database // get the dbConfig
IFPGridDatabase db = null; IFPGridDatabase db = null;
GridDbConfig dbConfig = this.config.gridDbConfig(id); GridDbConfig dbConfig = this.config.gridDbConfig(dbId);
if (dbConfig == null) { if (dbConfig == null) {
status.addMessage("Unable to obtain GridDbConfig information for creation" status.addMessage("Unable to obtain GridDbConfig information for creation"
+ " in createDB() for " + id); + " in createDB() for " + dbId);
} else { } else {
// don't create if this version would be immediately purgeable
List<DatabaseID> existing = new ArrayList<DatabaseID>();
for (DatabaseID id : this.dbMap.keySet()) {
if (id.sameModel(dbId)) {
existing.add(id);
}
}
if (!existing.contains(dbId)) {
existing.add(dbId);
}
// sort by model time (most recent first)
Collections.sort(existing);
int desiredVersions = this.config.desiredDbVersions(dbId);
if (existing.indexOf(dbId) >= desiredVersions) {
status.addMessage("Unable to create " + dbId
+ " as it would exceed the desired number of versions");
return status;
}
// attempt to create the GridDatabase // attempt to create the GridDatabase
db = new IFPGridDatabase(id, dbConfig); db = new IFPGridDatabase(dbId, dbConfig);
if (db.databaseIsValid()) { if (db.databaseIsValid()) {
// get databaseID object from database // get databaseID object from database
DatabaseID dbId = db.getDbId(); DatabaseID id = db.getDbId();
if (dbId.getRemovedDate() != null) { if (id.getRemovedDate() != null) {
// mark database as not removed // mark database as not removed
try { try {
GFEDao gfeDao = new GFEDao(); GFEDao gfeDao = new GFEDao();
gfeDao.setDatabaseRemovedDate(dbId, null); gfeDao.setDatabaseRemovedDate(id, null);
statusHandler.info("Database " + dbId + " restored"); statusHandler.info("Database " + id + " restored");
} catch (Exception e) { } catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Unable to mark database restored: " + dbId, e); "Unable to mark database restored: " + id, e);
} }
} }
} else { } else {
status.addMessage("Database " + id + " is not valid."); status.addMessage("Database " + dbId + " is not valid.");
db = null; db = null;
} }
} }
@ -1086,12 +1138,13 @@ public class GridParmManager {
// mark database as removed // mark database as removed
try { try {
GFEDao gfeDao = new GFEDao(); GFEDao gfeDao = new GFEDao();
gfeDao.setDatabaseRemovedDate(id, new Date()); gfeDao.setDatabaseRemovedDate(dbId, new Date());
statusHandler.warn("Database " + id + " marked for removal in " statusHandler.warn("Database " + dbId
+ " marked for removal in "
+ GFEDao.REMOVED_DB_PURGE_TIME + " days."); + GFEDao.REMOVED_DB_PURGE_TIME + " days.");
} catch (Exception e) { } catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Unable to mark database removed: " + id, e); "Unable to mark database removed: " + dbId, e);
} }
} }
@ -1112,6 +1165,13 @@ public class GridParmManager {
private void initializeManager() throws GfeException, private void initializeManager() throws GfeException,
DataAccessLayerException, PluginException { DataAccessLayerException, PluginException {
// add the topo database
TopoDatabase topoDb = topoMgr.getTopoDatabase();
if (topoDb != null) {
this.addDB(topoDb);
}
// get existing list (of just GRIDs) // get existing list (of just GRIDs)
GFEDao gfeDao = new GFEDao(); GFEDao gfeDao = new GFEDao();
List<DatabaseID> inventory = gfeDao.getDatabaseInventory(siteID); List<DatabaseID> inventory = gfeDao.getDatabaseInventory(siteID);
@ -1126,8 +1186,12 @@ public class GridParmManager {
} }
// create the databases (the list should now only contain GRID dbs) // create the databases (the list should now only contain GRID dbs)
List<DatabaseID> added = new ArrayList<DatabaseID>(inventory.size());
for (DatabaseID dbId : inventory) { for (DatabaseID dbId : inventory) {
getDatabase(dbId, false); GridDatabase db = getDatabase(dbId, false);
if (db != null) {
added.add(db.getDbId());
}
} }
NetCDFDatabaseManager.initializeNetCDFDatabases(config); NetCDFDatabaseManager.initializeNetCDFDatabases(config);
@ -1140,7 +1204,8 @@ public class GridParmManager {
D2DSatDatabase satDb = new D2DSatDatabase(config); D2DSatDatabase satDb = new D2DSatDatabase(config);
addDB(satDb); addDB(satDb);
initD2DDbs(); added.addAll(initD2DDbs());
createDbNotification(added, null);
// only fire smartInits if queue is instantiated // only fire smartInits if queue is instantiated
SmartInitQueue queue = SmartInitQueue.getQueue(); SmartInitQueue queue = SmartInitQueue.getQueue();
@ -1156,7 +1221,9 @@ public class GridParmManager {
boolean clearTime = false; boolean clearTime = false;
try { try {
for (DatabaseID dbId : this.dbMap.keySet()) { for (DatabaseID dbId : this.dbMap.keySet()) {
if (dbId.getDbType().equals("D2D")) { if (dbId.getDbType().equals("D2D")
&& !config.initModels(dbId.getModelName())
.isEmpty()) {
statusHandler.info("Firing smartinit for: " + dbId); statusHandler.info("Firing smartinit for: " + dbId);
VGridDatabase db = (VGridDatabase) getDatabase(dbId); VGridDatabase db = (VGridDatabase) getDatabase(dbId);
SortedSet<Date> validTimes = db.getValidTimes(); SortedSet<Date> validTimes = db.getValidTimes();
@ -1179,7 +1246,8 @@ public class GridParmManager {
} }
} }
private void initD2DDbs() throws GfeException { private List<DatabaseID> initD2DDbs() {
List<DatabaseID> added = new ArrayList<DatabaseID>();
for (String d2dModelName : config.getD2dModels()) { for (String d2dModelName : config.getD2dModels()) {
try { try {
// get dbId to get desiredDbVersions (date doesn't matter) // get dbId to get desiredDbVersions (date doesn't matter)
@ -1191,13 +1259,17 @@ public class GridParmManager {
d2dModelName, desiredVersions)) { d2dModelName, desiredVersions)) {
dbId = D2DGridDatabase.getDbId(d2dModelName, refTime, dbId = D2DGridDatabase.getDbId(d2dModelName, refTime,
config); config);
getDatabase(dbId, false); GridDatabase db = getDatabase(dbId, false);
if (db != null) {
added.add(db.getDbId());
}
} }
} catch (Exception e) { } catch (Exception e) {
statusHandler.error("Error initializing D2D model: " statusHandler.error("Error initializing D2D model: "
+ d2dModelName, e); + d2dModelName, e);
} }
} }
return (added);
} }
/** /**
@ -1218,6 +1290,9 @@ public class GridParmManager {
} }
D2DGridDatabase db = (D2DGridDatabase) getDatabase(dbId, true); D2DGridDatabase db = (D2DGridDatabase) getDatabase(dbId, true);
if (db == null) {
continue;
}
GridUpdateNotification gun = db.update(record); GridUpdateNotification gun = db.update(record);
if (gun != null) { if (gun != null) {
@ -1247,7 +1322,7 @@ public class GridParmManager {
public void filterSatelliteRecords(List<SatelliteRecord> records) { public void filterSatelliteRecords(List<SatelliteRecord> records) {
DatabaseID dbId = D2DSatDatabase.getDbId(siteID); DatabaseID dbId = D2DSatDatabase.getDbId(siteID);
D2DSatDatabase db = (D2DSatDatabase) getDatabase(dbId); D2DSatDatabase db = (D2DSatDatabase) getDatabase(dbId, true);
List<GridUpdateNotification> guns = new LinkedList<GridUpdateNotification>(); List<GridUpdateNotification> guns = new LinkedList<GridUpdateNotification>();
for (SatelliteRecord record : records) { for (SatelliteRecord record : records) {
@ -1343,7 +1418,7 @@ public class GridParmManager {
} else if (req.isDatabaseRequest()) { } else if (req.isDatabaseRequest()) {
// get the parm list for this database // get the parm list for this database
GridDatabase db = this.getDatabase(req.getDbId()); GridDatabase db = this.getDatabase(req.getDbId(), true);
if (db != null) { if (db != null) {
List<ParmID> parmList = db.getParmList().getPayload(); List<ParmID> parmList = db.getParmList().getPayload();
for (ParmID pid : parmList) { for (ParmID pid : parmList) {
@ -1398,7 +1473,8 @@ public class GridParmManager {
private void createDbNotification(List<DatabaseID> additions, private void createDbNotification(List<DatabaseID> additions,
List<DatabaseID> deletions) { List<DatabaseID> deletions) {
if (!additions.isEmpty() || !deletions.isEmpty()) { if ((additions != null && !additions.isEmpty())
|| (deletions != null && !deletions.isEmpty())) {
DBInvChangeNotification notify = new DBInvChangeNotification( DBInvChangeNotification notify = new DBInvChangeNotification(
additions, deletions, siteID); additions, deletions, siteID);
SendNotifications.send(notify); SendNotifications.send(notify);
@ -1409,30 +1485,33 @@ public class GridParmManager {
* @param notif * @param notif
*/ */
public void handleGfeNotification(GfeNotification notif) { public void handleGfeNotification(GfeNotification notif) {
// TODO: add UUID or some other identifier (hostname/process id?) to // Don't handle notifications sent by this JVM
// notif so we can recognize if (notif.isLocal()) {
// and not process notifications sent by this GridParmManager instance return;
}
if (notif instanceof DBInvChangeNotification) { if (notif instanceof DBInvChangeNotification) {
DBInvChangeNotification invChanged = (DBInvChangeNotification) notif; DBInvChangeNotification invChanged = (DBInvChangeNotification) notif;
// handle additions first to try to get old out-of-synch versions
// are purged sooner
for (DatabaseID dbId : invChanged.getAdditions()) {
this.getDatabase(dbId, false);
}
for (DatabaseID dbId : invChanged.getDeletions()) { for (DatabaseID dbId : invChanged.getDeletions()) {
deallocateDb(dbId, false); deallocateDb(dbId, false);
} }
ServerResponse<GridDatabase> sr = new ServerResponse<GridDatabase>();
for (DatabaseID dbId : invChanged.getAdditions()) {
this.getDatabase(dbId, false);
}
if (!sr.isOkay()) {
statusHandler.error("Error updating GridParmManager: "
+ sr.message());
}
} else if (notif instanceof GridUpdateNotification) { } else if (notif instanceof GridUpdateNotification) {
DatabaseID satDbId = D2DSatDatabase.getDbId(siteID);
GridUpdateNotification gun = (GridUpdateNotification) notif; GridUpdateNotification gun = (GridUpdateNotification) notif;
if (gun.getParmId().getDbId().equals(satDbId)) { DatabaseID dbid = gun.getParmId().getDbId();
D2DSatDatabase db = (D2DSatDatabase) this.dbMap.get(satDbId);
db.update(gun); // get the database as an extra attempt to
// keep the IFPServers in sync
GridDatabase db = getDatabase(dbid, false);
if (db instanceof D2DSatDatabase) {
((D2DSatDatabase) db).update(gun);
} }
} }
} }
@ -1440,7 +1519,7 @@ public class GridParmManager {
/** /**
* @param db * @param db
*/ */
public void addDB(GridDatabase db) { private void addDB(GridDatabase db) {
DatabaseID dbId = db.getDbId(); DatabaseID dbId = db.getDbId();
statusHandler.info("addDB called, adding " + dbId); statusHandler.info("addDB called, adding " + dbId);
this.dbMap.put(dbId, db); this.dbMap.put(dbId, db);
@ -1529,14 +1608,9 @@ public class GridParmManager {
// process the inventory looking for "old" unwanted databases // process the inventory looking for "old" unwanted databases
List<DatabaseID> purged = new ArrayList<DatabaseID>(); List<DatabaseID> purged = new ArrayList<DatabaseID>();
String model = modelToPurge.getModelName();
String site = modelToPurge.getSiteId();
String type = modelToPurge.getDbType();
int count = 0; int count = 0;
for (DatabaseID dbId : currentInv) { for (DatabaseID dbId : currentInv) {
// new series? if (dbId.sameModel(modelToPurge)) {
if (dbId.getSiteId().equals(site) && dbId.getDbType().equals(type)
&& dbId.getModelName().equals(model)) {
// process the id and determine whether it should be purged // process the id and determine whether it should be purged
count++; count++;

View file

@ -60,8 +60,9 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* May 30, 2013 2044 randerso Initial creation * May 30, 2013 #2044 randerso Initial creation
* Nov 20, 2013 #2331 randerso Added getTopoData method * Nov 20, 2013 #2331 randerso Added getTopoData method
* Oct 07, 2014 #3684 randerso Restructured IFPServer start up
* *
* </pre> * </pre>
* *
@ -191,26 +192,21 @@ public class IFPServer {
return activeServers.get(siteID); return activeServers.get(siteID);
} }
String siteId; private String siteId;
IFPServerConfig config; private IFPServerConfig config;
GridParmManager gridParmMgr; private GridParmManager gridParmMgr;
LockManager lockMgr;
TopoDatabaseManager topoMgr; // TODO do we need this?
private IFPServer(String siteId, IFPServerConfig config) private IFPServer(String siteId, IFPServerConfig config)
throws DataAccessLayerException, PluginException, GfeException { throws DataAccessLayerException, PluginException, GfeException {
this.siteId = siteId; this.siteId = siteId;
this.config = config; this.config = config;
this.lockMgr = new LockManager(siteId, config);
this.gridParmMgr = new GridParmManager(siteId, config, lockMgr);
this.topoMgr = new TopoDatabaseManager(siteId, config, gridParmMgr);
statusHandler.info("MapManager initializing..."); statusHandler.info("MapManager initializing...");
new MapManager(config); new MapManager(config);
this.gridParmMgr = new GridParmManager(siteId, config);
} }
private void dispose() { private void dispose() {
@ -258,14 +254,14 @@ public class IFPServer {
* @return the lockMgr * @return the lockMgr
*/ */
public LockManager getLockMgr() { public LockManager getLockMgr() {
return lockMgr; return this.gridParmMgr.getLockMgr();
} }
/** /**
* @return the topoMgr * @return the topoMgr
*/ */
public TopoDatabaseManager getTopoMgr() { public TopoDatabaseManager getTopoMgr() {
return topoMgr; return this.gridParmMgr.getTopoMgr();
} }
/** /**
@ -317,8 +313,6 @@ public class IFPServer {
*/ */
public static void filterDataURINotifications( public static void filterDataURINotifications(
DataURINotificationMessage message) throws Exception { DataURINotificationMessage message) throws Exception {
// ITimer timer = TimeUtil.getTimer();
// timer.start();
List<GridRecord> gridRecords = new LinkedList<GridRecord>(); List<GridRecord> gridRecords = new LinkedList<GridRecord>();
List<SatelliteRecord> satRecords = new LinkedList<SatelliteRecord>(); List<SatelliteRecord> satRecords = new LinkedList<SatelliteRecord>();
@ -332,26 +326,12 @@ public class IFPServer {
for (IFPServer ifpServer : getActiveServers()) { for (IFPServer ifpServer : getActiveServers()) {
if (!gridRecords.isEmpty()) { if (!gridRecords.isEmpty()) {
// TODO: remove this info before check in
String msg = "Processing " + gridRecords.size()
+ " grid DataURINotifications";
statusHandler.info(msg);
ifpServer.getGridParmMgr().filterGridRecords(gridRecords); ifpServer.getGridParmMgr().filterGridRecords(gridRecords);
} }
if (!satRecords.isEmpty()) { if (!satRecords.isEmpty()) {
// TODO: remove this info before check in
String msg = "Processing " + satRecords.size()
+ " satellite DataURINotifications";
statusHandler.info(msg);
ifpServer.getGridParmMgr().filterSatelliteRecords(satRecords); ifpServer.getGridParmMgr().filterSatelliteRecords(satRecords);
} }
} }
// timer.stop();
// perfLog.logDuration(
// "GfeIngestNotificationFilter: processing DataURINotificationMessage",
// timer.getElapsedTime());
} }
/** /**
@ -362,7 +342,7 @@ public class IFPServer {
* @return topo gridslice * @return topo gridslice
*/ */
public ServerResponse<ScalarGridSlice> getTopoData(GridLocation gloc) { public ServerResponse<ScalarGridSlice> getTopoData(GridLocation gloc) {
return this.topoMgr.getTopoData(gloc); return getTopoMgr().getTopoData(gloc);
} }
} }

View file

@ -30,7 +30,6 @@ import javax.measure.unit.NonSI;
import javax.measure.unit.SI; import javax.measure.unit.SI;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfig; import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
import com.raytheon.edex.plugin.gfe.server.GridParmManager;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory.OriginType; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory.OriginType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
@ -76,6 +75,7 @@ import com.raytheon.uf.common.topo.TopoQuery;
* code cleanup * code cleanup
* Nov 20, 2013 #2331 randerso Changed return type of getTopoData * Nov 20, 2013 #2331 randerso Changed return type of getTopoData
* Feb 11, 2014 #2788 randerso Set missing data points to 0 to match A1 * Feb 11, 2014 #2788 randerso Set missing data points to 0 to match A1
* Oct 07, 2014 #3684 randerso Restructured IFPServer start up
* *
* </pre> * </pre>
* *
@ -101,10 +101,8 @@ public class TopoDatabaseManager {
* *
* @param siteID * @param siteID
* @param config * @param config
* @param gridMgr
*/ */
public TopoDatabaseManager(String siteID, IFPServerConfig config, public TopoDatabaseManager(String siteID, IFPServerConfig config) {
GridParmManager gridMgr) {
this.config = config; this.config = config;
statusHandler.info("Topography Manager started for " + siteID); statusHandler.info("Topography Manager started for " + siteID);
@ -119,15 +117,20 @@ public class TopoDatabaseManager {
// create the disk cache // create the disk cache
createDiskCache(gloc); createDiskCache(gloc);
// Add the topo database. statusHandler.info("Topography Manager ready for " + siteID);
}
/**
* @return the topo database
*/
public TopoDatabase getTopoDatabase() {
TopoDatabase tdb = new TopoDatabase(this.config, this); TopoDatabase tdb = new TopoDatabase(this.config, this);
if (tdb.databaseIsValid()) { if (tdb.databaseIsValid()) {
gridMgr.addDB(tdb); return tdb;
} else { } else {
statusHandler.error("Invalid Topo database"); statusHandler.error("Invalid Topo database");
} }
return null;
statusHandler.info("Topography Manager ready for " + siteID);
} }
/** /**

View file

@ -67,6 +67,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* fixed inefficiencies in querying/merging * fixed inefficiencies in querying/merging
* 06/13/13 #2044 randerso Converted from singleton to instance per * 06/13/13 #2044 randerso Converted from singleton to instance per
* site managed by IFPServer * site managed by IFPServer
* 10/07/2014 #3684 randerso Restructured IFPServer start up
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -91,21 +92,12 @@ public class LockManager {
* *
* @param siteId * @param siteId
* @param config * @param config
*/
public LockManager(String siteId, IFPServerConfig config) {
this.siteId = siteId;
this.config = config;
}
/**
* Sets the GridParmManager instance to be used by this LockManager.
*
* Done post construction since GridParmManager and LockManager have
* references to each other
*
* @param gridParmMgr * @param gridParmMgr
*/ */
public void setGridParmMgr(GridParmManager gridParmMgr) { public LockManager(String siteId, IFPServerConfig config,
GridParmManager gridParmMgr) {
this.siteId = siteId;
this.config = config;
this.gridParmMgr = gridParmMgr; this.gridParmMgr = gridParmMgr;
} }

View file

@ -1,53 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.gfe.server.notify;
import java.util.List;
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GfeNotification;
/**
* TODO Add Description
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 3, 2008 njensen Initial creation
* </pre>
*
* @author njensen
* @version 1.0
*/
public class GfeNotificationFilter {
public boolean isGfeNotification(Object body) {
Object obj = body;
if (body instanceof List) {
List<?> list = (List<?>) body;
if (list.size() > 0) {
obj = list.get(0);
}
}
return obj instanceof GfeNotification;
}
}

View file

@ -49,6 +49,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* Jul 25, 2012 #957 dgilling Implement getEditAreaNames(). * Jul 25, 2012 #957 dgilling Implement getEditAreaNames().
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer * Jun 13, 2013 #2044 randerso Refactored to use IFPServer
* Nov 20, 2013 #2331 randerso Changed return type of getTopoData * Nov 20, 2013 #2331 randerso Changed return type of getTopoData
* Oct 08, 2014 #3684 randerso Changed createDB to return status
* Oct 27, 2014 #3766 randerso Fixed return type for createDB
* *
* </pre> * </pre>
* *
@ -98,13 +100,10 @@ public class InitClient {
* *
* @param key * @param key
*/ */
public void createDB(String key) { public ServerResponse<?> createDB(String key) {
DatabaseID id = new DatabaseID(key); DatabaseID id = new DatabaseID(key);
ServerResponse<?> sr = ifpServer.getGridParmMgr().createNewDb(id); ServerResponse<?> sr = ifpServer.getGridParmMgr().createNewDb(id);
if (!sr.isOkay()) { return sr;
statusHandler.error("Error creating database " + id + ": "
+ sr.message());
}
} }
/** /**

View file

@ -23,14 +23,11 @@ package com.raytheon.edex.plugin.gfe.util;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse; import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GfeNotification; import com.raytheon.uf.common.dataplugin.gfe.server.notify.GfeNotification;
import com.raytheon.uf.common.dataplugin.gfe.util.GfeUtil; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.core.EDEXUtil;
import com.raytheon.uf.edex.core.EdexException;
/** /**
* Sends GFE notifications to the GFE notify JMS topic. * Sends GFE notifications to the GFE notify JMS topic.
@ -43,14 +40,16 @@ import com.raytheon.uf.edex.core.EdexException;
* 09/22/09 3058 rjpeter changed to utility. * 09/22/09 3058 rjpeter changed to utility.
* 06/12/13 2099 dgilling Remove error when passed empty list of * 06/12/13 2099 dgilling Remove error when passed empty list of
* notifications. * notifications.
* 10/08/14 #3684 randerso Changed to send directly to JMS topic
*
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
* @version 1.0 * @version 1.0
*/ */
public class SendNotifications { public class SendNotifications {
protected static final transient Log logger = LogFactory private static final transient IUFStatusHandler statusHandler = UFStatus
.getLog(SendNotifications.class); .getHandler(SendNotifications.class);
public static ServerResponse<?> send(GfeNotification notification) { public static ServerResponse<?> send(GfeNotification notification) {
List<GfeNotification> notifications = new ArrayList<GfeNotification>(); List<GfeNotification> notifications = new ArrayList<GfeNotification>();
@ -66,12 +65,11 @@ public class SendNotifications {
} }
try { try {
EDEXUtil.getMessageProducer().sendAsync(GfeUtil.NOTIFY, EDEXUtil.getMessageProducer().sendAsyncThriftUri(
"jms-generic:topic:edex.alerts.gfe?timeToLive=60000",
notifications); notifications);
// logger.info("Sending " + notifications.size() + " " } catch (Exception e) {
// + notifications.get(0).getClass().getSimpleName()); statusHandler.error("Error sending gfe notification", e);
} catch (EdexException e) {
logger.error("Error sending gfe notification", e);
sr.addMessage("Error sending gfe notification"); sr.addMessage("Error sending gfe notification");
} }
return sr; return sr;

View file

@ -1223,6 +1223,7 @@ else: #######DCS3501 WEST_CONUS
('HPCqpf', 'HPCQPF'), ('HPCqpf', 'HPCQPF'),
('HPCqpfNDFD', 'HPCERP'), ('HPCqpfNDFD', 'HPCERP'),
('RFCqpf', 'RFCQPF'), ('RFCqpf', 'RFCQPF'),
('HRRR', 'HRRR'),
#DR3511 'HPCdelta', #DR3511 'HPCdelta',
'GLERL', 'GLERL',
'WNAWAVE238', 'WNAWAVE238',

View file

@ -28,7 +28,8 @@
# 04/04/13 #1787 randerso fix validTime check to work with accumulative parms # 04/04/13 #1787 randerso fix validTime check to work with accumulative parms
# fix logging so you can actually determine why # fix logging so you can actually determine why
# a smartInit is not calculating a parameter # a smartInit is not calculating a parameter
# Oct 29, 2013 2476 njensen Improved getting wx/discrete keys when retrieving data # 10/29/2013 #2476 njensen Improved getting wx/discrete keys when retrieving data
# 10/27/2014 #3766 randerso Changed _getLatest to include error text returned from InitClient.createDB()
# #
## ##
import string, sys, re, time, types, getopt, fnmatch, LogStream, DatabaseID, JUtil, AbsTime, TimeRange import string, sys, re, time, types, getopt, fnmatch, LogStream, DatabaseID, JUtil, AbsTime, TimeRange
@ -325,7 +326,9 @@ class Forecaster(GridUtilities):
msg = "No databases for " + self._srcName msg = "No databases for " + self._srcName
LogStream.logProblem(msg) LogStream.logProblem(msg)
return return
#sys.exit(1)
if self.newdb() is None:
return
self.__topo = self.getTopo() * .3048 self.__topo = self.getTopo() * .3048
srcdbkeys = self.srcdb().getKeys() srcdbkeys = self.srcdb().getKeys()
@ -551,6 +554,9 @@ class Forecaster(GridUtilities):
start = time.time() start = time.time()
self.__init() self.__init()
if self.newdb() is None:
return
msgDest = "Destination database:" + self.newdb().getModelIdentifier() msgDest = "Destination database:" + self.newdb().getModelIdentifier()
if validTime is not None: if validTime is not None:
@ -647,10 +653,16 @@ class Forecaster(GridUtilities):
break break
if singletonNeeded: if singletonNeeded:
newdb = newdb[:-13] + '00000000_0000' newdb = newdb[:-13] + '00000000_0000'
newdb = self.getDb(newdb)
else: else:
client.createDB(newdb) sr = client.createDB(newdb)
if sr.isOkay():
newdb = self.getDb(newdb) newdb = self.getDb(newdb)
else:
msg = "Unable to create database for " + str(newdb) + ":\n" + \
str(sr.message())
LogStream.logProblem(msg)
newdb = None
return srcdb, newdb return srcdb, newdb

View file

@ -19,7 +19,7 @@
further_licensing_information. further_licensing_information.
--> -->
<latLonGridCoverage> <latLonGridCoverage>
<name>gridHFR-EAST1_6KM</name> <name>gridHFR-EAST_6KM</name>
<description>High Frequency Radar (EAST_6KM) total vector velocity (TVV) <description>High Frequency Radar (EAST_6KM) total vector velocity (TVV)
Lon/Lat Resolution Lon/Lat Resolution
</description> </description>

View file

@ -19,8 +19,8 @@
further_licensing_information. further_licensing_information.
--> -->
<latLonGridCoverage> <latLonGridCoverage>
<name>gridHFR-EAST2_6KM</name> <name>gridHFR-EAST_PR_6KM</name>
<description>High Frequency Radar (EAST_6KM) total vector velocity (TVV) <description>High Frequency Radar (PUERTO RICO_6KM) total vector velocity (TVV)
Lon/Lat Resolution Lon/Lat Resolution
</description> </description>
<la1>14.5</la1> <la1>14.5</la1>

View file

@ -19,8 +19,8 @@
further_licensing_information. further_licensing_information.
--> -->
<latLonGridCoverage> <latLonGridCoverage>
<name>gridHFR-WEST2_6KM</name> <name>gridHFR-US_HAWAII_6KM</name>
<description>High Frequency Radar (WEST_6KM) total vector velocity (TVV) <description>High Frequency Radar (US_WEST_HAWAII_6KM) total vector velocity (TVV)
Lon/Lat Resolution Lon/Lat Resolution
</description> </description>
<la1>16.2204</la1> <la1>16.2204</la1>

View file

@ -19,7 +19,7 @@
further_licensing_information. further_licensing_information.
--> -->
<latLonGridCoverage> <latLonGridCoverage>
<name>gridHFR-WEST1_6KM</name> <name>gridHFR-WEST_6KM</name>
<description>High Frequency Radar (WEST_6KM) total vector velocity (TVV) <description>High Frequency Radar (WEST_6KM) total vector velocity (TVV)
Lon/Lat Resolution Lon/Lat Resolution
</description> </description>

View file

@ -138,17 +138,17 @@
<name>HFR-EAST_6KM</name> <name>HFR-EAST_6KM</name>
<center>9</center> <center>9</center>
<subcenter>0</subcenter> <subcenter>0</subcenter>
<grid>gridHFR-EAST1_6KM</grid> <grid>gridHFR-EAST_6KM</grid>
<process> <process>
<id>255</id> <id>255</id>
</process> </process>
</model> </model>
<model> <model>
<name>HFR-EAST_6KM</name> <name>HFR-EAST_PR_6KM</name>
<center>9</center> <center>9</center>
<subcenter>0</subcenter> <subcenter>0</subcenter>
<grid>gridHFR-EAST2_6KM</grid> <grid>gridHFR-EAST_PR_6KM</grid>
<process> <process>
<id>255</id> <id>255</id>
</process> </process>
@ -168,17 +168,17 @@
<name>HFR-WEST_6KM</name> <name>HFR-WEST_6KM</name>
<center>9</center> <center>9</center>
<subcenter>0</subcenter> <subcenter>0</subcenter>
<grid>gridHFR-WEST1_6KM</grid> <grid>gridHFR-WEST_6KM</grid>
<process> <process>
<id>255</id> <id>255</id>
</process> </process>
</model> </model>
<model> <model>
<name>HFR-WEST_6KM</name> <name>HFR-US_HAWAII_6KM</name>
<center>9</center> <center>9</center>
<subcenter>0</subcenter> <subcenter>0</subcenter>
<grid>gridHFR-WEST2_6KM</grid> <grid>gridHFR-US_HAWAII_6KM</grid>
<process> <process>
<id>255</id> <id>255</id>
</process> </process>

View file

@ -67,6 +67,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdap
* 06/20/13 2127 rjpeter Removed unused bidirectional relationship. * 06/20/13 2127 rjpeter Removed unused bidirectional relationship.
* 06/13/13 2044 randerso Code cleanup * 06/13/13 2044 randerso Code cleanup
* 07/31/13 2057 randerso Added removedDate * 07/31/13 2057 randerso Added removedDate
* 10/08/14 #3684 randerso Added sameModel()
*
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -598,6 +600,23 @@ public class DatabaseID implements Comparable<DatabaseID> {
return cal.getTime(); return cal.getTime();
} }
public boolean sameModel(DatabaseID other) {
if (!this.siteId.equals(other.getSiteId())) {
return false;
}
if (!this.format.equals(other.getFormat())) {
return false;
}
if (!this.dbType.equals(other.getDbType())) {
return false;
}
return this.modelName.equals(other.getModelName());
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View file

@ -26,21 +26,56 @@ import java.util.Map;
import com.raytheon.uf.common.message.IMessage; import com.raytheon.uf.common.message.IMessage;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.util.SystemUtil;
/**
* Base class for GFE Notifications
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 7, 2014 #3684 randerso Added sourceId field
*
* </pre>
*
* @author randerso
* @version 1.0
*/
@DynamicSerialize @DynamicSerialize
public class GfeNotification implements IMessage { public class GfeNotification implements IMessage {
private static final String localSourceID;
static {
String host = SystemUtil.getHostName();
int pid = SystemUtil.getPid();
localSourceID = host + ":" + pid;
}
@DynamicSerializeElement @DynamicSerializeElement
protected String siteID; protected String siteID;
public GfeNotification() { @DynamicSerializeElement
protected String sourceID;
public GfeNotification() {
this.sourceID = localSourceID;
} }
public GfeNotification(String siteId) { public GfeNotification(String siteId) {
this();
this.siteID = siteId; this.siteID = siteId;
} }
public String getSourceID() {
return sourceID;
}
public void setSourceID(String sourceId) {
this.sourceID = sourceId;
}
public String getSiteID() { public String getSiteID() {
return siteID; return siteID;
} }
@ -49,6 +84,15 @@ public class GfeNotification implements IMessage {
this.siteID = siteID; this.siteID = siteID;
} }
/**
*
*
* @return
*/
public boolean isLocal() {
return localSourceID.equals(this.sourceID);
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View file

@ -67,6 +67,7 @@ import com.vividsolutions.jts.operation.polygonize.Polygonizer;
* favor of new GridLocation constructor * favor of new GridLocation constructor
* 06/24/13 #2044 randerso Changed format of hdf5 group to include * 06/24/13 #2044 randerso Changed format of hdf5 group to include
* minutes for satellite data * minutes for satellite data
* 10/08/14 #3684 randerso Removed NOTIFY
* *
* </pre> * </pre>
* *
@ -105,8 +106,6 @@ public class GfeUtil {
public static final String HAZARDS_KEY = "Hazards"; public static final String HAZARDS_KEY = "Hazards";
public static final String NOTIFY = "gfeNotify";
private static Pattern DISCRETE_PATTERN = Pattern private static Pattern DISCRETE_PATTERN = Pattern
.compile("'[\\w<>+/^\\[\\]\\.,:-]*'"); .compile("'[\\w<>+/^\\[\\]\\.,:-]*'");

View file

@ -22,6 +22,7 @@ class GfeNotification:
def __init__(self): def __init__(self):
self.siteID = None self.siteID = None
self.sourceID = None
def getSiteID(self): def getSiteID(self):
return self.siteID return self.siteID
@ -29,3 +30,9 @@ class GfeNotification:
def setSiteID(self, siteID): def setSiteID(self, siteID):
self.siteID = siteID self.siteID = siteID
def getSourceID(self):
return self.sourceID
def setSourceID(self, sourceID):
self.sourceID = sourceID