small bug fixes and experiments with search speed enhancement

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7549 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent bed79402be
commit f8d0454c53

@ -64,8 +64,8 @@ public class NetworkPicture {
int width = 1024; // 640x480 = VGA, 768x576 = SD/4:3, 1024x576 =SD/16:9 1280x720 = HD/16:9, 1920x1080 = FULL HD/16:9
int height = 576;
int passiveLimit = 10080; // minutes; 1440 = 1 day; 720 = 12 hours; 10080 = 1 week;
int potentialLimit = 10080;
int passiveLimit = 1440; // minutes; 1440 = 1 day; 720 = 12 hours; 1440 = 24 hours, 10080 = 1 week;
int potentialLimit = 1440;
int maxCount = 1000;
String bgcolor = NetworkGraph.COL_BACKGROUND;
boolean corona = true;

@ -66,7 +66,6 @@ public class swfParser extends AbstractParser implements Parser {
try {
contents = swf2html.convertSWFToHTML(source);
} catch (NegativeArraySizeException e) {
Log.logException(e);
throw new Parser.Failure(e.getMessage(), location);
} catch (IOException e) {
throw new Parser.Failure(e.getMessage(), location);

@ -92,7 +92,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
this.array = new ReferenceContainerArray<ReferenceType>(cellPath, prefix, factory, termOrder, payloadrow, merger);
this.ram = new ReferenceContainerCache<ReferenceType>(factory, payloadrow, termOrder);
this.countCache = new ComparableARC<byte[], Integer>(100, termOrder);
this.countCache = new ComparableARC<byte[], Integer>(1000, termOrder);
this.maxRamEntries = maxRamEntries;
this.merger = merger;
this.lastCleanup = System.currentTimeMillis();

@ -558,28 +558,23 @@ public class ReferenceContainer<ReferenceType extends Reference> extends RowSet
public static final TreeMap<String, String> decompressIndex(ByteBuffer ci, final String peerhash) {
TreeMap<String, String> target = new TreeMap<String, String>();
// target is a mapping from url-hashes to a string of peer-hashes
if ((ci.byteAt(0) == '{') && (ci.byteAt(ci.length() - 1) == '}')) {
//System.out.println("DEBUG-DECOMPRESS: input is " + ci.toString());
ci = ci.trim(1, ci.length() - 2);
String dom, url, peers;
while ((ci.length() >= 13) && (ci.byteAt(6) == ':')) {
if (ci.byteAt(0) != '{' || ci.byteAt(ci.length() - 1) != '}') return target;
//System.out.println("DEBUG-DECOMPRESS: input is " + ci.toString());
ci = ci.trim(1, ci.length() - 2);
String dom, url, peers;
while ((ci.length() >= 13) && (ci.byteAt(6) == ':')) {
assert ci.length() >= 6 : "ci.length() = " + ci.length();
dom = ci.toString(0, 6);
ci.trim(7);
while ((ci.length() > 0) && (ci.byteAt(0) != ',')) {
assert ci.length() >= 6 : "ci.length() = " + ci.length();
dom = ci.toString(0, 6);
ci.trim(7);
while ((ci.length() > 0) && (ci.byteAt(0) != ',')) {
assert ci.length() >= 6 : "ci.length() = " + ci.length();
url = ci.toString(0, 6) + dom;
ci.trim(6);
peers = target.get(url);
if (peers == null) {
target.put(url, peerhash);
} else {
target.put(url, peers + peerhash);
}
//System.out.println("DEBUG-DECOMPRESS: " + url + ":" + target.get(url));
}
if (ci.byteAt(0) == ',') ci.trim(1);
url = ci.toString(0, 6) + dom;
ci.trim(6);
peers = target.put(url, peerhash);
if (peers != null) target.put(url, peers + peerhash);
//System.out.println("DEBUG-DECOMPRESS: " + url + ":" + target.get(url));
}
if (ci.byteAt(0) == ',') ci.trim(1);
}
return target;
}

@ -364,6 +364,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
public boolean put(final Row.Entry row) throws IOException, RowSpaceExceededException {
assert row.objectsize() <= this.rowdef.objectsize;
byte[] key = row.getPrimaryKeyBytes();
if (tables == null) return true;
synchronized (this.tables) {
Index keeper = keeperOf(key);
if (keeper != null) return keeper.put(row);
@ -378,6 +379,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
private Index keeperOf(final byte[] key) {
if (key == null) return null;
if (tables == null) return null;
for (Index oi: tables.values()) {
if (oi.has(key)) return oi;
}

Loading…
Cancel
Save