Omaha #3763 Update xml tags to match labels in the ArchiveRetentionDlg dialog.

Change-Id: I9d8344fdecb16d75bfa360d403ab84312f6bfe0e

Former-commit-id: 083ba10ef9ecdae0c2a242f432641b7659fdc822
This commit is contained in:
Roger Ferrel 2015-01-22 12:29:56 -06:00
parent 2c559f4c88
commit 5e91714487
6 changed files with 88 additions and 33 deletions

View file

@ -0,0 +1,27 @@
#!/bin/bash
# This searches for archiver xml files in common_static and sends them to updateRetentionTags.sh
# to update retention hour tags.
#
# The base files should be updated when upgraded to 15.1.1 but this will handle any that are added.
COMMON=/awips2/edex/data/utility/common_static
DIR=`dirname $0`
echo "+++ checking base +++"
$DIR/updateRetentionTags.sh ${COMMON}/base/archiver/purger/*.xml
for dir in `ls ${COMMON}` ; do
if [[ "$dir" != "base" && "$dir" != "configured" && -d "${COMMON}/$dir" ]] ; then
echo "+++ checking $dir +++"
for d in `ls ${COMMON}/$dir/` ; do
pDir="${COMMON}/$dir/$d/archiver/purger"
if [[ -d "$pDir" ]] ; then
for f in `ls $pDir` ; do
if [[ "${f##*.}" == "xml" ]] ; then
$DIR/updateRetentionTags.sh $pDir/$f
fi
done
fi
done
fi
done

View file

@ -0,0 +1,22 @@
#!/bin/bash
# This assumes arguments are archiver xml files that need to have the tag minRetentionHours
# changed to defaultRetentionHours and extRetentionHours to selectedRetentionHours.
# If the conversion is not needed the file is left untouched otherwise the original has '.bak' appended
# to its name and it is replaced with the converted file.
for f in $* ; do
rm -f ${f}.$$
sed -e 's/minRetentionHours>/defaultRetentionHours>/g' -e 's/extRetentionHours>/selectedRetentionHours>/g' $f > ${f}.$$
cmp -s $f ${f}.$$
if [[ $? != 0 ]] ; then
rm -f ${f}.bak
mv $f ${f}.bak
mv ${f}.$$ $f
chmod 664 $f
chown awips:fxalpha $f
echo "converted $f"
else
echo "No conversion needed for $f"
rm -f ${f}.$$
fi
done

View file

@ -36,7 +36,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* <name>Raw</name>
* <rootDir>/data_store/</rootDir>
* <!-- default retention hours for a category. -->
* <minRetentionHours>168</minRetentionHours>
* <defaultRetentionHours>168</defaultRetentionHours>
* <category>
* <name>Model grib</name>
* ...
@ -58,6 +58,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* May 1, 2013 1966 rferrel Initial creation
* May 31, 2013 1965 bgonzale Added getCategory(categoryName)
* Apr 17, 2014 3045 rferrel Code cleanup to prevent null pointer.
* Jan 22, 2015 3763 rferrel Change tag from minRetentionHours to defaultRetentionHours
*
* </pre>
*
@ -81,10 +82,10 @@ public class ArchiveConfig implements Comparable<ArchiveConfig> {
private String rootDir;
/**
* Minimum number of hours the purger should retain data. May be overridden
* Default number of hours the purger should retain data. May be overridden
* for a given category.
*/
@XmlElement(name = "minRetentionHours")
@XmlElement(name = "defaultRetentionHours")
private int retentionHours;
/**

View file

@ -38,7 +38,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* &lt;category>
* &lt;name>redbook&lt;/name>
* &lt;!-- When 0 default to the parent archive's retentionHours -->
* &lt;retentionHours>0&lt;/retentionHours>
* &lt;selectedRetentionHours>0&lt;/selectedRetentionHours>
* &lt;dataSet>
* &lt;dirPattern>hdf5/(redbook)&lt;/dirPattern>
* &lt;displayLabel>{1}&lt;/displayLabel>
@ -54,7 +54,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* <pre>
* &lt;category>
* &lt;name>Model grib&lt;/name>
* &lt;retentionHours>0&lt;/retentionHours>
* &lt;selectedRetentionHours>0&lt;/selectedRetentionHours>
* &lt;dataSet>
* &lt;dirPattern>grib/(\d{4})(\d{2})(\d{2})/(\d{2})/(.*)&lt;/dirPattern>
* &lt;displayLabel>{5}&lt;/displayLabel>
@ -74,6 +74,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* Aug 03, 2013 2224 rferrel Changes to include DataSet.
* Jan 09, 2014 2603 rferrel Fix bug in setSelectedDisplayNames
* Apr 17, 2014 3045 rferrel Code cleanup to prevent null pointer.
* Jan 22, 2014 3763 rferrel Change tag extRententionHours to selectedRetentionHours
*
* </pre>
*
@ -94,7 +95,7 @@ public class CategoryConfig implements Comparable<CategoryConfig> {
* Minimum number of hours the purger should retain data. When 0 use the
* parent archive's value.
*/
@XmlElement(name = "extRetentionHours")
@XmlElement(name = "selectedRetentionHours")
private int retentionHours;
@XmlElement(name = "dataSet")

View file

@ -31,6 +31,8 @@
* Dec 12, 2013 2624 rferrel Document Julian time stamp.
* Dec 13, 2013 2555 rjpeter Updated all to use dirPatterns.
* May 24, 2014 2881 rferrel Updated retention times.
* Jan 22, 2015 3793 rferrel Converted tags minRetentionHours to defaultRetentionHours
* and extRetentionHours to selectedDetentionHours.
*
* @author rferrel
* @version 1.0
@ -40,17 +42,17 @@
<name> - Required tag. The id for the archive such as Raw or Processed.
Used in the GUIs to filter which archive to display.
<rootDir> - Required tag. The root directory on the edex server for the archive.
<minRetentionHours> - Required tag. The default number of hours to retain data in the <rootDir>
<defaultRetentionHours> - Required tag. The default number of hours to retain data in the <rootDir>
<category> - Logical grouping of archive's sub-directories.
The <category> has four types of tags:
<name> - Required tag. The id for the category such as grib2 or redbook.
Used in the GUIs to filter what is the display in the table.
<extRetentionHours> - Optional tag. The hours to retain data in directories of selected Data Sets for a category.
<selectedRetentionHours> - Optional tag. The hours to retain data in directories of selected Data Sets for a category.
Default is 1 hour.
<dataSet> - Required to have a least one. Each one contains a set of tags explained below.
<selectedDisplayNames> - A directory matching <dirPattern>. These are selected directories from the Retention GUI. The purger
will used the category's <extRetentionHours> instead of the Arhivie's <minRetentionHours>.
will used the category's <selectedRetentionHours> instead of the Arhivie's <defaultRetentionHours>.
An optional tag; may have more then one. (NOTE these are set internally when a selection configuration
file is loaded. They should not appear in the configuration file.)
The <dataSet> contains ? types of tags:
@ -117,7 +119,7 @@
Example with multiple <dirPattern>s
<category>
<name>Observation</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(acars|airep|airmet|taf)</dirPattern>
<dirPattern>(bufrsigwx|sfcobs)/.*</dirPattern>
@ -140,10 +142,10 @@
<archive>
<name>Processed</name>
<rootDir>/archive/</rootDir>
<minRetentionHours>168</minRetentionHours>
<defaultRetentionHours>168</defaultRetentionHours>
<category>
<name>Decision Assistance</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(cwat|fog|ffmp|fssobs|preciprate|qpf|scan|vil)/.*(\d{4})-(\d{2})-(\d{2})-(\d{2}).*</dirPattern>
<displayLabel>{1}</displayLabel>
@ -152,7 +154,7 @@
</category>
<category>
<name>GFE</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>gfe/(.*)/(.*)/(\d{4})_(\d{2})_(\d{2})_(\d{2})\d{2}.*</dirPattern>
<displayLabel>{1} - {2}</displayLabel>
@ -166,7 +168,7 @@
</category>
<category>
<name>Local</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(ldadhydro|ldadmesonet|ldadprofiler|ldad_manual|qc)/.*(\d{4})-(\d{2})-(\d{2})-(\d{2}).*</dirPattern>
<displayLabel>{1}</displayLabel>
@ -175,7 +177,7 @@
</category>
<category>
<name>Model</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(grid)/(.*)/(.*)/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})-.*</dirPattern>
<displayLabel>{2}</displayLabel>
@ -190,7 +192,7 @@
</category>
<category>
<name>Products</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(airmet|atcf|aww|bufrncwf|ccfp|convsigmet|cwa|ffg|intlsigmet|nonconvsigmet|stormtrack|taf|tcg|tcm|tcs|text|vaa|warning|wcp)/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})</dirPattern>
<dirPattern>(bufrsigwx|redbook)/.*/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})</dirPattern>
@ -200,7 +202,7 @@
</category>
<category>
<name>Observation</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(acars|airep|binlightning|bufrascat|bufrhdw|bufrmthdw|bufrssmi|idft|lsr|obs|pirep|recco|svrwx)/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})</dirPattern>
<dirPattern>(sfcobs)/.*/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})</dirPattern>
@ -210,7 +212,7 @@
</category>
<category>
<name>Satellite</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>satellite/(.*)/(.*)/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})</dirPattern>
<dateGroupIndices>3,4,5,6</dateGroupIndices>
@ -225,7 +227,7 @@
</category>
<category>
<name>Profiles</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(acarssounding|bufrua|goessounding|poessounding|profiler)/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})</dirPattern>
<displayLabel>{1}</displayLabel>
@ -235,7 +237,7 @@
<category>
<!-- Find mosaic dataset and add here. -->
<name>radar</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>radar/(.*)/(.*)/.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})</dirPattern>
<displayLabel>{1}</displayLabel>

View file

@ -29,6 +29,8 @@
* Dec 12, 2013 2624 rferrel Document Julian time stamp.
* May 14, 2014 2881 rferrel Change retention times and data set modifications.
* Aug 25, 2014 3537 rferrel Fixed dirPattern in Category Local.
* Jan 22, 2015 3793 rferrel Converted tags minRetentionHours to defaultRetentionHours
* and extRetentionHours to selectedDetentionHours.
*
* @author rferrel
* @version 1.0
@ -38,17 +40,17 @@
<name> - Required tag. The id for the archive such as Raw or Processed.
Used in the GUIs to filter which archive to display.
<rootDir> - Required tag. The root directory on the edex server for the archive.
<minRetentionHours> - Required tag. The default number of hours to retain data in the <rootDir>
<defaultRetentionHours> - Required tag. The default number of hours to retain data in the <rootDir>
<category> - Logical grouping of archive's sub-directories.
The <category> has four types of tags:
<name> - Required tag. The id for the category such as grib2 or redbook.
Used in the GUIs to filter what is the display in the table.
<extRetentionHours> - Optional tag. The hours to retain data in directories of selected Data Sets for a category.
<selectedRetentionHours> - Optional tag. The hours to retain data in directories of selected Data Sets for a category.
Default is 1 hour.
<dataSet> - Required to have a least one. Each one contains a set of tags explained below.
<selectedDisplayNames> - A directory matching <dirPattern>. These are selected directories from the Retention GUI. The purger
will used the category's <extRetentionHours> instead of the Arhivie's <minRetentionHours>.
will used the category's <selectedRetentionHours> instead of the Arhivie's <defaultRetentionHours>.
An optional tag; may have more then one. (NOTE these are set internally when a selection configuration
file is loaded. They should not appear in the configuration file.)
The <dataSet> contains ? types of tags:
@ -115,7 +117,7 @@
Example with multiple <dirPattern>s
<category>
<name>Observation</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(acars|airep|airmet|taf)</dirPattern>
<dirPattern>(bufrsigwx|sfcobs)/.*</dirPattern>
@ -138,10 +140,10 @@
<archive>
<name>Raw</name>
<rootDir>/data_store/</rootDir>
<minRetentionHours>168</minRetentionHours>
<defaultRetentionHours>168</defaultRetentionHours>
<category>
<name>Local</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(manual)/grib/(\d{4})(\d{2})(\d{2})/(\d{2})</dirPattern>
<filePattern>.*(LAPS|MSAS).*</filePattern>
@ -192,7 +194,7 @@
</category>
<category>
<name>Model</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(grib|grib2)/(\d{4})(\d{2})(\d{2})/(\d{2})/(.*)</dirPattern>
<displayLabel>{1} - {6}</displayLabel>
@ -206,7 +208,7 @@
</category>
<category>
<name>Observation</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(airep|binlightning|bufrascat|bufrhdw|bufrmthdw|bufrssmi|lsr|MAROB|maritime|metar|misc_sfc_obs|pirep|sfcobs|shef|svrwx|synoptic)/(\d{4})(\d{2})(\d{2})/(\d{2})</dirPattern>
<displayLabel>{1}</displayLabel>
@ -220,7 +222,7 @@
</category>
<category>
<name>Products</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(airmet|bufrncwf|bufrsigwx|climate|convsigmet|cwa|fire_wx_spot_fcst_reports|forecast|intlsigmet|misc_adm_messages|nonconvsigmet|redbook|summaries|tcg|tcs|text|wwa|xml)/(\d{4})(\d{2})(\d{2})/(\d{2})</dirPattern>
<displayLabel>{1}</displayLabel>
@ -229,7 +231,7 @@
</category>
<category>
<name>radar</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>radar/(\d{4})(\d{2})(\d{2})/(\d{2})/(.*)</dirPattern>
<displayLabel>{5}</displayLabel>
@ -238,7 +240,7 @@
</category>
<category>
<name>Radar (Local)</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>radar/([k|t|e|f]\w{3})/.*</dirPattern> <!-- one level like GSM or HI --> <!-- e and f are for FAA ASR and ARSR radars -->
<dirPattern>radar/(k...|t...|e...|f...)/.*/.*</dirPattern> <!-- two levels like ML -->
@ -258,7 +260,7 @@
</category>
<category>
<name>Satellite</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>sat/(\d{4})(\d{2})(\d{2})/(\d{2})/(.*)</dirPattern>
<displayLabel>{5}</displayLabel>
@ -267,7 +269,7 @@
</category>
<category>
<name>Profiles</name>
<extRetentionHours>168</extRetentionHours>
<selectedRetentionHours>168</selectedRetentionHours>
<dataSet>
<dirPattern>(bufrua|goessounding|poessounding|profiler|raobs|upperair)/(\d{4})(\d{2})(\d{2})/(\d{2})</dirPattern>
<displayLabel>{1}</displayLabel>