Skip to content

Commit

Permalink
fixed not-working kelondroRecords-Cache
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@56 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 25, 2005
1 parent d03d60f commit ba16da7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 20 deletions.
3 changes: 3 additions & 0 deletions htroot/Performance_p.java
Expand Up @@ -113,6 +113,9 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
// load with new values
idlesleep = Long.parseLong((String) post.get(threadName + "_idlesleep", "1")) * 1000;
busysleep = Long.parseLong((String) post.get(threadName + "_busysleep", "1")) * 1000;

// check values to prevent short-cut loops
if (idlesleep == 0) idlesleep = 1000;

// on-the-fly re-configuration
switchboard.setThreadSleep(threadName, idlesleep, busysleep);
Expand Down
1 change: 0 additions & 1 deletion htroot/SettingsAck_p.html
Expand Up @@ -49,7 +49,6 @@ <h2>Settings Receipt:</h2>
::
<b>Port is: #[port]#</b><br>
<b>PeerName is: #[peerName]#</b><br>
<b>Shutdown time is: #[shutdownWaiting]# seconds</b><br>
<u>if you changed the Port, you need to restart the Proxy.</u>
::
<b>SeedFTP Server Settings changed. You are now a principal peer.</b><br>
Expand Down
3 changes: 0 additions & 3 deletions htroot/SettingsAck_p.java
Expand Up @@ -190,7 +190,6 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
if (post.containsKey("generalsettings")) {
String port = (String) post.get("port");
String peerName = (String) post.get("peername");
String shutdownWaiting = (String) post.get("shutdownWaiting");

// check if peer name already exists
yacySeed oldSeed = yacyCore.seedDB.lookupByName(peerName);
Expand All @@ -209,12 +208,10 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
// set values
env.setConfig("port", port);
env.setConfig("peerName", peerName);
env.setConfig("shutdownWaiting", shutdownWaiting);

prop.put("info", 12);//port or peername changed
prop.put("info_port", port);
prop.put("info_peerName", peerName);
prop.put("info_shutdownWaiting", shutdownWaiting);
}
} else {
// deny change
Expand Down
8 changes: 0 additions & 8 deletions htroot/Settings_p.html
Expand Up @@ -37,14 +37,6 @@ <h2>Settings</h2>
<td><input name="port" type="text" size="5" maxlength="5" value="#[port]#"></td>
<td><i>Changes will take effect after restart only.</i></td>
</tr>
<tr valign="top">
<td>Shutdown Time Limit:</td>
<td><input name="shutdownWaiting" type="text" size="5" maxlength="4" value="#[shutdownWaiting]#"></td>
<td>This is the time that a peer takes at most for shutdown.
The shutdown-procedure is difficult since there are many caches that must be flushed
first (seconds)
</td>
</tr>
<tr valign="top">
<td>Peer Name:</td>
<td><input name="peername" type="text" size="32" maxlength="80" value="#[peerName]#"></td>
Expand Down
1 change: 0 additions & 1 deletion htroot/Settings_p.java
Expand Up @@ -58,7 +58,6 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
//if (post == null) System.out.println("POST: NULL"); else System.out.println("POST: " + post.toString());

prop.put("port", env.getConfig("port", "8080"));
prop.put("shutdownWaiting", env.getConfig("shutdownWaiting", "120"));
prop.put("peerName", env.getConfig("peerName", "nameless"));
// set values
String s;
Expand Down
6 changes: 5 additions & 1 deletion source/de/anomic/kelondro/kelondroRecords.java
Expand Up @@ -322,7 +322,11 @@ protected Node getNode(Handle handle, Node parentNode, int referenceInParent) {
if (cachesize == 0) return new Node(handle, parentNode, referenceInParent);
Node n = (Node) cache.get(handle);
if (n == null) {
return new Node(handle, parentNode, referenceInParent);
n = new Node(handle, parentNode, referenceInParent);
cache.put(handle, n);
cacheScore.setScore(handle, (int) ((System.currentTimeMillis() - startup) / 1000));
checkCacheSpace();
return n;
} else {
cacheScore.setScore(handle, (int) ((System.currentTimeMillis() - startup) / 1000));
return n;
Expand Down
4 changes: 2 additions & 2 deletions source/de/anomic/plasma/plasmaSwitchboard.java
Expand Up @@ -281,11 +281,11 @@ public plasmaSwitchboard(String rootPath, String initPath, String configPath) th
deployThread("60_globalcrawl", "Global Crawl", "thread that performes a single crawl/indexing step of a web page for global crawling",
new serverInstantThread(this, "globalCrawlJob", "globalCrawlJobSize"), log, 30000);
deployThread("50_localcrawl", "Local Crawl", "thread that performes a single crawl step from the local crawl queue",
new serverInstantThread(this, "localCrawlJob", "localCrawlJobSize"), log, 20000);
new serverInstantThread(this, "localCrawlJob", "localCrawlJobSize"), log, 10000);
deployThread("40_peerseedcycle", "Seed-List Upload", "task that a principal peer performes to generate and upload a seed-list to a ftp account",
new serverInstantThread(yc, "publishSeedList", null), yc.log, 180000);
deployThread("30_peerping", "YaCy Core", "this is the p2p-control and peer-ping task",
new serverInstantThread(yc, "peerPing", null), yc.log, 4000);
new serverInstantThread(yc, "peerPing", null), yc.log, 2000);
indexDistribution = new distributeIndex(100 /*indexCount*/, 8000, 1 /*peerCount*/);
deployThread("20_dhtdistribution", "DHT Distribution (currently by juniors only)", "selection, transfer and deletion of index entries that are not searched on your peer, but on others",
new serverInstantThread(indexDistribution, "job", null), log, 120000);
Expand Down
8 changes: 4 additions & 4 deletions yacy.init
Expand Up @@ -375,13 +375,13 @@ xpstopw=true
40_peerseedcycle_idlesleep=1800000
40_peerseedcycle_busysleep=1200000
50_localcrawl_idlesleep=5000
50_localcrawl_busysleep=1000
50_localcrawl_busysleep=0
60_globalcrawl_idlesleep=60000
60_globalcrawl_busysleep=5000
60_globalcrawl_busysleep=3000
70_cachemanager_idlesleep=10000
70_cachemanager_busysleep=4000
70_cachemanager_busysleep=0
80_dequeue_idlesleep=4000
80_dequeue_busysleep=1000
80_dequeue_busysleep=0
90_cleanup_idlesleep=300000
90_cleanup_busysleep=300000

Expand Down

0 comments on commit ba16da7

Please sign in to comment.