fix for a profile = null problem and new monitor in crawl queue

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@730 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 19547f1821
commit 416c126815

@ -25,6 +25,7 @@ There are #[num]# entries in the global crawler queue. Showing #[show-num]# most
<table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader">
<th class="small">Initiator</th>
<th class="small">Profile</th>
<th class="small">Depth</th>
<th class="small">Modified Date</th>
<th class="small">Anchor Name</th>
@ -33,6 +34,7 @@ There are #[num]# entries in the global crawler queue. Showing #[show-num]# most
#{list}#
<tr class="TableCell#(dark)#Light::Dark#(/dark)#" class="small">
<td width="60" class="small">#[initiator]#</td>
<td width="60" class="small">#[profile]#</td>
<td width="10" class="small">#[depth]#</td>
<td width="80" class="small">#[modified]#</td>
<td width="180" class="small">#[anchor]#</td>

@ -49,6 +49,7 @@ import java.util.Locale;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaCrawlNURL;
import de.anomic.plasma.plasmaCrawlProfile;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@ -96,13 +97,18 @@ public class IndexCreateWWWGlobalQueue_p {
plasmaCrawlNURL.Entry urle;
boolean dark = true;
yacySeed initiator;
String profileHandle;
plasmaCrawlProfile.entry profileEntry;
int i;
for (i = 0; i < crawlerList.length; i++) {
urle = crawlerList[i];
if (urle != null) {
initiator = yacyCore.seedDB.getConnected(urle.initiator());
profileHandle = urle.profileHandle();
profileEntry = (profileHandle == null) ? null : switchboard.profiles.getEntry(profileHandle);
prop.put("crawler-queue_list_"+i+"_dark", ((dark) ? 1 : 0) );
prop.put("crawler-queue_list_"+i+"_initiator", ((initiator == null) ? "proxy" : initiator.getName()) );
prop.put("crawler-queue_list_"+i+"_profile", ((profileEntry == null) ? "unknown" : profileEntry.name()));
prop.put("crawler-queue_list_"+i+"_depth", urle.depth());
prop.put("crawler-queue_list_"+i+"_modified", daydate(urle.loaddate()) );
prop.put("crawler-queue_list_"+i+"_anchor", urle.name());

@ -25,6 +25,7 @@ There are #[num]# entries in the local crawler queue. Showing #[show-num]# most
<table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader">
<th class="small">Initiator</th>
<th class="small">Profile</th>
<th class="small">Depth</th>
<th class="small">Modified Date</th>
<th class="small">Anchor Name</th>
@ -34,6 +35,7 @@ There are #[num]# entries in the local crawler queue. Showing #[show-num]# most
#{list}#
<tr class="TableCell#(dark)#Light::Dark#(/dark)#" class="small">
<td width="60" class="small">#[initiator]#</td>
<td width="60" class="small">#[profile]#</td>
<td width="10" class="small">#[depth]#</td>
<td width="80" class="small">#[modified]#</td>
<td width="180" class="small">#[anchor]#</td>

@ -49,6 +49,7 @@ import java.util.Locale;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaCrawlNURL;
import de.anomic.plasma.plasmaCrawlProfile;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@ -94,13 +95,18 @@ public class IndexCreateWWWLocalQueue_p {
plasmaCrawlNURL.Entry urle;
boolean dark = true;
yacySeed initiator;
String profileHandle;
plasmaCrawlProfile.entry profileEntry;
int i;
for (i = 0; (i < crawlerList.length) && (showNum < 100); i++) {
urle = crawlerList[i];
if ((urle != null)&&(urle.url()!=null)) {
initiator = yacyCore.seedDB.getConnected(urle.initiator());
profileHandle = urle.profileHandle();
profileEntry = (profileHandle == null) ? null : switchboard.profiles.getEntry(profileHandle);
prop.put("crawler-queue_list_"+showNum+"_dark", ((dark) ? 1 : 0) );
prop.put("crawler-queue_list_"+showNum+"_initiator", ((initiator == null) ? "proxy" : initiator.getName()) );
prop.put("crawler-queue_list_"+showNum+"_profile", ((profileEntry == null) ? "unknown" : profileEntry.name()));
prop.put("crawler-queue_list_"+showNum+"_depth", urle.depth());
prop.put("crawler-queue_list_"+showNum+"_modified", daydate(urle.loaddate()) );
prop.put("crawler-queue_list_"+showNum+"_anchor", urle.name());

@ -339,7 +339,7 @@ public class plasmaCrawlNURL extends plasmaURL {
this.referrer = (referrer == null) ? dummyHash : referrer;
this.name = (name == null) ? "" : name;
this.loaddate = (loaddate == null) ? new Date() : loaddate;
this.profileHandle = profileHandle;
this.profileHandle = profileHandle; // must not be null
this.depth = depth;
this.anchors = anchors;
this.forkfactor = forkfactor;
@ -380,7 +380,7 @@ public class plasmaCrawlNURL extends plasmaURL {
this.referrer = (entry[3]==null) ? dummyHash : new String(entry[3]);
this.name = (entry[4] == null) ? "" : new String(entry[4]).trim();
this.loaddate = new Date(86400000 * serverCodings.enhancedCoder.decodeBase64Long(new String(entry[5])));
this.profileHandle = new String(entry[6]).trim();
this.profileHandle = (entry[6] == null) ? null : new String(entry[6]).trim();
this.depth = (int) serverCodings.enhancedCoder.decodeBase64Long(new String(entry[7]));
this.anchors = (int) serverCodings.enhancedCoder.decodeBase64Long(new String(entry[8]));
this.forkfactor = (int) serverCodings.enhancedCoder.decodeBase64Long(new String(entry[9]));
@ -408,7 +408,7 @@ public class plasmaCrawlNURL extends plasmaURL {
this.referrer.getBytes(),
this.name.getBytes(),
loaddatestr.getBytes(),
this.profileHandle.getBytes(),
(this.profileHandle == null) ? null : this.profileHandle.getBytes(),
serverCodings.enhancedCoder.encodeBase64Long(this.depth, urlCrawlDepthLength).getBytes(),
serverCodings.enhancedCoder.encodeBase64Long(this.anchors, urlParentBranchesLength).getBytes(),
serverCodings.enhancedCoder.encodeBase64Long(this.forkfactor, urlForkFactorLength).getBytes(),

@ -1230,7 +1230,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
loadDate, /* load date */
referrerHash, /* last url in crawling queue */
name, /* the anchor name */
(profile == null) ? null : profile.handle(),
(profile == null) ? null : profile.handle(), // profile must not be null!
currentdepth, /*depth so far*/
0, /*anchors, default value */
0, /*forkfactor, default value */

Loading…
Cancel
Save