Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

removed unnecessary cleanup method

orbiterb2150057d268
diff --git a/htroot/CrawlProfileEditor_p.java b/htroot/CrawlProfileEditor_p.java
index 178499760..30ed6f471 100644
--- a/htroot/CrawlProfileEditor_p.java
+++ b/htroot/CrawlProfileEditor_p.java
@@ -97,7 +97,7 @@ public class CrawlProfileEditor_p {
sb.profilesPassiveCrawls.removeEntry(handle);
}
if (post.containsKey("deleteTerminatedProfiles")) {
- Iterator profiles = sb.profilesPassiveCrawls.profiles(false);
+ Iterator<plasmaCrawlProfile.entry> profiles = sb.profilesPassiveCrawls.profiles(false);
while (profiles.hasNext()) {
profiles.next();
profiles.remove();
@@ -111,7 +111,7 @@ public class CrawlProfileEditor_p {
Iterator<plasmaCrawlProfile.entry> it = sb.profilesActiveCrawls.profiles(true);
entry selentry;
while (it.hasNext()) {
- selentry = (entry)it.next();
+ selentry = it.next();
if (selentry.name().equals(plasmaSwitchboard.CRAWL_PROFILE_PROXY) ||
selentry.name().equals(plasmaSwitchboard.CRAWL_PROFILE_REMOTE) /*||
selentry.name().equals(plasmaSwitchboard.CRAWL_PROFILE_SNIPPET_TEXT) ||
@@ -153,7 +153,7 @@ public class CrawlProfileEditor_p {
// put active crawls into list
it = sb.profilesActiveCrawls.profiles(true);
while (it.hasNext()) {
- profile = (plasmaCrawlProfile.entry) it.next();
+ profile = it.next();
putProfileEntry(prop, profile, true, dark, count, domlistlength);
dark = !dark;
count++;
@@ -162,7 +162,7 @@ public class CrawlProfileEditor_p {
boolean existPassiveCrawls = false;
it = sb.profilesPassiveCrawls.profiles(true);
while (it.hasNext()) {
- profile = (plasmaCrawlProfile.entry) it.next();
+ profile = it.next();
putProfileEntry(prop, profile, false, dark, count, domlistlength);
dark = !dark;
count++;
diff --git a/source/de/anomic/server/serverProfiling.java b/source/de/anomic/server/serverProfiling.java
index 04bb4948e..a2cf445e1 100644
--- a/source/de/anomic/server/serverProfiling.java
+++ b/source/de/anomic/server/serverProfiling.java
@@ -35,14 +35,13 @@ public class serverProfiling extends Thread {
private static Map<String, TreeMap<Long, Event>> historyMaps; // key=name of history, value=TreeMap of Long/Event
private static Map<String, Integer> eventCounter; // key=name of history, value=Integer of event counter
- private static long lastCompleteCleanup;
private static serverProfiling systemProfiler;
static {
// initialize profiling
historyMaps = new ConcurrentHashMap<String, TreeMap<Long, Event>>();
eventCounter = new ConcurrentHashMap<String, Integer>();
- lastCompleteCleanup = System.currentTimeMillis();
+ //lastCompleteCleanup = System.currentTimeMillis();
systemProfiler = null;
}
@@ -87,33 +86,11 @@ public class serverProfiling extends Thread {
// clean up too old entries
cleanup(history);
- cleanup();
// store map
historyMaps.put(eventName, history);
}
- private static void cleanup() {
- if (System.currentTimeMillis() - lastCompleteCleanup < 600000) return;
- Object[] historyNames = historyMaps.keySet().toArray();
- for (int i = 0; i < historyNames.length; i++) {
- cleanup((String) historyNames[i]);
- }
- lastCompleteCleanup = System.currentTimeMillis();
- }
-
- private static void cleanup(String eventName) {
- if (historyMaps.containsKey(eventName)) {
- TreeMap<Long, Event> history = historyMaps.get(eventName);
- cleanup(history);
- if (history.size() > 0) {
- historyMaps.put(eventName, history);
- } else {
- historyMaps.remove(eventName);
- }
- }
- }
-
private static void cleanup(TreeMap<Long, Event> history) {
// clean up too old entries
while (history.size() > 0) {