Issue #1869 Remove DataURI from goes/poes soundings.

Change-Id: Ib13c7537c94e15d70588d75f546586e6d1f08416

Former-commit-id: 1c3e60a5ff [formerly b905ee013c [formerly 836239896aace50e37896f6219015a75aea117b7]]
Former-commit-id: b905ee013c
Former-commit-id: 22b20b5f8e
This commit is contained in:
Ben Steffensmeier 2013-05-15 12:35:04 -05:00
parent 5714866fc5
commit 61b468a9f5
9 changed files with 51 additions and 271 deletions

View file

@ -38,9 +38,8 @@ import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
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.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.status.StatusConstants;
import com.raytheon.uf.viz.sounding.Activator;
import com.raytheon.viz.pointdata.PointDataRequest;
/**
@ -51,7 +50,8 @@ import com.raytheon.viz.pointdata.PointDataRequest;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 1, 2008 1747 jkorman Initial creation
* Dec 01, 2008 1747 jkorman Initial creation
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
*
* </pre>
*
@ -94,8 +94,12 @@ public class GOESSoundingAdapter extends AbstractVerticalSoundingAdapter {
if (obsData != null) {
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
rcMap.put("dataURI", new RequestConstraint(""
+ obsData.getDataURI()));
rcMap.put("location.stationId", new RequestConstraint(obsData
.getLocation().getStationId()));
rcMap.put(
"dataTime.refTime",
new RequestConstraint(TimeUtil.formatToSqlTimestamp(obsData
.getDataTime().getRefTime())));
PointDataContainer container;
try {
container = PointDataRequest.requestPointDataAllLevels(null,

View file

@ -39,9 +39,8 @@ import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
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.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.status.StatusConstants;
import com.raytheon.uf.viz.sounding.Activator;
import com.raytheon.viz.pointdata.PointDataRequest;
/**
@ -52,7 +51,8 @@ import com.raytheon.viz.pointdata.PointDataRequest;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 1, 2008 1747 jkorman Initial creation
* Dec 01, 2008 1747 jkorman Initial creation
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
*
* </pre>
*
@ -95,8 +95,12 @@ public class POESSoundingAdapter extends AbstractVerticalSoundingAdapter {
if (obsData != null) {
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
rcMap.put("dataURI", new RequestConstraint(""
+ obsData.getDataURI()));
rcMap.put("location.stationId", new RequestConstraint(obsData
.getLocation().getStationId()));
rcMap.put(
"dataTime.refTime",
new RequestConstraint(TimeUtil.formatToSqlTimestamp(obsData
.getDataTime().getRefTime())));
PointDataContainer container;
try {
container = PointDataRequest.requestPointDataAllLevels(null,

View file

@ -30,14 +30,16 @@ function dropDatauriAndAddConstraint {
echo "FATAL: The update has failed."
exit 1
fi
${PSQL} -U awips -d metadata -c "VACUUM FULL $1"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE $1"
}
echo "INFO: Dropping dataURI columns."
dropDatauri gfe
${PSQL} -U awips -d metadata -c "VACUUM FULL gfe"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE gfe"
dropDatauriAndAddConstraint bufrmosavn bufrmosavn_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)"
dropDatauriAndAddConstraint bufrmoshpc bufrmoshpc_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)"
dropDatauriAndAddConstraint goessounding goessounding_stationid_reftime_latitude_longitude_key "(stationid, reftime, latitude, longitude)"
dropDatauriAndAddConstraint poessounding poessounding_stationid_reftime_latitude_longitude_key "(stationid, reftime, latitude, longitude)"
echo "INFO: dataURI columns dropped successfully"

View file

@ -23,7 +23,6 @@
<parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" />
<parameter name="elevation" queryName="location.elevation" type="FLOAT" unit="m" />
<parameter name="stationId" queryName="location.stationId" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" />
<parameter name="validTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms" />
<parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/>
<parameter name="forecastHr" queryName="dataTime.fcstTime" numDims="1" type="INT" unit="h" dbunit="s"/>

View file

@ -35,7 +35,6 @@ import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.edex.plugin.goessounding.dao.GOESSoundingDAO;
import com.raytheon.edex.plugin.goessounding.decoder.GOESSoundingDataAdapter;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.goessounding.GOESSounding;
import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataDescription;
@ -59,8 +58,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20080414 1077 jkorman Initial implementation.
* 11/25/08 #1684 chammack Camel Refactor
* Apr 14, 2008 1077 jkorman Initial implementation.
* Nov 25, 2008 1684 chammack Camel Refactor
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
*
* </pre>
*
@ -154,17 +154,11 @@ public class GOESSoundingDecoder extends AbstractDecoder implements
if (soundingData != null) {
soundingData.setTraceId(traceId);
soundingData.setPluginName(PLUGIN_NAME);
try {
soundingData.constructDataURI();
PointDataView pdv = soundingData
.getPointDataView();
pdv.setString("wmoHeader",
soundingData.getWmoHeader());
pdoList.add(soundingData);
} catch (PluginException e) {
logger.error(traceId
+ "- Unable to construct dataURI", e);
}
PointDataView pdv = soundingData.getPointDataView();
pdv.setString("wmoHeader",
soundingData.getWmoHeader());
pdoList.add(soundingData);
}
}

View file

@ -23,7 +23,6 @@
<parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" />
<parameter name="elevation" queryName="location.elevation" type="FLOAT" unit="m" />
<parameter name="stationId" queryName="location.stationId" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" />
<parameter name="wmoHeader" queryName="wmoHeader" type="STRING" />
<parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/>
<parameter name="forecastHr" queryName="dataTime.fcstTime" numDims="1" type="INT" unit="h" dbunit="s"/>

View file

@ -31,7 +31,6 @@ import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.edex.plugin.poessounding.decoder.POESSoundingDataAdapter;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.poessounding.POESSounding;
import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataDescription;
@ -55,8 +54,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20080303 1026 jkorman Initial implementation.
* 20080408 1039 jkorman Added traceId for tracing data.
* Mar 03, 2008 1026 jkorman Initial implementation.
* Apr 08, 2008 1039 jkorman Added traceId for tracing data.
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
*
* </pre>
*
@ -145,12 +145,6 @@ public class POESSoundingDecoder extends AbstractDecoder implements
if (soundingData != null) {
soundingData.setTraceId(traceId);
soundingData.setPluginName(PLUGIN_NAME);
try {
soundingData.constructDataURI();
} catch (PluginException e) {
logger.error(traceId
+ "- Unable to construct dataURI", e);
}
pdoList.add(soundingData);
}
}

View file

@ -21,15 +21,8 @@ package com.raytheon.uf.common.dataplugin.goessounding;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import javax.measure.quantity.Angle;
import javax.measure.unit.NonSI;
import javax.measure.unit.Unit;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
@ -37,16 +30,10 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type;
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
@ -55,7 +42,6 @@ import com.raytheon.uf.common.geospatial.ISpatialEnabled;
import com.raytheon.uf.common.pointdata.IPointData;
import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
import com.raytheon.uf.common.serialization.adapters.GeometryAdapter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.vividsolutions.jts.geom.Geometry;
@ -69,11 +55,13 @@ import com.vividsolutions.jts.geom.Geometry;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20080414 1077 jkorman Initial implementation.
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* Apr 14, 2008 1077 jkorman Initial implementation.
* Apr 04, 2013 1846 bkowal Added an index on refTime and
* forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 07, 2013 1869 bsteffen Remove dataURI column from
* PluginDataObject.
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
*
* </pre>
*
@ -82,7 +70,8 @@ import com.vividsolutions.jts.geom.Geometry;
*/
@Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "goessoundingseq")
@Table(name = "goessounding", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
@Table(name = "goessounding", uniqueConstraints = { @UniqueConstraint(columnNames = {
"stationid", "reftime", "latitude", "longitude" }) })
/*
* Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used.
@ -94,31 +83,19 @@ import com.vividsolutions.jts.geom.Geometry;
}
)
@DynamicSerialize
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class GOESSounding extends PersistablePluginDataObject implements
ISpatialEnabled, IDecoderGettable, IPointData, IPersistable {
ISpatialEnabled, IPointData, IPersistable {
private static final long serialVersionUID = 1L;
public static final Unit<Angle> LOCATION_UNIT = NonSI.DEGREE_ANGLE;
private static final HashMap<String, String> PARM_MAP = new HashMap<String, String>();
static {
PARM_MAP.put("NLAT", STA_LAT);
PARM_MAP.put("NLON", STA_LON);
}
@Embedded
@DataURI(position = 1, embedded = true)
@XmlElement
@DynamicSerializeElement
private SurfaceObsLocation location;
// The bounding box that contains this observation.
@Column(name = "boxGeometry", columnDefinition = "geometry")
@Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement
private Geometry boxGeometry;
@ -129,42 +106,34 @@ public class GOESSounding extends PersistablePluginDataObject implements
// Text of the WMO header
@Transient
@DynamicSerializeElement
@XmlElement
private String wmoHeader;
@Transient
@DynamicSerializeElement
@XmlElement
private Integer satId;
@Transient
@DynamicSerializeElement
@XmlElement
private Integer satInstrument;
@Transient
@DynamicSerializeElement
@XmlElement
private Integer qualityInfo;
@Transient
@DynamicSerializeElement
@XmlElement
private Integer sounderChannels;
@Transient
@DynamicSerializeElement
@XmlElement
private Double solarElevation;
// The profiler observation time.
@Transient
@DynamicSerializeElement
@XmlElement
private Calendar timeObs;
@Transient
@XmlElement
@DynamicSerializeElement
private List<GOESSoundingLevel> soundingLevels;
@ -428,83 +397,6 @@ public class GOESSounding extends PersistablePluginDataObject implements
soundingLevels.add(soundingLevel);
}
/**
* Return this class reference as the IDecoderGettable interface
* implementation.
*
* @return Returns reference to this class.
*/
@Override
public IDecoderGettable getDecoderGettable() {
return this;
}
/**
* Get the value of a parameter that is represented as a String.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The String value of the parameter. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public String getString(String paramName) {
if ("STA".matches(paramName)) {
return this.getStationId();
}
return null;
}
/**
* Get the value and units of a named parameter within this observation.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return An Amount with value and units. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public Amount getValue(String paramName) {
Amount a = null;
String pName = PARM_MAP.get(paramName);
if (STA_LAT.equals(pName)) {
a = new Amount(this.getLatitude(), LOCATION_UNIT);
} else if (STA_LON.equals(pName)) {
a = new Amount(this.getLongitude(), LOCATION_UNIT);
}
return a;
}
/**
* Get the value of a parameter that is represented as a collection of
* values.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an Amount. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public Collection<Amount> getValues(String paramName) {
return null;
}
/**
* Get the value of a parameter that is represented as a collection of
* Strings.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an String. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public String[] getStrings(String paramName) {
return null;
}
@Override
public SurfaceObsLocation getSpatialObject() {
return location;
@ -527,10 +419,5 @@ public class GOESSounding extends PersistablePluginDataObject implements
public void setPointDataView(PointDataView pointDataView) {
this.pointDataView = pointDataView;
}
@Override
@Column
@Access(AccessType.PROPERTY)
public String getDataURI() {
return super.getDataURI();
}
}

View file

@ -19,16 +19,9 @@
**/
package com.raytheon.uf.common.dataplugin.poessounding;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import javax.measure.quantity.Angle;
import javax.measure.unit.NonSI;
import javax.measure.unit.Unit;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
@ -36,14 +29,9 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Index;
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
@ -64,11 +52,13 @@ import com.vividsolutions.jts.geom.Geometry;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20080303 1026 jkorman Initial implementation.
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* Mar 03, 2008 1026 jkorman Initial implementation.
* Apr 04, 2013 1846 bkowal Added an index on refTime and
* forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 07, 2013 1869 bsteffen Remove dataURI column from
* PluginDataObject.
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
*
* </pre>
*
@ -77,7 +67,8 @@ import com.vividsolutions.jts.geom.Geometry;
*/
@Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "poessoundingseq")
@Table(name = "poessounding", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
@Table(name = "poessounding", uniqueConstraints = { @UniqueConstraint(columnNames = {
"stationid", "reftime", "latitude", "longitude" }) })
/*
* Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used.
@ -89,21 +80,11 @@ import com.vividsolutions.jts.geom.Geometry;
}
)
@DynamicSerialize
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public class POESSounding extends PersistablePluginDataObject implements
ISpatialEnabled, IDecoderGettable, IPointData {
ISpatialEnabled, IPointData {
private static final long serialVersionUID = 1L;
public static final Unit<Angle> LOCATION_UNIT = NonSI.DEGREE_ANGLE;
private static final HashMap<String, String> PARM_MAP = new HashMap<String, String>();
static {
PARM_MAP.put("NLAT", STA_LAT);
PARM_MAP.put("NLON", STA_LON);
}
// The profiler observation time.
// @Column
// @DynamicSerializeElement
@ -116,7 +97,6 @@ public class POESSounding extends PersistablePluginDataObject implements
// Text of the WMO header
@Column(length = 32)
@XmlElement
@DynamicSerializeElement
private String wmoHeader;
@ -125,7 +105,6 @@ public class POESSounding extends PersistablePluginDataObject implements
@Embedded
@DataURI(position = 1, embedded = true)
@XmlElement
@DynamicSerializeElement
private SurfaceObsLocation location;
@ -251,83 +230,6 @@ public class POESSounding extends PersistablePluginDataObject implements
soundingLevels.add(soundingLevel);
}
/**
* Return this class reference as the IDecoderGettable interface
* implementation.
*
* @return Returns reference to this class.
*/
@Override
public IDecoderGettable getDecoderGettable() {
return this;
}
/**
* Get the value of a parameter that is represented as a String.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The String value of the parameter. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public String getString(String paramName) {
if ("STA".matches(paramName)) {
return this.getStationId();
}
return null;
}
/**
* Get the value and units of a named parameter within this observation.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return An Amount with value and units. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public Amount getValue(String paramName) {
Amount a = null;
String pName = PARM_MAP.get(paramName);
if (STA_LAT.equals(pName)) {
a = new Amount(this.getLatitude(), LOCATION_UNIT);
} else if (STA_LON.equals(pName)) {
a = new Amount(this.getLongitude(), LOCATION_UNIT);
}
return a;
}
/**
* Get the value of a parameter that is represented as a collection of
* values.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an Amount. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public Collection<Amount> getValues(String paramName) {
return null;
}
/**
* Get the value of a parameter that is represented as a collection of
* Strings.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an String. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public String[] getStrings(String paramName) {
return null;
}
@Override
public SurfaceObsLocation getSpatialObject() {
return location;
@ -350,10 +252,5 @@ public class POESSounding extends PersistablePluginDataObject implements
public void setPointDataView(PointDataView pointDataView) {
this.pointDataView = pointDataView;
}
@Override
@Column
@Access(AccessType.PROPERTY)
public String getDataURI() {
return super.getDataURI();
}
}