Merge branch 'omaha_14.3.1' of ssh://www.awips2omaha.com:29418/AWIPS2_baseline into master_14.3.1

Conflicts:
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java

Former-commit-id: 43b6c9ff82 [formerly 1cd471ed72] [formerly 1e7d47d2aa [formerly b9d6c75a5c5f4cbe6b1e32f37e044989edf7c39f]]
Former-commit-id: 1e7d47d2aa
Former-commit-id: 331a06fedb
This commit is contained in:
Brian.Dyke 2014-11-06 13:14:24 -05:00
commit f2fad2a476
4 changed files with 53 additions and 46 deletions

View file

@ -101,6 +101,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 09/16/2013 2033 dgilling Remove unused IToolController.
* 12/09/2013 2367 dgilling Instantiate ProcedureJobPool here.
* 09/09/2014 3592 randerso Added call to SampleSetManager.dispose()
* 10/30/2014 3775 randerso Added parmCacheInit to initStatus
*
* </pre>
*
@ -221,7 +222,7 @@ public class DataManager {
this.router = new NotificationRouter(this.getSiteID());
this.parmManager = new ParmManager(this);
GFEParmCacheInitJob cacheJob = new GFEParmCacheInitJob(this.parmManager);
GFEParmCacheInitJob cacheJob = new GFEParmCacheInitJob(this);
cacheJob.setSystem(true);
cacheJob.schedule();
this.refManager = new ReferenceSetManager(this);

View file

@ -29,6 +29,7 @@ package com.raytheon.viz.gfe.core.internal;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 25, 2011 njensen Initial creation
* Oct 30, 2014 #3775 randerso Added parmCacheInit to initStatus
*
* </pre>
*
@ -38,12 +39,22 @@ package com.raytheon.viz.gfe.core.internal;
public class DataMgrInitStatus {
private boolean parmCacheInitDone = false;
private boolean iscInitDone = false;
private boolean selectTRMgrDone = false;
private boolean sampleSetMgrDone = false;
public boolean isParmCacheInitDone() {
return parmCacheInitDone;
}
public void setParmCacheInitDone(boolean parmCacheInitDone) {
this.parmCacheInitDone = parmCacheInitDone;
}
public boolean isIscInitDone() {
return iscInitDone;
}
@ -69,7 +80,8 @@ public class DataMgrInitStatus {
}
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.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.
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.core.IParmManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 19, 2011 njensen Initial creation
* Oct 30, 2014 #3775 randerso Added parmCacheInit to initStatus
*
* </pre>
*
@ -45,11 +46,11 @@ import com.raytheon.viz.gfe.core.IParmManager;
public class GFEParmCacheInitJob extends Job {
private IParmManager parmMgr;
private DataManager dataMgr;
public GFEParmCacheInitJob(IParmManager pm) {
public GFEParmCacheInitJob(DataManager dataMgr) {
super("Parm Cache Initialization");
this.parmMgr = pm;
this.dataMgr = dataMgr;
}
/*
@ -61,7 +62,8 @@ public class GFEParmCacheInitJob extends Job {
@Override
protected IStatus run(IProgressMonitor monitor) {
long t0 = System.currentTimeMillis();
this.parmMgr.getAllAvailableParms();
this.dataMgr.getParmManager().getAllAvailableParms();
this.dataMgr.getInitStatus().setParmCacheInitDone(true);
System.out.println("GFEParmCacheInitJob took: "
+ (System.currentTimeMillis() - t0) + "ms");

View file

@ -144,7 +144,8 @@ import com.raytheon.viz.gfe.types.MutableInteger;
* 05/01/2014 #3105 dgilling Ensure mutable db gets into availableServerDatabases
* if it has to be created during ParmManager construction.
* 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles()
* 10/08/14 #3684 randerso Minor code optimization
* 10/08/2014 #3684 randerso Minor code optimization
* 10/30/2014 #3775 randerso Changed to createMutableDb before getting initial database inventory
* </pre>
*
* @author chammack
@ -361,9 +362,6 @@ public class ParmManager implements IParmManager, IMessageClient {
dbCategories = Arrays.asList(prefs.getStringArray("dbTypes"));
this.availableDatabases = new HashSet<DatabaseID>(
getDatabaseInventory());
this.dbInvChangeListener = new AbstractGFENotificationObserver<DBInvChangeNotification>(
DBInvChangeNotification.class) {
@ -1284,6 +1282,20 @@ public class ParmManager implements IParmManager, IMessageClient {
}
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>(
availableDatabases);
this.availableVCParmDatabases = determineVCParmDatabases(vcModules);
@ -1309,44 +1321,24 @@ public class ParmManager implements IParmManager, IMessageClient {
}
Collections.sort(this.availableServerDatabases);
DatabaseID mutableDbId = getMutableDatabase();
if (mutableDbId.isValid()) {
boolean containsMutable = availableServerDatabases
.contains(mutableDbId);
if (!containsMutable) {
ServerResponse<?> sr = this.dataManager.getClient()
.createNewDb(mutableDbId);
containsMutable = sr.isOkay();
if (containsMutable) {
this.availableServerDatabases.add(mutableDbId);
Collections.sort(this.availableServerDatabases);
if (containsMutable) {
// order of isc databases is important, since ISCDataAccess will
// 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);
}
}
if (containsMutable) {
// order of isc databases is important, since ISCDataAccess will
// 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") && !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
for (DatabaseID dbid : availableVParmDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
}
for (DatabaseID dbid : availableServerDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
}
for (DatabaseID dbid : availableServerDatabases) {
if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
}
}