Issue #2280 Fix plugin purging
Former-commit-id:8b80ed7ae1
[formerly 7678e5a7b42b704ed531197291c1de5a7f2d14de] Former-commit-id:35b9b81e86
This commit is contained in:
parent
23dca45a0c
commit
1764948e53
6 changed files with 11 additions and 112 deletions
|
@ -335,7 +335,7 @@
|
||||||
<include>.*-ogc-request.xml</include>
|
<include>.*-ogc-request.xml</include>
|
||||||
<!-- Purge OGC/DPA registred plugins -->
|
<!-- Purge OGC/DPA registred plugins -->
|
||||||
<include>purge-spring.xml</include>
|
<include>purge-spring.xml</include>
|
||||||
<include>ogc-purge.xml</include>
|
<include>purge-spring-impl.xml</include>
|
||||||
<include>purge-logs.xml</include>
|
<include>purge-logs.xml</include>
|
||||||
</mode>
|
</mode>
|
||||||
<!-- This is MADIS implmentation of dataprovideragent -->
|
<!-- This is MADIS implmentation of dataprovideragent -->
|
||||||
|
|
|
@ -2,6 +2,4 @@
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
source.. = src/
|
|
||||||
output.. = bin/
|
|
||||||
bin.includes = META-INF/,\
|
bin.includes = META-INF/,\
|
||||||
.,\
|
.,\
|
||||||
res/
|
res/
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
|
||||||
|
|
||||||
<bean id="purgeManager" class="com.raytheon.uf.edex.dataprovideragent.purge.OGCPurgeManager">
|
|
||||||
<property name="clusterLimit" value="${purge.clusterlimit}"/>
|
|
||||||
<property name="serverLimit" value="${purge.serverlimit}"/>
|
|
||||||
<property name="deadPurgeJobAge" value="${purge.deadjobage}"/>
|
|
||||||
<property name="purgeFrequency" value="${purge.frequency}"/>
|
|
||||||
<property name="fatalFailureCount" value="${purge.fatalfailurecount}"/>
|
|
||||||
<property name="purgeEnabled" value="${purge.enabled}"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
</beans>
|
|
|
@ -1,67 +0,0 @@
|
||||||
package com.raytheon.uf.edex.dataprovideragent.purge;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This software was developed and / or modified by Raytheon Company,
|
|
||||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
||||||
*
|
|
||||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
||||||
* This software product contains export-restricted data whose
|
|
||||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
||||||
* to non-U.S. persons whether in the United States or abroad requires
|
|
||||||
* an export license or other authorization.
|
|
||||||
*
|
|
||||||
* Contractor Name: Raytheon Company
|
|
||||||
* Contractor Address: 6825 Pine Street, Suite 340
|
|
||||||
* Mail Stop B8
|
|
||||||
* Omaha, NE 68106
|
|
||||||
* 402.291.0100
|
|
||||||
*
|
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
||||||
* further licensing information.
|
|
||||||
**/
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.raytheon.uf.edex.core.dataplugin.PluginRegistry;
|
|
||||||
import com.raytheon.uf.edex.purgesrv.PurgeManager;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Apr 11, 2013 #1959 dhladky Our own OGC purger
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author dhladky
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class OGCPurgeManager extends PurgeManager {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new PurgeManager
|
|
||||||
*/
|
|
||||||
protected OGCPurgeManager() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes the purge only on available plugins that are registered with
|
|
||||||
* camel. This works better for the DPA instances that will be running it.
|
|
||||||
* They aren't required to purge data from plugins that aren't registerd to
|
|
||||||
* their JVM which would be highly wasteful in this instance.
|
|
||||||
*/
|
|
||||||
public void executePurge() {
|
|
||||||
// check for any new plugins or database being purged and needing
|
|
||||||
// entries recreated
|
|
||||||
List<String> availablePlugins = new ArrayList<String>(PluginRegistry
|
|
||||||
.getInstance().getRegisteredObjects());
|
|
||||||
|
|
||||||
purgeRunner(availablePlugins);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -22,13 +22,10 @@ package com.raytheon.uf.edex.purgesrv;
|
||||||
import java.lang.Thread.State;
|
import java.lang.Thread.State;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
@ -84,6 +81,8 @@ import com.raytheon.uf.edex.purgesrv.PurgeJob.PURGE_JOB_TYPE;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 18, 2012 #470 bphillip Initial creation
|
* Apr 18, 2012 #470 bphillip Initial creation
|
||||||
* Apr 11, 2013 #1959 dhladky Added method that only processes running plugins
|
* Apr 11, 2013 #1959 dhladky Added method that only processes running plugins
|
||||||
|
* Aug 18, 2013 #2280 dhladky Made OGC method of only purging active plugins the standard practice
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -149,34 +148,19 @@ public class PurgeManager {
|
||||||
protected PurgeManager() {
|
protected PurgeManager() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the purge routine
|
* Executes the purge only on available plugins that are registered with
|
||||||
|
* camel. This works better for our system instances that will be running it.
|
||||||
|
* They aren't required to purge data from plugins that aren't registerd to
|
||||||
|
* their JVM which would be highly wasteful in this instance.
|
||||||
*/
|
*/
|
||||||
public void executePurge() {
|
public void executePurge() {
|
||||||
|
// check only for active plugins
|
||||||
// Gets the list of plugins in ascending order by the last time they
|
List<String> availablePlugins = new ArrayList<String>(PluginRegistry
|
||||||
// were purged
|
|
||||||
List<String> pluginList = dao.getPluginsByPurgeTime();
|
|
||||||
|
|
||||||
// check for any new plugins or database being purged and needing
|
|
||||||
// entries recreated
|
|
||||||
Set<String> availablePlugins = new HashSet<String>(PluginRegistry
|
|
||||||
.getInstance().getRegisteredObjects());
|
.getInstance().getRegisteredObjects());
|
||||||
|
|
||||||
// Merge the lists
|
purgeRunner(availablePlugins);
|
||||||
availablePlugins.removeAll(pluginList);
|
|
||||||
|
|
||||||
if (availablePlugins.size() > 0) {
|
|
||||||
// generate new list with them at the beginning
|
|
||||||
List<String> newSortedPlugins = new ArrayList<String>(
|
|
||||||
availablePlugins);
|
|
||||||
Collections.sort(newSortedPlugins);
|
|
||||||
newSortedPlugins.addAll(pluginList);
|
|
||||||
pluginList = newSortedPlugins;
|
|
||||||
}
|
|
||||||
|
|
||||||
purgeRunner(pluginList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue