Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) Bugfix of Delete-Indexqueue-Entry, Clear Indexing Queue functionality - htcache files will now also be deleted if entry should not be stored into cache
thelidc85b1021e26
diff --git a/htroot/IndexCreateIndexingQueue_p.html b/htroot/IndexCreateIndexingQueue_p.htmlindex 9b4d86938..30e7253db 100644--- a/htroot/IndexCreateIndexingQueue_p.html+++ b/htroot/IndexCreateIndexingQueue_p.html@@ -18,7 +18,7 @@ The indexing queue is empty<br><input type="submit" name="clearIndexingQueue" value="clear indexing queue"></form><br>-There are #[num]# entries in the indexing queue:<br>+There are #[num]# entries with a total size of #[totalSize]# in the indexing queue:<br><table border="0" cellpadding="2" cellspacing="1"><tr class="TableHeader"><th class="small">Initiator</th>@@ -37,7 +37,7 @@ There are #[num]# entries in the indexing queue:<br><td width="180" class="small">#[anchor]#</td><td class="small"><a class="small" href="#[url]#">#[url]#</a></td><td width="80" class="small" align="right"><nobr>#[size]#</nobr></td>-<td width="10" class="small">#(inProcess)#<a class="small" href="IndexCreateIndexingQueue_p.html?deleteEntry=#[hash]#">[Delete]</a>::#(/inProcess)#</td>+<td width="10" class="small" title="#[hash]#">#(inProcess)#<a class="small" href="IndexCreateIndexingQueue_p.html?deleteEntry=#[hash]#">[Delete]</a>::#(/inProcess)#</td></tr>#{/list}#</table>diff --git a/htroot/IndexCreateIndexingQueue_p.java b/htroot/IndexCreateIndexingQueue_p.javaindex d8cf2d867..d797d00e4 100644--- a/htroot/IndexCreateIndexingQueue_p.java+++ b/htroot/IndexCreateIndexingQueue_p.java@@ -84,7 +84,12 @@ public class IndexCreateIndexingQueue_p {if (post.containsKey("clearIndexingQueue")) {try {synchronized (switchboard.sbQueue) {- switchboard.sbQueue.clear();+ plasmaSwitchboardQueue.Entry entry = null;+ while ((entry = switchboard.sbQueue.pop()) != null) {+ if ((entry != null) && (entry.profile() != null) && (!(entry.profile().storeHTCache()))) {+ switchboard.cacheManager.deleteFile(entry.url());+ }+ }}} catch (Exception e) {}} else if (post.containsKey("deleteEntry")) {@@ -95,7 +100,10 @@ public class IndexCreateIndexingQueue_p {for (int i=entries.size()-1; i >= 0; i--) {plasmaSwitchboardQueue.Entry pcentry = (plasmaSwitchboardQueue.Entry) entries.get(i);if (pcentry.urlHash().equals(urlHash)) {- switchboard.sbQueue.remove(i);+ plasmaSwitchboardQueue.Entry entry = switchboard.sbQueue.remove(i);+ if ((entry != null) && (entry.profile() != null) && (!(entry.profile().storeHTCache()))) {+ switchboard.cacheManager.deleteFile(entry.url());+ }break;}}@@ -117,6 +125,7 @@ public class IndexCreateIndexingQueue_p {dark = true;plasmaSwitchboardQueue.Entry pcentry;int inProcessCount = 0, entryCount = 0;+ long totalSize = 0;try {ArrayList entryList = new ArrayList();@@ -134,6 +143,8 @@ public class IndexCreateIndexingQueue_p {for (int i = 0; i < entryList.size(); i++) {boolean inProcess = i < inProcessCount;pcentry = (plasmaSwitchboardQueue.Entry) entryList.get(i);+ long entrySize = pcentry.size();+ totalSize += entrySize;if ((pcentry != null)&&(pcentry.url() != null)) {initiator = yacyCore.seedDB.getConnected(pcentry.initiator());prop.put("indexing-queue_list_"+entryCount+"_dark", (inProcess)? 2: ((dark) ? 1 : 0));@@ -142,16 +153,17 @@ public class IndexCreateIndexingQueue_p {prop.put("indexing-queue_list_"+entryCount+"_modified", (pcentry.responseHeader() == null) ? "" : daydate(pcentry.responseHeader().lastModified()));prop.put("indexing-queue_list_"+entryCount+"_anchor", (pcentry.anchorName()==null)?"":pcentry.anchorName());prop.put("indexing-queue_list_"+entryCount+"_url", pcentry.normalizedURLString());- prop.put("indexing-queue_list_"+entryCount+"_size", Status.bytesToString(pcentry.size()));+ prop.put("indexing-queue_list_"+entryCount+"_size", Status.bytesToString(entrySize));prop.put("indexing-queue_list_"+entryCount+"_inProcess", (inProcess)?1:0);- prop.put("indexing-queue_list_"+entryCount+"_0_hash", pcentry.urlHash());+ prop.put("indexing-queue_list_"+entryCount+"_inProcess_hash", pcentry.urlHash());dark = !dark;entryCount++;}}} catch (IOException e) {}- prop.put("indexing-queue_num", entryCount);//num entries in queue+ prop.put("indexing-queue_num", entryCount);//num entries in queue+ prop.put("indexing-queue_totalSize", Status.bytesToString(totalSize));//num entries in queueprop.put("indexing-queue_list", entryCount);}