some enhancements to the remote crawl trigger

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2030 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent dbe96e6541
commit 60e5aff9fc

@ -1161,19 +1161,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
log.logInfo("shifted " + toshift + " jobs from global crawl to local crawl"); log.logInfo("shifted " + toshift + " jobs from global crawl to local crawl");
} }
if (sbQueue.size() >= indexingSlots) {
log.logFine("LimitCrawl: too many processes in indexing queue, dismissed to protect emergency case (" +
"sbQueueSize=" + sbQueue.size() + ")");
return false;
}
if (cacheLoader.size() >= crawlSlots) {
log.logFine("LimitCrawl: too many processes in loader queue, dismissed to protect emergency case (" +
"cacheLoader=" + cacheLoader.size() + ")");
return false;
}
// if the server is busy, we do crawling more slowly // if the server is busy, we do crawling more slowly
//if (!(cacheManager.idle())) try {Thread.currentThread().sleep(2000);} catch (InterruptedException e) {} //if (!(cacheManager.idle())) try {Thread.currentThread().sleep(2000);} catch (InterruptedException e) {}
@ -1214,7 +1201,20 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
if (success) return true; if (success) return true;
} }
processLocalCrawling(urlEntry, profile, stats); processLocalCrawling(urlEntry, profile, stats); // emergency case
if (sbQueue.size() >= indexingSlots) {
log.logFine("LimitCrawl: too many processes in indexing queue, delayed to protect emergency case (" +
"sbQueueSize=" + sbQueue.size() + ")");
return false;
}
if (cacheLoader.size() >= crawlSlots) {
log.logFine("LimitCrawl: too many processes in loader queue, delayed to protect emergency case (" +
"cacheLoader=" + cacheLoader.size() + ")");
return false;
}
return true; return true;
} catch (IOException e) { } catch (IOException e) {
log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage()); log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage());
@ -1706,7 +1706,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// do the request // do the request
try { try {
HashMap page = yacyClient.crawlOrder(remoteSeed, urlEntry.url(), urlPool.getURL(urlEntry.referrerHash())); HashMap page = yacyClient.crawlOrder(remoteSeed, urlEntry.url(), urlPool.getURL(urlEntry.referrerHash()), 6000);
// check success // check success
/* /*

@ -733,11 +733,11 @@ public final class yacyClient {
return "wrong protocol: " + protocol; return "wrong protocol: " + protocol;
} }
public static HashMap crawlOrder(yacySeed targetSeed, URL url, URL referrer) { public static HashMap crawlOrder(yacySeed targetSeed, URL url, URL referrer, int timeout) {
return crawlOrder(targetSeed,new URL[]{url},new URL[]{referrer}); return crawlOrder(targetSeed, new URL[]{url}, new URL[]{referrer}, timeout);
} }
public static HashMap crawlOrder(yacySeed targetSeed, URL[] url, URL[] referrer) { public static HashMap crawlOrder(yacySeed targetSeed, URL[] url, URL[] referrer, int timeout) {
// this post a message to the remote message board // this post a message to the remote message board
if (targetSeed == null) { return null; } if (targetSeed == null) { return null; }
if (yacyCore.seedDB.mySeed == null) { return null; } if (yacyCore.seedDB.mySeed == null) { return null; }
@ -777,7 +777,7 @@ public final class yacyClient {
return nxTools.table( return nxTools.table(
httpc.wput( httpc.wput(
new URL("http://" + address + "/yacy/crawlOrder.html"), new URL("http://" + address + "/yacy/crawlOrder.html"),
60000, timeout,
null, null,
null, null,
(useProxy)?yacyCore.seedDB.sb.remoteProxyConfig:null, (useProxy)?yacyCore.seedDB.sb.remoteProxyConfig:null,

Loading…
Cancel
Save