Omaha #4670 return null when processing fails.
Former-commit-id: 99e232362cf9d555aefc3d2396593e9432a71488
This commit is contained in:
parent
ff10705d68
commit
9aa69c1379
1 changed files with 11 additions and 9 deletions
|
@ -31,7 +31,6 @@ import java.util.TimeZone;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import com.raytheon.edex.exception.DecoderException;
|
import com.raytheon.edex.exception.DecoderException;
|
||||||
import com.raytheon.edex.plugin.AbstractDecoder;
|
|
||||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
import com.raytheon.uf.common.dataplugin.madis.MadisRecord;
|
import com.raytheon.uf.common.dataplugin.madis.MadisRecord;
|
||||||
import com.raytheon.uf.common.dataplugin.madis.MadisRecord.QCD;
|
import com.raytheon.uf.common.dataplugin.madis.MadisRecord.QCD;
|
||||||
|
@ -57,14 +56,15 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Jun 17, 2013 2113 dhladky QPID memory usage alleviation
|
* Jun 17, 2013 2113 dhladky QPID memory usage alleviation
|
||||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||||
* Dec 10, 2013 2616 mpduff Set overwrite allowed on MadisRecord.
|
* Dec 10, 2013 2616 mpduff Set overwrite allowed on MadisRecord.
|
||||||
* jan 22, 2014 2713 dhladky Calendar conversion.
|
* jan 22, 2014 2713 dhladky Calendar conversion.
|
||||||
|
* Jul 28, 2015 4670 dhladky Return null when processing fails.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
* @version 1
|
* @version 1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MadisDecoder extends AbstractDecoder {
|
public class MadisDecoder {
|
||||||
|
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(MadisDecoder.class);
|
.getHandler(MadisDecoder.class);
|
||||||
|
@ -95,7 +95,7 @@ public class MadisDecoder extends AbstractDecoder {
|
||||||
|
|
||||||
private static final Pattern QUOTES_PATTERN = Pattern.compile("\"");
|
private static final Pattern QUOTES_PATTERN = Pattern.compile("\"");
|
||||||
|
|
||||||
private final String PLUGIN_NAME;
|
public static String PLUGIN_NAME;
|
||||||
|
|
||||||
private static ThreadLocal<SimpleDateFormat> madisDateFormat = new ThreadLocal<SimpleDateFormat>() {
|
private static ThreadLocal<SimpleDateFormat> madisDateFormat = new ThreadLocal<SimpleDateFormat>() {
|
||||||
|
|
||||||
|
@ -143,14 +143,14 @@ public class MadisDecoder extends AbstractDecoder {
|
||||||
|
|
||||||
long time3 = System.currentTimeMillis();
|
long time3 = System.currentTimeMillis();
|
||||||
MadisRecord rec = processMadis(headerType, line);
|
MadisRecord rec = processMadis(headerType, line);
|
||||||
rec.setOverwriteAllowed(true);
|
|
||||||
long time4 = System.currentTimeMillis();
|
|
||||||
statusHandler.handle(Priority.DEBUG,
|
|
||||||
"MADIS record decode time: " + (time4 - time3)
|
|
||||||
+ " ms");
|
|
||||||
|
|
||||||
if (rec != null) {
|
if (rec != null) {
|
||||||
|
rec.setOverwriteAllowed(true);
|
||||||
retList.add(rec);
|
retList.add(rec);
|
||||||
|
long time4 = System.currentTimeMillis();
|
||||||
|
statusHandler.handle(Priority.DEBUG,
|
||||||
|
"MADIS record decode time: " + (time4 - time3)
|
||||||
|
+ " ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
@ -408,6 +408,7 @@ public class MadisDecoder extends AbstractDecoder {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Couldn't parse D file row. " + stationId + e);
|
"Couldn't parse D file row. " + stationId + e);
|
||||||
|
rec = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
|
@ -736,6 +737,7 @@ public class MadisDecoder extends AbstractDecoder {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Couldn't parse F file row. " + stationId + e);
|
"Couldn't parse F file row. " + stationId + e);
|
||||||
|
rec = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
|
|
Loading…
Add table
Reference in a new issue