summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-06-28 15:25:33 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-06-28 15:25:33 +0000
commitf1ed91a8e42b13596932d5beac05e80dc412242e (patch)
treee1873f78a00c213f4f8c5b2782b86ac1d8123ceb
parent87afdfc2a789a73b50072ecde4b22b9f0bf575ec (diff)
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
-rw-r--r--htroot/ConfigNetwork_p.html10
-rw-r--r--htroot/ConfigNetwork_p.java8
-rw-r--r--htroot/Steering.java2
-rw-r--r--source/de/anomic/plasma/plasmaSwitchboard.java7
-rw-r--r--yacy.init1
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 @@
<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>
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