Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
set default ppm when network is switched
orbiter3c6e8d201575
diff --git a/htroot/IndexControlURLs_p.java b/htroot/IndexControlURLs_p.javaindex 456a1d13c..3643f4194 100644--- a/htroot/IndexControlURLs_p.java+++ b/htroot/IndexControlURLs_p.java@@ -263,7 +263,7 @@ public class IndexControlURLs_p {while (statsiter.hasNext() && cnt < count) {hs = statsiter.next();prop.put("statisticslines_domains_" + cnt + "_dark", (dark) ? "1" : "0");- prop.put("statisticslines_domains_" + cnt + "_domain", hs.hostname);+ prop.put("statisticslines_domains_" + cnt + "_domain", hs.hostname + ((hs.port == 80) ? "" : ":" + hs.port));prop.put("statisticslines_domains_" + cnt + "lines", count);prop.put("statisticslines_domains_" + cnt + "_hashpart", hs.hosthash);prop.put("statisticslines_domains_" + cnt + "_count", hs.count);diff --git a/source/de/anomic/index/indexRepositoryReference.java b/source/de/anomic/index/indexRepositoryReference.javaindex c9216e573..23332d5e6 100644--- a/source/de/anomic/index/indexRepositoryReference.java+++ b/source/de/anomic/index/indexRepositoryReference.java@@ -556,13 +556,17 @@ public final class indexRepositoryReference {count += 10; // make some more to prevent that we have to do this again after deletions too soon.if (count < 0 || count > s.size()) count = s.size();statsDump = new ArrayList<hostStat>();+ indexURLReference.Components comps;+ yacyURL url;while (j.hasNext()) {urlhash = j.next();if (urlhash == null) continue;urlref = this.load(urlhash, null, 0);if (urlref == null || urlref.comp() == null || urlref.comp().url() == null || urlref.comp().url().getHost() == null) continue;if (statsDump == null) return new ArrayList<hostStat>().iterator(); // some other operation has destroyed the object- statsDump.add(new hostStat(urlref.comp().url().getHost(), urlhash.substring(6), s.getScore(urlhash)));+ comps = urlref.comp();+ url = comps.url();+ statsDump.add(new hostStat(url.getHost(), url.getPort(), urlhash.substring(6), s.getScore(urlhash)));count--;if (count == 0) break;}@@ -581,10 +585,12 @@ public final class indexRepositoryReference {public class hostStat {public String hostname, hosthash;+ public int port;public int count;- public hostStat(String host, String urlhashfragment, int count) {+ public hostStat(String host, int port, String urlhashfragment, int count) {assert urlhashfragment.length() == 6;this.hostname = host;+ this.port = port;this.hosthash = urlhashfragment;this.count = count;}diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex d3f634e35..8e31e2b68 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -300,11 +300,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.// set network-specific performance attributesif (this.firstInit) {- int remotecrawl_ppm = Math.max(1, (int) getConfigLong("network.unit.remotecrawl.speed", 60));- setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, 60000 / remotecrawl_ppm);- setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_IDLESLEEP, Math.max(10000, 180000 / remotecrawl_ppm));- setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER_BUSYSLEEP, Math.max(15000, 1800000 / remotecrawl_ppm));- setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER_IDLESLEEP, Math.max(30000, 3600000 / remotecrawl_ppm));+ setRemotecrawlPPM(Math.max(1, (int) getConfigLong("network.unit.remotecrawl.speed", 60)));}// start indexing management@@ -763,6 +759,15 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.log.logInfo("RANDOM PASSWORD REMOVED! User must set a new password");}}+ // set the network-specific remote crawl ppm+ setRemotecrawlPPM(Math.max(1, (int) getConfigLong("network.unit.remotecrawl.speed", 60)));+ }++ private void setRemotecrawlPPM(int ppm) {+ setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, 60000 / ppm);+ setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_IDLESLEEP, Math.max(10000, 180000 / ppm));+ setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER_BUSYSLEEP, Math.max(15000, 1800000 / ppm));+ setConfig(plasmaSwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER_IDLESLEEP, Math.max(30000, 3600000 / ppm));}public void initMessages() {