Issue #2625 - fix no data errors in bandwidth utilization graph
remove datauri from RetrievalGeneratorUtilities Set queries for DPA data to query by insertTime rather than obsTime Change-Id: I67a55ca6898a5f478456d75c9ffd7e24120cade7 Former-commit-id:3492436907
[formerly 9e37fa3a052d49830b36e6187280615cb6517d47] Former-commit-id:d378d9194a
This commit is contained in:
parent
85bc26b5a3
commit
4073f048d2
4 changed files with 26 additions and 15 deletions
|
@ -56,14 +56,15 @@ import com.raytheon.uf.common.util.LogUtil;
|
|||
* Jul 18, 2013 1653 mpduff Add getSubscriptionStatusSummary method.
|
||||
* Oct 2, 2013 1797 dhladky Generics
|
||||
* Oct 01, 2013 2267 bgonzale Log error response from proposed scheduling.
|
||||
* Dec 11, 2013 2625 mpduff Fix error handling to not return null.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public abstract class BandwidthService<T extends Time, C extends Coverage> extends
|
||||
BasePrivilegedServerService<IBandwidthRequest<T, C>> implements
|
||||
public abstract class BandwidthService<T extends Time, C extends Coverage>
|
||||
extends BasePrivilegedServerService<IBandwidthRequest<T, C>> implements
|
||||
IBandwidthService<T, C> {
|
||||
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
|
@ -183,7 +184,8 @@ public abstract class BandwidthService<T extends Time, C extends Coverage> exten
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public IProposeScheduleResponse proposeSchedule(Subscription<T, C> subscription) {
|
||||
public IProposeScheduleResponse proposeSchedule(
|
||||
Subscription<T, C> subscription) {
|
||||
return proposeSchedule(Arrays.asList(subscription));
|
||||
}
|
||||
|
||||
|
@ -257,9 +259,8 @@ public abstract class BandwidthService<T extends Time, C extends Coverage> exten
|
|||
return sendRequest(request, BandwidthGraphData.class);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to retrieve bandwidth graph data, returning null.",
|
||||
e);
|
||||
return null;
|
||||
"Unable to retrieve bandwidth graph data.", e);
|
||||
return new BandwidthGraphData();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +269,8 @@ public abstract class BandwidthService<T extends Time, C extends Coverage> exten
|
|||
public SubscriptionStatusSummary getSubscriptionStatusSummary(
|
||||
Subscription<T, C> subscription) {
|
||||
IBandwidthRequest<T, C> request = new IBandwidthRequest<T, C>();
|
||||
request.setSubscriptions(Arrays.<Subscription<T, C>> asList(subscription));
|
||||
request.setSubscriptions(Arrays
|
||||
.<Subscription<T, C>> asList(subscription));
|
||||
request.setRequestType(RequestType.GET_SUBSCRIPTION_STATUS);
|
||||
try {
|
||||
return sendRequest(request, SubscriptionStatusSummary.class);
|
||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Sep 20, 2013 2397 bgonzale Added Map of Bucket Descriptions.
|
||||
* Nov 19, 2013 2545 bgonzale Added 'add' method stub. Still work to do.
|
||||
* Nov 25, 2013 2545 mpduff Finished implementing 2545.
|
||||
* Dec 11, 2013 2625 mpduff Add error handling for no data conditions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -220,7 +221,11 @@ public class BandwidthGraphData {
|
|||
* @return Number of subscriptions
|
||||
*/
|
||||
public int getNumberOfSubscriptions(Network network) {
|
||||
return networkDataMap.get(network).size();
|
||||
if (networkDataMap.size() > 0) {
|
||||
return networkDataMap.get(network).size();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -239,6 +244,11 @@ public class BandwidthGraphData {
|
|||
*/
|
||||
public List<String> getSubscriptionsSortedByTime(Network network,
|
||||
long currentTime, boolean intersect) {
|
||||
// No data so return empty list.
|
||||
if (networkDataMap.size() == 0) {
|
||||
return new ArrayList<String>(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort each of the subscriptions array time windows so they are in
|
||||
* order by time window start time.
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
||||
|
@ -48,6 +47,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 19, 2012 bsteffen Initial javadoc
|
||||
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
|
||||
* Dec 11, 2013 2625 mpduff Remove creation of DataURI.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -91,8 +91,7 @@ public class RetrievalGeneratorUtilities {
|
|||
*/
|
||||
public static Map<DataTime, List<Level>> findGridDuplicates(String name,
|
||||
List<DataTime> times, List<Level> levels,
|
||||
List<String> ensembleMembers, Parameter parm,
|
||||
GridCoverage cov) {
|
||||
List<String> ensembleMembers, Parameter parm, GridCoverage cov) {
|
||||
|
||||
HashMap<DataTime, List<Level>> dups = new HashMap<DataTime, List<Level>>();
|
||||
|
||||
|
@ -112,13 +111,12 @@ public class RetrievalGeneratorUtilities {
|
|||
.getGridRecord(name, parm, level,
|
||||
ensembleMember, cov);
|
||||
rec.setDataTime(time);
|
||||
rec.constructDataURI();
|
||||
boolean isDup = findDuplicateUri(rec.getDataURI(),
|
||||
"grid");
|
||||
if (isDup) {
|
||||
levDups.add(level);
|
||||
}
|
||||
} catch (PluginException e) {
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import com.raytheon.uf.edex.wfs.request.QualifiedName;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 04/01/2013 1746 dhladky Initial creation
|
||||
* 05/30/2013 753 dhladky updated
|
||||
* 12/11/2013 2625 mpduff query by insertTime rather than obsTime.
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -40,7 +41,7 @@ public class MadisWfsSource extends PluginWfsSource {
|
|||
|
||||
private static final String schemaloc = "META-INF/schema/madis.xsd";
|
||||
|
||||
private WfsFeatureType feature;
|
||||
private final WfsFeatureType feature;
|
||||
|
||||
private static String schemaXml = null;
|
||||
|
||||
|
@ -58,7 +59,7 @@ public class MadisWfsSource extends PluginWfsSource {
|
|||
static {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("obsLocation.location", spatialKey);
|
||||
map.put("timeObs", "dataTime.refTime");
|
||||
map.put("timeObs", "insertTime");
|
||||
map.put("obsLocation.stationId", "location.stationId");
|
||||
map.put("obsLocation.elevation", "location.elevation");
|
||||
fieldMap = Collections.unmodifiableMap(map);
|
||||
|
|
Loading…
Add table
Reference in a new issue