Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed bug that caused deletion of crawl profiles at every application startup
orbiterc4ae2cd03fa8
diff --git a/source/de/anomic/crawler/CrawlProfile.java b/source/de/anomic/crawler/CrawlProfile.javaindex 3d2491cd5..8dab24559 100644--- a/source/de/anomic/crawler/CrawlProfile.java+++ b/source/de/anomic/crawler/CrawlProfile.java@@ -41,6 +41,7 @@ import de.anomic.kelondro.util.FileUtils;import de.anomic.kelondro.util.kelondroException;import de.anomic.yacy.yacySeedDB;import de.anomic.yacy.yacyURL;+import de.anomic.yacy.logging.Log;public class CrawlProfile {@@ -57,6 +58,12 @@ public class CrawlProfile {profileTableFile.getParentFile().mkdirs();final Heap dyn = new Heap(profileTableFile, yacySeedDB.commonHashLength, NaturalOrder.naturalOrder, 1024 * 64);profileTable = new MapView(dyn, 500, '_');+ profileIterator pi = new profileIterator(true);+ entry e;+ while (pi.hasNext()) {+ e = pi.next();+ Log.logInfo("CrawlProfiles", "loaded Profile " + e.handle() + ": " + e.name());+ }}public void clear() {diff --git a/source/de/anomic/crawler/CrawlSwitchboard.java b/source/de/anomic/crawler/CrawlSwitchboard.javaindex b2807ac9f..6ac52521f 100644--- a/source/de/anomic/crawler/CrawlSwitchboard.java+++ b/source/de/anomic/crawler/CrawlSwitchboard.java@@ -103,14 +103,7 @@ public final class CrawlSwitchboard {}}initActiveCrawlProfiles();- log.logInfo("Loaded active crawl profiles from file " + profilesActiveFile.getName() +- ", " + this.profilesActiveCrawls.size() + " entries");- Iterator<entry> i = this.profilesActiveCrawls.profiles(true);- entry c;- while (i.hasNext()) {- c = i.next();- log.logInfo("active crawl: " + c.handle() + " - " + c.name());- }+ log.logInfo("Loaded active crawl profiles from file " + profilesActiveFile.getName() + ", " + this.profilesActiveCrawls.size() + " entries");final File profilesPassiveFile = new File(queuesRoot, DBFILE_PASSIVE_CRAWL_PROFILES);if (!profilesPassiveFile.exists()) {// migrate old filediff --git a/source/de/anomic/kelondro/blob/MapView.java b/source/de/anomic/kelondro/blob/MapView.javaindex 3e286508f..ab247ac29 100644--- a/source/de/anomic/kelondro/blob/MapView.java+++ b/source/de/anomic/kelondro/blob/MapView.java@@ -279,12 +279,12 @@ public class MapView {}- public synchronized objectIterator entries(final boolean up, final boolean rotating) throws IOException {- return new objectIterator(keys(up, rotating));+ public synchronized MapIterator entries(final boolean up, final boolean rotating) throws IOException {+ return new MapIterator(keys(up, rotating));}- public synchronized objectIterator entries(final boolean up, final boolean rotating, final byte[] firstKey, final byte[] secondKey) throws IOException {- return new objectIterator(keys(up, rotating, firstKey, secondKey));+ public synchronized MapIterator entries(final boolean up, final boolean rotating, final byte[] firstKey, final byte[] secondKey) throws IOException {+ return new MapIterator(keys(up, rotating, firstKey, secondKey));}/**@@ -311,14 +311,14 @@ public class MapView {close();}- public class objectIterator implements Iterator<Map<String, String>> {+ public class MapIterator implements Iterator<Map<String, String>> {// enumerates Map-Type elements// the key is also included in every map that is returned; it's key is 'key'Iterator<byte[]> keyIterator;boolean finish;- public objectIterator(final Iterator<byte[]> keyIterator) {+ public MapIterator(final Iterator<byte[]> keyIterator) {this.keyIterator = keyIterator;this.finish = false;}diff --git a/source/de/anomic/search/Switchboard.java b/source/de/anomic/search/Switchboard.javaindex f071423b1..dde46dbf5 100644--- a/source/de/anomic/search/Switchboard.java+++ b/source/de/anomic/search/Switchboard.java@@ -626,10 +626,6 @@ public final class Switchboard extends serverAbstractSwitch implements serverSwinew String[]{"condenseDocument", "CrawlStacker"},this, "parseDocument", 2 * serverProcessor.useCPU + 1, indexingCondensementProcessor, 2 * serverProcessor.useCPU + 1);- // clean up profiles- this.log.logConfig("Cleaning Profiles");- try { cleanProfiles(); } catch (final InterruptedException e) { /* Ignore this here */ }-// deploy busy threadslog.logConfig("Starting Threads");MemoryControl.gc(10000, "plasmaSwitchboard, help for profiler"); // help for profiler - thq