Issue #1729 Fixed tertiary loader blocking of FFMP dialog draw.
Change-Id: Ib8a66439ac12ed3c55a585219abc7e4200ab10b4 Former-commit-id:680317d9c4
[formerly680317d9c4
[formerly ef45479b067655db8203f199502ea4e772a80e34]] Former-commit-id:fc36146f48
Former-commit-id:1260b40307
This commit is contained in:
parent
36f44524d0
commit
fc90d47619
10 changed files with 168 additions and 120 deletions
|
@ -19,9 +19,9 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.monitor.ffmp;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/**
|
||||
* A data container that holds the site's FFMPSourceData for each source.
|
||||
|
@ -33,6 +33,7 @@ import java.util.Set;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 18, 2013 njensen Initial creation
|
||||
* Feb 28, 2013 1729 dhladky Sped up, synch blocks were hanging it.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -42,7 +43,7 @@ import java.util.Set;
|
|||
|
||||
public class FFMPSiteData {
|
||||
|
||||
private Map<String, FFMPSourceData> sourceMap = new HashMap<String, FFMPSourceData>();
|
||||
private ConcurrentMap<String, FFMPSourceData> sourceMap = new ConcurrentHashMap<String, FFMPSourceData>();
|
||||
|
||||
/**
|
||||
* Gets the data of the specified source
|
||||
|
@ -51,14 +52,17 @@ public class FFMPSiteData {
|
|||
* @return
|
||||
*/
|
||||
public FFMPSourceData getSourceData(String source) {
|
||||
FFMPSourceData sourceData = null;
|
||||
synchronized (sourceMap) {
|
||||
sourceData = sourceMap.get(source);
|
||||
|
||||
FFMPSourceData sourceData = sourceMap.get(source);
|
||||
|
||||
if (sourceData == null) {
|
||||
sourceData = new FFMPSourceData();
|
||||
sourceMap.put(source, sourceData);
|
||||
FFMPSourceData previous = sourceMap.putIfAbsent(source, sourceData);
|
||||
if (previous != null) {
|
||||
return previous;
|
||||
}
|
||||
}
|
||||
|
||||
return sourceData;
|
||||
}
|
||||
|
||||
|
@ -69,7 +73,6 @@ public class FFMPSiteData {
|
|||
for (FFMPSourceData source : sourceMap.values()) {
|
||||
source.clear();
|
||||
}
|
||||
sourceMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
package com.raytheon.uf.viz.monitor.ffmp;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/**
|
||||
* FFMP data container that holds the FFMPSiteData for each site.
|
||||
|
@ -33,6 +33,7 @@ import java.util.Map;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 19, 2013 njensen Initial creation
|
||||
* Feb 28, 2013 1729 dhladky Sped up, synch blocks were hanging it.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -42,17 +43,20 @@ import java.util.Map;
|
|||
|
||||
public class FFMPSiteDataContainer {
|
||||
|
||||
private Map<String, FFMPSiteData> siteDataMap = new HashMap<String, FFMPSiteData>();
|
||||
private ConcurrentMap<String, FFMPSiteData> siteDataMap = new ConcurrentHashMap<String, FFMPSiteData>();
|
||||
|
||||
public FFMPSiteData get(String siteKey) {
|
||||
FFMPSiteData data = null;
|
||||
synchronized (siteDataMap) {
|
||||
data = siteDataMap.get(siteKey);
|
||||
|
||||
FFMPSiteData data = siteDataMap.get(siteKey);
|
||||
|
||||
if (data == null) {
|
||||
data = new FFMPSiteData();
|
||||
siteDataMap.put(siteKey, data);
|
||||
FFMPSiteData previous = siteDataMap.putIfAbsent(siteKey, data);
|
||||
if (previous != null) {
|
||||
return previous;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -61,17 +65,13 @@ public class FFMPSiteDataContainer {
|
|||
for (FFMPSiteData data : vals) {
|
||||
data.clear();
|
||||
}
|
||||
synchronized (siteDataMap) {
|
||||
|
||||
siteDataMap.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public FFMPSiteData removeSite(String siteKey) {
|
||||
FFMPSiteData data = null;
|
||||
synchronized (siteDataMap) {
|
||||
data = siteDataMap.remove(siteKey);
|
||||
}
|
||||
return data;
|
||||
|
||||
return siteDataMap.remove(siteKey);
|
||||
}
|
||||
|
||||
public boolean containsSite(String siteKey) {
|
||||
|
|
|
@ -21,10 +21,10 @@ package com.raytheon.uf.viz.monitor.ffmp;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.ConcurrentNavigableMap;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
|
||||
|
@ -41,6 +41,7 @@ import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 18, 2013 njensen Initial creation
|
||||
* Feb 28, 2013 1729 dhladky Sped up, synch blocks were hanging it.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -58,7 +59,7 @@ public class FFMPSourceData {
|
|||
private ConcurrentNavigableMap<Date, List<String>> availableUris = new ConcurrentSkipListMap<Date, List<String>>();
|
||||
|
||||
/** map of huc to list of loaded URIs **/
|
||||
private Map<String, List<String>> loadedUris = new HashMap<String, List<String>>();
|
||||
private ConcurrentMap<String, List<String>> loadedUris = new ConcurrentHashMap<String, List<String>>();
|
||||
|
||||
/**
|
||||
* Clears the data
|
||||
|
@ -67,10 +68,8 @@ public class FFMPSourceData {
|
|||
ffmpData = null;
|
||||
previousUriQueryDate = null;
|
||||
availableUris.clear();
|
||||
synchronized (loadedUris) {
|
||||
loadedUris.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the FFMPRecord. Possibly null.
|
||||
|
@ -117,14 +116,17 @@ public class FFMPSourceData {
|
|||
* @return
|
||||
*/
|
||||
public List<String> getLoadedUris(String huc) {
|
||||
List<String> loaded = null;
|
||||
synchronized (loadedUris) {
|
||||
loaded = loadedUris.get(huc);
|
||||
|
||||
List<String> loaded = loadedUris.get(huc);
|
||||
|
||||
if (loaded == null) {
|
||||
loaded = new ArrayList<String>();
|
||||
loadedUris.put(huc, loaded);
|
||||
List<String> previous = loadedUris.putIfAbsent(huc, loaded);
|
||||
if (previous != null) {
|
||||
return previous;
|
||||
}
|
||||
}
|
||||
|
||||
return loaded;
|
||||
}
|
||||
|
||||
|
@ -135,15 +137,19 @@ public class FFMPSourceData {
|
|||
* @param uri
|
||||
*/
|
||||
public void addLoadedUri(String huc, String uri) {
|
||||
synchronized (loadedUris) {
|
||||
|
||||
List<String> uriList = loadedUris.get(huc);
|
||||
|
||||
if (uriList == null) {
|
||||
uriList = new ArrayList<String>();
|
||||
loadedUris.put(huc, uriList);
|
||||
List<String> previous = loadedUris.putIfAbsent(huc, uriList);
|
||||
if (previous != null) {
|
||||
uriList = previous;
|
||||
}
|
||||
}
|
||||
|
||||
uriList.add(uri);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this site and source has loaded any URIs yet.
|
||||
|
@ -151,7 +157,7 @@ public class FFMPSourceData {
|
|||
* @return
|
||||
*/
|
||||
public boolean hasLoadedAnyUris() {
|
||||
return (loadedUris.size() > 0);
|
||||
return !loadedUris.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -65,6 +65,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.util.ITimer;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
|
||||
|
@ -113,6 +114,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Changes for non-blocking LoadSaveConfigDlg.
|
||||
* Jan 23, 2013 14907 gzhang GUID not in Thresholds menu even ColorCell true
|
||||
* Feb 10, 2013 1584 mpduff Add performance logging.
|
||||
* Feb 28, 2013 1729 dhladky Adjusted the way in which the dialog load thread rejoins the main GUI thread.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -264,6 +266,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
*/
|
||||
private String previousHuc;
|
||||
|
||||
private FFMPLoaderStatus loadStatus;
|
||||
|
||||
public FfmpBasinTableDlg(Shell parent, FFMPTableData tData,
|
||||
FFMPResource resource) {
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
|
||||
|
@ -1739,11 +1743,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
ffmpTable
|
||||
.setCenteredAggregationKey(resource.centeredAggregationKey);
|
||||
ffmpTable.setTableData(mainTableData);
|
||||
|
||||
resetCursor();
|
||||
shell.pack();
|
||||
shell.redraw();
|
||||
|
||||
if (loadEvent != null) {
|
||||
StatsCollector.stop(initialLoadKey);
|
||||
loadEvent = null;
|
||||
|
@ -2085,14 +2087,14 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
}
|
||||
|
||||
public void updateLoadingLabel(FFMPLoaderStatus status) {
|
||||
this.loadStatus = status;
|
||||
|
||||
if (dataLoadComp == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
GridData gd = (GridData) dataLoadComp.getLayoutData();
|
||||
|
||||
// System.out.println("Status message...");
|
||||
|
||||
if (gd.exclude == true) {
|
||||
((GridData) dataLoadComp.getLayoutData()).exclude = false;
|
||||
dataLoadComp.setVisible(true);
|
||||
|
@ -2120,8 +2122,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
dataLoadComp.setVisible(false);
|
||||
shell.pack();
|
||||
}
|
||||
|
||||
resource.manageLoaders(status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2191,7 +2191,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
|
||||
if (!this.isDisposed()) {
|
||||
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
processUpdate(fupdateData);
|
||||
|
@ -2227,6 +2227,11 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
updateGapValueLabel(fupdateData.getGapValueLabel());
|
||||
|
||||
resetCursor();
|
||||
|
||||
// start tertiary loader if not run yet
|
||||
if (loadStatus != null) {
|
||||
resource.manageLoaders(loadStatus);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,6 +69,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
|
|||
* Feb 1, 2013 DR 1569 dhladky Switched to using pypies records instead of files
|
||||
* Feb 19, 2013 1639 njensen Replaced FFMPCacheRecord with FFMPRecord
|
||||
* feb 20, 2013 1635 dhladky Fixed multi guidance displays
|
||||
* Feb 28, 2013 1729 dhladky General enhancements for speed.
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -180,7 +181,9 @@ public class FFMPDataGenerator {
|
|||
tData = new FFMPTableData();
|
||||
|
||||
try {
|
||||
|
||||
FIELDS field = getBaseField();
|
||||
|
||||
if (field != null) {
|
||||
if (baseRec != null) {
|
||||
FFMPBasinData fbd = null;
|
||||
|
@ -190,7 +193,7 @@ public class FFMPDataGenerator {
|
|||
fbd = baseRec.getBasinData(huc);
|
||||
}
|
||||
|
||||
if (fbd.getBasins().size() > 0) {
|
||||
if (!fbd.getBasins().isEmpty()) {
|
||||
if ((centeredAggregationKey == null) || huc.equals(ALL)) {
|
||||
// System.out.println(fbd.getBasins().keySet().size()
|
||||
// + " rows in the table");
|
||||
|
@ -200,18 +203,19 @@ public class FFMPDataGenerator {
|
|||
|
||||
FFMPBasinMetaData fmdb = ft.getBasin(
|
||||
siteKey, key);
|
||||
String cwa = domain.getCwa();
|
||||
|
||||
if (fmdb == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((domain.getCwa().equals(fmdb
|
||||
if ((cwa.equals(fmdb
|
||||
.getCwa()))
|
||||
|| (domain.isPrimary() && fmdb
|
||||
.isPrimaryCwa())) {
|
||||
|
||||
setFFMPRow(fbd.get(key), tData,
|
||||
false, domain.getCwa());
|
||||
false, cwa);
|
||||
|
||||
if (virtualBasin != null) {
|
||||
for (Long id : ft
|
||||
|
@ -243,7 +247,7 @@ public class FFMPDataGenerator {
|
|||
isVGB = true;
|
||||
}
|
||||
|
||||
if (pfafs.size() > 0) {
|
||||
if (!pfafs.isEmpty()) {
|
||||
|
||||
FFMPBasinMetaData fmdb = ft
|
||||
.getBasinInDomains(siteKey,
|
||||
|
@ -295,13 +299,12 @@ public class FFMPDataGenerator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
tData.sortData();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
statusHandler.handle(Priority.PROBLEM, "Failed to load FFMP table data!", e);
|
||||
}
|
||||
|
||||
return tData;
|
||||
|
@ -344,10 +347,12 @@ public class FFMPDataGenerator {
|
|||
|
||||
rowField = FIELDS.VIRTUAL;
|
||||
|
||||
displayName = ((FFMPVirtualGageBasin) cBasin).getLid();
|
||||
|
||||
if (displayName != null) {
|
||||
String lid = ((FFMPVirtualGageBasin) cBasin).getLid();
|
||||
|
||||
if (lid != null) {
|
||||
|
||||
StringBuilder sb = new StringBuilder(lid);
|
||||
// in this special case it is actually the LID
|
||||
trd.setPfaf(((FFMPVirtualGageBasin) cBasin).getLid());
|
||||
FFMPVirtualGageBasinMetaData fvgmbd = ft
|
||||
|
@ -358,21 +363,22 @@ public class FFMPDataGenerator {
|
|||
Long parentBasinPfaf = fvgmbd.getParentPfaf();
|
||||
|
||||
if (fvgmbd != null) {
|
||||
|
||||
mouseOverText = metabasin.getBasinId() + "\n"
|
||||
+ fvgmbd.getLid() + "-" + fvgmbd.getName();
|
||||
|
||||
if (!huc.equals(ALL)) {
|
||||
displayName += "-" + fvgmbd.getName();
|
||||
sb.append("-").append(fvgmbd.getName());
|
||||
}
|
||||
}
|
||||
|
||||
trd.setTableCellData(0, new FFMPTableCellData(rowField,
|
||||
displayName, mouseOverText));
|
||||
sb.toString(), mouseOverText));
|
||||
|
||||
if (!isWorstCase || huc.equals(ALL)
|
||||
|| (centeredAggregationKey != null)) {
|
||||
|
||||
if (cBasin.getValues().size() > 0) {
|
||||
if (!cBasin.getValues().isEmpty()) {
|
||||
rate = ((FFMPVirtualGageBasin) cBasin)
|
||||
.getValue(paintRefTime);
|
||||
trd.setTableCellData(1, new FFMPTableCellData(
|
||||
|
@ -381,7 +387,7 @@ public class FFMPDataGenerator {
|
|||
trd.setTableCellData(1, new FFMPTableCellData(
|
||||
FIELDS.RATE, Float.NaN));
|
||||
}
|
||||
if (cBasin.getValues().size() > 0) {
|
||||
if (!cBasin.getValues().isEmpty()) {
|
||||
|
||||
if (sliderTime > 0.00) {
|
||||
qpe = cBasin.getAccumValue(monitor.getQpeWindow()
|
||||
|
@ -460,7 +466,7 @@ public class FFMPDataGenerator {
|
|||
forced = forceUtil.isForced();
|
||||
}
|
||||
|
||||
if (((forcedPfafs.size() > 1)) && forced) {
|
||||
if ((!forcedPfafs.isEmpty()) && forced) {
|
||||
// Recalculate the guidance using the forced
|
||||
// value(s)
|
||||
guidance = guidRecords
|
||||
|
@ -473,7 +479,7 @@ public class FFMPDataGenerator {
|
|||
guidance,
|
||||
forcedPfafs,
|
||||
resource.getGuidSourceExpiration(guidType));
|
||||
} else if (forcedPfafs.size() > 1) {
|
||||
} else if (!forcedPfafs.isEmpty()) {
|
||||
guidance = guidRecords
|
||||
.get(guidType)
|
||||
.getBasinData(ALL)
|
||||
|
@ -485,7 +491,7 @@ public class FFMPDataGenerator {
|
|||
forcedPfafs,
|
||||
resource.getGuidSourceExpiration(guidType));
|
||||
forced = true;
|
||||
} else if (pfafList.size() > 1) {
|
||||
} else if (!pfafList.isEmpty()) {
|
||||
guidance = guidRecords
|
||||
.get(guidType)
|
||||
.getBasinData(ALL)
|
||||
|
@ -543,10 +549,12 @@ public class FFMPDataGenerator {
|
|||
displayName = getDisplayName(cBasin);
|
||||
|
||||
if (displayName != null) {
|
||||
trd.setPfaf(cBasin.getPfaf().toString());
|
||||
String cbasinPfaf = cBasin.getPfaf().toString();
|
||||
StringBuilder sb = new StringBuilder(cbasinPfaf);
|
||||
sb.append(cbasinPfaf).append("\n").append(displayName);
|
||||
trd.setPfaf(cbasinPfaf);
|
||||
trd.setTableCellData(0, new FFMPTableCellData(rowField,
|
||||
displayName, cBasin.getPfaf().toString() + "\n"
|
||||
+ displayName));
|
||||
displayName, sb.toString()));
|
||||
|
||||
if (!isWorstCase || huc.equals(ALL)
|
||||
|| (centeredAggregationKey != null)) {
|
||||
|
@ -635,7 +643,7 @@ public class FFMPDataGenerator {
|
|||
forced = forceUtil.isForced();
|
||||
}
|
||||
|
||||
if (((forcedPfafs.size() > 1)) && forced) {
|
||||
if ((!forcedPfafs.isEmpty()) && forced) {
|
||||
// Recalculate the guidance using the forced
|
||||
// value(s)
|
||||
guidance = guidRecords
|
||||
|
@ -648,7 +656,7 @@ public class FFMPDataGenerator {
|
|||
guidance,
|
||||
forcedPfafs,
|
||||
resource.getGuidSourceExpiration(guidType));
|
||||
} else if (forcedPfafs.size() > 1) {
|
||||
} else if (!forcedPfafs.isEmpty()) {
|
||||
guidance = guidRecords
|
||||
.get(guidType)
|
||||
.getBasinData(ALL)
|
||||
|
@ -660,7 +668,7 @@ public class FFMPDataGenerator {
|
|||
forcedPfafs,
|
||||
resource.getGuidSourceExpiration(guidType));
|
||||
forced = true;
|
||||
} else if (pfafList.size() > 1) {
|
||||
} else if (!pfafList.isEmpty()) {
|
||||
guidance = guidRecords
|
||||
.get(guidType)
|
||||
.getBasinData(ALL)
|
||||
|
@ -671,7 +679,7 @@ public class FFMPDataGenerator {
|
|||
Float.NaN,
|
||||
forcedPfafs,
|
||||
resource.getGuidSourceExpiration(guidType));
|
||||
if (forcedPfafs.size() > 0) {
|
||||
if (!forcedPfafs.isEmpty()) {
|
||||
forced = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -803,7 +811,7 @@ public class FFMPDataGenerator {
|
|||
|
||||
ArrayList<Long> pfafs = ft.getAggregatePfafs(basin.getPfaf(),
|
||||
siteKey, huc);
|
||||
if (pfafs.size() > 0) {
|
||||
if (!pfafs.isEmpty()) {
|
||||
if (huc.equals("COUNTY")) {
|
||||
name = ft.getCountyStateName(siteKey, basin.getPfaf());
|
||||
} else {
|
||||
|
@ -846,7 +854,7 @@ public class FFMPDataGenerator {
|
|||
Float qpf = Float.NaN;
|
||||
|
||||
if (cBasin instanceof FFMPVirtualGageBasin) {
|
||||
if (pfafs.size() == 0) {
|
||||
if (!pfafs.isEmpty()) {
|
||||
if (virtualBasin != null) {
|
||||
trd.setTableCellData(
|
||||
1,
|
||||
|
@ -911,7 +919,7 @@ public class FFMPDataGenerator {
|
|||
|
||||
if (!forced) {
|
||||
if ((forcedPfafs != null)
|
||||
&& (forcedPfafs.size() > 0)) {
|
||||
&& (!forcedPfafs.isEmpty())) {
|
||||
forced = true;
|
||||
}
|
||||
}
|
||||
|
@ -944,7 +952,7 @@ public class FFMPDataGenerator {
|
|||
}
|
||||
|
||||
} else {
|
||||
if (pfafs.size() > 0) {
|
||||
if (!pfafs.isEmpty()) {
|
||||
if (rateBasin != null) {
|
||||
rate = rateBasin.getMaxValue(pfafs, paintRefTime);
|
||||
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
|
||||
|
@ -988,7 +996,7 @@ public class FFMPDataGenerator {
|
|||
|
||||
List<Long> pfafList = new ArrayList<Long>();
|
||||
if ((guidBasin != null)
|
||||
&& (guidBasin.getBasins().size() > 0)) {
|
||||
&& (!guidBasin.getBasins().isEmpty())) {
|
||||
if (cBasin.getAggregated()) {
|
||||
pfafList = ft.getAggregatePfafs(cBasin.getPfaf(),
|
||||
siteKey, huc);
|
||||
|
@ -1008,7 +1016,7 @@ public class FFMPDataGenerator {
|
|||
|
||||
if (!forced) {
|
||||
if ((forcedPfafs != null)
|
||||
&& (forcedPfafs.size() > 0)) {
|
||||
&& (!forcedPfafs.isEmpty())) {
|
||||
forced = true;
|
||||
}
|
||||
}
|
||||
|
@ -1050,8 +1058,8 @@ public class FFMPDataGenerator {
|
|||
resource.getGuidSourceExpiration(guidType));
|
||||
}
|
||||
|
||||
if ((qpes.size() > 0)
|
||||
&& ((guids != null) && (guids.size() > 0))) {
|
||||
if ((!qpes.isEmpty())
|
||||
&& ((guids != null) && (!guids.isEmpty()))) {
|
||||
|
||||
trd.setTableCellData(
|
||||
i + 5,
|
||||
|
@ -1144,7 +1152,7 @@ public class FFMPDataGenerator {
|
|||
|
||||
if (!forced) {
|
||||
if ((forcedPfafs != null)
|
||||
&& (forcedPfafs.size() > 0)) {
|
||||
&& (!forcedPfafs.isEmpty())) {
|
||||
forced = true;
|
||||
}
|
||||
}
|
||||
|
@ -1250,14 +1258,14 @@ public class FFMPDataGenerator {
|
|||
try {
|
||||
if (rateRecord != null) {
|
||||
rateBasin = rateRecord.getBasinData(localHuc);
|
||||
if (rateBasin.getBasins().size() > 0) {
|
||||
if (!rateBasin.getBasins().isEmpty()) {
|
||||
field = FIELDS.RATE;
|
||||
baseRec = rateRecord;
|
||||
}
|
||||
}
|
||||
if (qpeRecord != null) {
|
||||
qpeBasin = qpeRecord.getBasinData(localHuc);
|
||||
if (qpeBasin.getBasins().size() > 0) {
|
||||
if (!qpeBasin.getBasins().isEmpty()) {
|
||||
field = FIELDS.QPE;
|
||||
if (baseRec == null) {
|
||||
baseRec = qpeRecord;
|
||||
|
@ -1285,7 +1293,7 @@ public class FFMPDataGenerator {
|
|||
// Get interpolators
|
||||
HashMap<String, FFMPGuidanceInterpolation> interpolators = resource
|
||||
.getGuidanceInterpolators();
|
||||
if ((forceUtils == null) || (forceUtils.size() == 0)) {
|
||||
if ((forceUtils == null) || (forceUtils.isEmpty())) {
|
||||
forceUtils = new HashMap<String, FFFGForceUtil>();
|
||||
|
||||
for (String guidType : interpolators.keySet()) {
|
||||
|
|
|
@ -45,7 +45,6 @@ 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.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoadListener;
|
||||
|
@ -64,6 +63,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoaderEvent;
|
|||
* 25 Jan, 2012 DR13839 gzhang Handle Uris and Huc processing
|
||||
* 01/27/13 1478 D. Hladky revamped the cache file format to help NAS overloading
|
||||
* 02/01/13 1569 D. Hladky Changed to reading aggregate records from pypies
|
||||
* Feb 28, 2013 1729 dhladky Changed the way status messages are sent to the FFMP Dialog.
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -385,6 +385,9 @@ public class FFMPDataLoader extends Thread {
|
|||
statusHandler.handle(Priority.PROBLEM,"General Problem in Loading FFMP Data", e);
|
||||
} finally {
|
||||
isDone = true;
|
||||
synchronized(this) {
|
||||
this.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
String message = null;
|
||||
|
@ -396,7 +399,6 @@ public class FFMPDataLoader extends Thread {
|
|||
|
||||
long endTime = (System.currentTimeMillis()) - time;
|
||||
System.out.println(loadType.loaderType + " Loader took: " + endTime / 1000 + " seconds");
|
||||
|
||||
fireLoaderEvent(loadType, message, isDone);
|
||||
}
|
||||
|
||||
|
@ -408,11 +410,9 @@ public class FFMPDataLoader extends Thread {
|
|||
public void fireLoaderEvent(LOADER_TYPE ltype, String lmessage,
|
||||
boolean lstatus) {
|
||||
|
||||
final FFMPLoaderStatus sstatus = new FFMPLoaderStatus(ltype, lmessage,
|
||||
FFMPLoaderStatus sstatus = new FFMPLoaderStatus(ltype, lmessage,
|
||||
lstatus);
|
||||
|
||||
VizApp.runAsync(new Runnable() {
|
||||
public void run() {
|
||||
FFMPLoaderEvent fle = new FFMPLoaderEvent(sstatus);
|
||||
Iterator<FFMPLoadListener> iter = loadListeners.iterator();
|
||||
|
||||
|
@ -420,16 +420,13 @@ public class FFMPDataLoader extends Thread {
|
|||
FFMPLoadListener listener = iter.next();
|
||||
listener.loadStatus(fle);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private FFMPMonitor getMonitor() {
|
||||
if (FFMPMonitor.isRunning()) {
|
||||
// System.out.println("Monitor is running...");
|
||||
return FFMPMonitor.getInstance();
|
||||
} else {
|
||||
// System.out.println("Monitor is dead...");
|
||||
isDone = true;
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -161,6 +161,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* 10 Feb 2013 1584 mpduff Add performance logging.
|
||||
* Feb 19, 2013 1639 njensen Replaced FFMPCacheRecord with FFMPRecord
|
||||
* Feb 20, 2013 1635 dhladky Fixed multiple guidance display
|
||||
* Feb 28, 2013 1729 dhladky Changed the way the loaders are managed via the status updates.
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -476,9 +477,12 @@ public class FFMPResource extends
|
|||
} else {
|
||||
while (!loader.isDone) {
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
synchronized (loader) {
|
||||
loader.wait(1000);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
statusHandler.handle(Priority.INFO,
|
||||
"Data Loader thread interrupted, dying!", e);
|
||||
}
|
||||
}
|
||||
startLoader(previousMostRecentTime, ffmpRec
|
||||
|
@ -488,9 +492,12 @@ public class FFMPResource extends
|
|||
|
||||
while (!loader.isDone) {
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
synchronized (loader) {
|
||||
loader.wait();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
statusHandler.handle(Priority.INFO,
|
||||
"Data Loader thread interrupted, dying!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4182,10 +4189,18 @@ public class FFMPResource extends
|
|||
if (basinTableDlg != null) {
|
||||
// call to update the basin table dialog
|
||||
if (event.getSource() instanceof FFMPLoaderStatus) {
|
||||
FFMPLoaderStatus status = (FFMPLoaderStatus) event.getSource();
|
||||
final FFMPLoaderStatus status = (FFMPLoaderStatus) event
|
||||
.getSource();
|
||||
VizApp.runAsync(new Runnable() {
|
||||
public void run() {
|
||||
if (basinTableDlg != null
|
||||
&& !basinTableDlg.isDisposed()) {
|
||||
basinTableDlg.updateLoadingLabel(status);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4366,14 +4381,13 @@ public class FFMPResource extends
|
|||
- (6 * TimeUtil.MILLIS_PER_HOUR));
|
||||
FFMPMonitor.getInstance().startLoad(this, startDate,
|
||||
LOADER_TYPE.TERTIARY);
|
||||
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Secondary Data Load failure", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We don't really care about status of tertiary and general loaders
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML;
|
|||
* 29 June, 2009 2521 dhladky Initial creation
|
||||
* 02/01/13 1569 D. Hladky Added constants
|
||||
* Feb 10, 2013 1584 mpduff Add performance logging.
|
||||
* Feb 28, 2013 1729 dhladky Got rid of thread sleeps
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -204,11 +205,15 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
|
|||
"Failed to read template in allotted time");
|
||||
break;
|
||||
}
|
||||
Thread.sleep(50);
|
||||
if (floader != null) {
|
||||
synchronized (floader) {
|
||||
floader.wait(1000);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
statusHandler.handle(Priority.INFO,
|
||||
"Data Loader thread interrupted, dying!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,10 +269,13 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
|
|||
"Didn't load initial data in allotted time, releasing table");
|
||||
break;
|
||||
}
|
||||
Thread.sleep(30);
|
||||
synchronized (loader) {
|
||||
loader.wait(1000);
|
||||
}
|
||||
i++;
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
statusHandler.handle(Priority.INFO,
|
||||
"Data Loader thread interrupted, dying!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg;
|
|||
* Oct 13, 2011 dhladky Initial creation.
|
||||
* Jul 31, 2012 14517 mpduff Fix for Rapid slider changes
|
||||
* 02/01/13 1569 D. Hladky Added constants
|
||||
* Feb 28, 2013 1729 dhladky Removed un-necessary logging.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -150,6 +151,9 @@ public class FFMPTableDataLoader extends Thread {
|
|||
FFMPDataGenerator dg = new FFMPDataGenerator(
|
||||
ffmp, resource);
|
||||
tData = dg.generateFFMPData();
|
||||
|
||||
|
||||
|
||||
drawable.setTableData(iHuc, tData);
|
||||
drawable.setDrawTime(origDrawTime);
|
||||
}
|
||||
|
@ -163,7 +167,6 @@ public class FFMPTableDataLoader extends Thread {
|
|||
// multiple table cells
|
||||
statusHandler.handle(Priority.WARN,
|
||||
"No Data available...");
|
||||
System.err.println("NO Data Available...");
|
||||
}
|
||||
|
||||
if (tData != null) {
|
||||
|
@ -210,7 +213,6 @@ public class FFMPTableDataLoader extends Thread {
|
|||
tableDataUpdate.setSourceUpdate(sourceUpdate);
|
||||
|
||||
isDone = true;
|
||||
|
||||
callback.tableDataUpdateComplete(tableDataUpdate);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 06/03/09 2521 D. Hladky Initial release
|
||||
* 01/27/13 1478 D. Hladky OUN memory help
|
||||
* Feb 28, 2013 1729 dhladky Supressed un-necessary debug loggers
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -580,10 +581,14 @@ public class FFMPRecord extends ServerSpecificPersistablePluginDataObject
|
|||
uri + "/" + domain.getCwa(), ALL,
|
||||
Request.ALL);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
// This is a routine error. Sometimes you can not have data for a configured source
|
||||
// This suppresses spurrious messages that would inflate the loags needlessly.
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler.handle(Priority.DEBUG,
|
||||
"FFMPRecord: no data for: " + uri + "/"
|
||||
+ domain.getCwa());
|
||||
}
|
||||
}
|
||||
|
||||
if (rec != null) {
|
||||
float[] values = ((FloatDataRecord) rec)
|
||||
|
|
Loading…
Add table
Reference in a new issue