see http://www.yacy-forum.de/viewtopic.php?p=18093#18093 The servlet is now named IndexCleaner_p. See http://localhost:8080/IndexCleaner_p.html The Servlet was adopted to fit in the overall architecture git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1863 6c8d7289-2bf4-0310-a012-ef5d649a1542pull/1/head
parent
74ffb9b842
commit
0ec28b8f8e
@ -0,0 +1,53 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>YaCy '#[clientname]#': Index Control</title>
|
||||
#%env/templates/metas.template%#
|
||||
<meta http-equiv="REFRESH" content="10">
|
||||
</head>
|
||||
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
|
||||
#%env/templates/header.template%#
|
||||
#%env/templates/submenuIndexControl.template%#
|
||||
<br>
|
||||
<h2>Index Cleaner</h2>
|
||||
|
||||
#(urldb)#
|
||||
::
|
||||
<p>
|
||||
ThreadAlive: #[threadAlive]#<br>
|
||||
ThreadToString: #[threadToString]#<br>
|
||||
Total URLs searched: #[total]# (#[percentUrls]#%)<br>
|
||||
Blacklisted URLs found: #[blacklisted]#<br>
|
||||
Percentage blacklisted: #[percent]#%<br>
|
||||
last searched URL: #[lastUrl]# (#[lastHash]#)<br>
|
||||
last blacklisted URL found: #[lastBlacklistedUrl]# (#[lastBlacklistedHash]#)<br>
|
||||
</p>
|
||||
#(/urldb)#
|
||||
#(rwidb)#
|
||||
::
|
||||
<p>
|
||||
ThreadAlive: #[threadAlive]#<br>
|
||||
ThreadToString: #[threadToString]#<br>
|
||||
RWIs at Start: #[RWIcountstart]#<br>
|
||||
RWIs now: #[RWIcountnow]#<br>
|
||||
wordHash in Progress: #[wordHashNow]#<br>
|
||||
last wordHash with deleted URLs: #[lastWordHash]#<br>
|
||||
Number of deleted URLs in on this Hash: #[lastDeletionCounter]#<br>
|
||||
</p>
|
||||
#(/rwidb)#
|
||||
<p>
|
||||
UrldbCleaner - Clean up the database by deletion of blacklisted urls:<br>
|
||||
<a href="IndexCleaner_p.html?action=ustart">Start/Resume</a>
|
||||
<a href="IndexCleaner_p.html?action=ustop">Stop</a>
|
||||
<a href="IndexCleaner_p.html?action=upause">Pause</a>
|
||||
</p>
|
||||
<p>
|
||||
RWIDbCleaner - Clean up the database by deletion of words with reference to blacklisted urls:<br>
|
||||
<a href="IndexCleaner_p.html?action=rstart">Start/Resume</a>
|
||||
<a href="IndexCleaner_p.html?action=rstop">Stop</a>
|
||||
<a href="IndexCleaner_p.html?action=rpause">Pause</a>
|
||||
</p>
|
||||
|
||||
#%env/templates/footer.template%#
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,84 @@
|
||||
// This file was provided by Hydrox
|
||||
// see http://www.yacy-forum.de/viewtopic.php?p=18093#18093
|
||||
|
||||
import de.anomic.http.httpHeader;
|
||||
import de.anomic.plasma.plasmaCrawlLURL;
|
||||
import de.anomic.plasma.plasmaWordIndex;
|
||||
import de.anomic.plasma.plasmaSwitchboard;
|
||||
import de.anomic.server.serverObjects;
|
||||
import de.anomic.server.serverSwitch;
|
||||
|
||||
public class IndexCleaner_p {
|
||||
private static plasmaCrawlLURL.Cleaner urldbCleanerThread;
|
||||
private static plasmaWordIndex.Cleaner indexCleanerThread;
|
||||
|
||||
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
|
||||
serverObjects prop = new serverObjects();
|
||||
plasmaSwitchboard sb = (plasmaSwitchboard) env;
|
||||
prop.put("title", "DbCleanup_p");
|
||||
if (post!=null) {
|
||||
prop.put("bla", "post!=null");
|
||||
if (post.get("action").equals("ustart")) {
|
||||
if (urldbCleanerThread==null || !urldbCleanerThread.isAlive()) {
|
||||
urldbCleanerThread = sb.urlPool.loadedURL.makeCleaner();
|
||||
urldbCleanerThread.start();
|
||||
}
|
||||
else {
|
||||
urldbCleanerThread.endPause();
|
||||
}
|
||||
}
|
||||
else if (post.get("action").equals("ustop")) {
|
||||
urldbCleanerThread.abort();
|
||||
}
|
||||
else if (post.get("action").equals("upause")) {
|
||||
urldbCleanerThread.pause();
|
||||
}
|
||||
else if (post.get("action").equals("rstart")) {
|
||||
if (indexCleanerThread==null || !indexCleanerThread.isAlive()) {
|
||||
indexCleanerThread = sb.wordIndex.makeCleaner(sb.urlPool.loadedURL, post.get("wordHash","--------"));
|
||||
indexCleanerThread.start();
|
||||
}
|
||||
else {
|
||||
indexCleanerThread.endPause();
|
||||
}
|
||||
}
|
||||
else if (post.get("action").equals("rstop")) {
|
||||
indexCleanerThread.abort();
|
||||
}
|
||||
else if (post.get("action").equals("rpause")) {
|
||||
indexCleanerThread.pause();
|
||||
}
|
||||
prop.put("LOCATION","");
|
||||
return prop;
|
||||
}
|
||||
else {
|
||||
prop.put("bla", "post==null");
|
||||
}
|
||||
if (urldbCleanerThread!=null) {
|
||||
prop.put("urldb", 1);
|
||||
prop.put("urldb_percentUrls", ((double)urldbCleanerThread.totalSearchedUrls/sb.urlPool.loadedURL.size())*100 + "");
|
||||
prop.put("urldb_blacklisted", urldbCleanerThread.blacklistedUrls);
|
||||
prop.put("urldb_total", urldbCleanerThread.totalSearchedUrls);
|
||||
prop.put("urldb_lastBlacklistedUrl", urldbCleanerThread.lastBlacklistedUrl);
|
||||
prop.put("urldb_lastBlacklistedHash", urldbCleanerThread.lastBlacklistedHash);
|
||||
prop.put("urldb_lastUrl", urldbCleanerThread.lastUrl);
|
||||
prop.put("urldb_lastHash", urldbCleanerThread.lastHash);
|
||||
prop.put("urldb_threadAlive", urldbCleanerThread.isAlive() + "");
|
||||
prop.put("urldb_threadToString", urldbCleanerThread.toString());
|
||||
double percent = ((double)urldbCleanerThread.blacklistedUrls/urldbCleanerThread.totalSearchedUrls)*100;
|
||||
prop.put("urldb_percent", percent + "");
|
||||
}
|
||||
if (indexCleanerThread!=null) {
|
||||
prop.put("rwidb", 1);
|
||||
prop.put("rwidb_threadAlive", indexCleanerThread.isAlive() + "");
|
||||
prop.put("rwidb_threadToString", indexCleanerThread.toString());
|
||||
prop.put("rwidb_RWIcountstart", indexCleanerThread.rwiCountAtStart);
|
||||
prop.put("rwidb_RWIcountnow", sb.wordIndex.size());
|
||||
prop.put("rwidb_wordHashNow", indexCleanerThread.wordHashNow);
|
||||
prop.put("rwidb_lastWordHash", indexCleanerThread.lastWordHash);
|
||||
prop.put("rwidb_lastDeletionCounter", indexCleanerThread.lastDeletionCounter);
|
||||
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="SubMenu">
|
||||
<tr height="10"><td colspan="17" class="MenuHeader"> Index Control Menu</td></tr>
|
||||
<tr height="10"><td colspan="7" class="MenuHeader"> Index Control Menu</td></tr>
|
||||
<tr height="2"><td colspan="17"></td></tr>
|
||||
<tr class="TableHeader">
|
||||
<td width="33%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top">
|
||||
<td width="25%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top">
|
||||
<a href="/IndexControl_p.html" class="MenuItemLink">Index Administration</a> </td>
|
||||
<td class="MenuSubSpacer"></td>
|
||||
<td width="33%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top">
|
||||
<td width="25%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top">
|
||||
<a href="/IndexImport_p.html" class="MenuItemLink">Index Import</a> </td>
|
||||
<td class="MenuSubSpacer"></td>
|
||||
<td width="33%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top">
|
||||
<td width="25%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top">
|
||||
<a href="/IndexTransfer_p.html" class="MenuItemLink">Index Transfer</a> </td>
|
||||
<td class="MenuSubSpacer"></td>
|
||||
<td width="25%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top">
|
||||
<a href="/IndexCleaner_p.html" class="MenuItemLink">Index Cleaner</a> </td>
|
||||
</tr>
|
||||
</table>
|
Loading…
Reference in new issue