better dht-in cache flush. see also:

http://forum.yacy-websuche.de/viewtopic.php?p=11936#p11936

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5472 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 941ab78d9b
commit efe801173c

@ -227,6 +227,7 @@ public class PerformanceQueues_p {
final int wordCacheMaxCount = post.getInt("wordCacheMaxCount", 20000);
switchboard.setConfig(plasmaSwitchboardConstants.WORDCACHE_MAX_COUNT, Integer.toString(wordCacheMaxCount));
switchboard.webIndex.setMaxWordCount(wordCacheMaxCount);
switchboard.setConfig(plasmaSwitchboardConstants.INDEX_DIST_DHT_RECEIPT_LIMIT, wordCacheMaxCount);
final int wordCacheInitCount = post.getInt(plasmaSwitchboardConstants.WORDCACHE_INIT_COUNT, 30000);
switchboard.setConfig(plasmaSwitchboardConstants.WORDCACHE_INIT_COUNT, Integer.toString(wordCacheInitCount));

@ -35,6 +35,7 @@ import de.anomic.http.httpRequestHeader;
import de.anomic.index.indexRWIRowEntry;
import de.anomic.index.indexReferenceBlacklist;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaSwitchboardConstants;
import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@ -81,7 +82,7 @@ public final class transferRWI {
boolean granted = sb.getConfig("allowReceiveIndex", "false").equals("true");
final boolean blockBlacklist = sb.getConfig("indexReceiveBlockBlacklist", "false").equals("true");
final boolean checkLimit = sb.getConfigBool("indexDistribution.transferRWIReceiptLimitEnabled", true);
final long cachelimit = sb.getConfigLong("indexDistribution.dhtReceiptLimit", 10000);
final long cachelimit = sb.getConfigLong(plasmaSwitchboardConstants.INDEX_DIST_DHT_RECEIPT_LIMIT, 10000);
final yacySeed otherPeer = sb.webIndex.seedDB.get(iam);
final String otherPeerName = iam + ":" + ((otherPeer == null) ? "NULL" : (otherPeer.getName() + "/" + otherPeer.getVersion()));

@ -527,11 +527,19 @@ public final class plasmaWordIndex implements indexRI {
}
private synchronized void flushCacheUntil(long timeout) {
while (System.currentTimeMillis() < timeout &&
(dhtOutCache.size() > 0 || dhtInCache.size() > 0)) {
flushCacheOne(dhtOutCache);
long timeout0 = System.currentTimeMillis() + (timeout - System.currentTimeMillis()) / 10 * 6;
// we give 60% for dhtIn to prefer filling of cache with dht transmission
//int cIn = 0;
while (System.currentTimeMillis() < timeout0 && dhtInCache.size() > 0) {
flushCacheOne(dhtInCache);
//cIn++;
}
//int cOut = 0;
while (System.currentTimeMillis() < timeout && dhtOutCache.size() > 0) {
flushCacheOne(dhtOutCache);
//cOut++;
}
//System.out.println("*** DEBUG cache flush: cIn = " + cIn + ", cOut = " + cOut);
}
private synchronized void flushCacheOne(final indexRAMRI ram) {

Loading…
Cancel
Save