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
pull/1/head
orbiter 18 years ago
parent 87afdfc2a7
commit f1ed91a8e4

@ -74,7 +74,15 @@
<input type="radio" value="off" id="indexDistributeWhileCrawlingOff"
name="indexDistributeWhileCrawling"
#(indexDistributeWhileCrawling.off)#::checked="checked" #(/indexDistributeWhileCrawling.off)#/>
<label for="indexDistributeWhileCrawlingOff">disabled during crawling</label>.
<label for="indexDistributeWhileCrawlingOff">disabled during crawling</label>.<br>
<input type="radio" value="on" id="indexDistributeWhileIndexingOn"
name="indexDistributeWhileIndexing"
#(indexDistributeWhileIndexing.on)#::checked="checked" #(/indexDistributeWhileIndexing.on)#/>
<label for="indexDistributeWhileIndexingOn">enabled</label> /
<input type="radio" value="off" id="indexDistributeWhileIndexingOff"
name="indexDistributeWhileIndexing"
#(indexDistributeWhileIndexing.off)#::checked="checked" #(/indexDistributeWhileIndexing.off)#/>
<label for="indexDistributeWhileIndexingOff">disabled during indexing</label>.
</dd>
<dt>
<label for="indexReceive">Index Receive</label>

@ -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);

@ -73,7 +73,7 @@ public class Steering {
}
if (post.containsKey("shutdown")) {
sb.terminate(3000);
sb.terminate(5000);
prop.put("info", 3);
return prop;
}

@ -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;
}

@ -410,6 +410,7 @@ yacyDB=DATA/YACYDB
# you may switch this off
allowDistributeIndex=true
allowDistributeIndexWhileCrawling=false
allowDistributeIndexWhileIndexing=true
allowReceiveIndex=true
allowUnlimitedReceiveIndexFrom=
indexReceiveBlockBlacklist=true

Loading…
Cancel
Save