Issue #3222 - Fix for SHEF posting times
Former-commit-id: 3f1f9cf4fa6207edae642db5cffdc8284091f31a
This commit is contained in:
parent
c7ef7878f5
commit
8a5acd085d
1 changed files with 22 additions and 2 deletions
|
@ -84,6 +84,7 @@ import com.raytheon.uf.common.dataplugin.shef.util.ShefQC;
|
||||||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||||
import com.raytheon.uf.edex.database.dao.CoreDao;
|
import com.raytheon.uf.edex.database.dao.CoreDao;
|
||||||
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
||||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||||
|
@ -119,6 +120,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||||
* 02/18/2014 16572 l. Bousaidi only apply adjust factor to non missing values.
|
* 02/18/2014 16572 l. Bousaidi only apply adjust factor to non missing values.
|
||||||
* 04/29/2014 3088 mpduff Change logging class, clean up/optimization.
|
* 04/29/2014 3088 mpduff Change logging class, clean up/optimization.
|
||||||
* Updated with more performance fixes.
|
* Updated with more performance fixes.
|
||||||
|
* 05/28/2014 3222 mpduff Fix posting time to be processed time so db doesn't show all post times the same
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -459,6 +461,8 @@ public class PostShef {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
postDate.setTime(getToNearestSecond(TimeUtil
|
||||||
|
.currentTimeMillis()));
|
||||||
boolean same_lid_product = false;
|
boolean same_lid_product = false;
|
||||||
|
|
||||||
String dataValue = data.getStringValue();
|
String dataValue = data.getStringValue();
|
||||||
|
@ -476,7 +480,7 @@ public class PostShef {
|
||||||
data.setCreationDateObj(d);
|
data.setCreationDateObj(d);
|
||||||
data.setCreationDate("1970-01-01 00:00:00");
|
data.setCreationDate("1970-01-01 00:00:00");
|
||||||
}
|
}
|
||||||
|
|
||||||
locId = data.getLocationId();
|
locId = data.getLocationId();
|
||||||
String key = locId + prodId + data.getObservationTime();
|
String key = locId + prodId + data.getObservationTime();
|
||||||
if (idLocations.containsKey(key)) {
|
if (idLocations.containsKey(key)) {
|
||||||
|
@ -731,7 +735,7 @@ public class PostShef {
|
||||||
* shefrec structure
|
* shefrec structure
|
||||||
*/
|
*/
|
||||||
if (!dataValue.equals(ShefConstants.SHEF_MISSING)) {
|
if (!dataValue.equals(ShefConstants.SHEF_MISSING)) {
|
||||||
adjustRawValue(locId, data);
|
adjustRawValue(locId, data);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* multiply non-missing values of discharge values and
|
* multiply non-missing values of discharge values and
|
||||||
|
@ -2537,6 +2541,8 @@ public class PostShef {
|
||||||
*/
|
*/
|
||||||
private void postProductLink(String locId, String productId, Date obsTime) {
|
private void postProductLink(String locId, String productId, Date obsTime) {
|
||||||
PersistableDataObject link = null;
|
PersistableDataObject link = null;
|
||||||
|
|
||||||
|
postDate.setTime(getToNearestSecond(TimeUtil.currentTimeMillis()));
|
||||||
try {
|
try {
|
||||||
/* Get a Data Access Object */
|
/* Get a Data Access Object */
|
||||||
link = new Productlink(new ProductlinkId(locId, productId, obsTime,
|
link = new Productlink(new ProductlinkId(locId, productId, obsTime,
|
||||||
|
@ -2915,6 +2921,7 @@ public class PostShef {
|
||||||
ShefData data, String locId, String tableName, String dataValue,
|
ShefData data, String locId, String tableName, String dataValue,
|
||||||
String qualifier, long qualityCode) {
|
String qualifier, long qualityCode) {
|
||||||
PersistableDataObject dataObj = null;
|
PersistableDataObject dataObj = null;
|
||||||
|
postDate.setTime(getToNearestSecond(TimeUtil.currentTimeMillis()));
|
||||||
|
|
||||||
if (ShefConstants.COMMENT_VALUE.equalsIgnoreCase(tableName)) {
|
if (ShefConstants.COMMENT_VALUE.equalsIgnoreCase(tableName)) {
|
||||||
Commentvalue comment = new Commentvalue(new CommentvalueId());
|
Commentvalue comment = new Commentvalue(new CommentvalueId());
|
||||||
|
@ -3163,6 +3170,19 @@ public class PostShef {
|
||||||
return dataObj;
|
return dataObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the provided millisecond value to the nearest second.
|
||||||
|
*
|
||||||
|
* @param time
|
||||||
|
* time in milliseconds
|
||||||
|
*
|
||||||
|
* @return milliseconds rounded to the nearest second.
|
||||||
|
*/
|
||||||
|
private long getToNearestSecond(long time) {
|
||||||
|
// Force time to nearest second.
|
||||||
|
return time - (time % 1000);
|
||||||
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
postTables.close();
|
postTables.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue