Issue #2224 Add enable flag to archive purger and move properties to plug-in.
Change-Id: I6fd80f4b5f1326a173bd8e980735781d9ec03898 Former-commit-id: c9b8280236e1a3fc3afe9fb74e0b4c7c88c31179
This commit is contained in:
parent
465d41c2e9
commit
23479aa5f7
3 changed files with 28 additions and 18 deletions
|
@ -12,10 +12,6 @@ qc.cron=0+2,7,12,17,22,27,32,37,42,47,52,57+*+*+*+?
|
|||
acarssounding.cron=00+10,30,50+*+*+*+?
|
||||
gfe.cron=0+15+*+*+*+?
|
||||
repack.cron=0+20+*+*+*+?
|
||||
# runs database and hdf5 archive for archive server to pull data from
|
||||
archive.cron=0+40+*+*+*+?
|
||||
# purge archives
|
||||
archive.purge.cron=0+0+*+*+*+?
|
||||
|
||||
###purge configuration
|
||||
# Interval at which the purge job kicks off
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
# runs database and hdf5 archive for archive server to pull data from
|
||||
archive.cron=0+40+*+*+*+?
|
||||
# purge archives
|
||||
archive.purge.cron=0+5+*+*+*+?
|
||||
# enable archive purge
|
||||
archive.purge.enable=false
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Added info logging for purge counts.
|
||||
* Aug 28, 2013 2299 rferrel manager.purgeExpiredFromArchive now returns
|
||||
* number of files purged.
|
||||
* Sep 03, 2013 2224 rferrel Add check to enable/disable purger.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -49,12 +50,17 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
|
||||
public class ArchivePurger {
|
||||
private final static IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ArchiveConfigManager.class);
|
||||
.getHandler(ArchivePurger.class);
|
||||
|
||||
private final static String ENABLE_PROPERTY = "archive.purge.enable";
|
||||
|
||||
/**
|
||||
* Purge expired elements from the archives.
|
||||
*/
|
||||
public static void purge() {
|
||||
String enableString = System.getProperty(ENABLE_PROPERTY, "false");
|
||||
if (Boolean.parseBoolean(enableString)) {
|
||||
statusHandler.info("::Archive Purged started.");
|
||||
ArchiveConfigManager manager = ArchiveConfigManager.getInstance();
|
||||
Collection<ArchiveConfig> archives = manager.getArchives();
|
||||
for (ArchiveConfig archive : archives) {
|
||||
|
@ -71,5 +77,7 @@ public class ArchivePurger {
|
|||
statusHandler.info(sb.toString());
|
||||
}
|
||||
}
|
||||
statusHandler.info("::Archive Purged finished.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue