Skip to content

Commit

Permalink
collection of small bugfixes
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3600 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 26, 2007
1 parent 64a6d6e commit e192f61
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 40 deletions.
1 change: 1 addition & 0 deletions htroot/IndexControl_p.java
Expand Up @@ -333,6 +333,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("urlhashsimilar", 1);
while (entryIt.hasNext() && i < 256) {
entry = (indexURLEntry) entryIt.next();
if (entry == null) break;
prop.put("urlhashsimilar_rows_"+rows+"_cols_"+cols+"_urlHash", entry.hash());
cols++;
if (cols==8) {
Expand Down
3 changes: 1 addition & 2 deletions htroot/WatchCrawler_p.java
Expand Up @@ -266,8 +266,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
HashMap hyperlinks = (HashMap) scraper.getAnchors();

// creating a crawler profile
/* file.toURL() marked as deprecated per Sun JRE 6 */
plasmaCrawlProfile.entry profile = switchboard.profiles.newEntry(fileName, file.toURL().toString(), newcrawlingfilter, newcrawlingfilter, newcrawlingdepth, newcrawlingdepth, crawlingIfOlder, crawlingDomFilterDepth, crawlingDomMaxPages, crawlingQ, indexText, indexMedia, storeHTCache, true, crawlOrder, xsstopw, xdstopw, xpstopw);
plasmaCrawlProfile.entry profile = switchboard.profiles.newEntry(fileName, "file://" + file.toString(), newcrawlingfilter, newcrawlingfilter, newcrawlingdepth, newcrawlingdepth, crawlingIfOlder, crawlingDomFilterDepth, crawlingDomMaxPages, crawlingQ, indexText, indexMedia, storeHTCache, true, crawlOrder, xsstopw, xdstopw, xpstopw);

// loop through the contained links
Iterator interator = hyperlinks.entrySet().iterator();
Expand Down
2 changes: 2 additions & 0 deletions htroot/yacysearch.java
Expand Up @@ -127,6 +127,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("input_display", display);
prop.putASIS("input_promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("input_former", "");
prop.put("former", "");
prop.put("input_count", 10);
prop.put("input_resource", "global");
prop.put("input_time", 6);
Expand Down Expand Up @@ -502,6 +503,7 @@ else if (yacyonline) {
prop.put("input_display", display);
prop.putASIS("input_promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("input_former", post.get("search", ""));
prop.put("former", post.get("search", ""));
prop.put("input_count", count);
prop.put("input_resource", (global) ? "global" : "local");
prop.put("input_time", searchtime / 1000);
Expand Down
3 changes: 2 additions & 1 deletion source/de/anomic/plasma/plasmaCrawlLURL.java
Expand Up @@ -362,7 +362,8 @@ public Object clone(Object secondHash) {
}

public final boolean hasNext() {
if (this.error) { return false; }
if (this.error) return false;
if (this.iter == null) return false;
return this.iter.hasNext();
}

Expand Down
71 changes: 34 additions & 37 deletions source/de/anomic/plasma/plasmaSwitchboard.java
Expand Up @@ -1355,17 +1355,7 @@ public boolean isInMyCluster(String peer) {
return network.indexOf(peer) >= 0;
} else if (clustermode.equals("publiccluster")) {
// check if we got the request from a peer in the public cluster
String network = getConfig("cluster.peers.yacydomain", "");
// check for .yacyh hexhash-domain
String hexhash = yacySeed.b64Hash2hexHash(peer);
if (hexhash == null) return false;
if (network.indexOf(hexhash + ".yacyh") >= 0) return true;
// resolve seed
yacySeed seed = yacyCore.seedDB.get(peer);
if (seed == null) return false;
// check for .yacy (name) - Domain
if (network.indexOf(seed.getName() + ".yacy") >= 0) return true;
return false;
return this.clusterhashes.contains(peer);
} else {
return false;
}
Expand All @@ -1382,15 +1372,8 @@ public boolean isInMyCluster(yacySeed seed) {
String network = getConfig("cluster.peers.ipport", "");
return network.indexOf(seed.getAddress()) >= 0;
} else if (clustermode.equals("publiccluster")) {
// check if we got the request from a peer in the public cluster
String network = getConfig("cluster.peers.yacydomain", "");
// check for .yacyh hexhash-domain
String hexhash = yacySeed.b64Hash2hexHash(seed.hash);
if (hexhash == null) return false;
if (network.indexOf(hexhash + ".yacyh") >= 0) return true;
// check for .yacy (name) - Domain
if (network.indexOf(seed.getName() + ".yacy") >= 0) return true;
return false;
// check if we got the request from a peer in the public cluster
return this.clusterhashes.contains(seed.hash);
} else {
return false;
}
Expand Down Expand Up @@ -3049,32 +3032,46 @@ public void setPerformance(int wantedPPM) {
serverThread thread;

thread = getThread(INDEX_DIST);
setConfig(INDEX_DIST_BUSYSLEEP , thread.setBusySleep(Math.max(2000, thread.setBusySleep(newBusySleep * 2))));
thread.setIdleSleep(30000);
if (thread != null) {
setConfig(INDEX_DIST_BUSYSLEEP , thread.setBusySleep(Math.max(2000, thread.setBusySleep(newBusySleep * 2))));
thread.setIdleSleep(30000);
}

thread = getThread(CRAWLJOB_LOCAL_CRAWL);
setConfig(CRAWLJOB_LOCAL_CRAWL_BUSYSLEEP , thread.setBusySleep(newBusySleep));
thread.setIdleSleep(1000);
if (thread != null) {
setConfig(CRAWLJOB_LOCAL_CRAWL_BUSYSLEEP , thread.setBusySleep(newBusySleep));
thread.setIdleSleep(1000);
}

thread = getThread(CRAWLJOB_GLOBAL_CRAWL_TRIGGER);
setConfig(CRAWLJOB_GLOBAL_CRAWL_TRIGGER_BUSYSLEEP , thread.setBusySleep(Math.max(1000, newBusySleep * 3)));
thread.setIdleSleep(10000);

//thread = getThread(CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
//setConfig(CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP , thread.setBusySleep(newBusySleep * 10));
//thread.setIdleSleep(10000);

if (thread != null) {
setConfig(CRAWLJOB_GLOBAL_CRAWL_TRIGGER_BUSYSLEEP , thread.setBusySleep(Math.max(1000, newBusySleep * 3)));
thread.setIdleSleep(10000);
}
/*
thread = getThread(CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
if (thread != null) {
setConfig(CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP , thread.setBusySleep(newBusySleep * 10));
thread.setIdleSleep(10000);
}
*/
thread = getThread(PROXY_CACHE_ENQUEUE);
setConfig(PROXY_CACHE_ENQUEUE_BUSYSLEEP , thread.setBusySleep(0));
thread.setIdleSleep(1000);
if (thread != null) {
setConfig(PROXY_CACHE_ENQUEUE_BUSYSLEEP , thread.setBusySleep(0));
thread.setIdleSleep(1000);
}

thread = getThread(INDEXER);
setConfig(INDEXER_BUSYSLEEP , thread.setBusySleep(newBusySleep / 2));
thread.setIdleSleep(1000);
if (thread != null) {
setConfig(INDEXER_BUSYSLEEP , thread.setBusySleep(newBusySleep / 2));
thread.setIdleSleep(1000);
}

thread = getThread(CRAWLSTACK);
setConfig(CRAWLSTACK_BUSYSLEEP , thread.setBusySleep(0));
thread.setIdleSleep(5000);
if (thread != null) {
setConfig(CRAWLSTACK_BUSYSLEEP , thread.setBusySleep(0));
thread.setIdleSleep(5000);
}

}

Expand Down

0 comments on commit e192f61

Please sign in to comment.