debug code for index distribution testing

pull/1/head
Michael Peter Christen 11 years ago
parent 89e13fa34e
commit 6634b5b737

@ -283,7 +283,8 @@ public class IndexControlRWIs_p {
Reference iEntry;
while (urlIter.hasNext()) {
iEntry = urlIter.next();
if (segment.fulltext().getLoadTime(ASCII.String(iEntry.urlhash())) < 0) {
long loadTime = segment.fulltext().getLoadTime(ASCII.String(iEntry.urlhash()));
if (loadTime < 0) {
try {
unknownURLEntries.put(iEntry.urlhash());
} catch (final SpaceExceededException e) {

@ -36,6 +36,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import net.yacy.cora.document.encoding.ASCII;
import net.yacy.cora.order.ByteOrder;
import net.yacy.cora.order.CloneableIterator;
import net.yacy.cora.sorting.Rating;
@ -66,6 +67,7 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
private final ContainerOrder<ReferenceType> containerOrder;
private ConcurrentHashMap<ByteArray, ReferenceContainer<ReferenceType>> cache;
/**
* open an existing heap file in undefined mode
* after this a initialization should be made to use the heap:
@ -630,4 +632,17 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
}
}
/**
* return a string with the key as a list
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder(cache.size() * 13 + 2);
sb.append('[');
for (ByteArray k: cache.keySet()) {
sb.append(ASCII.String(k.asBytes())).append(',');
}
if (sb.length() == 1) sb.append(']'); else sb.setCharAt(sb.length() - 1, ']');
return sb.toString();
}
}

@ -1401,14 +1401,6 @@ public final class Protocol {
if ( uhss == null ) {
return "no unknownURL tag in response";
}
EventChannel
.channels(EventChannel.DHTSEND)
.addMessage(
new RSSMessage(
"Sent " + indexes.size() + " RWIs to " + targetSeed.getName(),
"",
targetSeed.hash));
uhss = uhss.trim();
if ( uhss.isEmpty() || uhss.equals(",") ) {
return null;
@ -1419,6 +1411,14 @@ public final class Protocol {
return null;
} // all url's known
EventChannel
.channels(EventChannel.DHTSEND)
.addMessage(
new RSSMessage(
"Sent " + indexes.size() + " RWIs " + indexes.toString() + " to " + targetSeed.getName() + "/[" + targetSeed.hash + "], " + uhs.length + " URLs there unknown",
"",
targetSeed.hash));
in = transferURL(targetSeed, uhs, urlRefs, segment, gzipBody, timeout);
if ( in == null ) {
@ -1435,7 +1435,7 @@ public final class Protocol {
}
EventChannel.channels(EventChannel.DHTSEND).addMessage(
new RSSMessage(
"Sent " + uhs.length + " URLs to peer " + targetSeed.getName(),
"Sent " + uhs.length + " URLs to peer " + targetSeed.getName()+ "/[" + targetSeed.hash + "]",
"",
targetSeed.hash));

@ -494,7 +494,7 @@ public final class Fulltext {
if (urlHash == null) return -1l;
try {
SolrConnector.Metadata md = this.getDefaultConnector().getMetadata(urlHash);
if (md == null) return -1;
if (md == null) return -1l;
return md.date;
} catch (final Throwable e) {
ConcurrentLog.logException(e);

Loading…
Cancel
Save