From b2150057d2685b295915ab692c7b5dd2219b5e1d Mon Sep 17 00:00:00 2001 From: orbiter Date: Sun, 30 Mar 2008 20:32:08 +0000 Subject: [PATCH] removed unnecessary cleanup method git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4625 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/CrawlProfileEditor_p.java | 8 +++---- source/de/anomic/server/serverProfiling.java | 25 +------------------- 2 files changed, 5 insertions(+), 28 deletions(-) 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 profiles = sb.profilesPassiveCrawls.profiles(false); while (profiles.hasNext()) { profiles.next(); profiles.remove(); @@ -111,7 +111,7 @@ public class CrawlProfileEditor_p { Iterator 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> historyMaps; // key=name of history, value=TreeMap of Long/Event private static Map eventCounter; // key=name of history, value=Integer of event counter - private static long lastCompleteCleanup; private static serverProfiling systemProfiler; static { // initialize profiling historyMaps = new ConcurrentHashMap>(); eventCounter = new ConcurrentHashMap(); - 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 history = historyMaps.get(eventName); - cleanup(history); - if (history.size() > 0) { - historyMaps.put(eventName, history); - } else { - historyMaps.remove(eventName); - } - } - } - private static void cleanup(TreeMap history) { // clean up too old entries while (history.size() > 0) {