mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-24 00:00:19 +02:00
842308ea97
- removed web structure picture from indexing menu and grouped it together with htcache monitor - added a database for terminated crawls, when a crawl is finished it is automatically moved to the new database - extended crawl profile edit servlet, shows now also terminated crawls - option that was used to delete profiles is now redesigned to a function that moves the current crawl to the terminated crawls and removes all urls from the current queues! - fixed here and there problems with indexing queues - enhances indexing speed by changing cache flush sizes. - changed behaviour of crawl result servlet: the list of crawled urls is shown if there is one, othevise the overview window is shown attention: the new profile databases are not compatible with the old one. current crawls will be lost! the web index is not touched. next steps: the database of terminated crawls can be used to start with them a new crawl. This is useful if one wants to re-crawl specific pages and wants to use a old crawl profile. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4113 6c8d7289-2bf4-0310-a012-ef5d649a1542
64 lines
2.3 KiB
Java
64 lines
2.3 KiB
Java
|
|
import java.util.Iterator;
|
|
|
|
import de.anomic.http.httpHeader;
|
|
import de.anomic.plasma.plasmaSwitchboard;
|
|
import de.anomic.plasma.plasmaCrawlProfile.entry;
|
|
import de.anomic.server.serverObjects;
|
|
import de.anomic.server.serverSwitch;
|
|
|
|
|
|
public class WatchWebStructure_p {
|
|
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
|
|
plasmaSwitchboard sb = (plasmaSwitchboard) env;
|
|
serverObjects prop = new serverObjects();
|
|
|
|
int width = 768;
|
|
int height = 576;
|
|
int depth = 3;
|
|
int nodes = 500; // maximum number of host nodes that are painted
|
|
int time = -1;
|
|
String host = "auto";
|
|
|
|
if (post != null) {
|
|
width = post.getInt("width", 768);
|
|
height = post.getInt("height", 576);
|
|
depth = post.getInt("depth", 3);
|
|
nodes = post.getInt("nodes", width * height * 100 / 768 / 576);
|
|
time = post.getInt("time", -1);
|
|
host = post.get("host", "auto");
|
|
}
|
|
|
|
if (host.equals("auto")) {
|
|
// try to find the host from the crawl profiles
|
|
Iterator it = sb.profilesActiveCrawls.profiles(true);
|
|
entry e;
|
|
while (it.hasNext()) {
|
|
e = (entry)it.next();
|
|
if (e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_PROXY) ||
|
|
e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_REMOTE) ||
|
|
e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_SNIPPET_TEXT) ||
|
|
e.name().equals(plasmaSwitchboard.CRAWL_PROFILE_SNIPPET_MEDIA))
|
|
continue;
|
|
host = e.name();
|
|
break; // take the first one
|
|
}
|
|
}
|
|
|
|
prop.put("host", host);
|
|
prop.put("depth", depth);
|
|
prop.put("depthi", Math.min(8, depth + 1));
|
|
prop.put("depthd", Math.max(0, depth - 1));
|
|
prop.put("nodes", nodes);
|
|
prop.put("nodesi", Math.min(1000, nodes + 100));
|
|
prop.put("nodesd", Math.max(100, nodes - 100));
|
|
prop.put("time", time);
|
|
prop.put("timei", (time > 9000) ? -1 : ((time < 0) ? -1 : Math.min(9999, time + 1000)));
|
|
prop.put("timed", (time < 0) ? 9000 : Math.max(1000, time - 1000));
|
|
prop.put("width", width);
|
|
prop.put("height", height);
|
|
|
|
return prop;
|
|
}
|
|
}
|