Skip to content

Commit

Permalink
some enhancements to the remote crawl trigger
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2030 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 20, 2006
1 parent dbe96e6 commit 60e5aff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions source/de/anomic/plasma/plasmaSwitchboard.java
Expand Up @@ -1161,19 +1161,6 @@ public boolean limitCrawlTriggerJob() {
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 (!(cacheManager.idle())) try {Thread.currentThread().sleep(2000);} catch (InterruptedException e) {}

Expand Down Expand Up @@ -1214,7 +1201,20 @@ public boolean limitCrawlTriggerJob() {
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;
} catch (IOException e) {
log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage());
Expand Down Expand Up @@ -1706,7 +1706,7 @@ private boolean processRemoteCrawlTrigger(plasmaCrawlNURL.Entry urlEntry) {

// do the request
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
/*
Expand Down
8 changes: 4 additions & 4 deletions source/de/anomic/yacy/yacyClient.java
Expand Up @@ -733,11 +733,11 @@ public static String transfer(String targetAddress, String filename, byte[] file
return "wrong protocol: " + protocol;
}

public static HashMap crawlOrder(yacySeed targetSeed, URL url, URL referrer) {
return crawlOrder(targetSeed,new URL[]{url},new URL[]{referrer});
public static HashMap crawlOrder(yacySeed targetSeed, URL url, URL referrer, int timeout) {
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
if (targetSeed == null) { return null; }
if (yacyCore.seedDB.mySeed == null) { return null; }
Expand Down Expand Up @@ -777,7 +777,7 @@ public static HashMap crawlOrder(yacySeed targetSeed, URL[] url, URL[] referrer)
return nxTools.table(
httpc.wput(
new URL("http://" + address + "/yacy/crawlOrder.html"),
60000,
timeout,
null,
null,
(useProxy)?yacyCore.seedDB.sb.remoteProxyConfig:null,
Expand Down

0 comments on commit 60e5aff

Please sign in to comment.