Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
refactoring: moved all crawler classes into their own package
orbiter1689030ee8c1
diff --git a/build.xml b/build.xmlindex a2a7105dc..7fc6e02c5 100644--- a/build.xml+++ b/build.xml@@ -196,7 +196,7 @@<!-- compiling the main sources --><javac srcdir="${src}/" destdir="${build}"- excludes="de/anomic/plasma/parser/*/*,de/anomic/yacy/seedUpload/**,yacy.java,de/anomic/server/portForwarding/*/*,de/anomic/data/rssReader.java"+ excludes="de/anomic/plasma/parser/*/*,de/anomic/yacy/seedUpload/**,yacy.java,de/anomic/data/rssReader.java"debug="true" debuglevel="lines,vars,source"source="${javacSource}" target="${javacTarget}"><classpath refid="project.class.path" />@@ -269,41 +269,8 @@</subant></target>- <target name="compilePortForwarding" depends="compileMain" description="Compiling and zipping additional port forwarder">- <javac srcdir="${src}/de/anomic/server/portForwarding" destdir="${build}" source="${javacSource}" target="${javacTarget}" debug="true" debuglevel="lines,vars,source">- <exclude name="serverPortForwarding.java"/>- <classpath>- <pathelement location="${build}" />-- <!-- libs needed by the sch port forwarder -->- <pathelement location="${libx}/jsch-0.1.21.jar" />-- <!-- libs needed by the upnp port forwarder -->- <pathelement location="${libx}/commons-logging.jar" />- <pathelement location="${libx}/commons-jxpath-1.1.jar" />- <pathelement location="${libx}/sbbi-upnplib-1.0.3.jar" />- </classpath>- </javac>- <copy todir="${release_ext}/libx/">- <fileset dir="${libx}" includes="jsch-0.1.21.*"/>- <fileset dir="${libx}" includes="commons-logging.*"/>- <fileset dir="${libx}" includes="commons-jxpath-1.1.*"/>- <fileset dir="${libx}" includes="sbbi-upnplib-1.0.3.*"/>- </copy>- <copy todir="${release_ext}/source/de/anomic/server/portForwarding">- <fileset dir="${src}/de/anomic/server/portForwarding">- <include name="**/*.java"/>- </fileset>- </copy>- <copy todir="${release_ext}/classes/de/anomic/server/portForwarding">- <fileset dir="${build}/de/anomic/server/portForwarding">- <include name="**/*.class"/>- </fileset>- </copy>- </target>-<!-- compile optional classs that were not compiled elsewhere -->- <target name="compileExtensions" depends="compileMain,compileParsers,compileSeedUploaders,compilePortForwarding">+ <target name="compileExtensions" depends="compileMain,compileParsers,compileSeedUploaders"><!-- compile rss Reader --><javac srcdir="${src}" destdir="${build}"debug="true" debuglevel="lines,vars,source"@@ -367,8 +334,6 @@<exclude name="de/anomic/plasma/parser/*/*"/><!-- excluding all additional seed uploaders --><exclude name="de/anomic/yacy/seedUpload/**"/>- <!-- excluding the port forwarder -->- <exclude name="de/anomic/server/portForwarding/*/*"/><!-- ecluding rss Reader class --><exclude name="de/anomic/data/rssReader.*"/></fileset>@@ -465,8 +430,6 @@<exclude name="de/anomic/plasma/parser/*/*"/><!-- excluding sources for additional seed uploaders --><exclude name="de/anomic/yacy/seedUpload/yacySeedUpload**"/>- <!-- excluding the port forwarder -->- <exclude name="de/anomic/server/portForwarding/*/*"/><!-- ecluding rss Reader class --><exclude name="de/anomic/data/rssReader.*"/></fileset>diff --git a/htroot/Collage.java b/htroot/Collage.javaindex f7a50a829..1f01cfc6a 100755--- a/htroot/Collage.java+++ b/htroot/Collage.java@@ -39,8 +39,8 @@import java.util.Random;+import de.anomic.crawler.ResultImages;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlResultImages;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -54,7 +54,7 @@ public class Collage {private static int fifoSize = 0;private static long zIndex = 0;- private static plasmaCrawlResultImages.OriginEntry origins[] = new plasmaCrawlResultImages.OriginEntry[fifoMax];+ private static ResultImages.OriginEntry origins[] = new ResultImages.OriginEntry[fifoMax];private static Integer imgWidth[] = new Integer[fifoMax];private static Integer imgHeight[] = new Integer[fifoMax];private static Integer imgPosX[] = new Integer[fifoMax];@@ -66,7 +66,7 @@ public class Collage {final serverObjects prop = new serverObjects();final plasmaSwitchboard sb = (plasmaSwitchboard) env;final boolean authenticated = sb.adminAuthenticated(header) >= 2;- plasmaCrawlResultImages.OriginEntry nextOrigin = plasmaCrawlResultImages.next(!authenticated);+ ResultImages.OriginEntry nextOrigin = ResultImages.next(!authenticated);if (nextOrigin != null) {if (fifoSize == 0 || origins[fifoPos] != nextOrigin) {@@ -104,9 +104,9 @@ public class Collage {prop.put("imgurl", "0");}- prop.putNum("refresh", Math.max(2, Math.min(5, 500 / (1 + plasmaCrawlResultImages.queueSize(!authenticated)))));- prop.put("privateQueueSize", plasmaCrawlResultImages.privateQueueHighSize() + "+" + plasmaCrawlResultImages.privateQueueLowSize());- prop.put("publicQueueSize", plasmaCrawlResultImages.publicQueueHighSize() + "+" + plasmaCrawlResultImages.publicQueueLowSize());+ prop.putNum("refresh", Math.max(2, Math.min(5, 500 / (1 + ResultImages.queueSize(!authenticated)))));+ prop.put("privateQueueSize", ResultImages.privateQueueHighSize() + "+" + ResultImages.privateQueueLowSize());+ prop.put("publicQueueSize", ResultImages.publicQueueHighSize() + "+" + ResultImages.publicQueueLowSize());return prop;}}\ No newline at end of filediff --git a/htroot/CrawlProfileEditor_p.java b/htroot/CrawlProfileEditor_p.javaindex bd295a48f..ef7dd8100 100644--- a/htroot/CrawlProfileEditor_p.java+++ b/htroot/CrawlProfileEditor_p.java@@ -28,10 +28,10 @@ import java.io.IOException;import java.util.ArrayList;import java.util.Iterator;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.CrawlProfile.entry;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlProfile;import de.anomic.plasma.plasmaSwitchboard;-import de.anomic.plasma.plasmaCrawlProfile.entry;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;import de.anomic.server.servletProperties;@@ -87,7 +87,7 @@ public class CrawlProfileEditor_p {if (post != null) {if (post.containsKey("terminate")) {// termination of a crawl: shift the crawl from active to passive- plasmaCrawlProfile.entry entry = sb.profilesActiveCrawls.getEntry(handle);+ CrawlProfile.entry entry = sb.profilesActiveCrawls.getEntry(handle);if (entry != null) sb.profilesPassiveCrawls.newEntry(entry.map());sb.profilesActiveCrawls.removeEntry(handle);// delete all entries from the crawl queue that are deleted here@@ -98,7 +98,7 @@ public class CrawlProfileEditor_p {sb.profilesPassiveCrawls.removeEntry(handle);}if (post.containsKey("deleteTerminatedProfiles")) {- Iterator<plasmaCrawlProfile.entry> profiles = sb.profilesPassiveCrawls.profiles(false);+ Iterator<CrawlProfile.entry> profiles = sb.profilesPassiveCrawls.profiles(false);while (profiles.hasNext()) {profiles.next();profiles.remove();@@ -109,7 +109,7 @@ public class CrawlProfileEditor_p {// generate handle listint count = 0;- Iterator<plasmaCrawlProfile.entry> it = sb.profilesActiveCrawls.profiles(true);+ Iterator<CrawlProfile.entry> it = sb.profilesActiveCrawls.profiles(true);entry selentry;while (it.hasNext()) {selentry = it.next();@@ -150,7 +150,7 @@ public class CrawlProfileEditor_p {count = 0;boolean dark = true;int domlistlength = (post == null) ? 160 : post.getInt("domlistlength", 160);- plasmaCrawlProfile.entry profile;+ CrawlProfile.entry profile;// put active crawls into listit = sb.profilesActiveCrawls.profiles(true);while (it.hasNext()) {@@ -206,7 +206,7 @@ public class CrawlProfileEditor_p {return prop;}- private static void putProfileEntry(servletProperties prop, plasmaCrawlProfile.entry profile, boolean active, boolean dark, int count, int domlistlength) {+ private static void putProfileEntry(servletProperties prop, CrawlProfile.entry profile, boolean active, boolean dark, int count, int domlistlength) {prop.put("crawlProfiles_" + count + "_dark", dark ? "1" : "0");prop.put("crawlProfiles_" + count + "_status", active ? "1" : "0");prop.put("crawlProfiles_" + count + "_name", profile.name());diff --git a/htroot/IndexCreateIndexingQueue_p.java b/htroot/IndexCreateIndexingQueue_p.javaindex 8f7f3c2f3..c12821c7e 100644--- a/htroot/IndexCreateIndexingQueue_p.java+++ b/htroot/IndexCreateIndexingQueue_p.java@@ -46,8 +46,8 @@import java.util.ArrayList;import java.util.Iterator;+import de.anomic.crawler.ZURL;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlZURL;import de.anomic.plasma.plasmaHTCache;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.plasma.plasmaSwitchboardQueue;@@ -171,7 +171,7 @@ public class IndexCreateIndexingQueue_p {dark = true;yacyURL url;String initiatorHash, executorHash;- plasmaCrawlZURL.Entry entry;+ ZURL.Entry entry;yacySeed initiatorSeed, executorSeed;int j=0;for (int i = sb.crawlQueues.errorURL.stackSize() - 1; i >= (sb.crawlQueues.errorURL.stackSize() - showRejectedCount); i--) {diff --git a/htroot/IndexCreateLoaderQueue_p.java b/htroot/IndexCreateLoaderQueue_p.javaindex 203aa06f0..50ece5648 100644--- a/htroot/IndexCreateLoaderQueue_p.java+++ b/htroot/IndexCreateLoaderQueue_p.java@@ -43,8 +43,8 @@// javac -classpath .:../classes IndexCreate_p.java// if the shell's current path is HTROOT+import de.anomic.crawler.CrawlEntry;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlEntry;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -63,7 +63,7 @@ public class IndexCreateLoaderQueue_p {} else {prop.put("loader-set", "1");boolean dark = true;- plasmaCrawlEntry[] w = sb.crawlQueues.activeWorkerEntries();+ CrawlEntry[] w = sb.crawlQueues.activeWorkerEntries();yacySeed initiator;int count = 0;for (int i = 0; i < w.length; i++) {diff --git a/htroot/IndexCreateWWWGlobalQueue_p.java b/htroot/IndexCreateWWWGlobalQueue_p.javaindex f6fde9923..031f87680 100644--- a/htroot/IndexCreateWWWGlobalQueue_p.java+++ b/htroot/IndexCreateWWWGlobalQueue_p.java@@ -47,10 +47,10 @@ import java.text.SimpleDateFormat;import java.util.Date;import java.util.Locale;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.NoticedURL;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlNURL;-import de.anomic.plasma.plasmaCrawlProfile;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -78,8 +78,8 @@ public class IndexCreateWWWGlobalQueue_p {}if (post.containsKey("clearcrawlqueue")) {- int c = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT);- sb.crawlQueues.noticeURL.clear(plasmaCrawlNURL.STACK_TYPE_LIMIT);+ int c = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT);+ sb.crawlQueues.noticeURL.clear(NoticedURL.STACK_TYPE_LIMIT);try { sb.cleanProfiles(); } catch (InterruptedException e) { /* Ignore this */}/*int c = 0;@@ -98,18 +98,18 @@ public class IndexCreateWWWGlobalQueue_p {}}- int stackSize = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT);+ int stackSize = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT);if (stackSize == 0) {prop.put("crawler-queue", "0");} else {prop.put("crawler-queue", "1");- plasmaCrawlEntry[] crawlerList = sb.crawlQueues.noticeURL.top(plasmaCrawlNURL.STACK_TYPE_LIMIT, showLimit);+ CrawlEntry[] crawlerList = sb.crawlQueues.noticeURL.top(NoticedURL.STACK_TYPE_LIMIT, showLimit);- plasmaCrawlEntry urle;+ CrawlEntry urle;boolean dark = true;yacySeed initiator;String profileHandle;- plasmaCrawlProfile.entry profileEntry;+ CrawlProfile.entry profileEntry;int i, showNum = 0;for (i = 0; (i < crawlerList.length) && (showNum < showLimit); i++) {urle = crawlerList[i];diff --git a/htroot/IndexCreateWWWLocalQueue_p.java b/htroot/IndexCreateWWWLocalQueue_p.javaindex 51cb63979..e9778fcd6 100644--- a/htroot/IndexCreateWWWLocalQueue_p.java+++ b/htroot/IndexCreateWWWLocalQueue_p.java@@ -51,10 +51,10 @@ import java.util.regex.Matcher;import java.util.regex.Pattern;import java.util.regex.PatternSyntaxException;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.NoticedURL;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlNURL;-import de.anomic.plasma.plasmaCrawlProfile;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -95,8 +95,8 @@ public class IndexCreateWWWLocalQueue_p {String pattern = post.get("pattern", ".*").trim();final int option = post.getInt("option", INVALID);if (pattern.equals(".*")) {- c = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE);- sb.crawlQueues.noticeURL.clear(plasmaCrawlNURL.STACK_TYPE_CORE);+ c = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE);+ sb.crawlQueues.noticeURL.clear(NoticedURL.STACK_TYPE_CORE);try { sb.cleanProfiles(); } catch (InterruptedException e) {/* ignore this */}} else if (option > INVALID) {Pattern compiledPattern = null;@@ -107,8 +107,8 @@ public class IndexCreateWWWLocalQueue_p {if (option == PROFILE) {// search and delete the crawl profile (_much_ faster, independant of queue size)// XXX: what to do about the annoying LOST PROFILE messages in the log?- Iterator<plasmaCrawlProfile.entry> it = sb.profilesActiveCrawls.profiles(true);- plasmaCrawlProfile.entry entry;+ Iterator<CrawlProfile.entry> it = sb.profilesActiveCrawls.profiles(true);+ CrawlProfile.entry entry;while (it.hasNext()) {entry = it.next();final String name = entry.name();@@ -125,8 +125,8 @@ public class IndexCreateWWWLocalQueue_p {}} else {// iterating through the list of URLs- Iterator<plasmaCrawlEntry> iter = sb.crawlQueues.noticeURL.iterator(plasmaCrawlNURL.STACK_TYPE_CORE);- plasmaCrawlEntry entry;+ Iterator<CrawlEntry> iter = sb.crawlQueues.noticeURL.iterator(NoticedURL.STACK_TYPE_CORE);+ CrawlEntry entry;while (iter.hasNext()) {if ((entry = iter.next()) == null) continue;String value = null;@@ -165,18 +165,18 @@ public class IndexCreateWWWLocalQueue_p {}}- int showNum = 0, stackSize = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE);+ int showNum = 0, stackSize = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE);if (stackSize == 0) {prop.put("crawler-queue", "0");} else {prop.put("crawler-queue", "1");- plasmaCrawlEntry[] crawlerList = sb.crawlQueues.noticeURL.top(plasmaCrawlNURL.STACK_TYPE_CORE, (int) (showLimit * 1.20));+ CrawlEntry[] crawlerList = sb.crawlQueues.noticeURL.top(NoticedURL.STACK_TYPE_CORE, (int) (showLimit * 1.20));- plasmaCrawlEntry urle;+ CrawlEntry urle;boolean dark = true;yacySeed initiator;String profileHandle;- plasmaCrawlProfile.entry profileEntry;+ CrawlProfile.entry profileEntry;int i;for (i = 0; (i < crawlerList.length) && (showNum < showLimit); i++) {urle = crawlerList[i];diff --git a/htroot/IndexCreateWWWRemoteQueue_p.java b/htroot/IndexCreateWWWRemoteQueue_p.javaindex 3a2a34184..d9cde963b 100644--- a/htroot/IndexCreateWWWRemoteQueue_p.java+++ b/htroot/IndexCreateWWWRemoteQueue_p.java@@ -47,10 +47,10 @@ import java.text.SimpleDateFormat;import java.util.Date;import java.util.Locale;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.NoticedURL;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlNURL;-import de.anomic.plasma.plasmaCrawlProfile;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -78,8 +78,8 @@ public class IndexCreateWWWRemoteQueue_p {}if (post.containsKey("clearcrawlqueue")) {- int c = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_REMOTE);- sb.crawlQueues.noticeURL.clear(plasmaCrawlNURL.STACK_TYPE_REMOTE);+ int c = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_REMOTE);+ sb.crawlQueues.noticeURL.clear(NoticedURL.STACK_TYPE_REMOTE);try { sb.cleanProfiles(); } catch (InterruptedException e) { /* Ignore this */}/*int c = 0;@@ -98,18 +98,18 @@ public class IndexCreateWWWRemoteQueue_p {}}- int stackSize = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_REMOTE);+ int stackSize = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_REMOTE);if (stackSize == 0) {prop.put("crawler-queue", "0");} else {prop.put("crawler-queue", "1");- plasmaCrawlEntry[] crawlerList = sb.crawlQueues.noticeURL.top(plasmaCrawlNURL.STACK_TYPE_REMOTE, showLimit);+ CrawlEntry[] crawlerList = sb.crawlQueues.noticeURL.top(NoticedURL.STACK_TYPE_REMOTE, showLimit);- plasmaCrawlEntry urle;+ CrawlEntry urle;boolean dark = true;yacySeed initiator;String profileHandle;- plasmaCrawlProfile.entry profileEntry;+ CrawlProfile.entry profileEntry;int i, showNum = 0;for (i = 0; (i < crawlerList.length) && (showNum < showLimit); i++) {urle = crawlerList[i];diff --git a/htroot/QuickCrawlLink_p.java b/htroot/QuickCrawlLink_p.javaindex 150872086..2c6222160 100644--- a/htroot/QuickCrawlLink_p.java+++ b/htroot/QuickCrawlLink_p.java@@ -53,8 +53,8 @@ import java.net.MalformedURLException;import java.net.URLDecoder;import java.util.Date;+import de.anomic.crawler.CrawlProfile;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlProfile;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -143,7 +143,7 @@ public class QuickCrawlLink_p {sb.crawlQueues.errorURL.remove(urlhash);// create crawling profile- plasmaCrawlProfile.entry pe = null;+ CrawlProfile.entry pe = null;try {pe = sb.profilesActiveCrawls.newEntry(crawlingStartURL.getHost(),diff --git a/htroot/WatchCrawler_p.java b/htroot/WatchCrawler_p.javaindex 0137b8620..8b68c4792 100644--- a/htroot/WatchCrawler_p.java+++ b/htroot/WatchCrawler_p.java@@ -35,12 +35,12 @@ import java.util.Map;import java.util.regex.Pattern;import java.util.regex.PatternSyntaxException;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.ZURL;import de.anomic.htmlFilter.htmlFilterContentScraper;import de.anomic.htmlFilter.htmlFilterWriter;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlProfile;-import de.anomic.plasma.plasmaCrawlZURL;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.plasma.dbImport.SitemapImporter;import de.anomic.server.serverFileUtils;@@ -191,7 +191,7 @@ public class WatchCrawler_p {// stack urlsb.profilesPassiveCrawls.removeEntry(crawlingStartURL.hash()); // if there is an old entry, delete it- plasmaCrawlProfile.entry pe = sb.profilesActiveCrawls.newEntry(+ CrawlProfile.entry pe = sb.profilesActiveCrawls.newEntry(crawlingStartURL.getHost(), crawlingStartURL, newcrawlingfilter, newcrawlingfilter,newcrawlingdepth, newcrawlingdepth,crawlingIfOlder, crawlingDomFilterDepth, crawlingDomMaxPages,@@ -228,8 +228,8 @@ public class WatchCrawler_p {prop.putHTML("info_crawlingURL", ((String) post.get("crawlingURL")));prop.putHTML("info_reasonString", reasonString);- plasmaCrawlZURL.Entry ee = sb.crawlQueues.errorURL.newEntry(- new plasmaCrawlEntry(+ ZURL.Entry ee = sb.crawlQueues.errorURL.newEntry(+ new CrawlEntry(sb.wordIndex.seedDB.mySeed().hash,crawlingStartURL,"",@@ -285,7 +285,7 @@ public class WatchCrawler_p {// creating a crawler profileyacyURL crawlURL = new yacyURL("file://" + file.toString(), null);- plasmaCrawlProfile.entry profile = sb.profilesActiveCrawls.newEntry(fileName, crawlURL, newcrawlingfilter, newcrawlingfilter, newcrawlingdepth, newcrawlingdepth, crawlingIfOlder, crawlingDomFilterDepth, crawlingDomMaxPages, crawlingQ, indexText, indexMedia, storeHTCache, true, crawlOrder, xsstopw, xdstopw, xpstopw);+ CrawlProfile.entry profile = sb.profilesActiveCrawls.newEntry(fileName, crawlURL, newcrawlingfilter, newcrawlingfilter, newcrawlingdepth, newcrawlingdepth, crawlingIfOlder, crawlingDomFilterDepth, crawlingDomMaxPages, crawlingQ, indexText, indexMedia, storeHTCache, true, crawlOrder, xsstopw, xdstopw, xpstopw);// pause local crawl heresb.pauseCrawlJob(plasmaSwitchboard.CRAWLJOB_LOCAL_CRAWL);@@ -331,7 +331,7 @@ public class WatchCrawler_p {yacyURL sitemapURL = new yacyURL(sitemapURLStr, null);// create a new profile- plasmaCrawlProfile.entry pe = sb.profilesActiveCrawls.newEntry(+ CrawlProfile.entry pe = sb.profilesActiveCrawls.newEntry(sitemapURLStr, sitemapURL, newcrawlingfilter, newcrawlingfilter,newcrawlingdepth, newcrawlingdepth,crawlingIfOlder, crawlingDomFilterDepth, crawlingDomMaxPages,diff --git a/htroot/WatchWebStructure_p.java b/htroot/WatchWebStructure_p.javaindex 0ea06ff5f..7537d57b1 100644--- a/htroot/WatchWebStructure_p.java+++ b/htroot/WatchWebStructure_p.java@@ -1,9 +1,9 @@import java.util.Iterator;+import de.anomic.crawler.CrawlProfile.entry;import de.anomic.http.httpHeader;import de.anomic.plasma.plasmaSwitchboard;-import de.anomic.plasma.plasmaCrawlProfile.entry;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;diff --git a/htroot/xml/queues_p.java b/htroot/xml/queues_p.javaindex 9fa74a621..a880b4a8f 100644--- a/htroot/xml/queues_p.java+++ b/htroot/xml/queues_p.java@@ -53,9 +53,9 @@ import java.util.Date;import java.util.Iterator;import java.util.Locale;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.NoticedURL;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlNURL;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.plasma.plasmaSwitchboardQueue;import de.anomic.server.serverObjects;@@ -140,7 +140,7 @@ public class queues_p {if (sb.crawlQueues.size() == 0) {prop.put("list-loader", "0");} else {- plasmaCrawlEntry[] w = sb.crawlQueues.activeWorkerEntries();+ CrawlEntry[] w = sb.crawlQueues.activeWorkerEntries();int count = 0;for (int i = 0; i < w.length; i++) {if (w[i] == null) continue;@@ -157,23 +157,23 @@ public class queues_p {//local crawl queueprop.putNum("localCrawlSize", Integer.toString(sb.getThread(plasmaSwitchboard.CRAWLJOB_LOCAL_CRAWL).getJobCount()));prop.put("localCrawlState", sb.crawlJobIsPaused(plasmaSwitchboard.CRAWLJOB_LOCAL_CRAWL) ? STATE_PAUSED : STATE_RUNNING);- int stackSize = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE);- addNTable(sb, prop, "list-local", sb.crawlQueues.noticeURL.top(plasmaCrawlNURL.STACK_TYPE_CORE, Math.min(10, stackSize)));+ int stackSize = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE);+ addNTable(sb, prop, "list-local", sb.crawlQueues.noticeURL.top(NoticedURL.STACK_TYPE_CORE, Math.min(10, stackSize)));//global crawl queueprop.putNum("limitCrawlSize", Integer.toString(sb.crawlQueues.limitCrawlJobSize()));prop.put("limitCrawlState", STATE_RUNNING);- stackSize = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT);+ stackSize = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT);//global crawl queueprop.putNum("remoteCrawlSize", Integer.toString(sb.getThread(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL).getJobCount()));prop.put("remoteCrawlState", sb.crawlJobIsPaused(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL) ? STATE_PAUSED : STATE_RUNNING);- stackSize = sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT);+ stackSize = sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT);if (stackSize == 0) {prop.put("list-remote", "0");} else {- addNTable(sb, prop, "list-remote", sb.crawlQueues.noticeURL.top(plasmaCrawlNURL.STACK_TYPE_LIMIT, Math.min(10, stackSize)));+ addNTable(sb, prop, "list-remote", sb.crawlQueues.noticeURL.top(NoticedURL.STACK_TYPE_LIMIT, Math.min(10, stackSize)));}// return rewrite properties@@ -181,10 +181,10 @@ public class queues_p {}- public static final void addNTable(plasmaSwitchboard sb, serverObjects prop, String tableName, plasmaCrawlEntry[] crawlerList) {+ public static final void addNTable(plasmaSwitchboard sb, serverObjects prop, String tableName, CrawlEntry[] crawlerList) {int showNum = 0;- plasmaCrawlEntry urle;+ CrawlEntry urle;yacySeed initiator;for (int i = 0; i < crawlerList.length; i++) {urle = crawlerList[i];diff --git a/htroot/yacy/crawlReceipt.java b/htroot/yacy/crawlReceipt.javaindex 2fe45d3aa..0665a13d2 100644--- a/htroot/yacy/crawlReceipt.java+++ b/htroot/yacy/crawlReceipt.java@@ -48,9 +48,9 @@import java.io.IOException;+import de.anomic.crawler.ZURL;import de.anomic.http.httpHeader;import de.anomic.index.indexURLReference;-import de.anomic.plasma.plasmaCrawlZURL;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -170,7 +170,7 @@ public final class crawlReceipt {}sb.crawlQueues.delegatedURL.remove(entry.hash()); // the delegated work is transformed into an error case- plasmaCrawlZURL.Entry ee = sb.crawlQueues.errorURL.newEntry(+ ZURL.Entry ee = sb.crawlQueues.errorURL.newEntry(entry.toBalancerEntry(iam),youare,null,diff --git a/htroot/yacy/urls.java b/htroot/yacy/urls.javaindex 6778ea9c9..af5bb3f37 100644--- a/htroot/yacy/urls.java+++ b/htroot/yacy/urls.java@@ -27,10 +27,10 @@import java.io.IOException;import java.util.Date;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.NoticedURL;import de.anomic.http.httpHeader;import de.anomic.index.indexURLReference;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlNURL;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverDate;import de.anomic.server.serverObjects;@@ -57,10 +57,10 @@ public class urls {if (post.get("call", "").equals("remotecrawl")) {// perform a remote crawl url handover- int stackType = plasmaCrawlNURL.STACK_TYPE_LIMIT;+ int stackType = NoticedURL.STACK_TYPE_LIMIT;int count = Math.min(100, post.getInt("count", 0));int c = 0;- plasmaCrawlEntry entry;+ CrawlEntry entry;yacyURL referrer;while ((count > 0) && (sb.crawlQueues.noticeURL.stackSize(stackType) > 0)) {try {diff --git a/source/de/anomic/plasma/plasmaCrawlBalancer.java b/source/de/anomic/crawler/Balancer.javasimilarity index 92%rename from source/de/anomic/plasma/plasmaCrawlBalancer.javarename to source/de/anomic/crawler/Balancer.javaindex ff1aac963..9436795de 100644--- a/source/de/anomic/plasma/plasmaCrawlBalancer.java+++ b/source/de/anomic/crawler/Balancer.java@@ -39,7 +39,7 @@// the intact and unchanged copyright notice.// Contributions and changes to the program code must be marked as such.-package de.anomic.plasma;+package de.anomic.crawler;import java.io.File;import java.io.IOException;@@ -58,10 +58,11 @@ import de.anomic.kelondro.kelondroEcoTable;import de.anomic.kelondro.kelondroIndex;import de.anomic.kelondro.kelondroRow;import de.anomic.kelondro.kelondroStack;+import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.logging.serverLog;import de.anomic.yacy.yacySeedDB;-public class plasmaCrawlBalancer {+public class Balancer {private static final String stackSuffix = "9.stack";private static final String indexSuffix = "9.db";@@ -102,7 +103,7 @@ public class plasmaCrawlBalancer {}}- public plasmaCrawlBalancer(File cachePath, String stackname, boolean fullram) {+ public Balancer(File cachePath, String stackname, boolean fullram) {this.cacheStacksPath = cachePath;this.stackname = stackname;File stackFile = new File(cachePath, stackname + stackSuffix);@@ -147,7 +148,7 @@ public class plasmaCrawlBalancer {private void openFileIndex() {cacheStacksPath.mkdirs();- urlFileIndex = new kelondroEcoTable(new File(cacheStacksPath, stackname + indexSuffix), plasmaCrawlEntry.rowdef, (fullram) ? kelondroEcoTable.tailCacheUsageAuto : kelondroEcoTable.tailCacheDenyUsage, EcoFSBufferSize, 0);+ urlFileIndex = new kelondroEcoTable(new File(cacheStacksPath, stackname + indexSuffix), CrawlEntry.rowdef, (fullram) ? kelondroEcoTable.tailCacheUsageAuto : kelondroEcoTable.tailCacheDenyUsage, EcoFSBufferSize, 0);}private void resetFileIndex() {@@ -159,11 +160,11 @@ public class plasmaCrawlBalancer {openFileIndex();}- public synchronized plasmaCrawlEntry get(String urlhash) throws IOException {+ public synchronized CrawlEntry get(String urlhash) throws IOException {assert urlhash != null;kelondroRow.Entry entry = urlFileIndex.get(urlhash.getBytes());if (entry == null) return null;- return new plasmaCrawlEntry(entry);+ return new CrawlEntry(entry);}public synchronized int removeAllByProfileHandle(String profileHandle) throws IOException {@@ -175,10 +176,10 @@ public class plasmaCrawlBalancer {Iterator<kelondroRow.Entry> i = urlFileIndex.rows(true, null);HashSet<String> urlHashes = new HashSet<String>();kelondroRow.Entry rowEntry;- plasmaCrawlEntry crawlEntry;+ CrawlEntry crawlEntry;while (i.hasNext()) {rowEntry = (kelondroRow.Entry) i.next();- crawlEntry = new plasmaCrawlEntry(rowEntry);+ crawlEntry = new CrawlEntry(rowEntry);if (crawlEntry.profileHandle().equals(profileHandle)) {urlHashes.add(crawlEntry.url().hash());}@@ -317,7 +318,7 @@ public class plasmaCrawlBalancer {urlFileStack.push(urlFileStack.row().newEntry(new byte[][]{((String) urlRAMStack.get(urlRAMStack.size() / 2)).getBytes()}));}- public synchronized void push(plasmaCrawlEntry entry) throws IOException {+ public synchronized void push(CrawlEntry entry) throws IOException {assert entry != null;if (urlFileIndex.has(entry.url().hash().getBytes())) {serverLog.logWarning("PLASMA BALANCER", "double-check has failed for urlhash " + entry.url().hash() + " in " + stackname + " - fixed");@@ -348,7 +349,7 @@ public class plasmaCrawlBalancer {}}- public synchronized plasmaCrawlEntry pop(long minimumLocalDelta, long minimumGlobalDelta, long maximumAge) throws IOException {+ public synchronized CrawlEntry pop(long minimumLocalDelta, long minimumGlobalDelta, long maximumAge) throws IOException {// returns an url-hash from the stack and ensures minimum delta times// we have 3 sources to choose from: the ramStack, the domainStacks and the fileStack@@ -481,9 +482,9 @@ public class plasmaCrawlBalancer {} else {assert urlFileIndex.size() + 1 == s : "urlFileIndex.size() = " + urlFileIndex.size() + ", s = " + s + ", result = " + result;}- plasmaCrawlEntry crawlEntry = new plasmaCrawlEntry(rowEntry);+ CrawlEntry crawlEntry = new CrawlEntry(rowEntry);long minimumDelta = (crawlEntry.url().isLocal()) ? minimumLocalDelta : minimumGlobalDelta;- plasmaCrawlRobotsTxt.Entry robotsEntry = plasmaSwitchboard.robots.getEntry(crawlEntry.url().getHost());+ RobotsTxt.Entry robotsEntry = plasmaSwitchboard.robots.getEntry(crawlEntry.url().getHost());Integer hostDelay = (robotsEntry == null) ? null : robotsEntry.getCrawlDelay();long genericDelta = ((robotsEntry == null) || (hostDelay == null)) ? minimumDelta : Math.max(minimumDelta, hostDelay.intValue() * 1000);genericDelta = Math.min(10000, genericDelta); // prevent that ta robots file can stop our indexer completely@@ -511,7 +512,7 @@ public class plasmaCrawlBalancer {return System.currentTimeMillis() - lastAccess.time();}- public synchronized plasmaCrawlEntry top(int dist) throws IOException {+ public synchronized CrawlEntry top(int dist) throws IOException {// if we need to flush anything, then flush the domain stack first,// to avoid that new urls get hidden by old entries from the file stackif (urlRAMStack == null) return null;@@ -536,14 +537,14 @@ public class plasmaCrawlBalancer {if (kelondroAbstractRecords.debugmode) serverLog.logWarning("PLASMA BALANCER", "no entry in index for urlhash " + urlhash);return null;}- return new plasmaCrawlEntry(entry);+ return new CrawlEntry(entry);}- public synchronized Iterator<plasmaCrawlEntry> iterator() throws IOException {+ public synchronized Iterator<CrawlEntry> iterator() throws IOException {return new EntryIterator();}- private class EntryIterator implements Iterator<plasmaCrawlEntry> {+ private class EntryIterator implements Iterator<CrawlEntry> {private Iterator<kelondroRow.Entry> rowIterator;@@ -555,10 +556,10 @@ public class plasmaCrawlBalancer {return (rowIterator == null) ? false : rowIterator.hasNext();}- public plasmaCrawlEntry next() {+ public CrawlEntry next() {kelondroRow.Entry entry = (kelondroRow.Entry) rowIterator.next();try {- return (entry == null) ? null : new plasmaCrawlEntry(entry);+ return (entry == null) ? null : new CrawlEntry(entry);} catch (IOException e) {rowIterator = null;return null;diff --git a/source/de/anomic/plasma/plasmaCrawlEntry.java b/source/de/anomic/crawler/CrawlEntry.javaold mode 100644new mode 100755similarity index 98%rename from source/de/anomic/plasma/plasmaCrawlEntry.javarename to source/de/anomic/crawler/CrawlEntry.javaindex 914f77705..045d69e83--- a/source/de/anomic/plasma/plasmaCrawlEntry.java+++ b/source/de/anomic/crawler/CrawlEntry.java@@ -1,4 +1,4 @@-// plasmaCrawlEntry.java+// CrawlEntry.java// (C) 2007 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany// first published 14.03.2007 on http://yacy.net//@@ -24,7 +24,7 @@// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-package de.anomic.plasma;+package de.anomic.crawler;import java.io.IOException;import java.io.UnsupportedEncodingException;@@ -37,7 +37,7 @@ import de.anomic.kelondro.kelondroRow;import de.anomic.yacy.yacySeedDB;import de.anomic.yacy.yacyURL;-public class plasmaCrawlEntry {+public class CrawlEntry {// row definition for balancer-related NURL-entriespublic final static kelondroRow rowdef = new kelondroRow(@@ -89,7 +89,7 @@ public class plasmaCrawlEntry {* @param anchors number of anchors of the parent* @param forkfactor sum of anchors of all ancestors*/- public plasmaCrawlEntry(+ public CrawlEntry(String initiator,yacyURL url,String referrerhash,@@ -124,7 +124,7 @@ public class plasmaCrawlEntry {this.initialHash = url.hashCode();}- public plasmaCrawlEntry(kelondroRow.Entry entry) throws IOException {+ public CrawlEntry(kelondroRow.Entry entry) throws IOException {assert (entry != null);insertEntry(entry);}diff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/crawler/CrawlProfile.javasimilarity index 97%rename from source/de/anomic/plasma/plasmaCrawlProfile.javarename to source/de/anomic/crawler/CrawlProfile.javaindex 9e3095332..f597bf891 100644--- a/source/de/anomic/plasma/plasmaCrawlProfile.java+++ b/source/de/anomic/crawler/CrawlProfile.java@@ -39,7 +39,7 @@// the intact and unchanged copyright notice.// Contributions and changes to the program code must be marked as such.-package de.anomic.plasma;+package de.anomic.crawler;import java.io.File;import java.io.IOException;@@ -58,14 +58,14 @@ import de.anomic.server.serverCodings;import de.anomic.yacy.yacySeedDB;import de.anomic.yacy.yacyURL;-public class plasmaCrawlProfile {+public class CrawlProfile {static HashMap<String, Map<String, DomProfile>> domsCache = new HashMap<String, Map<String, DomProfile>>();kelondroMapObjects profileTable;private File profileTableFile;- public plasmaCrawlProfile(File file) {+ public CrawlProfile(File file) {this.profileTableFile = file;profileTableFile.getParentFile().mkdirs();kelondroDyn dyn = new kelondroDyn(profileTableFile, true, true, yacySeedDB.commonHashLength, 2000, '#', kelondroNaturalOrder.naturalOrder, false, false, true);diff --git a/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java b/source/de/anomic/crawler/CrawlQueues.javasimilarity index 87%rename from source/de/anomic/plasma/crawler/plasmaCrawlQueues.javarename to source/de/anomic/crawler/CrawlQueues.javaindex 055dc6db8..cc1ea754c 100644--- a/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java+++ b/source/de/anomic/crawler/CrawlQueues.java@@ -24,7 +24,7 @@// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-package de.anomic.plasma.crawler;+package de.anomic.crawler;import java.io.File;import java.io.IOException;@@ -38,10 +38,6 @@ import java.util.concurrent.ConcurrentHashMap;import de.anomic.data.robotsParser;import de.anomic.kelondro.kelondroFlexWidthArray;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlNURL;-import de.anomic.plasma.plasmaCrawlProfile;-import de.anomic.plasma.plasmaCrawlZURL;import de.anomic.plasma.plasmaHTCache;import de.anomic.plasma.plasmaParser;import de.anomic.plasma.plasmaSwitchboard;@@ -54,27 +50,27 @@ import de.anomic.yacy.yacyCore;import de.anomic.yacy.yacySeed;import de.anomic.yacy.yacyURL;-public class plasmaCrawlQueues {+public class CrawlQueues {- private plasmaSwitchboard sb;+ plasmaSwitchboard sb;serverLog log;Map<Integer, crawlWorker> workers; // mapping from url hash to Worker thread object- plasmaProtocolLoader loader;+ ProtocolLoader loader;private ArrayList<String> remoteCrawlProviderHashes;- public plasmaCrawlNURL noticeURL;- public plasmaCrawlZURL errorURL, delegatedURL;+ public NoticedURL noticeURL;+ public ZURL errorURL, delegatedURL;- public plasmaCrawlQueues(plasmaSwitchboard sb, File plasmaPath) {+ public CrawlQueues(plasmaSwitchboard sb, File plasmaPath) {this.sb = sb;this.log = new serverLog("CRAWLER");this.workers = new ConcurrentHashMap<Integer, crawlWorker>();- this.loader = new plasmaProtocolLoader(sb, log);+ this.loader = new ProtocolLoader(sb, log);this.remoteCrawlProviderHashes = new ArrayList<String>();// start crawling managementlog.logConfig("Starting Crawling Management");- noticeURL = new plasmaCrawlNURL(plasmaPath);+ noticeURL = new NoticedURL(plasmaPath);//errorURL = new plasmaCrawlZURL(); // fresh error DB each startup; can be hold in RAM and reduces IO;File errorDBFile = new File(plasmaPath, "urlError2.db");if (errorDBFile.exists()) {@@ -82,8 +78,8 @@ public class plasmaCrawlQueues {// this is useful because there is currently no re-use of the data in this table.if (errorDBFile.isDirectory()) kelondroFlexWidthArray.delete(plasmaPath, "urlError2.db"); else errorDBFile.delete();}- errorURL = new plasmaCrawlZURL(plasmaPath, "urlError2.db", false);- delegatedURL = new plasmaCrawlZURL(plasmaPath, "urlDelegated2.db", true);+ errorURL = new ZURL(plasmaPath, "urlError2.db", false);+ delegatedURL = new ZURL(plasmaPath, "urlDelegated2.db", true);}public String urlExists(String hash) {@@ -107,9 +103,9 @@ public class plasmaCrawlQueues {public yacyURL getURL(String urlhash) {assert urlhash != null;- plasmaCrawlEntry ne = noticeURL.get(urlhash);+ CrawlEntry ne = noticeURL.get(urlhash);if (ne != null) return ne.url();- plasmaCrawlZURL.Entry ee = delegatedURL.getEntry(urlhash);+ ZURL.Entry ee = delegatedURL.getEntry(urlhash);if (ee != null) return ee.url();ee = errorURL.getEntry(urlhash);if (ee != null) return ee.url();@@ -130,9 +126,9 @@ public class plasmaCrawlQueues {delegatedURL.close();}- public plasmaCrawlEntry[] activeWorkerEntries() {+ public CrawlEntry[] activeWorkerEntries() {synchronized (workers) {- plasmaCrawlEntry[] e = new plasmaCrawlEntry[workers.size()];+ CrawlEntry[] e = new CrawlEntry[workers.size()];int i = 0;for (crawlWorker w: workers.values()) e[i++] = w.entry;return e;@@ -144,7 +140,7 @@ public class plasmaCrawlQueues {}public int coreCrawlJobSize() {- return noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE);+ return noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE);}public boolean coreCrawlJob() {@@ -157,14 +153,14 @@ public class plasmaCrawlQueues {// move some tasks to the core crawl job so we have something to doint toshift = Math.min(10, limitCrawlJobSize()); // this cannot be a big number because the balancer makes a forced waiting if it cannot balancefor (int i = 0; i < toshift; i++) {- noticeURL.shift(plasmaCrawlNURL.STACK_TYPE_LIMIT, plasmaCrawlNURL.STACK_TYPE_CORE);+ noticeURL.shift(NoticedURL.STACK_TYPE_LIMIT, NoticedURL.STACK_TYPE_CORE);}log.logInfo("shifted " + toshift + " jobs from global crawl to local crawl (coreCrawlJobSize()=" + coreCrawlJobSize() +", limitCrawlJobSize()=" + limitCrawlJobSize() + ", cluster.mode=" + sb.getConfig(plasmaSwitchboard.CLUSTER_MODE, "") +", robinsonMode=" + ((sb.isRobinsonMode()) ? "on" : "off"));}- if (noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE) == 0) {+ if (noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE) == 0) {//log.logDebug("CoreCrawl: queue is empty");return false;}@@ -193,11 +189,11 @@ public class plasmaCrawlQueues {}// do a local crawl- plasmaCrawlEntry urlEntry = null;- while (urlEntry == null && noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE) > 0) {- String stats = "LOCALCRAWL[" + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE) + ", " + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT) + ", " + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_OVERHANG) + ", " + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_REMOTE) + "]";+ CrawlEntry urlEntry = null;+ while (urlEntry == null && noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE) > 0) {+ String stats = "LOCALCRAWL[" + noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE) + ", " + noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT) + ", " + noticeURL.stackSize(NoticedURL.STACK_TYPE_OVERHANG) + ", " + noticeURL.stackSize(NoticedURL.STACK_TYPE_REMOTE) + "]";try {- urlEntry = noticeURL.pop(plasmaCrawlNURL.STACK_TYPE_CORE, true);+ urlEntry = noticeURL.pop(NoticedURL.STACK_TYPE_CORE, true);String profileHandle = urlEntry.profileHandle();// System.out.println("DEBUG plasmaSwitchboard.processCrawling:// profileHandle = " + profileHandle + ", urlEntry.url = " + urlEntry.url());@@ -205,7 +201,7 @@ public class plasmaCrawlQueues {log.logSevere(stats + ": NULL PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());return true;}- plasmaCrawlProfile.entry profile = sb.profilesActiveCrawls.getEntry(profileHandle);+ CrawlProfile.entry profile = sb.profilesActiveCrawls.getEntry(profileHandle);if (profile == null) {log.logWarning(stats + ": LOST PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());return true;@@ -226,7 +222,7 @@ public class plasmaCrawlQueues {return true;} catch (IOException e) {log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage(), e);- if (e.getMessage().indexOf("hash is null") > 0) noticeURL.clear(plasmaCrawlNURL.STACK_TYPE_CORE);+ if (e.getMessage().indexOf("hash is null") > 0) noticeURL.clear(NoticedURL.STACK_TYPE_CORE);}}return true;@@ -343,11 +339,11 @@ public class plasmaCrawlQueues {}public int limitCrawlJobSize() {- return noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT);+ return noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT);}public int remoteTriggeredCrawlJobSize() {- return noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_REMOTE);+ return noticeURL.stackSize(NoticedURL.STACK_TYPE_REMOTE);}public boolean remoteTriggeredCrawlJob() {@@ -355,7 +351,7 @@ public class plasmaCrawlQueues {// do nothing if either there are private processes to be done// or there is no global crawl on the stack- if (noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_REMOTE) == 0) {+ if (noticeURL.stackSize(NoticedURL.STACK_TYPE_REMOTE) == 0) {//log.logDebug("GlobalCrawl: queue is empty");return false;}@@ -384,15 +380,15 @@ public class plasmaCrawlQueues {}// we don't want to crawl a global URL globally, since WE are the global part. (from this point of view)- String stats = "REMOTETRIGGEREDCRAWL[" + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE) + ", " + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT) + ", " + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_OVERHANG) + ", "- + noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_REMOTE) + "]";+ String stats = "REMOTETRIGGEREDCRAWL[" + noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE) + ", " + noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT) + ", " + noticeURL.stackSize(NoticedURL.STACK_TYPE_OVERHANG) + ", "+ + noticeURL.stackSize(NoticedURL.STACK_TYPE_REMOTE) + "]";try {- plasmaCrawlEntry urlEntry = noticeURL.pop(plasmaCrawlNURL.STACK_TYPE_REMOTE, true);+ CrawlEntry urlEntry = noticeURL.pop(NoticedURL.STACK_TYPE_REMOTE, true);String profileHandle = urlEntry.profileHandle();// System.out.println("DEBUG plasmaSwitchboard.processCrawling:// profileHandle = " + profileHandle + ", urlEntry.url = " +// urlEntry.url());- plasmaCrawlProfile.entry profile = sb.profilesActiveCrawls.getEntry(profileHandle);+ CrawlProfile.entry profile = sb.profilesActiveCrawls.getEntry(profileHandle);if (profile == null) {log.logWarning(stats + ": LOST PROFILE HANDLE '" + urlEntry.profileHandle() + "' for URL " + urlEntry.url());@@ -414,12 +410,12 @@ public class plasmaCrawlQueues {return true;} catch (IOException e) {log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage(), e);- if (e.getMessage().indexOf("hash is null") > 0) noticeURL.clear(plasmaCrawlNURL.STACK_TYPE_REMOTE);+ if (e.getMessage().indexOf("hash is null") > 0) noticeURL.clear(NoticedURL.STACK_TYPE_REMOTE);return true;}}- private void processLocalCrawling(plasmaCrawlEntry entry, String stats) {+ private void processLocalCrawling(CrawlEntry entry, String stats) {// work off one Crawl stack entryif ((entry == null) || (entry.url() == null)) {log.logInfo(stats + ": urlEntry = null");@@ -439,7 +435,7 @@ public class plasmaCrawlQueues {boolean global) {- plasmaCrawlEntry centry = new plasmaCrawlEntry(+ CrawlEntry centry = new CrawlEntry(sb.wordIndex.seedDB.mySeed().hash,url,"",@@ -466,10 +462,10 @@ public class plasmaCrawlQueues {protected class crawlWorker extends Thread {- public plasmaCrawlEntry entry;+ public CrawlEntry entry;private Integer code;- public crawlWorker(plasmaCrawlEntry entry) {+ public crawlWorker(CrawlEntry entry) {this.entry = entry;this.entry.setStatus("worker-initialized");this.code = new Integer(entry.hashCode());@@ -485,7 +481,7 @@ public class plasmaCrawlQueues {this.entry.setStatus("worker-checkingrobots");if ((entry.url().getProtocol().equals("http") || entry.url().getProtocol().equals("https")) && robotsParser.isDisallowed(entry.url())) {if (log.isFine()) log.logFine("Crawling of URL '" + entry.url().toString() + "' disallowed by robots.txt.");- plasmaCrawlZURL.Entry eentry = errorURL.newEntry(+ ZURL.Entry eentry = errorURL.newEntry(this.entry,sb.wordIndex.seedDB.mySeed().hash,new Date(),@@ -498,7 +494,7 @@ public class plasmaCrawlQueues {this.entry.setStatus("worker-loading");String result = loader.process(this.entry, plasmaParser.PARSER_MODE_CRAWLER);if (result != null) {- plasmaCrawlZURL.Entry eentry = errorURL.newEntry(+ ZURL.Entry eentry = errorURL.newEntry(this.entry,sb.wordIndex.seedDB.mySeed().hash,new Date(),@@ -511,7 +507,7 @@ public class plasmaCrawlQueues {}}} catch (Exception e) {- plasmaCrawlZURL.Entry eentry = errorURL.newEntry(+ ZURL.Entry eentry = errorURL.newEntry(this.entry,sb.wordIndex.seedDB.mySeed().hash,new Date(),diff --git a/source/de/anomic/plasma/plasmaCrawlStacker.java b/source/de/anomic/crawler/CrawlStacker.javasimilarity index 86%rename from source/de/anomic/plasma/plasmaCrawlStacker.javarename to source/de/anomic/crawler/CrawlStacker.javaindex 761ba2072..47f24bc8f 100644--- a/source/de/anomic/plasma/plasmaCrawlStacker.java+++ b/source/de/anomic/crawler/CrawlStacker.java@@ -45,7 +45,7 @@// the intact and unchanged copyright notice.// Contributions and changes to the program code must be marked as such.-package de.anomic.plasma;+package de.anomic.crawler;import java.io.File;import java.io.IOException;@@ -64,11 +64,12 @@ import de.anomic.kelondro.kelondroIndex;import de.anomic.kelondro.kelondroRow;import de.anomic.kelondro.kelondroRowSet;import de.anomic.kelondro.kelondroTree;+import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverDomains;import de.anomic.server.logging.serverLog;import de.anomic.yacy.yacyURL;-public final class plasmaCrawlStacker extends Thread {+public final class CrawlStacker extends Thread {private static final int EcoFSBufferSize = 20;private static String stackfile = "urlNoticeStacker9.db";@@ -93,7 +94,7 @@ public final class plasmaCrawlStacker extends Thread {// objects for the prefetch taskprivate ArrayList<String> dnsfetchHosts = new ArrayList<String>();- public plasmaCrawlStacker(plasmaSwitchboard sb, File dbPath, int dbtype, boolean prequeue) {+ public CrawlStacker(plasmaSwitchboard sb, File dbPath, int dbtype, boolean prequeue) {this.sb = sb;this.prequeue = prequeue;this.dnsHit = 0;@@ -122,7 +123,7 @@ public final class plasmaCrawlStacker extends Thread {}} catch (kelondroException e) {/* if we have an error, we start with a fresh database */- plasmaCrawlStacker.this.log.logSevere("Unable to initialize crawl stacker queue, kelondroException:" + e.getMessage() + ". Reseting DB.\n", e);+ CrawlStacker.this.log.logSevere("Unable to initialize crawl stacker queue, kelondroException:" + e.getMessage() + ". Reseting DB.\n", e);// deleting old db and creating a new dbtry {this.urlEntryCache.close();} catch (Exception ex) {}@@ -130,7 +131,7 @@ public final class plasmaCrawlStacker extends Thread {openDB();} catch (IOException e) {/* if we have an error, we start with a fresh database */- plasmaCrawlStacker.this.log.logSevere("Unable to initialize crawl stacker queue, IOException:" + e.getMessage() + ". Reseting DB.\n", e);+ CrawlStacker.this.log.logSevere("Unable to initialize crawl stacker queue, IOException:" + e.getMessage() + ". Reseting DB.\n", e);// deleting old db and creating a new dbtry {this.urlEntryCache.close();} catch (Exception ex) {}@@ -197,7 +198,7 @@ public final class plasmaCrawlStacker extends Thread {}public boolean job() {- plasmaCrawlEntry entry;+ CrawlEntry entry;try {entry = dequeueEntry();} catch (IOException e) {@@ -212,12 +213,12 @@ public final class plasmaCrawlStacker extends Thread {// if the url was rejected we store it into the error URL dbif (rejectReason != null) {- plasmaCrawlZURL.Entry ee = sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, rejectReason);+ ZURL.Entry ee = sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, rejectReason);ee.store();sb.crawlQueues.errorURL.push(ee);}} catch (Exception e) {- plasmaCrawlStacker.this.log.logWarning("Error while processing stackCrawl entry.\n" + "Entry: " + entry.toString() + "Error: " + e.toString(), e);+ CrawlStacker.this.log.logWarning("Error while processing stackCrawl entry.\n" + "Entry: " + entry.toString() + "Error: " + e.toString(), e);return false;}return true;@@ -230,9 +231,9 @@ public final class plasmaCrawlStacker extends Thread {String name,Date loadDate,int currentdepth,- plasmaCrawlProfile.entry profile) {+ CrawlProfile.entry profile) {if (profile == null) return;- plasmaCrawlEntry newEntry = new plasmaCrawlEntry(+ CrawlEntry newEntry = new CrawlEntry(initiatorHash,nexturl,referrerhash,@@ -294,22 +295,22 @@ public final class plasmaCrawlStacker extends Thread {if (!(cacheStacksPath.exists())) cacheStacksPath.mkdir(); // make the pathif (this.dbtype == QUEUE_DB_TYPE_RAM) {- this.urlEntryCache = new kelondroRowSet(plasmaCrawlEntry.rowdef, 0);+ this.urlEntryCache = new kelondroRowSet(CrawlEntry.rowdef, 0);}if (this.dbtype == QUEUE_DB_TYPE_ECO) {cacheStacksPath.mkdirs();File f = new File(cacheStacksPath, stackfile);try {- this.urlEntryCache = new kelondroEcoTable(f, plasmaCrawlEntry.rowdef, kelondroEcoTable.tailCacheUsageAuto, EcoFSBufferSize, 0);- //this.urlEntryCache = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, preloadTime, plasmaCrawlEntry.rowdef, 0, true));+ this.urlEntryCache = new kelondroEcoTable(f, CrawlEntry.rowdef, kelondroEcoTable.tailCacheUsageAuto, EcoFSBufferSize, 0);+ //this.urlEntryCache = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, preloadTime, CrawlEntry.rowdef, 0, true));} catch (Exception e) {e.printStackTrace();// kill DB and try againf.delete();//kelondroFlexTable.delete(cacheStacksPath, newCacheName);try {- this.urlEntryCache = new kelondroEcoTable(f, plasmaCrawlEntry.rowdef, kelondroEcoTable.tailCacheUsageAuto, EcoFSBufferSize, 0);- //this.urlEntryCache = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, preloadTime, plasmaCrawlEntry.rowdef, 0, true));+ this.urlEntryCache = new kelondroEcoTable(f, CrawlEntry.rowdef, kelondroEcoTable.tailCacheUsageAuto, EcoFSBufferSize, 0);+ //this.urlEntryCache = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, preloadTime, CrawlEntry.rowdef, 0, true));} catch (Exception ee) {ee.printStackTrace();System.exit(-1);@@ -319,7 +320,7 @@ public final class plasmaCrawlStacker extends Thread {if (this.dbtype == QUEUE_DB_TYPE_TREE) {File cacheFile = new File(cacheStacksPath, stackfile);cacheFile.getParentFile().mkdirs();- this.urlEntryCache = new kelondroCache(kelondroTree.open(cacheFile, true, 0, plasmaCrawlEntry.rowdef));+ this.urlEntryCache = new kelondroCache(kelondroTree.open(cacheFile, true, 0, CrawlEntry.rowdef));}}@@ -333,7 +334,7 @@ public final class plasmaCrawlStacker extends Thread {return this.dbtype;}- public plasmaCrawlEntry dequeueEntry() throws IOException {+ public CrawlEntry dequeueEntry() throws IOException {if (this.urlEntryHashCache.size() == 0) return null;String urlHash = null;kelondroRow.Entry entry = null;@@ -344,16 +345,16 @@ public final class plasmaCrawlStacker extends Thread {}if ((urlHash == null) || (entry == null)) return null;- return new plasmaCrawlEntry(entry);+ return new CrawlEntry(entry);}- public String stackCrawl(yacyURL url, yacyURL referrer, String initiatorHash, String name, Date loadDate, int currentdepth, plasmaCrawlProfile.entry profile) {+ public String stackCrawl(yacyURL url, yacyURL referrer, String initiatorHash, String name, Date loadDate, int currentdepth, CrawlProfile.entry profile) {// stacks a crawl item. The position can also be remote// returns null if successful, a reason string if not successful//this.log.logFinest("stackCrawl: nexturlString='" + nexturlString + "'");// add the url into the crawling queue- plasmaCrawlEntry entry = new plasmaCrawlEntry(+ CrawlEntry entry = new CrawlEntry(initiatorHash, // initiator, needed for p2p-feedbackurl, // url clear text string(referrer == null) ? "" : referrer.hash(), // last url in crawling queue@@ -367,7 +368,7 @@ public final class plasmaCrawlStacker extends Thread {return stackCrawl(entry);}- public String stackCrawl(plasmaCrawlEntry entry) {+ public String stackCrawl(CrawlEntry entry) {// stacks a crawl item. The position can also be remote// returns null if successful, a reason string if not successful//this.log.logFinest("stackCrawl: nexturlString='" + nexturlString + "'");@@ -378,7 +379,7 @@ public final class plasmaCrawlStacker extends Thread {// check if the protocol is supportedString urlProtocol = entry.url().getProtocol();if (!sb.crawlQueues.isSupportedProtocol(urlProtocol)) {- reason = plasmaCrawlEURL.DENIED_UNSUPPORTED_PROTOCOL;+ reason = ErrorURL.DENIED_UNSUPPORTED_PROTOCOL;this.log.logSevere("Unsupported protocol in URL '" + entry.url().toString() + "'. " +"Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");return reason;@@ -394,13 +395,13 @@ public final class plasmaCrawlStacker extends Thread {// check blacklistif (plasmaSwitchboard.urlBlacklist.isListed(indexReferenceBlacklist.BLACKLIST_CRAWLER, entry.url())) {- reason = plasmaCrawlEURL.DENIED_URL_IN_BLACKLIST;+ reason = ErrorURL.DENIED_URL_IN_BLACKLIST;if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' is in blacklist. " +"Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");return reason;}- plasmaCrawlProfile.entry profile = sb.profilesActiveCrawls.getEntry(entry.profileHandle());+ CrawlProfile.entry profile = sb.profilesActiveCrawls.getEntry(entry.profileHandle());if (profile == null) {String errorMsg = "LOST PROFILE HANDLE '" + entry.profileHandle() + "' for URL " + entry.url();log.logWarning(errorMsg);@@ -409,7 +410,7 @@ public final class plasmaCrawlStacker extends Thread {// filter denyif ((entry.depth() > 0) && (profile != null) && (!(entry.url().toString().matches(profile.generalFilter())))) {- reason = plasmaCrawlEURL.DENIED_URL_DOES_NOT_MATCH_FILTER;+ reason = ErrorURL.DENIED_URL_DOES_NOT_MATCH_FILTER;if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' does not match crawling filter '" + profile.generalFilter() + "'. " +"Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");@@ -418,7 +419,7 @@ public final class plasmaCrawlStacker extends Thread {// deny cgiif (entry.url().isCGI()) {- reason = plasmaCrawlEURL.DENIED_CGI_URL;+ reason = ErrorURL.DENIED_CGI_URL;if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' is CGI URL. " +"Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");@@ -427,7 +428,7 @@ public final class plasmaCrawlStacker extends Thread {// deny post propertiesif ((entry.url().isPOST()) && (profile != null) && (!(profile.crawlingQ()))) {- reason = plasmaCrawlEURL.DENIED_POST_URL;+ reason = ErrorURL.DENIED_POST_URL;if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' is post URL. " +"Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");@@ -443,7 +444,7 @@ public final class plasmaCrawlStacker extends Thread {// deny urls that do not match with the profile domain listif (!(profile.grantedDomAppearance(entry.url().getHost()))) {- reason = plasmaCrawlEURL.DENIED_NO_MATCH_WITH_DOMAIN_FILTER;+ reason = ErrorURL.DENIED_NO_MATCH_WITH_DOMAIN_FILTER;if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' is not listed in granted domains. " +"Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");return reason;@@ -451,7 +452,7 @@ public final class plasmaCrawlStacker extends Thread {// deny urls that exceed allowed number of occurrencesif (!(profile.grantedDomCount(entry.url().getHost()))) {- reason = plasmaCrawlEURL.DENIED_DOMAIN_COUNT_EXCEEDED;+ reason = ErrorURL.DENIED_DOMAIN_COUNT_EXCEEDED;if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' appeared too often, a maximum of " + profile.domMaxPages() + " is allowed. "+"Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");return reason;@@ -463,12 +464,12 @@ public final class plasmaCrawlStacker extends Thread {boolean recrawl = (oldEntry != null) && ((System.currentTimeMillis() - oldEntry.loaddate().getTime()) > profile.recrawlIfOlder());// do double-checkif ((dbocc != null) && (!recrawl)) {- reason = plasmaCrawlEURL.DOUBLE_REGISTERED + dbocc + ")";+ reason = ErrorURL.DOUBLE_REGISTERED + dbocc + ")";if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' is double registered in '" + dbocc + "'. " + "Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");return reason;}if ((oldEntry != null) && (!recrawl)) {- reason = plasmaCrawlEURL.DOUBLE_REGISTERED + "LURL)";+ reason = ErrorURL.DOUBLE_REGISTERED + "LURL)";if (this.log.isFine()) this.log.logFine("URL '" + entry.url().toString() + "' is double registered in 'LURL'. " + "Stack processing time: " + (System.currentTimeMillis()-startTime) + "ms");return reason;}@@ -497,8 +498,8 @@ public final class plasmaCrawlStacker extends Thread {// add the url into the crawling queuesb.crawlQueues.noticeURL.push(- ((global) ? plasmaCrawlNURL.STACK_TYPE_LIMIT :- ((local) ? plasmaCrawlNURL.STACK_TYPE_CORE : plasmaCrawlNURL.STACK_TYPE_REMOTE)) /*local/remote stack*/,+ ((global) ? NoticedURL.STACK_TYPE_LIMIT :+ ((local) ? NoticedURL.STACK_TYPE_CORE : NoticedURL.STACK_TYPE_REMOTE)) /*local/remote stack*/,entry);return null;}diff --git a/source/de/anomic/plasma/plasmaCrawlEURL.java b/source/de/anomic/crawler/ErrorURL.javasimilarity index 97%rename from source/de/anomic/plasma/plasmaCrawlEURL.javarename to source/de/anomic/crawler/ErrorURL.javaindex f9c7f4740..393041986 100644--- a/source/de/anomic/plasma/plasmaCrawlEURL.java+++ b/source/de/anomic/crawler/ErrorURL.java@@ -24,9 +24,9 @@// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-package de.anomic.plasma;+package de.anomic.crawler;-public class plasmaCrawlEURL {+public class ErrorURL {/* =======================================================================* Failure reason constantsdiff --git a/source/de/anomic/plasma/crawler/plasmaFTPLoader.java b/source/de/anomic/crawler/FTPLoader.javasimilarity index 92%rename from source/de/anomic/plasma/crawler/plasmaFTPLoader.javarename to source/de/anomic/crawler/FTPLoader.javaindex e63610105..3a7459014 100644--- a/source/de/anomic/plasma/crawler/plasmaFTPLoader.java+++ b/source/de/anomic/crawler/FTPLoader.java@@ -44,7 +44,7 @@// the intact and unchanged copyright notice.// Contributions and changes to the program code must be marked as such.-package de.anomic.plasma.crawler;+package de.anomic.crawler;import java.io.ByteArrayOutputStream;import java.io.File;@@ -54,8 +54,6 @@ import java.io.PrintWriter;import java.util.Date;import de.anomic.net.ftpc;-import de.anomic.plasma.plasmaCrawlEURL;-import de.anomic.plasma.plasmaCrawlEntry;import de.anomic.plasma.plasmaHTCache;import de.anomic.plasma.plasmaParser;import de.anomic.plasma.plasmaSwitchboard;@@ -63,19 +61,19 @@ import de.anomic.plasma.cache.ftp.ResourceInfo;import de.anomic.server.logging.serverLog;import de.anomic.yacy.yacyURL;-public class plasmaFTPLoader {+public class FTPLoader {private final plasmaSwitchboard sb;private final serverLog log;private final int maxFileSize;- public plasmaFTPLoader(final plasmaSwitchboard sb, final serverLog log) {+ public FTPLoader(final plasmaSwitchboard sb, final serverLog log) {this.sb = sb;this.log = log;maxFileSize = (int) sb.getConfigLong("crawler.ftp.maxFileSize", -1l);}- protected plasmaHTCache.Entry createCacheEntry(final plasmaCrawlEntry entry, final String mimeType,+ protected plasmaHTCache.Entry createCacheEntry(final CrawlEntry entry, final String mimeType,final Date fileDate) {return plasmaHTCache.newEntry(new Date(), entry.depth(), entry.url(), entry.name(), "OK", new ResourceInfo(entry.url(), sb.getURL(entry.referrerhash()), mimeType, fileDate), entry.initiator(),@@ -88,7 +86,7 @@ public class plasmaFTPLoader {* @param entry* @return*/- public plasmaHTCache.Entry load(final plasmaCrawlEntry entry) {+ public plasmaHTCache.Entry load(final CrawlEntry entry) {final yacyURL entryUrl = entry.url();final String fullPath = getPath(entryUrl);final File cacheFile = createCachefile(entryUrl);@@ -157,7 +155,7 @@ public class plasmaFTPLoader {// some error loggingfinal String detail = (berr.size() > 0) ? "\n Errorlog: " + berr.toString() : "";log.logWarning("Unable to download URL " + entry.url().toString() + detail);- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_SERVER_DOWNLOAD_ERROR);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_SERVER_DOWNLOAD_ERROR);// an error has occured. cleanupif (cacheFile.exists()) {@@ -253,7 +251,7 @@ public class plasmaFTPLoader {* @return* @throws Exception*/- private plasmaHTCache.Entry getFile(final ftpc ftpClient, final plasmaCrawlEntry entry, final File cacheFile)+ private plasmaHTCache.Entry getFile(final ftpc ftpClient, final CrawlEntry entry, final File cacheFile)throws Exception {// determine the mimetype of the resourcefinal yacyURL entryUrl = entry.url();@@ -282,13 +280,13 @@ public class plasmaFTPLoader {} else {log.logInfo("REJECTED TOO BIG FILE with size " + size + " Bytes for URL " + entry.url().toString());sb.crawlQueues.errorURL.newEntry(entry, this.sb.wordIndex.seedDB.mySeed().hash, new Date(), 1,- plasmaCrawlEURL.DENIED_FILESIZE_LIMIT_EXCEEDED);+ ErrorURL.DENIED_FILESIZE_LIMIT_EXCEEDED);throw new Exception("file size exceeds limit");}} else {// if the response has not the right file type then reject filelog.logInfo("REJECTED WRONG MIME/EXT TYPE " + mimeType + " for URL " + entry.url().toString());- sb.crawlQueues.errorURL.newEntry(entry, null, new Date(), 1, plasmaCrawlEURL.DENIED_WRONG_MIMETYPE_OR_EXT);+ sb.crawlQueues.errorURL.newEntry(entry, null, new Date(), 1, ErrorURL.DENIED_WRONG_MIMETYPE_OR_EXT);throw new Exception("response has not the right file type -> rejected");}return htCache;@@ -310,7 +308,7 @@ public class plasmaFTPLoader {* @param cacheFile* @return*/- private boolean generateDirlist(final ftpc ftpClient, final plasmaCrawlEntry entry, final String path,+ private boolean generateDirlist(final ftpc ftpClient, final CrawlEntry entry, final String path,final File cacheFile) {// getting the dirlistfinal yacyURL entryUrl = entry.url();diff --git a/source/de/anomic/plasma/crawler/plasmaHTTPLoader.java b/source/de/anomic/crawler/HTTPLoader.javasimilarity index 85%rename from source/de/anomic/plasma/crawler/plasmaHTTPLoader.javarename to source/de/anomic/crawler/HTTPLoader.javaindex 62fd718c2..687fd2dab 100644--- a/source/de/anomic/plasma/crawler/plasmaHTTPLoader.java+++ b/source/de/anomic/crawler/HTTPLoader.java@@ -42,7 +42,7 @@//the intact and unchanged copyright notice.//Contributions and changes to the program code must be marked as such.-package de.anomic.plasma.crawler;+package de.anomic.crawler;import java.io.File;import java.io.FileOutputStream;@@ -61,8 +61,6 @@ import de.anomic.http.httpHeader;import de.anomic.http.httpdBoundedSizeOutputStream;import de.anomic.http.httpdLimitExceededException;import de.anomic.index.indexReferenceBlacklist;-import de.anomic.plasma.plasmaCrawlEURL;-import de.anomic.plasma.plasmaCrawlEntry;import de.anomic.plasma.plasmaHTCache;import de.anomic.plasma.plasmaParser;import de.anomic.plasma.plasmaSwitchboard;@@ -72,7 +70,7 @@ import de.anomic.server.serverSystem;import de.anomic.server.logging.serverLog;import de.anomic.yacy.yacyURL;-public final class plasmaHTTPLoader {+public final class HTTPLoader {public static final int DEFAULT_CRAWLING_RETRY_COUNT = 5;private static final String crawlerUserAgent = "yacybot (" + HttpClient.getSystemOST() +") http://yacy.net/bot.html";@@ -93,7 +91,7 @@ public final class plasmaHTTPLoader {private plasmaSwitchboard sb;private serverLog log;- public plasmaHTTPLoader(plasmaSwitchboard sb, serverLog theLog) {+ public HTTPLoader(plasmaSwitchboard sb, serverLog theLog) {this.sb = sb;this.log = theLog;@@ -117,7 +115,7 @@ public final class plasmaHTTPLoader {* @param responseStatus Status-Code SPACE Reason-Phrase* @return*/- protected plasmaHTCache.Entry createCacheEntry(plasmaCrawlEntry entry, Date requestDate, httpHeader requestHeader, httpHeader responseHeader, final String responseStatus) {+ protected plasmaHTCache.Entry createCacheEntry(CrawlEntry entry, Date requestDate, httpHeader requestHeader, httpHeader responseHeader, final String responseStatus) {IResourceInfo resourceInfo = new ResourceInfo(entry.url(), requestHeader, responseHeader);return plasmaHTCache.newEntry(requestDate,@@ -131,15 +129,15 @@ public final class plasmaHTTPLoader {);}- public plasmaHTCache.Entry load(plasmaCrawlEntry entry, String parserMode) {+ public plasmaHTCache.Entry load(CrawlEntry entry, String parserMode) {return load(entry, parserMode, DEFAULT_CRAWLING_RETRY_COUNT);}- private plasmaHTCache.Entry load(plasmaCrawlEntry entry, String parserMode, int retryCount) {+ private plasmaHTCache.Entry load(CrawlEntry entry, String parserMode, int retryCount) {if (retryCount < 0) {this.log.logInfo("Redirection counter exceeded for URL " + entry.url().toString() + ". Processing aborted.");- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_REDIRECTION_COUNTER_EXCEEDED).store();+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_REDIRECTION_COUNTER_EXCEEDED).store();return null;}@@ -154,7 +152,7 @@ public final class plasmaHTTPLoader {String hostlow = host.toLowerCase();if (plasmaSwitchboard.urlBlacklist.isListed(indexReferenceBlacklist.BLACKLIST_CRAWLER, hostlow, path)) {this.log.logInfo("CRAWLER Rejecting URL '" + entry.url().toString() + "'. URL is in blacklist.");- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_URL_IN_BLACKLIST).store();+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_URL_IN_BLACKLIST).store();return null;}@@ -192,7 +190,7 @@ public final class plasmaHTTPLoader {// aborting download if content is to long ...if (htCache.cacheFile().getAbsolutePath().length() > serverSystem.maxPathLength) {this.log.logInfo("REJECTED URL " + entry.url().toString() + " because path too long '" + plasmaHTCache.cachePath.getAbsolutePath() + "'");- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_CACHEFILE_PATH_TOO_LONG);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_CACHEFILE_PATH_TOO_LONG);return (htCache = null);}@@ -202,7 +200,7 @@ public final class plasmaHTTPLoader {this.log.logInfo("REJECTED URL " + entry.url().toString() + " because of an invalid file path ('" +htCache.cacheFile().getCanonicalPath() + "' does not start with '" +plasmaHTCache.cachePath.getAbsolutePath() + "').");- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_INVALID_CACHEFILE_PATH);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_INVALID_CACHEFILE_PATH);return (htCache = null);}@@ -232,7 +230,7 @@ public final class plasmaHTTPLoader {fos = new httpdBoundedSizeOutputStream(fos,this.maxFileSize);} else if (contentLength > this.maxFileSize) {this.log.logInfo("REJECTED URL " + entry.url() + " because file size '" + contentLength + "' exceeds max filesize limit of " + this.maxFileSize + " bytes.");- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_FILESIZE_LIMIT_EXCEEDED);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_FILESIZE_LIMIT_EXCEEDED);return null;}}@@ -251,7 +249,7 @@ public final class plasmaHTTPLoader {} else {// if the response has not the right file type then reject filethis.log.logInfo("REJECTED WRONG MIME/EXT TYPE " + res.getResponseHeader().mime() + " for URL " + entry.url().toString());- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_WRONG_MIMETYPE_OR_EXT);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_WRONG_MIMETYPE_OR_EXT);return null;}} catch (SocketException e) {@@ -262,7 +260,7 @@ public final class plasmaHTTPLoader {// and most possible corruptedif (cacheFile.exists()) cacheFile.delete();this.log.logSevere("CRAWLER LOADER ERROR1: with URL=" + entry.url().toString() + ": " + e.toString());- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_CONNECTION_ERROR);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_CONNECTION_ERROR);htCache = null;}} else if (res.getStatusLine().startsWith("30")) {@@ -273,7 +271,7 @@ public final class plasmaHTTPLoader {if (redirectionUrlString.length() == 0) {this.log.logWarning("CRAWLER Redirection of URL=" + entry.url().toString() + " aborted. Location header is empty.");- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_REDIRECTION_HEADER_EMPTY);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_REDIRECTION_HEADER_EMPTY);return null;}@@ -287,7 +285,7 @@ public final class plasmaHTTPLoader {// if we are already doing a shutdown we don't need to retry crawlingif (Thread.currentThread().isInterrupted()) {this.log.logSevere("CRAWLER Retry of URL=" + entry.url().toString() + " aborted because of server shutdown.");- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_SERVER_SHUTDOWN);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_SERVER_SHUTDOWN);return null;}@@ -298,7 +296,7 @@ public final class plasmaHTTPLoader {String dbname = sb.urlExists(urlhash);if (dbname != null) {this.log.logWarning("CRAWLER Redirection of URL=" + entry.url().toString() + " ignored. The url appears already in db " + dbname);- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_REDIRECTION_TO_DOUBLE_CONTENT);+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_REDIRECTION_TO_DOUBLE_CONTENT);return null;}@@ -312,7 +310,7 @@ public final class plasmaHTTPLoader {this.log.logInfo("REJECTED WRONG STATUS TYPE '" + res.getStatusLine() + "' for URL " + entry.url().toString());// not processed any further- sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, plasmaCrawlEURL.DENIED_WRONG_HTTP_STATUSCODE + res.getStatusCode() + ")");+ sb.crawlQueues.errorURL.newEntry(entry, sb.wordIndex.seedDB.mySeed().hash, new Date(), 1, ErrorURL.DENIED_WRONG_HTTP_STATUSCODE + res.getStatusCode() + ")");}} finally {@@ -332,26 +330,26 @@ public final class plasmaHTTPLoader {(Thread.currentThread().isInterrupted())) {this.log.logInfo("CRAWLER Interruption detected because of server shutdown.");- failreason = plasmaCrawlEURL.DENIED_SERVER_SHUTDOWN;+ failreason = ErrorURL.DENIED_SERVER_SHUTDOWN;} else if (e instanceof httpdLimitExceededException) {this.log.logWarning("CRAWLER Max file size limit '" + this.maxFileSize + "' exceeded while downloading URL " + entry.url());- failreason = plasmaCrawlEURL.DENIED_FILESIZE_LIMIT_EXCEEDED;+ failreason = ErrorURL.DENIED_FILESIZE_LIMIT_EXCEEDED;} else if (e instanceof MalformedURLException) {this.log.logWarning("CRAWLER Malformed URL '" + entry.url().toString() + "' detected. ");- failreason = plasmaCrawlEURL.DENIED_MALFORMED_URL;+ failreason = ErrorURL.DENIED_MALFORMED_URL;} else if (e instanceof NoRouteToHostException) {this.log.logWarning("CRAWLER No route to host found while trying to crawl URL '" + entry.url().toString() + "'.");- failreason = plasmaCrawlEURL.DENIED_NO_ROUTE_TO_HOST;+ failreason = ErrorURL.DENIED_NO_ROUTE_TO_HOST;} else if ((e instanceof UnknownHostException) ||((errorMsg != null) && (errorMsg.indexOf("unknown host") >= 0))) {yacyURL u = (entry.referrerhash() == null) ? null : sb.getURL(entry.referrerhash());this.log.logWarning("CRAWLER Unknown host in URL '" + entry.url() + "'. " +"Referer URL: " + ((u == null) ? "Unknown" : u.toNormalform(true, true)));- failreason = plasmaCrawlEURL.DENIED_UNKNOWN_HOST;+ failreason = ErrorURL.DENIED_UNKNOWN_HOST;} else if (e instanceof java.net.BindException) {this.log.logWarning("CRAWLER BindException detected while trying to download content from '" + entry.url().toString() +"'. Retrying request.");- failreason = plasmaCrawlEURL.DENIED_CONNECTION_BIND_EXCEPTION;+ failreason = ErrorURL.DENIED_CONNECTION_BIND_EXCEPTION;} else if ((errorMsg != null) && ((errorMsg.indexOf("Corrupt GZIP trailer") >= 0) ||(errorMsg.indexOf("Not in GZIP format") >= 0) ||@@ -359,45 +357,45 @@ public final class plasmaHTTPLoader {)) {this.log.logWarning("CRAWLER Problems detected while receiving gzip encoded content from '" + entry.url().toString() +"'. Retrying request without using gzip content encoding.");- failreason = plasmaCrawlEURL.DENIED_CONTENT_DECODING_ERROR;+ failreason = ErrorURL.DENIED_CONTENT_DECODING_ERROR;this.acceptEncoding = null;} else if ((errorMsg != null) && (errorMsg.indexOf("The host did not accept the connection within timeout of") >= 0)) {this.log.logWarning("CRAWLER Timeout while trying to connect to '" + entry.url().toString() +"'. Retrying request.");- failreason = plasmaCrawlEURL.DENIED_CONNECTION_TIMEOUT;+ failreason = ErrorURL.DENIED_CONNECTION_TIMEOUT;} else if ((errorMsg != null) && (errorMsg.indexOf("Read timed out") >= 0)) {this.log.logWarning("CRAWLER Read timeout while receiving content from '" + entry.url().toString() +"'. Retrying request.");- failreason = plasmaCrawlEURL.DENIED_CONNECTION_TIMEOUT;+ failreason = ErrorURL.DENIED_CONNECTION_TIMEOUT;} else if ((errorMsg != null) && (errorMsg.indexOf("connect timed out") >= 0)) {this.log.logWarning("CRAWLER Timeout while trying to connect to '" + entry.url().toString() +"'. Retrying request.");- failreason = plasmaCrawlEURL.DENIED_CONNECTION_TIMEOUT;+ failreason = ErrorURL.DENIED_CONNECTION_TIMEOUT;} else if ((errorMsg != null) && (errorMsg.indexOf("Connection timed out") >= 0)) {this.log.logWarning("CRAWLER Connection timeout while receiving content from '" + entry.url().toString() +"'. Retrying request.");- failreason = plasmaCrawlEURL.DENIED_CONNECTION_TIMEOUT;+ failreason = ErrorURL.DENIED_CONNECTION_TIMEOUT;} else if ((errorMsg != null) && (errorMsg.indexOf("Connection refused") >= 0)) {this.log.logWarning("CRAWLER Connection refused while trying to connect to '" + entry.url().toString() + "'.");- failreason = plasmaCrawlEURL.DENIED_CONNECTION_REFUSED;+ failreason = ErrorURL.DENIED_CONNECTION_REFUSED;} else if ((errorMsg != null) && (errorMsg.indexOf("Circular redirect to '")>= 0)) {this.log.logWarning("CRAWLER Redirect Error with URL '" + entry.url().toString() + "': "+ e.toString());- failreason = plasmaCrawlEURL.DENIED_REDIRECTION_COUNTER_EXCEEDED;+ failreason = ErrorURL.DENIED_REDIRECTION_COUNTER_EXCEEDED;} else if ((errorMsg != null) && (errorMsg.indexOf("There is not enough space on the disk") >= 0)) {this.log.logSevere("CRAWLER Not enough space on the disk detected while crawling '" + entry.url().toString() + "'. " +"Pausing crawlers. ");sb.pauseCrawlJob(plasmaSwitchboard.CRAWLJOB_LOCAL_CRAWL);sb.pauseCrawlJob(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL);- failreason = plasmaCrawlEURL.DENIED_OUT_OF_DISK_SPACE;+ failreason = ErrorURL.DENIED_OUT_OF_DISK_SPACE;} else if ((errorMsg != null) && (errorMsg.indexOf("Network is unreachable") >=0)) {this.log.logSevere("CRAWLER Network is unreachable while trying to crawl URL '" + entry.url().toString() + "'. ");- failreason = plasmaCrawlEURL.DENIED_NETWORK_IS_UNREACHABLE;+ failreason = ErrorURL.DENIED_NETWORK_IS_UNREACHABLE;} else if ((errorMsg != null) && (errorMsg.indexOf("No trusted certificate found")>= 0)) {this.log.logSevere("CRAWLER No trusted certificate found for URL '" + entry.url().toString() + "'. ");- failreason = plasmaCrawlEURL.DENIED_SSL_UNTRUSTED_CERT;+ failreason = ErrorURL.DENIED_SSL_UNTRUSTED_CERT;} else {this.log.logSevere("CRAWLER Unexpected Error with URL '" + entry.url().toString() + "': " + e.toString(), e);- failreason = plasmaCrawlEURL.DENIED_CONNECTION_ERROR;+ failreason = ErrorURL.DENIED_CONNECTION_ERROR;}if (failreason != null) {diff --git a/source/de/anomic/plasma/plasmaCrawlLoaderMessage.java b/source/de/anomic/crawler/LoaderMessage.javasimilarity index 92%rename from source/de/anomic/plasma/plasmaCrawlLoaderMessage.javarename to source/de/anomic/crawler/LoaderMessage.javaindex 382f0ff06..55b198cde 100644--- a/source/de/anomic/plasma/plasmaCrawlLoaderMessage.java+++ b/source/de/anomic/crawler/LoaderMessage.java@@ -40,12 +40,13 @@//Contributions and changes to the program code must be marked as such.-package de.anomic.plasma;+package de.anomic.crawler;+import de.anomic.plasma.plasmaHTCache;import de.anomic.server.serverSemaphore;import de.anomic.yacy.yacyURL;-public final class plasmaCrawlLoaderMessage {+public final class LoaderMessage {public final int crawlingPriority;public final yacyURL url;@@ -53,7 +54,7 @@ public final class plasmaCrawlLoaderMessage {public final String referer;public final String initiator;public final int depth;- public final plasmaCrawlProfile.entry profile;+ public final CrawlProfile.entry profile;public final boolean acceptAllContent;public final int timeout;public final boolean keepInMemory;@@ -63,13 +64,13 @@ public final class plasmaCrawlLoaderMessage {private String errorMessage;// loadParallel(URL url, String referer, String initiator, int depth, plasmaCrawlProfile.entry profile) {- public plasmaCrawlLoaderMessage(+ public LoaderMessage(yacyURL url,String name, // the name of the url, from anchor tag <a>name</a>String referer,String initiator,int depth,- plasmaCrawlProfile.entry profile,+ CrawlProfile.entry profile,int crawlingPriority,boolean acceptAllContent,int timeout,diff --git a/source/de/anomic/plasma/plasmaCrawlNURL.java b/source/de/anomic/crawler/NoticedURL.javaold mode 100644new mode 100755similarity index 83%rename from source/de/anomic/plasma/plasmaCrawlNURL.javarename to source/de/anomic/crawler/NoticedURL.javaindex 4ff6df522..8300b125f--- a/source/de/anomic/plasma/plasmaCrawlNURL.java+++ b/source/de/anomic/crawler/NoticedURL.java@@ -1,266 +1,268 @@-// plasmaNURL.java-// ------------------------// part of YaCy-// (C) by Michael Peter Christen; [email protected]-// first published on http://www.anomic.de-// Frankfurt, Germany, 2004-// last major change: 09.08.2004-//-// This program is free software; you can redistribute it and/or modify-// it under the terms of the GNU General Public License as published by-// the Free Software Foundation; either version 2 of the License, or-// (at your option) any later version.-//-// This program is distributed in the hope that it will be useful,-// but WITHOUT ANY WARRANTY; without even the implied warranty of-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-// GNU General Public License for more details.-//-// You should have received a copy of the GNU General Public License-// along with this program; if not, write to the Free Software-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-//-// Using this software in any meaning (reading, learning, copying, compiling,-// running) means that you agree that the Author(s) is (are) not responsible-// for cost, loss of data or any harm that may be caused directly or indirectly-// by usage of this softare or this documentation. The usage of this software-// is on your own risk. The installation and usage (starting/running) of this-// software may allow other people or application to access your computer and-// any attached devices and is highly dependent on the configuration of the-// software which must be done by the user of the software; the author(s) is-// (are) also not responsible for proper configuration and usage of the-// software, even if provoked by documentation provided together with-// the software.-//-// Any changes to this file according to the GPL as documented in the file-// gpl.txt aside this file in the shipment you received can be done to the-// lines that follows this copyright notice here, but changes must not be-// done inside the copyright notive above. A re-distribution must contain-// the intact and unchanged copyright notice.-// Contributions and changes to the program code must be marked as such.--// NURL - noticed (known but not loaded) URL's--package de.anomic.plasma;--import java.io.File;-import java.io.IOException;-import java.util.ArrayList;-import java.util.HashSet;-import java.util.Iterator;--import de.anomic.server.logging.serverLog;--public class plasmaCrawlNURL {-- public static final int STACK_TYPE_NULL = 0; // do not stack- public static final int STACK_TYPE_CORE = 1; // put on local stack- public static final int STACK_TYPE_LIMIT = 2; // put on global stack- public static final int STACK_TYPE_OVERHANG = 3; // put on overhang stack; links that are known but not crawled- public static final int STACK_TYPE_REMOTE = 4; // put on remote-triggered stack- public static final int STACK_TYPE_IMAGE = 11; // put on image stack- public static final int STACK_TYPE_MOVIE = 12; // put on movie stack- public static final int STACK_TYPE_MUSIC = 13; // put on music stack-- private static final long minimumLocalDelta = 0; // the minimum time difference between access of the same local domain- private static final long minimumGlobalDelta = 333; // the minimum time difference between access of the same global domain- private static final long maximumDomAge = 60000; // the maximum age of a domain until it is used for another crawl attempt-- private plasmaCrawlBalancer coreStack; // links found by crawling to depth-1- private plasmaCrawlBalancer limitStack; // links found by crawling at target depth- private plasmaCrawlBalancer remoteStack; // links from remote crawl orders- //private final plasmaCrawlBalancer overhangStack; // links found by crawling at depth+1- //private kelondroStack imageStack; // links pointing to image resources- //private kelondroStack movieStack; // links pointing to movie resources- //private kelondroStack musicStack; // links pointing to music resources-- public plasmaCrawlNURL(File cachePath) {- super();- coreStack = new plasmaCrawlBalancer(cachePath, "urlNoticeCoreStack", false);- limitStack = new plasmaCrawlBalancer(cachePath, "urlNoticeLimitStack", false);- //overhangStack = new plasmaCrawlBalancer(overhangStackFile);- remoteStack = new plasmaCrawlBalancer(cachePath, "urlNoticeRemoteStack", false);- }-- public void close() {- if (coreStack != null) {- coreStack.close();- coreStack = null;- }- if (limitStack != null) {- limitStack.close();- limitStack = null;- }- //overhangStack.close();- if (remoteStack != null) {- remoteStack.close();- remoteStack = null;- }- }-- public void finalize() {- if ((coreStack != null) || (limitStack != null) || (remoteStack != null)) {- serverLog.logWarning("plasmaCrawlNURL", "NURL stack closed by finalizer");- close();- }- }-- public boolean notEmpty() {- return coreStack.notEmpty() || limitStack.notEmpty() || remoteStack.notEmpty();- }-- public int size() {- // this does not count the overhang stack size- return ((coreStack == null) ? 0 : coreStack.size()) + ((limitStack == null) ? 0 : limitStack.size()) + ((remoteStack == null) ? 0 : remoteStack.size());- }-- public int stackSize(int stackType) {- switch (stackType) {- case STACK_TYPE_CORE: return (coreStack == null) ? 0 : coreStack.size();- case STACK_TYPE_LIMIT: return (limitStack == null) ? 0 : limitStack.size();- case STACK_TYPE_OVERHANG: return 0;- case STACK_TYPE_REMOTE: return (remoteStack == null) ? 0 : remoteStack.size();- default: return -1;- }- }-- public boolean existsInStack(String urlhash) {- return- coreStack.has(urlhash) ||- limitStack.has(urlhash) ||- //overhangStack.has(urlhash) ||- remoteStack.has(urlhash);- }-- public void push(int stackType, plasmaCrawlEntry entry) {- try {- switch (stackType) {- case STACK_TYPE_CORE:- coreStack.push(entry);- break;- case STACK_TYPE_LIMIT:- limitStack.push(entry);- break;- case STACK_TYPE_REMOTE:- remoteStack.push(entry);- break;- default: break;- }- } catch (IOException er) {}- }-- public plasmaCrawlEntry get(String urlhash) {- plasmaCrawlEntry entry = null;- try {if ((entry = coreStack.get(urlhash)) != null) return entry;} catch (IOException e) {}- try {if ((entry = limitStack.get(urlhash)) != null) return entry;} catch (IOException e) {}- try {if ((entry = remoteStack.get(urlhash)) != null) return entry;} catch (IOException e) {}- return null;- }-- /**- * remove a plasmaCrawlEntry by a given hash. Usage of this method is not encouraged,- * because the underlying data structure (crawl stacks) cannot handle removals very good.- * @param urlhash- * @return true, if the entry was removed; false if not- */- public boolean removeByURLHash(String urlhash) {- HashSet<String> urlHashes = new HashSet<String>();- urlHashes.add(urlhash);- try {return coreStack.remove(urlHashes) > 0;} catch (IOException e) {}- try {return limitStack.remove(urlHashes) > 0;} catch (IOException e) {}- try {return remoteStack.remove(urlHashes) > 0;} catch (IOException e) {}- return false;- }-- public int removeByProfileHandle(String handle) {- int removed = 0;- try {removed += coreStack.removeAllByProfileHandle(handle);} catch (IOException e) {}- try {removed += limitStack.removeAllByProfileHandle(handle);} catch (IOException e) {}- try {removed += remoteStack.removeAllByProfileHandle(handle);} catch (IOException e) {}- return removed;- }-- public plasmaCrawlEntry[] top(int stackType, int count) {- switch (stackType) {- case STACK_TYPE_CORE: return top(coreStack, count);- case STACK_TYPE_LIMIT: return top(limitStack, count);- case STACK_TYPE_REMOTE: return top(remoteStack, count);- default: return null;- }- }-- public plasmaCrawlEntry pop(int stackType, boolean delay) throws IOException {- switch (stackType) {- case STACK_TYPE_CORE: return pop(coreStack, delay);- case STACK_TYPE_LIMIT: return pop(limitStack, delay);- case STACK_TYPE_REMOTE: return pop(remoteStack, delay);- default: return null;- }- }-- public void shift(int fromStack, int toStack) {- try {- plasmaCrawlEntry entry = pop(fromStack, false);- if (entry != null) push(toStack, entry);- } catch (IOException e) {- return;- }- }-- public void clear(int stackType) {- switch (stackType) {- case STACK_TYPE_CORE: coreStack.clear(); break;- case STACK_TYPE_LIMIT: limitStack.clear(); break;- case STACK_TYPE_REMOTE: remoteStack.clear(); break;- default: return;- }- }-- private plasmaCrawlEntry pop(plasmaCrawlBalancer balancer, boolean delay) throws IOException {- // this is a filo - pop- int s;- plasmaCrawlEntry entry;- synchronized (balancer) {- while ((s = balancer.size()) > 0) {- entry = balancer.pop((delay) ? minimumLocalDelta : 0, (delay) ? minimumGlobalDelta : 0, maximumDomAge);- if (entry == null) {- if (s > balancer.size()) continue;- int aftersize = balancer.size();- balancer.clear(); // the balancer is broken and cannot shrink- throw new IOException("entry is null, balancer cannot shrink (bevore pop = " + s + ", after pop = " + aftersize + "); reset of balancer");- }- return entry;- }- }- throw new IOException("balancer stack is empty");- }-- private plasmaCrawlEntry[] top(plasmaCrawlBalancer balancer, int count) {- // this is a filo - top- if (count > balancer.size()) count = balancer.size();- ArrayList<plasmaCrawlEntry> list = new ArrayList<plasmaCrawlEntry>(count);- for (int i = 0; i < count; i++) {- try {- plasmaCrawlEntry entry = balancer.top(i);- if (entry == null) break;- list.add(entry);- } catch (IOException e) {- break;- }- }- return (plasmaCrawlEntry[]) list.toArray(new plasmaCrawlEntry[list.size()]);- }-- public Iterator<plasmaCrawlEntry> iterator(int stackType) {- // returns an iterator of plasmaCrawlBalancerEntry Objects- try {switch (stackType) {- case STACK_TYPE_CORE: return coreStack.iterator();- case STACK_TYPE_LIMIT: return limitStack.iterator();- case STACK_TYPE_REMOTE: return remoteStack.iterator();- default: return null;- }} catch (IOException e) {- return new HashSet<plasmaCrawlEntry>().iterator();- }- }--}+// plasmaNURL.java+// -----------------------+// part of YaCy+// (C) by Michael Peter Christen; [email protected]+// first published on http://www.anomic.de+// Frankfurt, Germany, 2004+// last major change: 09.08.2004+//+// This program is free software; you can redistribute it and/or modify+// it under the terms of the GNU General Public License as published by+// the Free Software Foundation; either version 2 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+//+// Using this software in any meaning (reading, learning, copying, compiling,+// running) means that you agree that the Author(s) is (are) not responsible+// for cost, loss of data or any harm that may be caused directly or indirectly+// by usage of this softare or this documentation. The usage of this software+// is on your own risk. The installation and usage (starting/running) of this+// software may allow other people or application to access your computer and+// any attached devices and is highly dependent on the configuration of the+// software which must be done by the user of the software; the author(s) is+// (are) also not responsible for proper configuration and usage of the+// software, even if provoked by documentation provided together with+// the software.+//+// Any changes to this file according to the GPL as documented in the file+// gpl.txt aside this file in the shipment you received can be done to the+// lines that follows this copyright notice here, but changes must not be+// done inside the copyright notive above. A re-distribution must contain+// the intact and unchanged copyright notice.+// Contributions and changes to the program code must be marked as such.++// NURL - noticed (known but not loaded) URL's++package de.anomic.crawler;++import java.io.File;+import java.io.IOException;+import java.util.ArrayList;+import java.util.HashSet;+import java.util.Iterator;++import de.anomic.crawler.Balancer;+import de.anomic.crawler.CrawlEntry;+import de.anomic.server.logging.serverLog;++public class NoticedURL {++ public static final int STACK_TYPE_NULL = 0; // do not stack+ public static final int STACK_TYPE_CORE = 1; // put on local stack+ public static final int STACK_TYPE_LIMIT = 2; // put on global stack+ public static final int STACK_TYPE_OVERHANG = 3; // put on overhang stack; links that are known but not crawled+ public static final int STACK_TYPE_REMOTE = 4; // put on remote-triggered stack+ public static final int STACK_TYPE_IMAGE = 11; // put on image stack+ public static final int STACK_TYPE_MOVIE = 12; // put on movie stack+ public static final int STACK_TYPE_MUSIC = 13; // put on music stack++ private static final long minimumLocalDelta = 0; // the minimum time difference between access of the same local domain+ private static final long minimumGlobalDelta = 333; // the minimum time difference between access of the same global domain+ private static final long maximumDomAge = 60000; // the maximum age of a domain until it is used for another crawl attempt++ private Balancer coreStack; // links found by crawling to depth-1+ private Balancer limitStack; // links found by crawling at target depth+ private Balancer remoteStack; // links from remote crawl orders+ //private final plasmaCrawlBalancer overhangStack; // links found by crawling at depth+1+ //private kelondroStack imageStack; // links pointing to image resources+ //private kelondroStack movieStack; // links pointing to movie resources+ //private kelondroStack musicStack; // links pointing to music resources++ public NoticedURL(File cachePath) {+ super();+ coreStack = new Balancer(cachePath, "urlNoticeCoreStack", false);+ limitStack = new Balancer(cachePath, "urlNoticeLimitStack", false);+ //overhangStack = new plasmaCrawlBalancer(overhangStackFile);+ remoteStack = new Balancer(cachePath, "urlNoticeRemoteStack", false);+ }++ public void close() {+ if (coreStack != null) {+ coreStack.close();+ coreStack = null;+ }+ if (limitStack != null) {+ limitStack.close();+ limitStack = null;+ }+ //overhangStack.close();+ if (remoteStack != null) {+ remoteStack.close();+ remoteStack = null;+ }+ }++ public void finalize() {+ if ((coreStack != null) || (limitStack != null) || (remoteStack != null)) {+ serverLog.logWarning("plasmaCrawlNURL", "NURL stack closed by finalizer");+ close();+ }+ }++ public boolean notEmpty() {+ return coreStack.notEmpty() || limitStack.notEmpty() || remoteStack.notEmpty();+ }++ public int size() {+ // this does not count the overhang stack size+ return ((coreStack == null) ? 0 : coreStack.size()) + ((limitStack == null) ? 0 : limitStack.size()) + ((remoteStack == null) ? 0 : remoteStack.size());+ }++ public int stackSize(int stackType) {+ switch (stackType) {+ case STACK_TYPE_CORE: return (coreStack == null) ? 0 : coreStack.size();+ case STACK_TYPE_LIMIT: return (limitStack == null) ? 0 : limitStack.size();+ case STACK_TYPE_OVERHANG: return 0;+ case STACK_TYPE_REMOTE: return (remoteStack == null) ? 0 : remoteStack.size();+ default: return -1;+ }+ }++ public boolean existsInStack(String urlhash) {+ return+ coreStack.has(urlhash) ||+ limitStack.has(urlhash) ||+ //overhangStack.has(urlhash) ||+ remoteStack.has(urlhash);+ }++ public void push(int stackType, CrawlEntry entry) {+ try {+ switch (stackType) {+ case STACK_TYPE_CORE:+ coreStack.push(entry);+ break;+ case STACK_TYPE_LIMIT:+ limitStack.push(entry);+ break;+ case STACK_TYPE_REMOTE:+ remoteStack.push(entry);+ break;+ default: break;+ }+ } catch (IOException er) {}+ }++ public CrawlEntry get(String urlhash) {+ CrawlEntry entry = null;+ try {if ((entry = coreStack.get(urlhash)) != null) return entry;} catch (IOException e) {}+ try {if ((entry = limitStack.get(urlhash)) != null) return entry;} catch (IOException e) {}+ try {if ((entry = remoteStack.get(urlhash)) != null) return entry;} catch (IOException e) {}+ return null;+ }++ /**+ * remove a CrawlEntry by a given hash. Usage of this method is not encouraged,+ * because the underlying data structure (crawl stacks) cannot handle removals very good.+ * @param urlhash+ * @return true, if the entry was removed; false if not+ */+ public boolean removeByURLHash(String urlhash) {+ HashSet<String> urlHashes = new HashSet<String>();+ urlHashes.add(urlhash);+ try {return coreStack.remove(urlHashes) > 0;} catch (IOException e) {}+ try {return limitStack.remove(urlHashes) > 0;} catch (IOException e) {}+ try {return remoteStack.remove(urlHashes) > 0;} catch (IOException e) {}+ return false;+ }++ public int removeByProfileHandle(String handle) {+ int removed = 0;+ try {removed += coreStack.removeAllByProfileHandle(handle);} catch (IOException e) {}+ try {removed += limitStack.removeAllByProfileHandle(handle);} catch (IOException e) {}+ try {removed += remoteStack.removeAllByProfileHandle(handle);} catch (IOException e) {}+ return removed;+ }++ public CrawlEntry[] top(int stackType, int count) {+ switch (stackType) {+ case STACK_TYPE_CORE: return top(coreStack, count);+ case STACK_TYPE_LIMIT: return top(limitStack, count);+ case STACK_TYPE_REMOTE: return top(remoteStack, count);+ default: return null;+ }+ }++ public CrawlEntry pop(int stackType, boolean delay) throws IOException {+ switch (stackType) {+ case STACK_TYPE_CORE: return pop(coreStack, delay);+ case STACK_TYPE_LIMIT: return pop(limitStack, delay);+ case STACK_TYPE_REMOTE: return pop(remoteStack, delay);+ default: return null;+ }+ }++ public void shift(int fromStack, int toStack) {+ try {+ CrawlEntry entry = pop(fromStack, false);+ if (entry != null) push(toStack, entry);+ } catch (IOException e) {+ return;+ }+ }++ public void clear(int stackType) {+ switch (stackType) {+ case STACK_TYPE_CORE: coreStack.clear(); break;+ case STACK_TYPE_LIMIT: limitStack.clear(); break;+ case STACK_TYPE_REMOTE: remoteStack.clear(); break;+ default: return;+ }+ }++ private CrawlEntry pop(Balancer balancer, boolean delay) throws IOException {+ // this is a filo - pop+ int s;+ CrawlEntry entry;+ synchronized (balancer) {+ while ((s = balancer.size()) > 0) {+ entry = balancer.pop((delay) ? minimumLocalDelta : 0, (delay) ? minimumGlobalDelta : 0, maximumDomAge);+ if (entry == null) {+ if (s > balancer.size()) continue;+ int aftersize = balancer.size();+ balancer.clear(); // the balancer is broken and cannot shrink+ throw new IOException("entry is null, balancer cannot shrink (bevore pop = " + s + ", after pop = " + aftersize + "); reset of balancer");+ }+ return entry;+ }+ }+ throw new IOException("balancer stack is empty");+ }++ private CrawlEntry[] top(Balancer balancer, int count) {+ // this is a filo - top+ if (count > balancer.size()) count = balancer.size();+ ArrayList<CrawlEntry> list = new ArrayList<CrawlEntry>(count);+ for (int i = 0; i < count; i++) {+ try {+ CrawlEntry entry = balancer.top(i);+ if (entry == null) break;+ list.add(entry);+ } catch (IOException e) {+ break;+ }+ }+ return (CrawlEntry[]) list.toArray(new CrawlEntry[list.size()]);+ }++ public Iterator<CrawlEntry> iterator(int stackType) {+ // returns an iterator of plasmaCrawlBalancerEntry Objects+ try {switch (stackType) {+ case STACK_TYPE_CORE: return coreStack.iterator();+ case STACK_TYPE_LIMIT: return limitStack.iterator();+ case STACK_TYPE_REMOTE: return remoteStack.iterator();+ default: return null;+ }} catch (IOException e) {+ return new HashSet<CrawlEntry>().iterator();+ }+ }++}diff --git a/source/de/anomic/plasma/crawler/plasmaProtocolLoader.java b/source/de/anomic/crawler/ProtocolLoader.javasimilarity index 83%rename from source/de/anomic/plasma/crawler/plasmaProtocolLoader.javarename to source/de/anomic/crawler/ProtocolLoader.javaindex f29e3a053..66a5963ea 100644--- a/source/de/anomic/plasma/crawler/plasmaProtocolLoader.java+++ b/source/de/anomic/crawler/ProtocolLoader.java@@ -24,32 +24,31 @@// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-package de.anomic.plasma.crawler;+package de.anomic.crawler;import java.util.Arrays;import java.util.HashSet;-import de.anomic.plasma.plasmaCrawlEntry;import de.anomic.plasma.plasmaHTCache;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.logging.serverLog;-public final class plasmaProtocolLoader {+public final class ProtocolLoader {private plasmaSwitchboard sb;private serverLog log;private HashSet<String> supportedProtocols;- private plasmaHTTPLoader httpLoader;- private plasmaFTPLoader ftpLoader;+ private HTTPLoader httpLoader;+ private FTPLoader ftpLoader;- public plasmaProtocolLoader(plasmaSwitchboard sb, serverLog log) {+ public ProtocolLoader(plasmaSwitchboard sb, serverLog log) {this.sb = sb;this.log = log;this.supportedProtocols = new HashSet<String>(Arrays.asList(new String[]{"http","https","ftp"}));// initiate loader objects- httpLoader = new plasmaHTTPLoader(sb, log);- ftpLoader = new plasmaFTPLoader(sb, log);+ httpLoader = new HTTPLoader(sb, log);+ ftpLoader = new FTPLoader(sb, log);}public boolean isSupportedProtocol(String protocol) {@@ -62,7 +61,7 @@ public final class plasmaProtocolLoader {return (HashSet<String>) this.supportedProtocols.clone();}- public plasmaHTCache.Entry load(plasmaCrawlEntry entry, String parserMode) {+ public plasmaHTCache.Entry load(CrawlEntry entry, String parserMode) {// getting the protocol of the next URLString protocol = entry.url().getProtocol();@@ -73,7 +72,7 @@ public final class plasmaProtocolLoader {return null;}- public String process(plasmaCrawlEntry entry, String parserMode) {+ public String process(CrawlEntry entry, String parserMode) {// load a resource, store it to htcache and push queue entry to switchboard queue// returns null if everything went fine, a fail reason string if a problem occurredplasmaHTCache.Entry h;diff --git a/source/de/anomic/plasma/plasmaCrawlResultImages.java b/source/de/anomic/crawler/ResultImages.javasimilarity index 98%rename from source/de/anomic/plasma/plasmaCrawlResultImages.javarename to source/de/anomic/crawler/ResultImages.javaindex 6a54e8ed7..87aa267cc 100755--- a/source/de/anomic/plasma/plasmaCrawlResultImages.java+++ b/source/de/anomic/crawler/ResultImages.java@@ -24,16 +24,17 @@// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-package de.anomic.plasma;+package de.anomic.crawler;import java.util.HashMap;import java.util.concurrent.ConcurrentHashMap;import java.util.concurrent.ConcurrentLinkedQueue;import de.anomic.htmlFilter.htmlFilterImageEntry;+import de.anomic.plasma.plasmaParserDocument;import de.anomic.yacy.yacyURL;-public class plasmaCrawlResultImages {+public class ResultImages {// we maintain two different queues for private and public crawls and divide both into two halves:// such images that appear to be good quality for a image monitor bacause their size is known, and other imagesdiff --git a/source/de/anomic/plasma/plasmaCrawlResultURLs.java b/source/de/anomic/crawler/ResultURLs.javasimilarity index 98%rename from source/de/anomic/plasma/plasmaCrawlResultURLs.javarename to source/de/anomic/crawler/ResultURLs.javaindex 89531f2fb..fb26a2cea 100644--- a/source/de/anomic/plasma/plasmaCrawlResultURLs.java+++ b/source/de/anomic/crawler/ResultURLs.java@@ -50,14 +50,14 @@algorithm. The MD5 is not encoded as a hex value, but a b64 value.*/-package de.anomic.plasma;+package de.anomic.crawler;import java.util.LinkedList;import de.anomic.index.indexURLReference;import de.anomic.yacy.yacySeedDB;-public final class plasmaCrawlResultURLs {+public final class ResultURLs {// result stacks;// these have all entries of form@@ -69,7 +69,7 @@ public final class plasmaCrawlResultURLs {private final LinkedList<String> lcrawlResultStack; // 5 - local index: result of local crawlingprivate final LinkedList<String> gcrawlResultStack; // 6 - local index: triggered external- public plasmaCrawlResultURLs() {+ public ResultURLs() {// init result stacksexternResultStack = new LinkedList<String>();searchResultStack = new LinkedList<String>();diff --git a/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java b/source/de/anomic/crawler/RobotsTxt.javasimilarity index 96%rename from source/de/anomic/plasma/plasmaCrawlRobotsTxt.javarename to source/de/anomic/crawler/RobotsTxt.javaindex 60e761ae0..d4dd6ee0c 100644--- a/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java+++ b/source/de/anomic/crawler/RobotsTxt.java@@ -43,7 +43,7 @@//Contributions and changes to the program code must be marked as such.-package de.anomic.plasma;+package de.anomic.crawler;import java.io.File;import java.io.IOException;@@ -59,14 +59,14 @@ import de.anomic.kelondro.kelondroException;import de.anomic.kelondro.kelondroMapObjects;import de.anomic.kelondro.kelondroNaturalOrder;-public class plasmaCrawlRobotsTxt {+public class RobotsTxt {public static final String ROBOTS_DB_PATH_SEPARATOR = ";";kelondroMapObjects robotsTable;private final File robotsTableFile;- public plasmaCrawlRobotsTxt(File robotsTableFile) {+ public RobotsTxt(File robotsTableFile) {this.robotsTableFile = robotsTableFile;robotsTableFile.getParentFile().mkdirs();robotsTable = new kelondroMapObjects(new kelondroDyn(robotsTableFile, true, true, 256, 512, '_', kelondroNaturalOrder.naturalOrder, false, false, true), 100);diff --git a/source/de/anomic/plasma/plasmaCrawlZURL.java b/source/de/anomic/crawler/ZURL.javaold mode 100644new mode 100755similarity index 93%rename from source/de/anomic/plasma/plasmaCrawlZURL.javarename to source/de/anomic/crawler/ZURL.javaindex 55af87099..4a1e270bd--- a/source/de/anomic/plasma/plasmaCrawlZURL.java+++ b/source/de/anomic/crawler/ZURL.java@@ -24,7 +24,7 @@// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-package de.anomic.plasma;+package de.anomic.crawler;import java.io.File;import java.io.IOException;@@ -32,6 +32,7 @@ import java.util.Date;import java.util.Iterator;import java.util.LinkedList;+import de.anomic.crawler.CrawlEntry;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroEcoTable;import de.anomic.kelondro.kelondroFlexWidthArray;@@ -41,7 +42,7 @@ import de.anomic.kelondro.kelondroRowSet;import de.anomic.yacy.yacySeedDB;import de.anomic.yacy.yacyURL;-public class plasmaCrawlZURL {+public class ZURL {private static final int EcoFSBufferSize = 200;@@ -51,7 +52,7 @@ public class plasmaCrawlZURL {"Cardinal workdate-8 {b256}, " + // the time when the url was last time tried to load"Cardinal workcount-4 {b256}, " + // number of load retries"String anycause-80, " + // string describing load failure- "byte[] entry-" + plasmaCrawlEntry.rowdef.objectsize, // extra space+ "byte[] entry-" + CrawlEntry.rowdef.objectsize, // extra spacekelondroBase64Order.enhancedCoder,0);@@ -59,8 +60,8 @@ public class plasmaCrawlZURL {kelondroIndex urlIndex = null;private LinkedList<String> stack = new LinkedList<String>(); // strings: url- public plasmaCrawlZURL(File cachePath, String tablename, boolean startWithEmptyFile) {- // creates a new ZURL in a file+ public ZURL(File cachePath, String tablename, boolean startWithEmptyFile) {+ // creates a new ZURL in a filecachePath.mkdirs();File f = new File(cachePath, tablename);if (startWithEmptyFile) {@@ -72,8 +73,8 @@ public class plasmaCrawlZURL {//urlIndex = new kelondroFlexTable(cachePath, tablename, -1, rowdef, 0, true);}- public plasmaCrawlZURL() {- // creates a new ZUR in RAM+ public ZURL() {+ // creates a new ZUR in RAMurlIndex = new kelondroRowSet(rowdef, 0);}@@ -89,7 +90,7 @@ public class plasmaCrawlZURL {}public synchronized Entry newEntry(- plasmaCrawlEntry bentry,+ CrawlEntry bentry,String executor,Date workdate,int workcount,@@ -153,7 +154,7 @@ public class plasmaCrawlZURL {public class Entry {- plasmaCrawlEntry bentry; // the balancer entry+ CrawlEntry bentry; // the balancer entryprivate String executor; // the crawling executorprivate Date workdate; // the time when the url was last time tried to loadprivate int workcount; // number of tryings@@ -161,7 +162,7 @@ public class plasmaCrawlZURL {private boolean stored;public Entry(- plasmaCrawlEntry bentry,+ CrawlEntry bentry,String executor,Date workdate,int workcount,@@ -183,7 +184,7 @@ public class plasmaCrawlZURL {this.workdate = new Date(entry.getColLong(2));this.workcount = (int) entry.getColLong(3);this.anycause = entry.getColString(4, "UTF-8");- this.bentry = new plasmaCrawlEntry(plasmaCrawlEntry.rowdef.newEntry(entry.getColBytes(5)));+ this.bentry = new CrawlEntry(CrawlEntry.rowdef.newEntry(entry.getColBytes(5)));assert ((new String(entry.getColBytes(0))).equals(bentry.url().hash()));this.stored = true;return;@@ -275,3 +276,4 @@ public class plasmaCrawlZURL {return new kiter(up, firstHash);}}+diff --git a/source/de/anomic/data/SitemapParser.java b/source/de/anomic/data/SitemapParser.javaindex 638606966..ba1e15808 100644--- a/source/de/anomic/data/SitemapParser.java+++ b/source/de/anomic/data/SitemapParser.java@@ -58,13 +58,13 @@ import org.xml.sax.Attributes;import org.xml.sax.SAXException;import org.xml.sax.helpers.DefaultHandler;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.ZURL;import de.anomic.http.JakartaCommonsHttpClient;import de.anomic.http.JakartaCommonsHttpResponse;import de.anomic.http.httpdByteCountInputStream;import de.anomic.index.indexURLReference;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlProfile;-import de.anomic.plasma.plasmaCrawlZURL;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverDate;import de.anomic.server.logging.serverLog;@@ -108,7 +108,7 @@ public class SitemapParser extends DefaultHandler {/*** The crawling profile used to parse the URLs contained in the sitemap file*/- private plasmaCrawlProfile.entry crawlingProfile = null;+ private CrawlProfile.entry crawlingProfile = null;/*** Reference to the plasmaswitchboard.@@ -155,7 +155,7 @@ public class SitemapParser extends DefaultHandler {*/private Date lastMod = null;- public SitemapParser(plasmaSwitchboard sb, yacyURL sitemap, plasmaCrawlProfile.entry theCrawlingProfile) {+ public SitemapParser(plasmaSwitchboard sb, yacyURL sitemap, CrawlProfile.entry theCrawlingProfile) {if (sb == null)throw new NullPointerException("The switchboard must not be null");if (sitemap == null)@@ -306,8 +306,8 @@ public class SitemapParser extends DefaultHandler {this.logger.logInfo("The URL '" + this.nextURL + "' can not be crawled. Reason: " + error);// insert URL into the error DB- plasmaCrawlZURL.Entry ee = this.switchboard.crawlQueues.errorURL.newEntry(- new plasmaCrawlEntry(+ ZURL.Entry ee = this.switchboard.crawlQueues.errorURL.newEntry(+ new CrawlEntry(switchboard.wordIndex.seedDB.mySeed().hash,new yacyURL(this.nextURL, null),"",@@ -352,7 +352,7 @@ public class SitemapParser extends DefaultHandler {}}- private plasmaCrawlProfile.entry createProfile(String domainName, yacyURL sitemapURL) {+ private CrawlProfile.entry createProfile(String domainName, yacyURL sitemapURL) {return this.switchboard.profilesActiveCrawls.newEntry(domainName, sitemapURL,// crawlingFilter".*", ".*",diff --git a/source/de/anomic/data/robotsParser.java b/source/de/anomic/data/robotsParser.javaindex 949e713de..6f405d332 100644--- a/source/de/anomic/data/robotsParser.java+++ b/source/de/anomic/data/robotsParser.java@@ -56,11 +56,11 @@ import java.net.URLDecoder;import java.util.ArrayList;import java.util.Date;+import de.anomic.crawler.RobotsTxt;import de.anomic.http.HttpClient;import de.anomic.http.JakartaCommonsHttpClient;import de.anomic.http.JakartaCommonsHttpResponse;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlRobotsTxt;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverByteBuffer;import de.anomic.server.serverFileUtils;@@ -218,7 +218,7 @@ public final class robotsParser{}// escaping all occurences of ; because this char is used as special char in the Robots DB- path = path.replaceAll(plasmaCrawlRobotsTxt.ROBOTS_DB_PATH_SEPARATOR,"%3B");+ path = path.replaceAll(RobotsTxt.ROBOTS_DB_PATH_SEPARATOR,"%3B");// adding it to the pathlistif (!isDisallowRule) path = "!" + path;@@ -262,7 +262,7 @@ public final class robotsParser{// generating the hostname:poart string needed to do a DB lookupString urlHostPort = getHostPort(theURL);- plasmaCrawlRobotsTxt.Entry robotsTxt4Host = null;+ RobotsTxt.Entry robotsTxt4Host = null;synchronized(urlHostPort) {// doing a DB lookup to determine if the robots data is already availablerobotsTxt4Host = plasmaSwitchboard.robots.getEntry(urlHostPort);@@ -284,7 +284,7 @@ public final class robotsParser{// generating the hostname:poart string needed to do a DB lookupString urlHostPort = getHostPort(theURL);- plasmaCrawlRobotsTxt.Entry robotsTxt4Host = null;+ RobotsTxt.Entry robotsTxt4Host = null;synchronized(urlHostPort) {// doing a DB lookup to determine if the robots data is already availablerobotsTxt4Host = plasmaSwitchboard.robots.getEntry(urlHostPort);@@ -305,7 +305,7 @@ public final class robotsParser{// generating the hostname:poart string needed to do a DB lookupString urlHostPort = getHostPort(nexturl);- plasmaCrawlRobotsTxt.Entry robotsTxt4Host = null;+ RobotsTxt.Entry robotsTxt4Host = null;synchronized(urlHostPort) {// doing a DB lookup to determine if the robots data is already availablerobotsTxt4Host = plasmaSwitchboard.robots.getEntry(urlHostPort);@@ -378,7 +378,7 @@ public final class robotsParser{return false;}- static Object[] downloadRobotsTxt(yacyURL robotsURL, int redirectionCount, plasmaCrawlRobotsTxt.Entry entry) throws Exception {+ static Object[] downloadRobotsTxt(yacyURL robotsURL, int redirectionCount, RobotsTxt.Entry entry) throws Exception {if (redirectionCount < 0) return new Object[]{Boolean.FALSE,null,null};redirectionCount--;diff --git a/source/de/anomic/index/indexURLReference.java b/source/de/anomic/index/indexURLReference.javaindex db9bb518c..35edcbf13 100644--- a/source/de/anomic/index/indexURLReference.java+++ b/source/de/anomic/index/indexURLReference.java@@ -32,12 +32,12 @@ import java.util.ArrayList;import java.util.Date;import java.util.Properties;+import de.anomic.crawler.CrawlEntry;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroBitfield;import de.anomic.kelondro.kelondroException;import de.anomic.kelondro.kelondroNaturalOrder;import de.anomic.kelondro.kelondroRow;-import de.anomic.plasma.plasmaCrawlEntry;import de.anomic.plasma.plasmaSearchQuery;import de.anomic.server.serverCharBuffer;import de.anomic.server.serverCodings;@@ -434,8 +434,8 @@ public class indexURLReference {//return "{" + core + ",snippet=" + crypt.simpleEncode(snippet) + "}";}- public plasmaCrawlEntry toBalancerEntry(String initiatorHash) {- return new plasmaCrawlEntry(+ public CrawlEntry toBalancerEntry(String initiatorHash) {+ return new CrawlEntry(initiatorHash,comp().url(),referrerHash(),diff --git a/source/de/anomic/plasma/dbImport/SitemapImporter.java b/source/de/anomic/plasma/dbImport/SitemapImporter.javaindex 1d7d43ade..8fcb37450 100644--- a/source/de/anomic/plasma/dbImport/SitemapImporter.java+++ b/source/de/anomic/plasma/dbImport/SitemapImporter.java@@ -46,8 +46,8 @@ package de.anomic.plasma.dbImport;import java.util.HashMap;+import de.anomic.crawler.CrawlProfile;import de.anomic.data.SitemapParser;-import de.anomic.plasma.plasmaCrawlProfile;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.yacy.yacyURL;@@ -105,7 +105,7 @@ public class SitemapImporter extends AbstractImporter implements dbImporter {super.init();}- public void initSitemap(yacyURL sitemapURL, plasmaCrawlProfile.entry profileEntry) throws ImporterException {+ public void initSitemap(yacyURL sitemapURL, CrawlProfile.entry profileEntry) throws ImporterException {try {// getting the sitemap URLthis.sitemapURL = sitemapURL;diff --git a/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java b/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.javaindex b213fab74..2f46637db 100644--- a/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java+++ b/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java@@ -6,17 +6,17 @@ import java.util.HashMap;import java.util.HashSet;import java.util.Iterator;-import de.anomic.plasma.plasmaCrawlEntry;-import de.anomic.plasma.plasmaCrawlNURL;-import de.anomic.plasma.plasmaCrawlProfile;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.NoticedURL;import de.anomic.plasma.plasmaSwitchboard;public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImporter {private File plasmaPath = null;private HashSet<String> importProfileHandleCache = new HashSet<String>();- private plasmaCrawlProfile importProfileDB;- private plasmaCrawlNURL importNurlDB;+ private CrawlProfile importProfileDB;+ private NoticedURL importNurlDB;private int importStartSize;private int urlCount = 0;private int profileCount = 0;@@ -91,13 +91,13 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor// init noticeUrlDBthis.log.logInfo("Initializing the source noticeUrlDB");- this.importNurlDB = new plasmaCrawlNURL(plasmaPath);+ this.importNurlDB = new NoticedURL(plasmaPath);this.importStartSize = this.importNurlDB.size();//int stackSize = this.importNurlDB.stackSize();// init profile DBthis.log.logInfo("Initializing the source profileDB");- this.importProfileDB = new plasmaCrawlProfile(profileDbFile);+ this.importProfileDB = new CrawlProfile(profileDbFile);}@SuppressWarnings("unchecked")@@ -107,9 +107,10 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor//this.importNurlDB.waitOnInitThread();// the stack types we want to import- int[] stackTypes = new int[] {plasmaCrawlNURL.STACK_TYPE_CORE,- plasmaCrawlNURL.STACK_TYPE_LIMIT,- plasmaCrawlNURL.STACK_TYPE_REMOTE,+ int[] stackTypes = new int[] {+ NoticedURL.STACK_TYPE_CORE,+ NoticedURL.STACK_TYPE_LIMIT,+ NoticedURL.STACK_TYPE_REMOTE,-1};// looping through the various stacks@@ -121,11 +122,11 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor}// getting an iterator and loop through the URL entries- Iterator<plasmaCrawlEntry> entryIter = (stackTypes[stackType] == -1) ? this.importNurlDB.iterator(stackType) : null;+ Iterator<CrawlEntry> entryIter = (stackTypes[stackType] == -1) ? this.importNurlDB.iterator(stackType) : null;while (true) {String nextHash = null;- plasmaCrawlEntry nextEntry = null;+ CrawlEntry nextEntry = null;try {if (stackTypes[stackType] != -1) {@@ -160,12 +161,12 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImporif (!this.importProfileHandleCache.contains(profileHandle)) {// testing if the profile is already known- plasmaCrawlProfile.entry profileEntry = this.sb.profilesActiveCrawls.getEntry(profileHandle);+ CrawlProfile.entry profileEntry = this.sb.profilesActiveCrawls.getEntry(profileHandle);// if not we need to import itif (profileEntry == null) {// copy and store the source profile entry into the destination db- plasmaCrawlProfile.entry sourceEntry = this.importProfileDB.getEntry(profileHandle);+ CrawlProfile.entry sourceEntry = this.importProfileDB.getEntry(profileHandle);if (sourceEntry != null) {this.profileCount++;this.importProfileHandleCache.add(profileHandle);@@ -179,7 +180,7 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor// if the url does not alredy exists in the destination stack we insert it nowif (!this.sb.crawlQueues.noticeURL.existsInStack(nextHash)) {- this.sb.crawlQueues.noticeURL.push((stackTypes[stackType] != -1) ? stackTypes[stackType] : plasmaCrawlNURL.STACK_TYPE_CORE, nextEntry);+ this.sb.crawlQueues.noticeURL.push((stackTypes[stackType] != -1) ? stackTypes[stackType] : NoticedURL.STACK_TYPE_CORE, nextEntry);}// removing hash from the import dbdiff --git a/source/de/anomic/plasma/parser/ParserException.java b/source/de/anomic/plasma/parser/ParserException.javaindex 4d94b7f9a..fb3ce27db 100644--- a/source/de/anomic/plasma/parser/ParserException.java+++ b/source/de/anomic/plasma/parser/ParserException.java@@ -44,7 +44,7 @@package de.anomic.plasma.parser;-import de.anomic.plasma.plasmaCrawlEURL;+import de.anomic.crawler.ErrorURL;import de.anomic.yacy.yacyURL;public class ParserException extends Exception@@ -59,7 +59,7 @@ public class ParserException extends Exception}public ParserException(String message, yacyURL url) {- this(message,url,plasmaCrawlEURL.DENIED_PARSER_ERROR);+ this(message,url,ErrorURL.DENIED_PARSER_ERROR);}public ParserException(String message, yacyURL url, String errorCode) {@@ -69,7 +69,7 @@ public class ParserException extends Exception}public ParserException(String message, yacyURL url, Throwable cause) {- this(message,url,cause,plasmaCrawlEURL.DENIED_PARSER_ERROR);+ this(message,url,cause,ErrorURL.DENIED_PARSER_ERROR);}public ParserException(String message, yacyURL url, Throwable cause, String errorCode) {diff --git a/source/de/anomic/plasma/parser/pdf/pdfParser.java b/source/de/anomic/plasma/parser/pdf/pdfParser.javaindex 21f965b1d..b49f43292 100644--- a/source/de/anomic/plasma/parser/pdf/pdfParser.java+++ b/source/de/anomic/plasma/parser/pdf/pdfParser.java@@ -56,7 +56,7 @@ import org.pdfbox.pdmodel.PDDocumentInformation;import org.pdfbox.pdmodel.encryption.StandardDecryptionMaterial;import org.pdfbox.util.PDFTextStripper;-import de.anomic.plasma.plasmaCrawlEURL;+import de.anomic.crawler.ErrorURL;import de.anomic.plasma.plasmaParserDocument;import de.anomic.plasma.parser.AbstractParser;import de.anomic.plasma.parser.Parser;@@ -122,7 +122,7 @@ public class pdfParser extends AbstractParser implements Parser {if (theDocument.isEncrypted()) {theDocument.openProtection(new StandardDecryptionMaterial(""));if (!theDocument.getCurrentAccessPermission().canExtractContent())- throw new ParserException("Document is encrypted",location,plasmaCrawlEURL.DENIED_DOCUMENT_ENCRYPTED);+ throw new ParserException("Document is encrypted",location,ErrorURL.DENIED_DOCUMENT_ENCRYPTED);}// extracting some metadatadiff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.javaindex eb6a6a0de..80803af04 100644--- a/source/de/anomic/plasma/plasmaHTCache.java+++ b/source/de/anomic/plasma/plasmaHTCache.java@@ -70,6 +70,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;import java.util.regex.Matcher;import java.util.regex.Pattern;+import de.anomic.crawler.CrawlProfile;import de.anomic.http.httpHeader;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroDyn;@@ -893,7 +894,7 @@ public final class plasmaHTCache {String responseStatus,IResourceInfo docInfo,String initiator,- plasmaCrawlProfile.entry profile+ CrawlProfile.entry profile) {return new Entry(initDate,@@ -920,7 +921,7 @@ public final class plasmaHTCache {private Date lastModified;private char doctype;private String language;- private plasmaCrawlProfile.entry profile;+ private CrawlProfile.entry profile;private String initiator;/**@@ -948,7 +949,7 @@ public final class plasmaHTCache {String responseStatus,IResourceInfo resourceInfo,String initiator,- plasmaCrawlProfile.entry profile+ CrawlProfile.entry profile) {if (resourceInfo == null){System.out.println("Content information object is null. " + url);@@ -999,7 +1000,7 @@ public final class plasmaHTCache {return this.language;}- public plasmaCrawlProfile.entry profile() {+ public CrawlProfile.entry profile() {return this.profile;}diff --git a/source/de/anomic/plasma/plasmaParser.java b/source/de/anomic/plasma/plasmaParser.javaindex 3be6e720b..e94fd00f4 100644--- a/source/de/anomic/plasma/plasmaParser.java+++ b/source/de/anomic/plasma/plasmaParser.java@@ -50,6 +50,7 @@ import java.util.Map;import java.util.Properties;import java.util.Set;+import de.anomic.crawler.ErrorURL;import de.anomic.htmlFilter.htmlFilterContentScraper;import de.anomic.htmlFilter.htmlFilterImageEntry;import de.anomic.htmlFilter.htmlFilterInputStream;@@ -543,7 +544,7 @@ public final class plasmaParser {if (sourceArray == null || sourceArray.length == 0) {String errorMsg = "No resource content available (1).";this.theLogger.logInfo("Unable to parse '" + location + "'. " + errorMsg);- throw new ParserException(errorMsg,location,plasmaCrawlEURL.DENIED_NOT_PARSEABLE_NO_CONTENT);+ throw new ParserException(errorMsg,location,ErrorURL.DENIED_NOT_PARSEABLE_NO_CONTENT);}// creating an InputStream@@ -577,7 +578,7 @@ public final class plasmaParser {if (!(sourceFile.exists() && sourceFile.canRead() && sourceFile.length() > 0)) {String errorMsg = sourceFile.exists() ? "Empty resource file." : "No resource content available (2).";this.theLogger.logInfo("Unable to parse '" + location + "'. " + errorMsg);- throw new ParserException(errorMsg,location,plasmaCrawlEURL.DENIED_NOT_PARSEABLE_NO_CONTENT);+ throw new ParserException(errorMsg,location,ErrorURL.DENIED_NOT_PARSEABLE_NO_CONTENT);}// create a new InputStream@@ -631,7 +632,7 @@ public final class plasmaParser {if (!plasmaParser.supportedContent(location,mimeType)) {String errorMsg = "No parser available to parse mimetype '" + mimeType + "'";this.theLogger.logInfo("Unable to parse '" + location + "'. " + errorMsg);- throw new ParserException(errorMsg,location,plasmaCrawlEURL.DENIED_WRONG_MIMETYPE_OR_EXT);+ throw new ParserException(errorMsg,location,ErrorURL.DENIED_WRONG_MIMETYPE_OR_EXT);}if (this.theLogger.isFine())@@ -653,7 +654,7 @@ public final class plasmaParser {} else {String errorMsg = "No parser available to parse mimetype '" + mimeType + "'";this.theLogger.logInfo("Unable to parse '" + location + "'. " + errorMsg);- throw new ParserException(errorMsg,location,plasmaCrawlEURL.DENIED_WRONG_MIMETYPE_OR_EXT);+ throw new ParserException(errorMsg,location,ErrorURL.DENIED_WRONG_MIMETYPE_OR_EXT);}// check result@@ -667,7 +668,7 @@ public final class plasmaParser {} catch (UnsupportedEncodingException e) {String errorMsg = "Unsupported charset encoding: " + e.getMessage();this.theLogger.logSevere("Unable to parse '" + location + "'. " + errorMsg, e);- throw new ParserException(errorMsg,location,plasmaCrawlEURL.DENIED_UNSUPPORTED_CHARSET);+ throw new ParserException(errorMsg,location,ErrorURL.DENIED_UNSUPPORTED_CHARSET);} catch (Exception e) {// Interrupted- and Parser-Exceptions should pass throughif (e instanceof InterruptedException) throw (InterruptedException) e;diff --git a/source/de/anomic/plasma/plasmaSearchEvent.java b/source/de/anomic/plasma/plasmaSearchEvent.javaindex 4602d0fda..daa846629 100644--- a/source/de/anomic/plasma/plasmaSearchEvent.java+++ b/source/de/anomic/plasma/plasmaSearchEvent.java@@ -37,6 +37,7 @@ import java.util.TreeMap;import java.util.TreeSet;import java.util.concurrent.ConcurrentHashMap;+import de.anomic.crawler.ResultURLs;import de.anomic.index.indexContainer;import de.anomic.index.indexRWIEntry;import de.anomic.index.indexRWIVarEntry;@@ -88,12 +89,12 @@ public final class plasmaSearchEvent {TreeSet<String> snippetFetchWordHashes; // a set of word hashes that are used to match with the snippetslong urlRetrievalAllTime;long snippetComputationAllTime;- plasmaCrawlResultURLs crawlResults;+ ResultURLs crawlResults;@SuppressWarnings("unchecked")private plasmaSearchEvent(plasmaSearchQuery query,plasmaWordIndex wordIndex,- plasmaCrawlResultURLs crawlResults,+ ResultURLs crawlResults,TreeMap<String, String> preselectedPeerHashes,boolean generateAbstracts) {this.eventTime = System.currentTimeMillis(); // for lifetime check@@ -456,7 +457,7 @@ public final class plasmaSearchEvent {plasmaSearchQuery query,plasmaSearchRankingProfile ranking,plasmaWordIndex wordIndex,- plasmaCrawlResultURLs crawlResults,+ ResultURLs crawlResults,TreeMap<String, String> preselectedPeerHashes,boolean generateAbstracts) {plasmaSearchEvent event = lastEvents.get(query.id(false));diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex 58151ba78..c5536b5ba 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -107,6 +107,17 @@ import java.util.TimerTask;import java.util.TreeMap;import java.util.TreeSet;+import de.anomic.crawler.CrawlEntry;+import de.anomic.crawler.ErrorURL;+import de.anomic.crawler.CrawlProfile;+import de.anomic.crawler.CrawlQueues;+import de.anomic.crawler.NoticedURL;+import de.anomic.crawler.ResultImages;+import de.anomic.crawler.ResultURLs;+import de.anomic.crawler.RobotsTxt;+import de.anomic.crawler.CrawlStacker;+import de.anomic.crawler.ProtocolLoader;+import de.anomic.crawler.ZURL;import de.anomic.data.URLLicense;import de.anomic.data.blogBoard;import de.anomic.data.blogBoardComments;@@ -133,8 +144,6 @@ import de.anomic.kelondro.kelondroException;import de.anomic.kelondro.kelondroMSetTools;import de.anomic.kelondro.kelondroMapTable;import de.anomic.kelondro.kelondroNaturalOrder;-import de.anomic.plasma.crawler.plasmaCrawlQueues;-import de.anomic.plasma.crawler.plasmaProtocolLoader;import de.anomic.plasma.dbImport.dbImportManager;import de.anomic.plasma.parser.ParserException;import de.anomic.server.serverAbstractSwitch;@@ -199,20 +208,20 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbopublic File releasePath;public HashMap<String, String> rankingPermissions;public plasmaWordIndex wordIndex;- public plasmaCrawlQueues crawlQueues;- public plasmaCrawlResultURLs crawlResults;+ public CrawlQueues crawlQueues;+ public ResultURLs crawlResults;public plasmaSwitchboardQueue sbQueue;- public plasmaCrawlStacker crawlStacker;+ public CrawlStacker crawlStacker;public messageBoard messageDB;public wikiBoard wikiDB;public blogBoard blogDB;public blogBoardComments blogCommentDB;- public static plasmaCrawlRobotsTxt robots = null;- public plasmaCrawlProfile profilesActiveCrawls, profilesPassiveCrawls;- public plasmaCrawlProfile.entry defaultProxyProfile;- public plasmaCrawlProfile.entry defaultRemoteProfile;- public plasmaCrawlProfile.entry defaultTextSnippetLocalProfile, defaultTextSnippetGlobalProfile;- public plasmaCrawlProfile.entry defaultMediaSnippetLocalProfile, defaultMediaSnippetGlobalProfile;+ public static RobotsTxt robots = null;+ public CrawlProfile profilesActiveCrawls, profilesPassiveCrawls;+ public CrawlProfile.entry defaultProxyProfile;+ public CrawlProfile.entry defaultRemoteProfile;+ public CrawlProfile.entry defaultTextSnippetLocalProfile, defaultTextSnippetGlobalProfile;+ public CrawlProfile.entry defaultMediaSnippetLocalProfile, defaultMediaSnippetGlobalProfile;public boolean rankingOn;public plasmaRankingDistribution rankingOwnDistribution;public plasmaRankingDistribution rankingOtherDistribution;@@ -933,7 +942,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbolog.logConfig("Starting Indexing Management");String networkName = getConfig("network.unit.name", "");wordIndex = new plasmaWordIndex(networkName, log, indexPrimaryPath, indexSecondaryPath);- crawlResults = new plasmaCrawlResultURLs();+ crawlResults = new ResultURLs();// start yacy corelog.logConfig("Starting YaCy Protocol Core");@@ -1020,13 +1029,13 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo// make crawl profiles database and default profilesthis.log.logConfig("Initializing Crawl Profiles");File profilesActiveFile = new File(this.plasmaPath, DBFILE_ACTIVE_CRAWL_PROFILES);- this.profilesActiveCrawls = new plasmaCrawlProfile(profilesActiveFile);+ this.profilesActiveCrawls = new CrawlProfile(profilesActiveFile);initActiveCrawlProfiles();log.logConfig("Loaded active crawl profiles from file " + profilesActiveFile.getName() +", " + this.profilesActiveCrawls.size() + " entries" +", " + ppRamString(profilesActiveFile.length()/1024));File profilesPassiveFile = new File(this.plasmaPath, DBFILE_PASSIVE_CRAWL_PROFILES);- this.profilesPassiveCrawls = new plasmaCrawlProfile(profilesPassiveFile);+ this.profilesPassiveCrawls = new CrawlProfile(profilesPassiveFile);log.logConfig("Loaded passive crawl profiles from file " + profilesPassiveFile.getName() +", " + this.profilesPassiveCrawls.size() + " entries" +", " + ppRamString(profilesPassiveFile.length()/1024));@@ -1034,7 +1043,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo// loading the robots.txt dbthis.log.logConfig("Initializing robots.txt DB");File robotsDBFile = new File(this.plasmaPath, DBFILE_CRAWL_ROBOTS);- robots = new plasmaCrawlRobotsTxt(robotsDBFile);+ robots = new RobotsTxt(robotsDBFile);this.log.logConfig("Loaded robots.txt DB from file " + robotsDBFile.getName() +", " + robots.size() + " entries" +", " + ppRamString(robotsDBFile.length()/1024));@@ -1112,7 +1121,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo// start a loaderlog.logConfig("Starting Crawl Loader");- this.crawlQueues = new plasmaCrawlQueues(this, plasmaPath);+ this.crawlQueues = new CrawlQueues(this, plasmaPath);/** Creating sync objects and loading status for the crawl jobs@@ -1208,7 +1217,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo}// initializing the stackCrawlThread- this.crawlStacker = new plasmaCrawlStacker(this, this.plasmaPath, (int) getConfigLong("tableTypeForPreNURL", 0), (((int) getConfigLong("tableTypeForPreNURL", 0) == 0) && (getConfigLong(CRAWLSTACK_BUSYSLEEP, 0) <= 100)));+ this.crawlStacker = new CrawlStacker(this, this.plasmaPath, (int) getConfigLong("tableTypeForPreNURL", 0), (((int) getConfigLong("tableTypeForPreNURL", 0) == 0) && (getConfigLong(CRAWLSTACK_BUSYSLEEP, 0) <= 100)));//this.sbStackCrawlThread = new plasmaStackCrawlThread(this,this.plasmaPath,ramPreNURL);//this.sbStackCrawlThread.start();@@ -1464,8 +1473,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbothis.defaultTextSnippetGlobalProfile = null;this.defaultMediaSnippetLocalProfile = null;this.defaultMediaSnippetGlobalProfile = null;- Iterator<plasmaCrawlProfile.entry> i = this.profilesActiveCrawls.profiles(true);- plasmaCrawlProfile.entry profile;+ Iterator<CrawlProfile.entry> i = this.profilesActiveCrawls.profiles(true);+ CrawlProfile.entry profile;String name;while (i.hasNext()) {profile = i.next();@@ -1518,17 +1527,17 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchboprivate void resetProfiles() {final File pdb = new File(plasmaPath, DBFILE_ACTIVE_CRAWL_PROFILES);if (pdb.exists()) pdb.delete();- profilesActiveCrawls = new plasmaCrawlProfile(pdb);+ profilesActiveCrawls = new CrawlProfile(pdb);initActiveCrawlProfiles();}/**- * {@link plasmaCrawlProfile Crawl Profiles} are saved independantly from the queues themselves+ * {@link CrawlProfile Crawl Profiles} are saved independantly from the queues themselves* and therefore have to be cleaned up from time to time. This method only performs the clean-up* if - and only if - the {@link plasmaSwitchboardQueue switchboard},- * {@link plasmaProtocolLoader loader} and {@link plasmaCrawlNURL local crawl} queues are all empty.+ * {@link ProtocolLoader loader} and {@link plasmaCrawlNURL local crawl} queues are all empty.* <p>- * Then it iterates through all existing {@link plasmaCrawlProfile crawl profiles} and removes+ * Then it iterates through all existing {@link CrawlProfile crawl profiles} and removes* all profiles which are not hardcoded.* </p>* <p>@@ -1549,8 +1558,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo(crawlStacker != null && crawlStacker.size() > 0) ||(crawlQueues.noticeURL.notEmpty()))return false;- final Iterator<plasmaCrawlProfile.entry> iter = profilesActiveCrawls.profiles(true);- plasmaCrawlProfile.entry entry;+ final Iterator<CrawlProfile.entry> iter = profilesActiveCrawls.profiles(true);+ CrawlProfile.entry entry;boolean hasDoneSomething = false;try {while (iter.hasNext()) {@@ -1742,10 +1751,10 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbosynchronized (sbQueue) {// do one processing stepif (this.log.isFine()) log.logFine("DEQUEUE: sbQueueSize=" + sbQueue.size() +- ", coreStackSize=" + crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE) +- ", limitStackSize=" + crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT) +- ", overhangStackSize=" + crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_OVERHANG) +- ", remoteStackSize=" + crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_REMOTE));+ ", coreStackSize=" + crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE) ++ ", limitStackSize=" + crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT) ++ ", overhangStackSize=" + crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_OVERHANG) ++ ", remoteStackSize=" + crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_REMOTE));try {int sizeBefore = sbQueue.size();nextentry = sbQueue.pop();@@ -1929,7 +1938,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo}}// clean up image stack- plasmaCrawlResultImages.clearQueues();+ ResultImages.clearQueues();// clean up profilescheckInterruption();@@ -2156,7 +2165,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo}long stackEndTime = System.currentTimeMillis();if (log.isInfo()) log.logInfo("CRAWL: ADDED " + hl.size() + " LINKS FROM " + entry.url().toNormalform(false, true) +- ", NEW CRAWL STACK SIZE IS " + crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE) ++ ", NEW CRAWL STACK SIZE IS " + crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_CORE) +", STACKING TIME = " + (stackEndTime-stackStartTime) +", PARSING TIME = " + (parsingEndTime-parsingStartTime));}@@ -2179,8 +2188,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo// update image result list statistics// its good to do this concurrently here, because it needs a DNS lookup// to compute a URL hash which is necessary for a double-check- plasmaCrawlProfile.entry profile = profilesActiveCrawls.getEntry(in.queueEntry.profileHandle);- plasmaCrawlResultImages.registerImages(in.document, (profile == null) ? true : !profile.remoteIndexing());+ CrawlProfile.entry profile = profilesActiveCrawls.getEntry(in.queueEntry.profileHandle);+ ResultImages.registerImages(in.document, (profile == null) ? true : !profile.remoteIndexing());return new indexingQueueEntry(in.queueEntry, in.document, condenser);}@@ -2191,7 +2200,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchboyacyURL referrerURL = entry.referrerURL();int processCase = entry.processCase();- String noIndexReason = plasmaCrawlEURL.DENIED_UNSPECIFIED_INDEXING_ERROR;+ String noIndexReason = ErrorURL.DENIED_UNSPECIFIED_INDEXING_ERROR;if (processCase == PROCESSCASE_4_PROXY_LOAD) {// proxy-loadnoIndexReason = entry.shallIndexCacheForProxy();@@ -2273,7 +2282,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo// STORE WORD INDEXif ((!queueEntry.profile().indexText()) && (!queueEntry.profile().indexMedia())) {if (this.log.isFine()) log.logFine("Not Indexed Resource '" + queueEntry.url().toNormalform(false, true) + "': process case=" + processCase);- addURLtoErrorDB(queueEntry.url(), referrerURL.hash(), queueEntry.initiator(), dc_title, plasmaCrawlEURL.DENIED_UNKNOWN_INDEXING_PROCESS_CASE, new kelondroBitfield());+ addURLtoErrorDB(queueEntry.url(), referrerURL.hash(), queueEntry.initiator(), dc_title, ErrorURL.DENIED_UNKNOWN_INDEXING_PROCESS_CASE, new kelondroBitfield());return;}@@ -2658,7 +2667,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo) {assert initiator != null;// create a new errorURL DB entry- plasmaCrawlEntry bentry = new plasmaCrawlEntry(+ CrawlEntry bentry = new CrawlEntry(initiator,url,referrerHash,@@ -2668,7 +2677,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo0,0,0);- plasmaCrawlZURL.Entry ee = crawlQueues.errorURL.newEntry(+ ZURL.Entry ee = crawlQueues.errorURL.newEntry(bentry, initiator, new Date(),0, failreason);// store the entrydiff --git a/source/de/anomic/plasma/plasmaSwitchboardQueue.java b/source/de/anomic/plasma/plasmaSwitchboardQueue.javaindex 282290f1c..7a2a3bae6 100644--- a/source/de/anomic/plasma/plasmaSwitchboardQueue.java+++ b/source/de/anomic/plasma/plasmaSwitchboardQueue.java@@ -52,6 +52,7 @@ import java.util.Date;import java.util.Iterator;import java.util.concurrent.ConcurrentHashMap;+import de.anomic.crawler.CrawlProfile;import de.anomic.index.indexURLReference;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroNaturalOrder;@@ -66,12 +67,12 @@ import de.anomic.yacy.yacyURL;public class plasmaSwitchboardQueue {kelondroStack sbQueueStack;- plasmaCrawlProfile profiles;+ CrawlProfile profiles;plasmaWordIndex wordIndex;private File sbQueueStackPath;ConcurrentHashMap<String, QueueEntry> queueInProcess;- public plasmaSwitchboardQueue(plasmaWordIndex wordIndex, File sbQueueStackPath, plasmaCrawlProfile profiles) {+ public plasmaSwitchboardQueue(plasmaWordIndex wordIndex, File sbQueueStackPath, CrawlProfile profiles) {this.sbQueueStackPath = sbQueueStackPath;this.profiles = profiles;this.wordIndex = wordIndex;@@ -231,7 +232,7 @@ public class plasmaSwitchboardQueue {int status;// computed values- private plasmaCrawlProfile.entry profileEntry;+ private CrawlProfile.entry profileEntry;private IResourceInfo contentInfo;private yacyURL referrerURL;@@ -351,7 +352,7 @@ public class plasmaSwitchboardQueue {if (cacheFile().exists()) return cacheFile().length(); else return 0;}- public plasmaCrawlProfile.entry profile() {+ public CrawlProfile.entry profile() {if (profileEntry == null) profileEntry = profiles.getEntry(profileHandle);return profileEntry;}diff --git a/source/de/anomic/urlRedirector/urlRedirectord.java b/source/de/anomic/urlRedirector/urlRedirectord.javaindex b589edb93..051a4e491 100644--- a/source/de/anomic/urlRedirector/urlRedirectord.java+++ b/source/de/anomic/urlRedirector/urlRedirectord.java@@ -7,10 +7,10 @@ import java.io.PrintWriter;import java.net.MalformedURLException;import java.util.Date;+import de.anomic.crawler.CrawlProfile;import de.anomic.data.userDB;import de.anomic.http.HttpClient;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlProfile;import de.anomic.plasma.plasmaParser;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverCore;@@ -24,7 +24,7 @@ public class urlRedirectord implements serverHandler {private serverCore.Session session;private static plasmaSwitchboard switchboard = null;private serverLog theLogger = new serverLog("URL-REDIRECTOR");- private static plasmaCrawlProfile.entry profile = null;+ private static CrawlProfile.entry profile = null;private String nextURL;public urlRedirectord() {diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.javaindex ffba9a83b..65ca086cd 100644--- a/source/de/anomic/yacy/yacyClient.java+++ b/source/de/anomic/yacy/yacyClient.java@@ -60,6 +60,7 @@ import org.apache.commons.httpclient.methods.multipart.FilePart;import org.apache.commons.httpclient.methods.multipart.Part;import org.apache.commons.httpclient.methods.multipart.StringPart;+import de.anomic.crawler.ResultURLs;import de.anomic.http.HttpClient;import de.anomic.http.JakartaCommonsHttpClient;import de.anomic.http.JakartaCommonsHttpResponse;@@ -74,7 +75,6 @@ import de.anomic.index.indexURLReference;import de.anomic.index.indexWord;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroBitfield;-import de.anomic.plasma.plasmaCrawlResultURLs;import de.anomic.plasma.plasmaSearchRankingProcess;import de.anomic.plasma.plasmaSearchRankingProfile;import de.anomic.plasma.plasmaSnippetCache;@@ -426,7 +426,7 @@ public final class yacyClient {int partitions,yacySeed target,plasmaWordIndex wordIndex,- plasmaCrawlResultURLs crawlResults,+ ResultURLs crawlResults,plasmaSearchRankingProcess containerCache,Map<String, TreeMap<String, String>> abstractCache,indexReferenceBlacklist blacklist,diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.javaindex 54d782c39..ae6c0c0d9 100644--- a/source/de/anomic/yacy/yacyCore.java+++ b/source/de/anomic/yacy/yacyCore.java@@ -104,7 +104,7 @@ public class yacyCore {// class variablesprivate static int onlineMode = 1;- private plasmaSwitchboard sb;+ plasmaSwitchboard sb;public static int yacyTime() {// the time since startup of yacy in secondsdiff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.javaindex 705d84144..632cf05ca 100644--- a/source/de/anomic/yacy/yacyPeerActions.java+++ b/source/de/anomic/yacy/yacyPeerActions.java@@ -49,9 +49,9 @@ import java.util.HashMap;import java.util.HashSet;import java.util.Iterator;+import de.anomic.crawler.NoticedURL;import de.anomic.http.HttpClient;import de.anomic.http.httpHeader;-import de.anomic.plasma.plasmaCrawlNURL;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverCore;import de.anomic.server.serverDate;@@ -112,7 +112,7 @@ public class yacyPeerActions {seedDB.mySeed().put(yacySeed.UPTIME, Long.toString(uptime/60)); // the number of minutes that the peer is up in minutes/day (moving average MA30)seedDB.mySeed().put(yacySeed.LCOUNT, Integer.toString(sb.wordIndex.countURL())); // the number of links that the peer has stored (LURL's)seedDB.mySeed().put(yacySeed.NCOUNT, Integer.toString(sb.crawlQueues.noticeURL.size())); // the number of links that the peer has noticed, but not loaded (NURL's)- seedDB.mySeed().put(yacySeed.RCOUNT, Integer.toString(sb.crawlQueues.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT))); // the number of links that the peer provides for remote crawling (ZURL's)+ seedDB.mySeed().put(yacySeed.RCOUNT, Integer.toString(sb.crawlQueues.noticeURL.stackSize(NoticedURL.STACK_TYPE_LIMIT))); // the number of links that the peer provides for remote crawling (ZURL's)seedDB.mySeed().put(yacySeed.ICOUNT, Integer.toString(sb.wordIndex.size())); // the minimum number of words that the peer has indexed (as it says)seedDB.mySeed().put(yacySeed.SCOUNT, Integer.toString(seedDB.sizeConnected())); // the number of seeds that the peer has storedseedDB.mySeed().put(yacySeed.CCOUNT, Double.toString(((int) ((seedDB.sizeConnected() + seedDB.sizeDisconnected() + seedDB.sizePotential()) * 60.0 / (uptime + 1.01)) * 100) / 100.0)); // the number of clients that the peer connects (as connects/hour)diff --git a/source/de/anomic/yacy/yacySearch.java b/source/de/anomic/yacy/yacySearch.javaindex bef3a321e..8fa3b60c7 100644--- a/source/de/anomic/yacy/yacySearch.java+++ b/source/de/anomic/yacy/yacySearch.java@@ -50,10 +50,10 @@ import java.util.Map;import java.util.Set;import java.util.TreeMap;+import de.anomic.crawler.ResultURLs;import de.anomic.index.indexReferenceBlacklist;import de.anomic.kelondro.kelondroBitfield;import de.anomic.kelondro.kelondroMScoreCluster;-import de.anomic.plasma.plasmaCrawlResultURLs;import de.anomic.plasma.plasmaSearchQuery;import de.anomic.plasma.plasmaSearchRankingProcess;import de.anomic.plasma.plasmaSearchRankingProfile;@@ -75,11 +75,11 @@ public class yacySearch extends Thread {final private plasmaSearchRankingProfile rankingProfile;final private String prefer, filter;final private kelondroBitfield constraint;- plasmaCrawlResultURLs crawlResults;+ ResultURLs crawlResults;public yacySearch(String wordhashes, String excludehashes, String urlhashes, String prefer, String filter, int count, int maxDistance,boolean global, int partitions, yacySeed targetPeer, plasmaWordIndex wordIndex,- plasmaCrawlResultURLs crawlResults,+ ResultURLs crawlResults,plasmaSearchRankingProcess containerCache,Map<String, TreeMap<String, String>> abstractCache,indexReferenceBlacklist blacklist,@@ -253,7 +253,7 @@ public class yacySearch extends Thread {String wordhashes, String excludehashes, String urlhashes,String prefer, String filter, int count, int maxDist,plasmaWordIndex wordIndex,- plasmaCrawlResultURLs crawlResults,+ ResultURLs crawlResults,plasmaSearchRankingProcess containerCache,Map<String, TreeMap<String, String>> abstractCache,int targets,@@ -281,7 +281,7 @@ public class yacySearch extends Thread {public static yacySearch secondaryRemoteSearch(String wordhashes, String excludehashes, String urlhashes,plasmaWordIndex wordIndex,- plasmaCrawlResultURLs crawlResults,+ ResultURLs crawlResults,plasmaSearchRankingProcess containerCache,String targethash, indexReferenceBlacklist blacklist,plasmaSearchRankingProfile rankingProfile,