Merge "Issue #1635 Second Guidance source verification, general cleanup" into development
Former-commit-id:73f53bd513
[formerlya9c4e54287
[formerly 25ecfc3e6199294275abc8547c482388c55be724]] Former-commit-id:a9c4e54287
Former-commit-id:033b9e3852
This commit is contained in:
commit
a8e81097fc
8 changed files with 1286 additions and 1307 deletions
|
@ -91,6 +91,7 @@ import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
|
||||||
* 02/01/13 1569 D. Hladky updated constants
|
* 02/01/13 1569 D. Hladky updated constants
|
||||||
* 02/01/13 1627 D. Hladky removed unused(useless) db load method
|
* 02/01/13 1627 D. Hladky removed unused(useless) db load method
|
||||||
* 02/19/13 1639 njensen Replaced ConcurrentHashMaps with data structures
|
* 02/19/13 1639 njensen Replaced ConcurrentHashMaps with data structures
|
||||||
|
* 02/20/13 1635 D. Hladky Fixed multi guidance sources
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -119,23 +120,6 @@ public class FFMPMonitor extends ResourceMonitor {
|
||||||
|
|
||||||
private FFMPSiteDataContainer siteDataMap = new FFMPSiteDataContainer();
|
private FFMPSiteDataContainer siteDataMap = new FFMPSiteDataContainer();
|
||||||
|
|
||||||
// /** FFMP Records indexed by site, times and field **/
|
|
||||||
// public ConcurrentHashMap<String, ConcurrentHashMap<String,
|
|
||||||
// FFMPCacheRecord>> ffmpData = null;
|
|
||||||
//
|
|
||||||
// // list of earliest available date queried by site, sourceName
|
|
||||||
// public ConcurrentHashMap<String, ConcurrentHashMap<String, Date>>
|
|
||||||
// ffmpAvailableUriQueryDates = null;
|
|
||||||
//
|
|
||||||
// // map by site, sourceName, Date
|
|
||||||
// public ConcurrentHashMap<String, ConcurrentHashMap<String,
|
|
||||||
// ConcurrentSkipListMap<Date, List<String>>>> ffmpAvailableUris = null;
|
|
||||||
//
|
|
||||||
// // map by field, huc, and the URIs that have been loaded for
|
|
||||||
// public ConcurrentHashMap<String, ConcurrentHashMap<String,
|
|
||||||
// ConcurrentHashMap<String, ConcurrentHashMap<String, String>>>>
|
|
||||||
// ffmpLoadedUris = null;
|
|
||||||
|
|
||||||
// Interpolation Guidance Sources
|
// Interpolation Guidance Sources
|
||||||
public FFMPGuidanceInterpolation interpolation = null;
|
public FFMPGuidanceInterpolation interpolation = null;
|
||||||
|
|
||||||
|
@ -890,7 +874,7 @@ public class FFMPMonitor extends ResourceMonitor {
|
||||||
ffmpSplash.close();
|
ffmpSplash.close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Thread.sleep(1000);
|
Thread.sleep(100);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if (ffmpSplash != null) {
|
if (ffmpSplash != null) {
|
||||||
|
|
|
@ -1122,19 +1122,21 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
||||||
|
|
||||||
private void updateGapValueLabel(double gapVal) {
|
private void updateGapValueLabel(double gapVal) {
|
||||||
|
|
||||||
if (gapVal > 0.75) {
|
if (gapValueLbl != null) {
|
||||||
gapValueLbl.setBackground(getDisplay()
|
if (gapVal > 0.75) {
|
||||||
.getSystemColor(SWT.COLOR_RED));
|
gapValueLbl.setBackground(getDisplay().getSystemColor(
|
||||||
} else if (gapVal > 0.30) {
|
SWT.COLOR_RED));
|
||||||
gapValueLbl.setBackground(getDisplay().getSystemColor(
|
} else if (gapVal > 0.30) {
|
||||||
SWT.COLOR_YELLOW));
|
gapValueLbl.setBackground(getDisplay().getSystemColor(
|
||||||
} else {
|
SWT.COLOR_YELLOW));
|
||||||
gapValueLbl.setBackground(getDisplay().getSystemColor(
|
} else {
|
||||||
SWT.COLOR_GREEN));
|
gapValueLbl.setBackground(getDisplay().getSystemColor(
|
||||||
}
|
SWT.COLOR_GREEN));
|
||||||
|
}
|
||||||
|
|
||||||
String str = String.format("%2.2f ", gapVal);
|
String str = String.format("%2.2f ", gapVal);
|
||||||
gapValueLbl.setText(str);
|
gapValueLbl.setText(str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initTimeDuration() {
|
private void initTimeDuration() {
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package com.raytheon.uf.viz.monitor.ffmp.ui.dialogs;
|
package com.raytheon.uf.viz.monitor.ffmp.ui.dialogs;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -46,8 +47,10 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 8, 2011 lvenable Initial creation
|
* Mar 8, 2011 lvenable Initial creation
|
||||||
* Mar 8, 2012 DR 14406 gzhang Fixing QPF Column Title Missing
|
* Mar 8, 2012 DR 14406 gzhang Fixing QPF Column Title Missing
|
||||||
|
* Feb 19, 2013 1635 dhladky Fixed multiple guidance displays
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
@ -261,6 +264,7 @@ public class FfmpTableConfigData {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> guidTypes = productXml.getAvailableGuidanceTypes();
|
ArrayList<String> guidTypes = productXml.getAvailableGuidanceTypes();
|
||||||
|
Collections.sort(guidTypes);
|
||||||
|
|
||||||
ffmpTableColMap.put(COLUMN_NAME.NAME.getColumnName(),
|
ffmpTableColMap.put(COLUMN_NAME.NAME.getColumnName(),
|
||||||
COLUMN_NAME.NAME.getColumnName());
|
COLUMN_NAME.NAME.getColumnName());
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -160,6 +160,7 @@ import com.vividsolutions.jts.geom.Point;
|
||||||
* 02/01/13 1569 D. Hladky Added constants
|
* 02/01/13 1569 D. Hladky Added constants
|
||||||
* 10 Feb 2013 1584 mpduff Add performance logging.
|
* 10 Feb 2013 1584 mpduff Add performance logging.
|
||||||
* Feb 19, 2013 1639 njensen Replaced FFMPCacheRecord with FFMPRecord
|
* Feb 19, 2013 1639 njensen Replaced FFMPCacheRecord with FFMPRecord
|
||||||
|
* Feb 20, 2013 1635 dhladky Fixed multiple guidance display
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -475,7 +476,7 @@ public class FFMPResource extends
|
||||||
} else {
|
} else {
|
||||||
while (!loader.isDone) {
|
while (!loader.isDone) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(10);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -487,7 +488,7 @@ public class FFMPResource extends
|
||||||
|
|
||||||
while (!loader.isDone) {
|
while (!loader.isDone) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(10);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -708,7 +709,7 @@ public class FFMPResource extends
|
||||||
value = getGuidanceRecord().getBasinData(FFMPRecord.ALL)
|
value = getGuidanceRecord().getBasinData(FFMPRecord.ALL)
|
||||||
.getMaxGuidanceValue(pfafs,
|
.getMaxGuidanceValue(pfafs,
|
||||||
getGuidanceInterpolation(getFFGName()),
|
getGuidanceInterpolation(getFFGName()),
|
||||||
getGuidSourceExpiration(), fips);
|
getGuidSourceExpiration(getFFGName()), fips);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QPE: {
|
case QPE: {
|
||||||
|
@ -803,6 +804,7 @@ public class FFMPResource extends
|
||||||
private float forceValue(List<Long> pfafs, FFMPBasin basin,
|
private float forceValue(List<Long> pfafs, FFMPBasin basin,
|
||||||
float unforcedValue) {
|
float unforcedValue) {
|
||||||
float value = unforcedValue;
|
float value = unforcedValue;
|
||||||
|
String ffgType = getFFGName();
|
||||||
|
|
||||||
if (forceUtil == null) {
|
if (forceUtil == null) {
|
||||||
forceUtil = new FFFGForceUtil(this, getFFGName());
|
forceUtil = new FFFGForceUtil(this, getFFGName());
|
||||||
|
@ -821,15 +823,15 @@ public class FFMPResource extends
|
||||||
// Recalculate the guidance using the forced value(s)
|
// Recalculate the guidance using the forced value(s)
|
||||||
value = guidRecord.getBasinData(FFMPRecord.ALL)
|
value = guidRecord.getBasinData(FFMPRecord.ALL)
|
||||||
.getAverageGuidanceValue(pfafList,
|
.getAverageGuidanceValue(pfafList,
|
||||||
this.getGuidanceInterpolation(getFFGName()),
|
this.getGuidanceInterpolation(ffgType),
|
||||||
new Float(value), forcedPfafs,
|
new Float(value), forcedPfafs,
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(ffgType));
|
||||||
} else if (forcedPfafs.size() > 0) {
|
} else if (forcedPfafs.size() > 0) {
|
||||||
value = guidRecord.getBasinData(FFMPRecord.ALL)
|
value = guidRecord.getBasinData(FFMPRecord.ALL)
|
||||||
.getAverageGuidanceValue(pfafList,
|
.getAverageGuidanceValue(pfafList,
|
||||||
this.getGuidanceInterpolation(getFFGName()),
|
this.getGuidanceInterpolation(ffgType),
|
||||||
Float.NaN, forcedPfafs,
|
Float.NaN, forcedPfafs,
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(ffgType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1870,6 +1872,7 @@ public class FFMPResource extends
|
||||||
float qpe = 0.0f;
|
float qpe = 0.0f;
|
||||||
float guid = 0.0f;
|
float guid = 0.0f;
|
||||||
float diff = Float.NaN;
|
float diff = Float.NaN;
|
||||||
|
String ffgType = getFFGName();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (aggregate) {
|
if (aggregate) {
|
||||||
|
@ -1886,8 +1889,8 @@ public class FFMPResource extends
|
||||||
guids = getGuidanceRecord()
|
guids = getGuidanceRecord()
|
||||||
.getBasinData(FFMPRecord.ALL)
|
.getBasinData(FFMPRecord.ALL)
|
||||||
.getGuidanceValues(pfafs,
|
.getGuidanceValues(pfafs,
|
||||||
getGuidanceInterpolation(getFFGName()),
|
getGuidanceInterpolation(ffgType),
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(ffgType));
|
||||||
}
|
}
|
||||||
if ((qpes != null) && (guids != null)) {
|
if ((qpes != null) && (guids != null)) {
|
||||||
diff = FFMPUtils.getMaxDiffValue(qpes, guids);
|
diff = FFMPUtils.getMaxDiffValue(qpes, guids);
|
||||||
|
@ -1908,7 +1911,7 @@ public class FFMPResource extends
|
||||||
guid = getGuidanceValue(
|
guid = getGuidanceValue(
|
||||||
(FFMPGuidanceBasin) getGuidanceRecord()
|
(FFMPGuidanceBasin) getGuidanceRecord()
|
||||||
.getBasinData(getHuc()).get(key),
|
.getBasinData(getHuc()).get(key),
|
||||||
recentTime, getFFGName());
|
recentTime, ffgType);
|
||||||
|
|
||||||
diff = FFMPUtils.getDiffValue(qpe, guid);
|
diff = FFMPUtils.getDiffValue(qpe, guid);
|
||||||
}
|
}
|
||||||
|
@ -1924,7 +1927,7 @@ public class FFMPResource extends
|
||||||
guid = getGuidanceValue(
|
guid = getGuidanceValue(
|
||||||
(FFMPGuidanceBasin) getGuidanceRecord()
|
(FFMPGuidanceBasin) getGuidanceRecord()
|
||||||
.getBasinData(FFMPRecord.ALL).get(key),
|
.getBasinData(FFMPRecord.ALL).get(key),
|
||||||
recentTime, getFFGName());
|
recentTime, ffgType);
|
||||||
guid = forceValue(pfafs,
|
guid = forceValue(pfafs,
|
||||||
getBasin(key, getField(), recentTime, aggregate),
|
getBasin(key, getField(), recentTime, aggregate),
|
||||||
guid);
|
guid);
|
||||||
|
@ -1932,7 +1935,7 @@ public class FFMPResource extends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
statusHandler.handle(Priority.ERROR, "Error caculating Diff", e);
|
||||||
}
|
}
|
||||||
return diff;
|
return diff;
|
||||||
}
|
}
|
||||||
|
@ -1950,6 +1953,7 @@ public class FFMPResource extends
|
||||||
float qpe = 0.0f;
|
float qpe = 0.0f;
|
||||||
float guid = 0.0f;
|
float guid = 0.0f;
|
||||||
float ratio = Float.NaN;
|
float ratio = Float.NaN;
|
||||||
|
String ffgType = getFFGName();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (aggregate) {
|
if (aggregate) {
|
||||||
|
@ -1966,8 +1970,8 @@ public class FFMPResource extends
|
||||||
guids = getGuidanceRecord()
|
guids = getGuidanceRecord()
|
||||||
.getBasinData(FFMPRecord.ALL)
|
.getBasinData(FFMPRecord.ALL)
|
||||||
.getGuidanceValues(pfafs,
|
.getGuidanceValues(pfafs,
|
||||||
getGuidanceInterpolation(getFFGName()),
|
getGuidanceInterpolation(ffgType),
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(ffgType));
|
||||||
}
|
}
|
||||||
if ((qpes != null) && (guids != null)) {
|
if ((qpes != null) && (guids != null)) {
|
||||||
ratio = FFMPUtils.getMaxRatioValue(qpes, guids);
|
ratio = FFMPUtils.getMaxRatioValue(qpes, guids);
|
||||||
|
@ -1987,7 +1991,7 @@ public class FFMPResource extends
|
||||||
guid = getGuidanceValue(
|
guid = getGuidanceValue(
|
||||||
(FFMPGuidanceBasin) getGuidanceRecord()
|
(FFMPGuidanceBasin) getGuidanceRecord()
|
||||||
.getBasinData(getHuc()).get(key),
|
.getBasinData(getHuc()).get(key),
|
||||||
recentTime, getFFGName());
|
recentTime, ffgType);
|
||||||
ratio = FFMPUtils.getRatioValue(qpe, guid);
|
ratio = FFMPUtils.getRatioValue(qpe, guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2001,12 +2005,12 @@ public class FFMPResource extends
|
||||||
guid = getGuidanceValue(
|
guid = getGuidanceValue(
|
||||||
(FFMPGuidanceBasin) getGuidanceRecord()
|
(FFMPGuidanceBasin) getGuidanceRecord()
|
||||||
.getBasinData(FFMPRecord.ALL).get(key),
|
.getBasinData(FFMPRecord.ALL).get(key),
|
||||||
recentTime, getFFGName());
|
recentTime, ffgType);
|
||||||
ratio = FFMPUtils.getRatioValue(qpe, guid);
|
ratio = FFMPUtils.getRatioValue(qpe, guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
statusHandler.handle(Priority.ERROR, "Error caculating Ratio", e);
|
||||||
}
|
}
|
||||||
return ratio;
|
return ratio;
|
||||||
}
|
}
|
||||||
|
@ -3426,14 +3430,14 @@ public class FFMPResource extends
|
||||||
for (SourceXML ffgSource : getProduct().getGuidanceSourcesByType(
|
for (SourceXML ffgSource : getProduct().getGuidanceSourcesByType(
|
||||||
ffgGraphType)) {
|
ffgGraphType)) {
|
||||||
if (guidBasin.getValue(ffgSource.getSourceName(),
|
if (guidBasin.getValue(ffgSource.getSourceName(),
|
||||||
guidanceInterpolator, getGuidSourceExpiration()) != null) {
|
guidanceInterpolator, getGuidSourceExpiration(ffgGraphType)) != null) {
|
||||||
|
|
||||||
double time = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
|
double time = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
|
||||||
FFMPGuiUtils.getHourDisplacement(mostRecentRefTime,
|
FFMPGuiUtils.getHourDisplacement(mostRecentRefTime,
|
||||||
ffgSource.getDurationHour()));
|
ffgSource.getDurationHour()));
|
||||||
fgd.setGuid(time, (double) guidBasin.getValue(
|
fgd.setGuid(time, (double) guidBasin.getValue(
|
||||||
ffgSource.getSourceName(), guidanceInterpolator,
|
ffgSource.getSourceName(), guidanceInterpolator,
|
||||||
getGuidSourceExpiration()));
|
getGuidSourceExpiration(ffgGraphType)));
|
||||||
guidTimes.add(time);
|
guidTimes.add(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3503,13 +3507,13 @@ public class FFMPResource extends
|
||||||
guidanceInterpolator
|
guidanceInterpolator
|
||||||
.getInterpolationOffset(),
|
.getInterpolationOffset(),
|
||||||
guidanceInterpolator,
|
guidanceInterpolator,
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(ffgGraphType));
|
||||||
} else {
|
} else {
|
||||||
if (guidanceInterpolator.getSource1() != null) {
|
if (guidanceInterpolator.getSource1() != null) {
|
||||||
guidancev = guidBasin.getValue(
|
guidancev = guidBasin.getValue(
|
||||||
guidanceInterpolator.getSource1(),
|
guidanceInterpolator.getSource1(),
|
||||||
guidanceInterpolator,
|
guidanceInterpolator,
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(ffgGraphType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3934,12 +3938,12 @@ public class FFMPResource extends
|
||||||
getGuidanceInterpolation(guidType)
|
getGuidanceInterpolation(guidType)
|
||||||
.getInterpolationOffset(),
|
.getInterpolationOffset(),
|
||||||
getGuidanceInterpolation(guidType),
|
getGuidanceInterpolation(guidType),
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(guidType));
|
||||||
} else {
|
} else {
|
||||||
dvalue = basin.getValue(getGuidanceInterpolation(guidType)
|
dvalue = basin.getValue(getGuidanceInterpolation(guidType)
|
||||||
.getStandardSource(),
|
.getStandardSource(),
|
||||||
getGuidanceInterpolation(guidType),
|
getGuidanceInterpolation(guidType),
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(guidType));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dvalue == FFMPUtils.MISSING) {
|
if (dvalue == FFMPUtils.MISSING) {
|
||||||
|
@ -3948,7 +3952,7 @@ public class FFMPResource extends
|
||||||
} else {
|
} else {
|
||||||
dvalue = basin.getValue(getPrimarySource(), recentTime,
|
dvalue = basin.getValue(getPrimarySource(), recentTime,
|
||||||
getGuidanceInterpolation(guidType),
|
getGuidanceInterpolation(guidType),
|
||||||
getGuidSourceExpiration());
|
getGuidSourceExpiration(guidType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4125,18 +4129,12 @@ public class FFMPResource extends
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public long getGuidSourceExpiration() {
|
public long getGuidSourceExpiration(String guidType) {
|
||||||
if (guidSourceExpiration == 0l) {
|
if (guidSourceExpiration == 0l) {
|
||||||
if (getProduct() != null) {
|
if (getProduct() != null) {
|
||||||
|
|
||||||
String guidSrc = FFMPConfig.getInstance().getFFMPConfigData()
|
|
||||||
.getIncludedGuids();
|
|
||||||
if (guidSrc.contains(",")) {
|
|
||||||
String[] parts = guidSrc.split(",");
|
|
||||||
guidSrc = parts[0];
|
|
||||||
}
|
|
||||||
SourceXML source = getProduct().getGuidanceSourcesByType(
|
SourceXML source = getProduct().getGuidanceSourcesByType(
|
||||||
guidSrc).get(0);
|
guidType).get(0);
|
||||||
guidSourceExpiration = source
|
guidSourceExpiration = source
|
||||||
.getExpirationMinutes(getSiteKey())
|
.getExpirationMinutes(getSiteKey())
|
||||||
* TimeUtil.MILLIS_PER_MINUTE;
|
* TimeUtil.MILLIS_PER_MINUTE;
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.uf.common.stats.StatisticsEvent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 8, 2013 mpduff Initial creation
|
* Feb 8, 2013 mpduff Initial creation
|
||||||
|
* Feb 19, 2013 1635 dhladky Safety from null
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -106,8 +107,9 @@ public class StatsCollector {
|
||||||
*/
|
*/
|
||||||
public void setStop(String key) {
|
public void setStop(String key) {
|
||||||
StatisticsEvent event = statsDataMap.remove(key);
|
StatisticsEvent event = statsDataMap.remove(key);
|
||||||
event.finalizeEvent();
|
if (event != null) {
|
||||||
|
event.finalizeEvent();
|
||||||
EventBus.publish(event);
|
EventBus.publish(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ import com.vividsolutions.jts.io.WKBReader;
|
||||||
* 07/09/10 3914 D. Hladky Localization work
|
* 07/09/10 3914 D. Hladky Localization work
|
||||||
* 12/13/10 7484 D. Hladky Service Backup
|
* 12/13/10 7484 D. Hladky Service Backup
|
||||||
* 02/01/13 1569 D.Hladky Constants
|
* 02/01/13 1569 D.Hladky Constants
|
||||||
|
* 02/20/13 1635 D. Hladky Constants
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -568,7 +569,7 @@ public class FFMPTemplates {
|
||||||
"FFMPTemplate: Starting site template process " + dataKey
|
"FFMPTemplate: Starting site template process " + dataKey
|
||||||
+ ":" + cwa + ":" + huc);
|
+ ":" + cwa + ":" + huc);
|
||||||
// special handling for VGB's
|
// special handling for VGB's
|
||||||
if (huc.equals("VIRTUAL")) {
|
if (huc.equals(FFMPRecord.VIRTUAL)) {
|
||||||
getVirtualGageBasins(dataKey, cwa);
|
getVirtualGageBasins(dataKey, cwa);
|
||||||
} else {
|
} else {
|
||||||
getMap(dataKey, cwa, huc);
|
getMap(dataKey, cwa, huc);
|
||||||
|
|
|
@ -111,6 +111,7 @@ import com.raytheon.uf.edex.plugin.ffmp.common.FFTIProcessor;
|
||||||
* 07/31/2011 578 dhladky FFTI modifications
|
* 07/31/2011 578 dhladky FFTI modifications
|
||||||
* 01/27/13 1478 D. Hladky Added creation of full cache records to help read write stress on NAS
|
* 01/27/13 1478 D. Hladky Added creation of full cache records to help read write stress on NAS
|
||||||
* 02/01/13 1569 D. Hladky Added constants, switched to using aggregate records written through pypies
|
* 02/01/13 1569 D. Hladky Added constants, switched to using aggregate records written through pypies
|
||||||
|
* 02/20/13 1635 D. Hladky Added some finally methods to increase dead lock safety. Reduced wait times for threads.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -468,15 +469,19 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
while (processes.size() > 0) {
|
while (processes.size() > 0) {
|
||||||
// wait for all threads to finish before returning
|
// wait for all threads to finish before returning
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(50);
|
||||||
statusHandler.handle(Priority.DEBUG,
|
|
||||||
"Checking status ..." + processes.size());
|
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
for (String source : processes.keySet()) {
|
|
||||||
statusHandler.handle(Priority.DEBUG,
|
statusHandler.handle(Priority.DEBUG,
|
||||||
"Still processing ..." + source);
|
"Checking status ..." + processes.size());
|
||||||
|
for (String source : processes.keySet()) {
|
||||||
|
statusHandler.handle(Priority.DEBUG,
|
||||||
|
"Still processing ..." + source);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
statusHandler.handle(Priority.WARN,
|
||||||
|
"Thread interrupted ..." + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,9 +511,11 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
|
|
||||||
while (fftiSources.size() > 0) {
|
while (fftiSources.size() > 0) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(50);
|
||||||
statusHandler.handle(Priority.DEBUG,
|
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
"Checking status ..." + fftiDone);
|
statusHandler.handle(Priority.DEBUG,
|
||||||
|
"Checking status ..." + fftiDone);
|
||||||
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
statusHandler.handle(Priority.DEBUG,
|
statusHandler.handle(Priority.DEBUG,
|
||||||
"Checking status failed!" + e);
|
"Checking status failed!" + e);
|
||||||
|
@ -532,8 +539,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(Priority.ERROR,
|
||||||
"Unable to process FFMP Records.");
|
"Unable to process FFMP Records.", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -585,19 +591,25 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
statusHandler.handle(
|
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
Priority.DEBUG,
|
statusHandler.handle(
|
||||||
"ProcessProduct: Starting thread "
|
Priority.DEBUG,
|
||||||
+ ffmpProduct.getSourceName());
|
"ProcessProduct: Starting thread "
|
||||||
|
+ ffmpProduct.getSourceName());
|
||||||
|
}
|
||||||
process();
|
process();
|
||||||
statusHandler.handle(
|
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
Priority.DEBUG,
|
statusHandler.handle(
|
||||||
"ProcessProduct: Finishing thread "
|
Priority.DEBUG,
|
||||||
+ ffmpProduct.getSourceName());
|
"ProcessProduct: Finishing thread "
|
||||||
|
+ ffmpProduct.getSourceName());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
processes.remove(ffmpProduct.getSourceName());
|
|
||||||
statusHandler.handle(Priority.ERROR, "ProcessProduct: removed "
|
statusHandler.handle(Priority.ERROR, "ProcessProduct: removed "
|
||||||
+ ffmpProduct.getSourceName(), e);
|
+ ffmpProduct.getSourceName(), e);
|
||||||
|
} finally {
|
||||||
|
// resets the process list
|
||||||
|
processes.remove(ffmpProduct.getSourceName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -748,12 +760,15 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
while (productKeys.size() > 0) {
|
while (productKeys.size() > 0) {
|
||||||
// wait for all threads to finish before returning
|
// wait for all threads to finish before returning
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(50);
|
||||||
statusHandler.handle(Priority.DEBUG,
|
|
||||||
"Checking status ..." + productKeys.size());
|
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||||
for (String source : productKeys.keySet()) {
|
|
||||||
statusHandler.handle(Priority.DEBUG,
|
statusHandler.handle(Priority.DEBUG,
|
||||||
"Still processing ..." + source);
|
"Checking status ..." + productKeys.size());
|
||||||
|
for (String source : productKeys.keySet()) {
|
||||||
|
statusHandler.handle(Priority.DEBUG,
|
||||||
|
"Still processing ..." + source);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
statusHandler.handle(Priority.WARN,
|
statusHandler.handle(Priority.WARN,
|
||||||
|
@ -767,7 +782,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
recs[i] = ffmpRecords.get(i);
|
recs[i] = ffmpRecords.get(i);
|
||||||
}
|
}
|
||||||
products.put(ffmpProduct.getSourceName(), recs);
|
products.put(ffmpProduct.getSourceName(), recs);
|
||||||
processes.remove(ffmpProduct.getSourceName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,8 +825,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
*/
|
*/
|
||||||
public void createUnifiedGeometries(DomainXML domain) {
|
public void createUnifiedGeometries(DomainXML domain) {
|
||||||
ArrayList<String> hucsToGen = new ArrayList<String>();
|
ArrayList<String> hucsToGen = new ArrayList<String>();
|
||||||
hucsToGen.add("ALL");
|
hucsToGen.add(FFMPRecord.ALL);
|
||||||
hucsToGen.add("COUNTY");
|
hucsToGen.add(FFMPRecord.COUNTY);
|
||||||
|
|
||||||
for (int i = template.getTotalHucLevels() - 1; i >= 0; i--) {
|
for (int i = template.getTotalHucLevels() - 1; i >= 0; i--) {
|
||||||
hucsToGen.add("HUC" + i);
|
hucsToGen.add("HUC" + i);
|
||||||
|
@ -877,7 +891,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
// Didn't process a domain, locked by another cluster
|
// Didn't process a domain, locked by another cluster
|
||||||
// member, sleep and try again
|
// member, sleep and try again
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(50);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
statusHandler.handle(Priority.WARN,
|
statusHandler.handle(Priority.WARN,
|
||||||
"Domain processing Interrupted!", e);
|
"Domain processing Interrupted!", e);
|
||||||
|
@ -1204,10 +1218,11 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
||||||
statusHandler.handle(Priority.ERROR, getGeneratorName()
|
statusHandler.handle(Priority.ERROR, getGeneratorName()
|
||||||
+ ": filter: " + filter.getName()
|
+ ": filter: " + filter.getName()
|
||||||
+ ": failed to route filter to generator", e);
|
+ ": failed to route filter to generator", e);
|
||||||
|
} finally {
|
||||||
|
// safer, this way filter never gets set in weird state
|
||||||
|
filter.setValidTime(new Date(System.currentTimeMillis()));
|
||||||
|
filter.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
filter.setValidTime(new Date(System.currentTimeMillis()));
|
|
||||||
filter.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue