From f1ed91a8e42b13596932d5beac05e80dc412242e Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 28 Jun 2007 15:25:33 +0000 Subject: [PATCH] added option to allow/disallow DHT transmission during indexing see also http://forum.yacy.de/viewtopic.php?f=9&t=8 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3933 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigNetwork_p.html | 10 +++++++++- htroot/ConfigNetwork_p.java | 8 ++++++++ htroot/Steering.java | 2 +- source/de/anomic/plasma/plasmaSwitchboard.java | 7 +++++-- yacy.init | 1 + 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/htroot/ConfigNetwork_p.html b/htroot/ConfigNetwork_p.html index 292d4950d..5ebce9bdd 100644 --- a/htroot/ConfigNetwork_p.html +++ b/htroot/ConfigNetwork_p.html @@ -74,7 +74,15 @@ - . + .
+ + / + + .
diff --git a/htroot/ConfigNetwork_p.java b/htroot/ConfigNetwork_p.java index a2b13f642..13768a318 100644 --- a/htroot/ConfigNetwork_p.java +++ b/htroot/ConfigNetwork_p.java @@ -89,6 +89,12 @@ public class ConfigNetwork_p { sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_CRAWLING, "false"); } + if (post.get("indexDistributeWhileIndexing","").equals("on")) { + sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_INDEXING, "true"); + } else { + sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_INDEXING, "false"); + } + if (indexReceive) { sb.setConfig("allowReceiveIndex", "true"); yacyCore.seedDB.mySeed.setFlagAcceptRemoteIndex(true); @@ -139,6 +145,8 @@ public class ConfigNetwork_p { prop.put("indexDistributeChecked", (indexDistribute) ? 1 : 0); prop.put("indexDistributeWhileCrawling.on", (sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_CRAWLING, "true").equals("true")) ? 1 : 0); prop.put("indexDistributeWhileCrawling.off", (sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_CRAWLING, "true").equals("true")) ? 0 : 1); + prop.put("indexDistributeWhileIndexing.on", (sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_INDEXING, "true").equals("true")) ? 1 : 0); + prop.put("indexDistributeWhileIndexing.off", (sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW_WHILE_INDEXING, "true").equals("true")) ? 0 : 1); prop.put("indexReceiveChecked", (indexReceive) ? 1 : 0); prop.put("indexReceiveBlockBlacklistChecked.on", (sb.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 1 : 0); prop.put("indexReceiveBlockBlacklistChecked.off", (sb.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 0 : 1); diff --git a/htroot/Steering.java b/htroot/Steering.java index a577f19dd..4929e83a7 100644 --- a/htroot/Steering.java +++ b/htroot/Steering.java @@ -73,7 +73,7 @@ public class Steering { } if (post.containsKey("shutdown")) { - sb.terminate(3000); + sb.terminate(5000); prop.put("info", 3); return prop; } diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 7a1953c82..d2a4e687a 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -537,6 +537,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser * @see plasmaSwitchboard#INDEX_DIST_ALLOW */ public static final String INDEX_DIST_ALLOW_WHILE_CRAWLING = "allowDistributeIndexWhileCrawling"; + public static final String INDEX_DIST_ALLOW_WHILE_INDEXING = "allowDistributeIndexWhileIndexing"; public static final String INDEX_TRANSFER_TIMEOUT = "indexTransfer.timeout"; public static final String INDEX_TRANSFER_GZIP_BODY = "indexTransfer.gzipBody"; @@ -3209,10 +3210,12 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser if (wordIndex.size() < 100) { return "no DHT distribution: not enough words - wordIndex.size() = " + wordIndex.size(); } - if ((getConfig(INDEX_DIST_ALLOW_WHILE_CRAWLING, "false").equalsIgnoreCase("false")) && - ((noticeURL.stackSize() > 0) /*|| (sbQueue.size() > 3)*/)) { + if ((getConfig(INDEX_DIST_ALLOW_WHILE_CRAWLING, "false").equalsIgnoreCase("false")) && (noticeURL.stackSize() > 0)) { return "no DHT distribution: crawl in progress: noticeURL.stackSize() = " + noticeURL.stackSize() + ", sbQueue.size() = " + sbQueue.size(); } + if ((getConfig(INDEX_DIST_ALLOW_WHILE_INDEXING, "false").equalsIgnoreCase("false")) && (sbQueue.size() > 1)) { + return "no DHT distribution: indexing in progress: noticeURL.stackSize() = " + noticeURL.stackSize() + ", sbQueue.size() = " + sbQueue.size(); + } return null; } diff --git a/yacy.init b/yacy.init index c9f7bd3d2..88bdf96e2 100644 --- a/yacy.init +++ b/yacy.init @@ -410,6 +410,7 @@ yacyDB=DATA/YACYDB # you may switch this off allowDistributeIndex=true allowDistributeIndexWhileCrawling=false +allowDistributeIndexWhileIndexing=true allowReceiveIndex=true allowUnlimitedReceiveIndexFrom= indexReceiveBlockBlacklist=true